@ckeditor/ckeditor5-ai 47.3.0-alpha.2 → 47.3.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index-editor.css +18 -11
  3. package/dist/index.css +19 -11
  4. package/dist/index.js +5 -5
  5. package/dist/translations/af.js +1 -1
  6. package/dist/translations/af.umd.js +1 -1
  7. package/dist/translations/ar.js +1 -1
  8. package/dist/translations/ar.umd.js +1 -1
  9. package/dist/translations/ast.js +1 -1
  10. package/dist/translations/ast.umd.js +1 -1
  11. package/dist/translations/az.js +1 -1
  12. package/dist/translations/az.umd.js +1 -1
  13. package/dist/translations/be.js +1 -1
  14. package/dist/translations/be.umd.js +1 -1
  15. package/dist/translations/bg.js +1 -1
  16. package/dist/translations/bg.umd.js +1 -1
  17. package/dist/translations/bn.js +1 -1
  18. package/dist/translations/bn.umd.js +1 -1
  19. package/dist/translations/bs.js +1 -1
  20. package/dist/translations/bs.umd.js +1 -1
  21. package/dist/translations/ca.js +1 -1
  22. package/dist/translations/ca.umd.js +1 -1
  23. package/dist/translations/cs.js +1 -1
  24. package/dist/translations/cs.umd.js +1 -1
  25. package/dist/translations/da.js +1 -1
  26. package/dist/translations/da.umd.js +1 -1
  27. package/dist/translations/de-ch.js +1 -1
  28. package/dist/translations/de-ch.umd.js +1 -1
  29. package/dist/translations/de.js +1 -1
  30. package/dist/translations/de.umd.js +1 -1
  31. package/dist/translations/el.js +1 -1
  32. package/dist/translations/el.umd.js +1 -1
  33. package/dist/translations/en-au.js +1 -1
  34. package/dist/translations/en-au.umd.js +1 -1
  35. package/dist/translations/en-gb.js +1 -1
  36. package/dist/translations/en-gb.umd.js +1 -1
  37. package/dist/translations/en.js +1 -1
  38. package/dist/translations/en.umd.js +1 -1
  39. package/dist/translations/eo.js +1 -1
  40. package/dist/translations/eo.umd.js +1 -1
  41. package/dist/translations/es-co.js +1 -1
  42. package/dist/translations/es-co.umd.js +1 -1
  43. package/dist/translations/es.js +1 -1
  44. package/dist/translations/es.umd.js +1 -1
  45. package/dist/translations/et.js +1 -1
  46. package/dist/translations/et.umd.js +1 -1
  47. package/dist/translations/eu.js +1 -1
  48. package/dist/translations/eu.umd.js +1 -1
  49. package/dist/translations/fa.js +1 -1
  50. package/dist/translations/fa.umd.js +1 -1
  51. package/dist/translations/fi.js +1 -1
  52. package/dist/translations/fi.umd.js +1 -1
  53. package/dist/translations/fr.js +1 -1
  54. package/dist/translations/fr.umd.js +1 -1
  55. package/dist/translations/gl.js +1 -1
  56. package/dist/translations/gl.umd.js +1 -1
  57. package/dist/translations/gu.js +1 -1
  58. package/dist/translations/gu.umd.js +1 -1
  59. package/dist/translations/he.js +1 -1
  60. package/dist/translations/he.umd.js +1 -1
  61. package/dist/translations/hi.js +1 -1
  62. package/dist/translations/hi.umd.js +1 -1
  63. package/dist/translations/hr.js +1 -1
  64. package/dist/translations/hr.umd.js +1 -1
  65. package/dist/translations/hu.js +1 -1
  66. package/dist/translations/hu.umd.js +1 -1
  67. package/dist/translations/hy.js +1 -1
  68. package/dist/translations/hy.umd.js +1 -1
  69. package/dist/translations/id.js +1 -1
  70. package/dist/translations/id.umd.js +1 -1
  71. package/dist/translations/it.js +1 -1
  72. package/dist/translations/it.umd.js +1 -1
  73. package/dist/translations/ja.js +1 -1
  74. package/dist/translations/ja.umd.js +1 -1
  75. package/dist/translations/jv.js +1 -1
  76. package/dist/translations/jv.umd.js +1 -1
  77. package/dist/translations/kk.js +1 -1
  78. package/dist/translations/kk.umd.js +1 -1
  79. package/dist/translations/km.js +1 -1
  80. package/dist/translations/km.umd.js +1 -1
  81. package/dist/translations/kn.js +1 -1
  82. package/dist/translations/kn.umd.js +1 -1
  83. package/dist/translations/ko.js +1 -1
  84. package/dist/translations/ko.umd.js +1 -1
  85. package/dist/translations/ku.js +1 -1
  86. package/dist/translations/ku.umd.js +1 -1
  87. package/dist/translations/lt.js +1 -1
  88. package/dist/translations/lt.umd.js +1 -1
  89. package/dist/translations/lv.js +1 -1
  90. package/dist/translations/lv.umd.js +1 -1
  91. package/dist/translations/ms.js +1 -1
  92. package/dist/translations/ms.umd.js +1 -1
  93. package/dist/translations/nb.js +1 -1
  94. package/dist/translations/nb.umd.js +1 -1
  95. package/dist/translations/ne.js +1 -1
  96. package/dist/translations/ne.umd.js +1 -1
  97. package/dist/translations/nl.js +1 -1
  98. package/dist/translations/nl.umd.js +1 -1
  99. package/dist/translations/no.js +1 -1
  100. package/dist/translations/no.umd.js +1 -1
  101. package/dist/translations/oc.js +1 -1
  102. package/dist/translations/oc.umd.js +1 -1
  103. package/dist/translations/pl.js +1 -1
  104. package/dist/translations/pl.umd.js +1 -1
  105. package/dist/translations/pt-br.js +1 -1
  106. package/dist/translations/pt-br.umd.js +1 -1
  107. package/dist/translations/pt.js +1 -1
  108. package/dist/translations/pt.umd.js +1 -1
  109. package/dist/translations/ro.js +1 -1
  110. package/dist/translations/ro.umd.js +1 -1
  111. package/dist/translations/ru.js +1 -1
  112. package/dist/translations/ru.umd.js +1 -1
  113. package/dist/translations/si.js +1 -1
  114. package/dist/translations/si.umd.js +1 -1
  115. package/dist/translations/sk.js +1 -1
  116. package/dist/translations/sk.umd.js +1 -1
  117. package/dist/translations/sl.js +1 -1
  118. package/dist/translations/sl.umd.js +1 -1
  119. package/dist/translations/sq.js +1 -1
  120. package/dist/translations/sq.umd.js +1 -1
  121. package/dist/translations/sr-latn.js +1 -1
  122. package/dist/translations/sr-latn.umd.js +1 -1
  123. package/dist/translations/sr.js +1 -1
  124. package/dist/translations/sr.umd.js +1 -1
  125. package/dist/translations/sv.js +1 -1
  126. package/dist/translations/sv.umd.js +1 -1
  127. package/dist/translations/th.js +1 -1
  128. package/dist/translations/th.umd.js +1 -1
  129. package/dist/translations/ti.js +1 -1
  130. package/dist/translations/ti.umd.js +1 -1
  131. package/dist/translations/tk.js +1 -1
  132. package/dist/translations/tk.umd.js +1 -1
  133. package/dist/translations/tr.js +1 -1
  134. package/dist/translations/tr.umd.js +1 -1
  135. package/dist/translations/tt.js +1 -1
  136. package/dist/translations/tt.umd.js +1 -1
  137. package/dist/translations/ug.js +1 -1
  138. package/dist/translations/ug.umd.js +1 -1
  139. package/dist/translations/uk.js +1 -1
  140. package/dist/translations/uk.umd.js +1 -1
  141. package/dist/translations/ur.js +1 -1
  142. package/dist/translations/ur.umd.js +1 -1
  143. package/dist/translations/uz.js +1 -1
  144. package/dist/translations/uz.umd.js +1 -1
  145. package/dist/translations/vi.js +1 -1
  146. package/dist/translations/vi.umd.js +1 -1
  147. package/dist/translations/zh-cn.js +1 -1
  148. package/dist/translations/zh-cn.umd.js +1 -1
  149. package/dist/translations/zh.js +1 -1
  150. package/dist/translations/zh.umd.js +1 -1
  151. package/package.json +15 -15
  152. package/src/aiactions/aiactions.js +1 -1
  153. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  154. package/src/aiactions/model/aiactionsreply.js +1 -1
  155. package/src/aiassistant/adapters/aiadapter.js +1 -1
  156. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  157. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  158. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  159. package/src/aiassistant/aiassistant.js +1 -1
  160. package/src/aiassistant/aiassistantediting.js +1 -1
  161. package/src/aiassistant/aiassistantui.js +1 -1
  162. package/src/aiassistant/legacyerrors.js +1 -1
  163. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  164. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  165. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  167. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  168. package/src/aiassistant/ui/form/aiformview.js +1 -1
  169. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  170. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  171. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  172. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  173. package/src/aiassistant/utils/common-translations.js +1 -1
  174. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  175. package/src/aiballoon/aiballoon.js +1 -1
  176. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  177. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  178. package/src/aiballoon/ui/aiballoonview.js +1 -1
  179. package/src/aichat/aichat.js +1 -1
  180. package/src/aichat/aichatcontroller.js +1 -1
  181. package/src/aichat/aichatui.js +1 -1
  182. package/src/aichat/model/aichatcontext.js +1 -1
  183. package/src/aichat/model/aichatconversation.js +1 -1
  184. package/src/aichat/model/aichatinteraction.js +1 -1
  185. package/src/aichat/model/aichatmodels.js +1 -1
  186. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  187. package/src/aichat/ui/aichatfeedview.js +1 -1
  188. package/src/aichat/ui/aichatheaderview.js +1 -1
  189. package/src/aichat/ui/aichatview.js +1 -1
  190. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  192. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  193. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  194. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  195. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  196. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  197. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  200. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  201. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  202. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  209. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  210. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  211. package/src/aichat/utils/eventnames.js +1 -1
  212. package/src/aichat/utils/promisequeue.js +1 -1
  213. package/src/aichathistory/aichathistory.js +1 -1
  214. package/src/aichathistory/aichathistorycontroller.js +1 -1
  215. package/src/aichathistory/aichathistoryui.js +1 -1
  216. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  217. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  218. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  219. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  220. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  221. package/src/aichathistory/ui/aichathistoryview.d.ts +1 -0
  222. package/src/aichathistory/ui/aichathistoryview.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/aisuggestioncontentpartview.js +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  240. package/src/aicore/utils/common-translations.js +1 -1
  241. package/src/aicore/utils/createresizebutton.js +1 -1
  242. package/src/aicore/utils/documentposition.js +1 -1
  243. package/src/aicore/utils/documentrange.js +1 -1
  244. package/src/aicore/utils/eventnames.js +1 -1
  245. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  246. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  247. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  248. package/src/aicore/utils/htmlparser.js +1 -1
  249. package/src/aicore/utils/htmlstreamer.js +1 -1
  250. package/src/aicore/utils/scrollmanager.js +1 -1
  251. package/src/aieditorintegration/aieditorintegration.js +1 -1
  252. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  253. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  254. package/src/aiquickactions/aiquickactions.js +1 -1
  255. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  256. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  257. package/src/aiquickactions/aiquickactionsui.js +1 -1
  258. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  259. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  260. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  261. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  262. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  263. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  264. package/src/aireviewmode/aireviewmode.js +1 -1
  265. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  266. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  267. package/src/aireviewmode/aireviewmodeui.js +1 -1
  268. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  269. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  270. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  271. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  272. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  273. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  274. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  275. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  276. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  277. package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
  278. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  279. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  280. package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
  281. package/src/aireviewmode/ui/aireviewmodegeneralerrorview.js +1 -1
  282. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  283. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  284. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  285. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  286. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  287. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  288. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  289. package/src/aitabs/aitabs.js +1 -1
  290. package/src/aitabs/aitabsmainview.js +1 -1
  291. package/src/aitabs/tabs/aitabsview.js +1 -1
  292. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  293. package/src/aitabs/tabs/tabpanelview.js +1 -1
  294. package/src/errors.js +1 -1
  295. package/src/errorsmap.js +1 -1
  296. package/src/index.js +1 -1
  297. package/theme/aiballoon/aiballoon.css +2 -1
  298. package/theme/aiquickactions/aiquickactions.css +17 -10
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x2a4cc7,Command as At,ContextPlugin as _0x4404b9,Editor as _0x1e9e1e}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4559bc,IconCheck as _0x2a5a64,IconError as _0x1b5390,IconSubmit as _0x47a449,IconAIHistory as It,IconMagicWand as _0x5253a5,IconRobotPencil as ti,IconMaximize as _0x1d3e4d,IconMinimize as to,IconDocumentWithLoupe as _0x4c9c07,IconAddComment as _0x36635b,IconShowChangesOn as _0x7a6747,IconShowChangesOff as _0x5cd197,IconDocument as _0x7efb12,IconThreeStars as _0x4e7318,IconRemove as _0x55fa0e,IconDocumentWithCheckmark as _0x1fca69,IconDocumentWithCross as _0x37a396,IconLoupe as _0x23aea4,IconCancel as _0x2c2a0c,IconStop as _0x16a978,IconAIChat as ot,IconPlus as _0x22fde5,IconPin as _0x1dd126,IconThreeHorizontalDots as _0x40bfd1,IconChevronRight as _0x341b4d,IconInfo as _0x1e356f,IconOutdated as _0x596197,IconEye as _0x3868ae,IconEyeCrossedOut as _0x4a4f33,IconAIReview as _0x48c39b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3bb1ce,CKEditorError as _0x19ee7d,ObservableMixin as $t,global as _0x384749,isVisible as _0x1ec9b5,Rect as _0x1ba12e,Collection as _0x1c36f7,FocusTracker as Bt,KeystrokeHandler as Wt,first as _0x4e3c0f,toArray as _0x719a8,EmitterMixin as _0x3dcb71,logWarning as _0xe189d1,logError as _0x543541,scrollViewportToShowTarget as _0x414134,ResizeObserver as _0x488e19,_isMotionReduced as at,scrollAncestorsToShowTarget as _0x4446ba,getConstrainedViewportRect as _0x4fae9d,DomEmitterMixin as _0x22fceb}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x39a08b,ButtonView as _0x21bd9e,View as _0x492b6b,SpinnerView as _0x1e37e5,IconView as _0x25e498,AutocompleteView as _0x143cba,ListView as _0x24784f,ListItemGroupView as _0x23de91,ListItemView as _0x8a8c30,ButtonLabelView as _0xb0531d,FocusCycler as Vt,createLabeledTextarea as _0x1eaf41,Dialog as _0x43b27c,createDropdown as _0x35c3bd,addMenuToDropdown as _0x571ded,MenuBarMenuView as _0xc03205,MenuBarMenuListItemButtonView as _0x4f4ee6,DialogViewPosition as _0x6f5cfb,MenuBarMenuListView as _0x1c5a64,MenuBarMenuListItemView as _0x4b1a57,UIModel as _0x1bf3fd,SplitButtonView as _0x18c56d,BalloonPanelView as _0x257cec,BodyCollection as Kt,clickOutsideHandler as ts,ListItemButtonView as _0x1bb418,ViewCollection as _0x2b3021,addListToDropdown as _0x1cd684,submitHandler as _0x7b6908,LabeledFieldView as _0x94787a,createLabeledInputText as _0x52c7a3,FormHeaderView as _0x5e5898,HighlightedTextView as _0x1f83e8,FileDialogButtonView as _0x45b20c,InputTextView as _0x257805,SearchTextView as _0xc3c8d,ButtonLabelWithHighlightView as _0x1c8ce8,DropdownMenuPanelPositioningFunctions as _0x3f95b9,BalloonToolbar as Rt,FormRowView as _0x523985,TextareaView as _0x225711}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as lt,ClipboardMarkersUtils as _0x2c5fc2}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as wt,ViewDataTransfer as ft,ViewUpcastWriter as _0x176332,Matcher as _0x9dd39e,_DetachOperation as _0x253f92,_insertIntoModelNodeList as _0xbc492c,_removeFromModelNodeList as _0x5f0c2d,ModelRange as _0x184fda,ViewDowncastWriter as gt,transformOperationSets as _0x39cd19,ModelDocumentFragment as _0x246996,ModelPosition as _0x5a23f1,ModelTreeWalker as _0x31667d,InsertOperation as _0x207529,MarkerOperation as _0xd05c7f}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2e79bc,escape as Zt,escapeRegExp as _0xfb43f9,debounce as _0xa4b43}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x21bcef,InvokeModelWithResponseStreamCommand as _0x35b305,InvokeModelCommand as _0x8386c5}from'@aws-sdk/client-bedrock-runtime';import{createParser as Ct}from'eventsource-parser';import{parseDocument as _0x8953d3}from'htmlparser2';import{isTag as _0x1a9650,findOne as _0x3019e1,getParent as _0x2ea8c9,findAll as _0x37808d,removeElement as _0x19c981,replaceElement as _0x20fcd7,prepend as _0x4e9405,prependChild as _0x5578be,appendChild as _0x4fe58e,append as _0x41021b,find as _0x4b09e5,isComment as _0x336631,getChildren as _0x51e789,textContent as _0x4b97d9}from'domutils';import _0x20dcd7 from'dom-serializer';import{Document as it,Element as _0x1781b0,Text as _0xe506f9,cloneNode as _0x2ef420,isDocument as _0xa44e7b,isText as _0xb35865,NodeWithChildren as _0x19bfe3}from'domhandler';import{MarkdownGfmMdToHtml as _0x5a2309}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x2fc611,getAllMarkersDomElementsSorted as _0x489432,DocumentCompare as _0x1f61c4,DATA_ID_MODEL_ATTRIBUTE as _0x359efb,ConfirmMixin as _0x4bf1f4,LateFocusDropdownButtonView as _0x5a11e2,DATA_ID_VIEW_ATTRIBUTE as _0x5438d9}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4b1575}from'es-toolkit';import{IconThumbUp as _0x1e0de2,IconThumbDown as _0x1b416f,IconCopy as _0x385135,IconCheck as _0x347166,IconShowChangesOff as _0x376600,IconShowChangesOn as _0x2eeddb,IconWeb as _0x4f04ad,IconNextArrow as _0x395cb2,IconPreviousArrow as _0x48be9f,IconAI as et,IconClose as _0x3a2bed,IconSelection as _0x25d747,IconFileUpload as _0x241668,IconLink as _0x3fc296,IconDocument as _0x3fd5d1,IconBulb as _0x4bb0b4,IconDocumentOutline as _0x169e77,IconPaperClip as _0x4d54fb,IconBrowseFiles as _0x257af9,IconDropdownArrow as _0x39e693,IconAIAskAI as _0x5bf2c9,IconAIQuickActions as _0x2e8536,IconAIChatCommands as Qt,IconAIImproveWriting as Ot,IconAIContinueWriting as St,IconAIGrammarCheck as xt,IconAIAdjustLength as yt,IconAIChangeTone as Tt,IconAITranslate as vt,IconAIOther as Et,IconRefresh as _0x4e53d3}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x1e000f from'morphdom';import{SuggestionsConversion as kt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x26ee2a}from'diff';const mi='_ungrouppedCommands';function ne(_0x4d5dc8,_0xf68838){const _0x15a23a=(0x0,_0xf68838['t'])('Other');return _0x4d5dc8['length']?'groupId'in _0x4d5dc8[0x0]?_0x4d5dc8:[{'groupId':mi,'groupLabel':_0x15a23a,'order':0x1/0x0,'commands':_0x4d5dc8}]:[{'groupId':mi,'groupLabel':_0x15a23a,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],pt='ai-ui';class te extends _0x2a4cc7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2ed69f}=this,_0x237dd3=['ck-fake-ai-selection'];_0x2ed69f['config']['get']('ai.assistant.useTheme')&&_0x237dd3['push']('ck-ai-assistant-ui_theme'),_0x2ed69f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pt,'view':{'classes':_0x237dd3,'priority':0xc}}),_0x2ed69f['conversion']['for']('editingDowncast')['markerToElement']({'model':pt,'view':(_0x3ea913,{writer:_0x451e53})=>{if(!_0x3ea913['markerRange']['isCollapsed'])return null;const _0x4b8878=_0x451e53['createUIElement']('span');return _0x451e53['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4b8878),_0x4b8878;}});}['afterInit'](){!async function(_0x127ca7){const _0x15f781=_0x8d381([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]),_0x2e25a2=0x3dffc4e1,_0x58d725=0x3df8be81^_0x2e25a2,_0x3ecc28=window[_0x8d381([0x44,0x61,0x74,0x65])][_0x8d381([0x6e,0x6f,0x77])](),_0x1235bd=_0x127ca7[_0x8d381([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x136d29=new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1d060b=>{_0x1235bd[_0x8d381([0x6f,0x6e,0x63,0x65])](_0x8d381([0x72,0x65,0x61,0x64,0x79]),_0x1d060b);}),_0x53326c={[_0x8d381([0x6b,0x74,0x79])]:_0x8d381([0x45,0x43]),[_0x8d381([0x75,0x73,0x65])]:_0x8d381([0x73,0x69,0x67]),[_0x8d381([0x63,0x72,0x76])]:_0x8d381([0x50,0x2d,0x32,0x35,0x36]),[_0x8d381([0x78])]:_0x8d381([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]),[_0x8d381([0x79])]:_0x8d381([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]),[_0x8d381([0x61,0x6c,0x67])]:_0x8d381([0x45,0x53,0x32,0x35,0x36])},_0x5766d7=_0x1235bd[_0x8d381([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x8d381([0x67,0x65,0x74])](_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x10d351(){let _0x593770,_0x1025e9=null,_0x171fd8=null;try{if(_0x5766d7==_0x8d381([0x47,0x50,0x4c]))return _0x8d381([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x593770=_0x1e5606(),!_0x593770)return _0x8d381([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x593770[_0x8d381([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x171fd8=_0x43a8bb(_0x593770[_0x8d381([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x593770[_0x8d381([0x6a,0x74,0x69])])),await _0x4b5606()?_0x3d6fa3()?_0x1b7fac()?_0x8d381([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4b9fdd()?(_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x8d381([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1025e9=_0xa1d269(_0x8d381([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x8d381([0x74,0x72,0x69,0x61,0x6c])&&(_0x1025e9=_0xa1d269(_0x8d381([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xf992d3()):_0x8d381([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x8d381([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x8d381([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x8d381([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1b7fac(){const _0xb61096=[_0x8d381([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x8d381([0x74,0x72,0x69,0x61,0x6c])][_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3ecc28/0x3e8:0xe10*_0x58d725;return _0x593770[_0x8d381([0x65,0x78,0x70])]<_0xb61096;}function _0x3d6fa3(){const _0x25c894=_0x593770[_0x8d381([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x25c894&&(!!_0x25c894[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8d381([0x2a]))||!!_0x25c894[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8d381([0x41,0x49])));}function _0x4b9fdd(){const _0x387e64=_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x387e64||0x0==_0x387e64[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x490ad1}=new URL(window[_0x8d381([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x387e64[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x490ad1))return!0x0;const _0x4d3d2c=_0x490ad1[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e]));return _0x387e64[_0x8d381([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3684ee=>_0x3684ee[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8d381([0x2a])))[_0x8d381([0x6d,0x61,0x70])](_0x36c96e=>_0x36c96e[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e])))[_0x8d381([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x22a71d=>_0x22a71d[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4d3d2c[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x8d381([0x6d,0x61,0x70])](_0x185f87=>Array(_0x4d3d2c[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x185f87[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x8d381([0x66,0x69,0x6c,0x6c])](_0x185f87[0x0]===_0x8d381([0x2a])?_0x8d381([0x2a]):'')[_0x8d381([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x185f87))[_0x8d381([0x73,0x6f,0x6d,0x65])](_0x5bf1bf=>_0x4d3d2c[_0x8d381([0x65,0x76,0x65,0x72,0x79])]((_0xe8d24,_0x5ef96d)=>_0x5bf1bf[_0x5ef96d]===_0xe8d24||_0x5bf1bf[_0x5ef96d]===_0x8d381([0x2a])));}function _0xf992d3(){return _0x1025e9&&_0x171fd8?new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3a6cd0,_0x555160)=>{_0x1025e9[_0x8d381([0x74,0x68,0x65,0x6e])](_0x3a6cd0,_0x555160),_0x171fd8[_0x8d381([0x74,0x68,0x65,0x6e])](_0x11da56=>{_0x11da56!=_0x8d381([0x56,0x61,0x6c,0x69,0x64])&&_0x3a6cd0(_0x11da56);},_0x555160);}):_0x1025e9||_0x171fd8||_0x8d381([0x56,0x61,0x6c,0x69,0x64]);}}function _0x43a8bb(_0x3e6374,_0x2e6c1a){return new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x326e90=>{if(_0x25b947())return _0x326e90(_0x8d381([0x56,0x61,0x6c,0x69,0x64]));_0x17ba1d(),_0x1235bd[_0x8d381([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x8d381([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1c270c=!0x1;const _0x5a4a20=_0x3bb1ce();function _0x48797d(_0x22d164){return!!_0x22d164&&(typeof _0x22d164===_0x8d381([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x22d164===_0x8d381([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x22d164[_0x8d381([0x74,0x68,0x65,0x6e])]===_0x8d381([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x22d164[_0x8d381([0x63,0x61,0x74,0x63,0x68])]===_0x8d381([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x30087b(_0x4191e7){_0x1417fb(_0x4191e7)[_0x8d381([0x74,0x68,0x65,0x6e])](_0xa84739=>{if(!_0xa84739||_0xa84739[_0x8d381([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x8d381([0x6f,0x6b]))return _0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3d930a(_0x362e33(_0x5a4a20+_0x2e6c1a))!=_0xa84739[_0x8d381([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x8d381([0x56,0x61,0x6c,0x69,0x64]);})[_0x8d381([0x74,0x68,0x65,0x6e])](_0x116341=>(_0x998b1c(),_0x116341),()=>{const _0x4fc159=_0x2d1c45();return null==_0x4fc159?(_0x998b1c(),_0x8d381([0x56,0x61,0x6c,0x69,0x64])):_0x8d381(_0x3ecc28-_0x4fc159>(0x19f340e1^_0x2e25a2)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x8d381([0x74,0x68,0x65,0x6e])](_0x326e90)[_0x8d381([0x63,0x61,0x74,0x63,0x68])](()=>{_0x326e90(_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x12c607=0x3dc92a61^_0x2e25a2;function _0x998b1c(){const _0x61a1cf=_0x8d381([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d930a(_0x362e33(_0x3e6374)),_0x537e30=_0x1fec3d(_0x3d930a(window[_0x8d381([0x4d,0x61,0x74,0x68])][_0x8d381([0x63,0x65,0x69,0x6c])](_0x3ecc28/_0x12c607)));window[_0x8d381([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x8d381([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x61a1cf,_0x537e30);}function _0x2d1c45(){const _0x5dedce=_0x8d381([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d930a(_0x362e33(_0x3e6374)),_0x4e0f12=window[_0x8d381([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x8d381([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5dedce);return _0x4e0f12?window[_0x8d381([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1fec3d(_0x4e0f12),0x10)*_0x12c607:null;}function _0x1417fb(_0x27694e){return new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3d6e50,_0x41241e)=>{_0x27694e[_0x8d381([0x74,0x68,0x65,0x6e])](_0x3d6e50,_0x41241e),window[_0x8d381([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x41241e,0x3dfe1021^_0x2e25a2);});}}_0x1235bd[_0x8d381([0x6f,0x6e])](_0x8d381([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x49d9ad,_0x2a67a8)=>{if(_0x2a67a8[0x0]!=_0x3e6374)return _0x326e90(_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2a67a8[0x1]={..._0x2a67a8[0x1],[_0x8d381([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5a4a20};},{[_0x8d381([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x8d381([0x68,0x69,0x67,0x68])}),_0x1235bd[_0x8d381([0x6f,0x6e])](_0x8d381([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x581924=>{_0x48797d(_0x581924[_0x8d381([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1c270c=!0x0,_0x30087b(_0x581924[_0x8d381([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x8d381([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x8d381([0x6c,0x6f,0x77])}),_0x136d29[_0x8d381([0x74,0x68,0x65,0x6e])](()=>{_0x1c270c||_0x326e90(_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x25b947(){return _0x1235bd[_0x8d381([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x8d381([0x76,0x69,0x65,0x77])][_0x8d381([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x8d381([0x61,0x75,0x74,0x6f]);}function _0x17ba1d(){_0x1235bd[_0x8d381([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x8d381([0x76,0x69,0x65,0x77])][_0x8d381([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x8d381([0x61,0x75,0x74,0x6f]);}}function _0xa1d269(_0x40f985){const _0x30a095=[new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15f8fe=>setTimeout(_0x15f8fe,0x3df6fa2d^_0x2e25a2)),_0x136d29[_0x8d381([0x74,0x68,0x65,0x6e])](()=>new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x544dc8=>{let _0x568c2d=0x0;_0x1235bd[_0x8d381([0x6d,0x6f,0x64,0x65,0x6c])][_0x8d381([0x6f,0x6e])](_0x8d381([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x407800,_0x48561c)=>{_0x48561c[0x0][_0x8d381([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x568c2d++,_0x568c2d==(0x3dffc519^_0x2e25a2)&&(_0x544dc8(),_0x407800[_0x8d381([0x6f,0x66,0x66])]());});}))];return window[_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x8d381([0x72,0x61,0x63,0x65])](_0x30a095)[_0x8d381([0x74,0x68,0x65,0x6e])](()=>_0x40f985);}async function _0x3d38cd(){await _0x136d29,_0x1235bd[_0x8d381([0x6d,0x6f,0x64,0x65,0x6c])][_0x8d381([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x308fe5,_0x1235bd[_0x8d381([0x6d,0x6f,0x64,0x65,0x6c])][_0x8d381([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x308fe5,_0x1235bd[_0x8d381([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x8d381([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x33dc92(_0xa70a41){const _0x12f91b=_0x41aa92();_0x1235bd[_0x12f91b]=_0x8d381([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xa70a41,_0xa70a41!=_0x8d381([0x56,0x61,0x6c,0x69,0x64])&&_0x3d38cd();}function _0x41aa92(){const _0x4bcc49=window[_0x8d381([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x8d381([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x8d381([0x6e,0x6f,0x77])]())[_0x8d381([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x8d381([0x2e]),'');let _0xc22ab6=_0x8d381([0x6e]);for(let _0x9a38f1=0x0;_0x9a38f1<_0x4bcc49[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x9a38f1+=0x2){let _0x4e100e=window[_0x8d381([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4bcc49[_0x8d381([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x9a38f1,_0x9a38f1+0x2));_0x4e100e>=_0x15f781[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4e100e-=_0x15f781[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xc22ab6+=_0x15f781[_0x4e100e];}return _0xc22ab6;}function _0x1e5606(){const _0xaddc76=_0x5766d7[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e]));if(0x3!=_0xaddc76[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5c66b3(_0xaddc76[0x1]);function _0x5c66b3(_0x88829b){const _0x3895bc=_0x1739af(_0x88829b);return _0x3895bc&&_0x503c53()?_0x3895bc:null;function _0x503c53(){const _0x506de7=_0x3895bc[_0x8d381([0x6a,0x74,0x69])],_0x5f5bd8=window[_0x8d381([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x506de7[_0x8d381([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x506de7[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x16d9d1={..._0x3895bc,[_0x8d381([0x6a,0x74,0x69])]:_0x506de7[_0x8d381([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x506de7[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x16d9d1[_0x8d381([0x76,0x63])],_0x362e33(_0x16d9d1)==_0x5f5bd8;}}}async function _0x4b5606(){let _0x6bafb7=!0x0;try{const _0x322b89=_0x5766d7[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e])),[_0x72b7ba,_0x5efa3d,_0x493547]=_0x322b89;return _0xa661a9(_0x72b7ba),await _0x14add3(_0x72b7ba,_0x5efa3d,_0x493547),_0x6bafb7;}catch{return!0x1;}function _0xa661a9(_0x756974){const _0x14f22d=_0x1739af(_0x756974);_0x14f22d&&_0x14f22d[_0x8d381([0x61,0x6c,0x67])]==_0x8d381([0x45,0x53,0x32,0x35,0x36])||(_0x6bafb7=!0x1);}async function _0x14add3(_0x63ebb8,_0x24f53f,_0x23d3f5){const _0x19c2ba=window[_0x8d381([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x8d381([0x66,0x72,0x6f,0x6d])](_0x5bc924(_0x23d3f5),_0x54c235=>_0x54c235[_0x8d381([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x307205=new window[(_0x8d381([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x8d381([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x63ebb8+_0x8d381([0x2e])+_0x24f53f),_0x550884=window[_0x8d381([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x8d381([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x550884)return;const _0x43852d=await _0x550884[_0x8d381([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x8d381([0x6a,0x77,0x6b]),_0x53326c,{[_0x8d381([0x6e,0x61,0x6d,0x65])]:_0x8d381([0x45,0x43,0x44,0x53,0x41]),[_0x8d381([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x8d381([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x8d381([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x550884[_0x8d381([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x8d381([0x6e,0x61,0x6d,0x65])]:_0x8d381([0x45,0x43,0x44,0x53,0x41]),[_0x8d381([0x68,0x61,0x73,0x68])]:{[_0x8d381([0x6e,0x61,0x6d,0x65])]:_0x8d381([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x43852d,_0x19c2ba,_0x307205)||(_0x6bafb7=!0x1);}}function _0x1739af(_0x3347fa){return _0x3347fa[_0x8d381([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x8d381([0x65,0x79]))?JSON[_0x8d381([0x70,0x61,0x72,0x73,0x65])](_0x5bc924(_0x3347fa)):null;}function _0x5bc924(_0x899fc6){return window[_0x8d381([0x61,0x74,0x6f,0x62])](_0x899fc6[_0x8d381([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x8d381([0x2b]))[_0x8d381([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x8d381([0x2f])));}function _0x362e33(_0x256918){let _0xde6ac9=0x1505;function _0x26dbf1(_0x5c74b0){for(let _0x106be6=0x0;_0x106be6<_0x5c74b0[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x106be6++){const _0x49bf11=_0x5c74b0[_0x8d381([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x106be6);_0xde6ac9=(_0xde6ac9<<0x5)+_0xde6ac9+_0x49bf11,_0xde6ac9&=_0xde6ac9;}}function _0x350ce1(_0x5f0caa){Array[_0x8d381([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5f0caa)?_0x5f0caa[_0x8d381([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x350ce1):_0x5f0caa&&typeof _0x5f0caa==_0x8d381([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x8d381([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5f0caa)[_0x8d381([0x73,0x6f,0x72,0x74])]()[_0x8d381([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x11e236,_0x4bd6c9])=>{_0x26dbf1(_0x11e236),_0x350ce1(_0x4bd6c9);}):_0x26dbf1(window[_0x8d381([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5f0caa));}return _0x350ce1(_0x256918),_0xde6ac9>>>0x0;}function _0x3d930a(_0x3c538f){return _0x3c538f[_0x8d381([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x8d381([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x8d381([0x30]));}function _0x1fec3d(_0x1a1b39){return _0x1a1b39[_0x8d381([0x73,0x70,0x6c,0x69,0x74])]('')[_0x8d381([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x8d381([0x6a,0x6f,0x69,0x6e])]('');}function _0x308fe5(){}function _0x8d381(_0xce10d){return _0xce10d['map'](_0x4bbabf=>String['fromCharCode'](_0x4bbabf))['join']('');}_0x33dc92(await _0x10d351());}(this);}['showFakeVisualSelection'](){const _0x1f2b9d=this['editor']['model'];_0x1f2b9d['change'](_0xcb056f=>{const _0x196806=_0x1f2b9d['document']['selection']['getRanges']();let _0x44aafc=0x0;for(const _0x240957 of _0x196806){const _0x1de637=pt+':'+_0x44aafc;if(_0x1f2b9d['markers']['has'](_0x1de637))_0xcb056f['updateMarker'](_0x1de637,{'range':_0x240957});else{if(_0x240957['start']['isAtEnd']){const _0xb6600=_0x240957['start']['getLastMatchingPosition'](({item:_0x15897b})=>!_0x1f2b9d['schema']['isContent'](_0x15897b),{'boundaries':_0x240957});_0xcb056f['addMarker'](_0x1de637,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xcb056f['createRange'](_0xb6600,_0x240957['end'])});}else _0xcb056f['addMarker'](_0x1de637,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x240957});}_0x44aafc++;}});}['hideFakeVisualSelection'](){const _0x53d73c=this['editor']['model'],_0xdcf3e7=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](pt));_0xdcf3e7['length']&&_0x53d73c['change'](_0x23dfd8=>{_0xdcf3e7['forEach'](_0xb9672f=>{_0x23dfd8['removeMarker'](_0xb9672f);});});}['insertContent'](_0x33981b,_0x885f78){const _0x1ff200=this['_getAISelection'](),_0x3f8d5d=_0x885f78||_0x1ff200['getFirstRange']();this['editor']['model']['canEditAt'](_0x3f8d5d)&&this['editor']['model']['change'](_0x10fb0e=>{this['hideFakeVisualSelection'](),_0x885f78||this['_resetContentOfSelectedTableCells'](_0x10fb0e,_0x1ff200),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3f8d5d,'writer':_0x10fb0e,'html':_0x33981b});});}['insertContentBelow'](_0x360df1){const {model:_0x1a49d1}=this['editor'],_0x286e30=this['_getAISelection']();_0x1a49d1['change'](()=>{const _0x125f4a=this['_prepareTableInsertBelowPosition'](_0x360df1,_0x286e30)||this['_getDefaultInsertBelowPosition'](_0x286e30);this['insertContent'](_0x360df1,_0x125f4a);});}['_getAISelection'](){const _0x492d45=this['editor']['model'],_0x37e2a2=Array['from'](_0x492d45['markers']['getMarkersGroup'](pt))['map'](_0x2d24da=>_0x2d24da['getRange']());return _0x492d45['createSelection'](_0x37e2a2);}['_pasteHTMLUsingClipboard']({writer:_0x146a03,html:_0x8885bc,insertAt:_0x3ce8aa}){const {view:_0x163869}=this['editor']['editing'],_0x357e72=this['editor']['plugins']['get'](lt),_0xbcb82b=new Wn();_0xbcb82b['setData']('text/html',_0x8885bc);const _0x3e265b=new ClipboardEvent('paste',{'clipboardData':_0xbcb82b}),_0x503052=new wt(_0x163869,_0x3e265b,{'dataTransfer':new ft(_0xbcb82b)});_0x146a03['setSelection'](_0x3ce8aa);const _0x32381c=(_0x46e845,_0x5475f6)=>{_0x5475f6['resultRange']&&_0x146a03['setSelection'](_0x5475f6['resultRange']);};_0x357e72['once']('contentInsertion',_0x32381c,{'priority':'lowest'}),_0x163869['document']['fire']('paste',_0x503052),_0x357e72['off']('contentInsertion',_0x32381c);}['_getDefaultInsertBelowPosition'](_0x397460){const {model:_0x2b56f1}=this['editor'],_0x30d527=Array['from'](_0x397460['getSelectedBlocks']());return _0x30d527['length']?_0x2b56f1['createPositionAfter'](_0x30d527['pop']()):_0x397460['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1984c4,_0x2dc5fb){const {model:_0x36fd9b,plugins:_0x4279b0}=this['editor'];if(_0x4279b0['has']('TableUtils')){const _0x3d5fb2=_0x4279b0['get']('TableUtils')['getSelectedTableCells'](_0x2dc5fb);if(_0x3d5fb2['length']){const _0xe27fee=this['_getTableRowCountFromContent'](_0x1984c4),_0x53fa45=this['_createEmptyTableRows'](_0x3d5fb2,_0xe27fee);return _0x36fd9b['createPositionAt'](_0x53fa45,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3dbffd){const _0x1cd4f9=this['editor']['plugins']['get']('TableUtils'),_0x58aa91=this['editor']['data']['parse'](_0x3dbffd),_0x455be7=Array['from'](_0x58aa91['getChildren']())['filter'](_0x58cc6a=>_0x58cc6a['is']('element','table'));let _0x37a084=0x0;return _0x455be7['forEach'](_0x21e593=>{_0x37a084+=_0x1cd4f9['getRows'](_0x21e593);}),_0x37a084;}['_createEmptyTableRows'](_0x423291,_0x1510ba){const _0x6ba4d5=this['editor']['plugins']['get']('TableUtils'),_0x1f4ec8=_0x6ba4d5['getRowIndexes'](_0x423291),_0x405a4b=_0x6ba4d5['getColumnIndexes'](_0x423291),_0x54a672=_0x1f4ec8['last']+0x1,_0x4c9d46=_0x405a4b['first'],_0x3ae6d9=_0x423291[0x0]['findAncestor']('table');for(let _0x2dbd60=0x0;_0x2dbd60<_0x1510ba;_0x2dbd60++)_0x6ba4d5['insertRows'](_0x3ae6d9,{'at':_0x54a672});return _0x3ae6d9['getChild'](_0x54a672)['getChild'](_0x4c9d46);}['_resetContentOfSelectedTableCells'](_0x2af38f,_0x354e34){const {plugins:_0x8c62b4}=this['editor'],{model:_0xb38537}=_0x2af38f;if(!_0x8c62b4['has']('TableUtils'))return;_0x8c62b4['get']('TableUtils')['getSelectedTableCells'](_0x354e34)['length']&&_0xb38537['deleteContent'](_0x354e34);}}class li extends _0x2a4cc7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x19ee7d('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1e8dfb){super(_0x1e8dfb),this['name']='AIRequestError';}}function Fn(_0x165a43,_0x3b862d,_0x44d685){const t=_0x165a43['t'];switch(_0x3b862d){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',_0x44d685);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x44d685);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'},_0x44d685);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3b862d;}}class hi extends At{['_commandDefinitions'];constructor(_0x30e8e2,_0x3b9701){super(_0x30e8e2),this['_commandDefinitions']=_0x3b9701,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5f1609,_0x117213,_0x54e978)=>{this['isEnabled']&&(this['enabledCommandsIds']=xs(this['_commandDefinitions'],_0x54e978));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x24a890,_0x4e3fa3,_0x51e398)=>{this['enabledCommandsIds']=_0x51e398?xs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x40bbd5=this['editor']['model'];this['_hasContext']=function(_0x13a353){const _0x55f8c4=_0x13a353['document']['selection'];return _0x55f8c4['isCollapsed']?0x0!==[..._0x55f8c4['getSelectedBlocks']()]['length']&&![..._0x55f8c4['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x13a353['hasContent'](_0x55f8c4['getFirstRange']());}(_0x40bbd5);const _0x381253=_0x40bbd5['document']['selection'],_0x5c7601=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x494640 of _0x381253['getRanges']())for(const _0xd19bdd of _0x494640['getItems']())if(_0xd19bdd['is']('element')&&_0x5c7601['includes'](_0xd19bdd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x504e26='',_0x1b804c='',_0x271ab2='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x504e26,_0x1b804c,_0x271ab2);}}function xs(_0x59ea56,_0x36658d){const _0x4d043d=new Set();for(const _0x1e4b3b of _0x59ea56['values']())(_0x36658d||!0x1===_0x1e4b3b['requiresContent'])&&_0x4d043d['add'](_0x1e4b3b['id']);return Array['from'](_0x4d043d);}const fs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class di extends/* #__PURE__ -- @preserve */
24
- $t(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x6c8339,_0x282ab6,_0x47c9a5){super(),this['editor']=_0x6c8339,this['textAdapter']=_0x282ab6,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x47c9a5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x38dc79,_0x3f24cc,_0x5751ca)=>{this['view']['value']=this['_sanitizeHTML'](_0x5751ca);}),this['listenTo'](this['view'],'submitPrompt',(_0x5e3e2c,_0x4b3fca)=>{const _0x148ce8=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4b3fca,_0x148ce8,'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:_0xd9b8f8,query:_0x3c73fe,htmlContent:_0x2c1917,label:_0x5344cd,mainActionLabel:_0x21513a}){this['view']['prompt']=_0x5344cd,this['view']['mainAction']=_0x21513a,this['initialContext']=_0x2c1917,_0x3c73fe&&(this['view']['isRendered']?this['_handleQuery'](_0x3c73fe,_0x2c1917,_0xd9b8f8,_0x5344cd):this['view']['once']('render',()=>{this['_handleQuery'](_0x3c73fe,_0x2c1917,_0xd9b8f8,_0x5344cd);}));}['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'](_0x10738c,_0x2f887e,_0x33a87d,_0x1608a1){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2f887e,this['previousQuery']=_0x10738c,this['previousLabel']=_0x1608a1||_0x10738c,this['previousActionId']=_0x33a87d,new Promise(_0x58a948=>{this['textAdapter']['makeRequest']({'query':_0x10738c,'context':_0x2f887e,'onData':_0x43347d=>{this['currentResponse']=_0x43347d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33a87d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x34ec20=>{_0x34ec20 instanceof tr?this['view']['handleError'](_0x34ec20['message']):this['view']['handleError'](),_0x58a948();})['finally'](()=>{this['stopProcessing'](),_0x58a948();});});}['_parseAndNormalizeContent'](_0x412d9f,_0xcd5992=!0x1){const _0x474bfa=fs['exec'](_0x412d9f);_0x412d9f=_0x474bfa?_0x412d9f['substring'](_0x474bfa[0x1]['length']):_0x412d9f['length']<0x64&&!_0xcd5992?'':this['_stripMarkdownSyntax'](_0x412d9f);const _0x24ab12=this['_domParser']['parseFromString'](_0x412d9f,'text/html');if(_0x474bfa){const _0x59242a=Array['from'](_0x24ab12['body']['childNodes']);_0x59242a['reverse']();for(const _0x2a4f5e of _0x59242a){if(_0x2a4f5e['nodeType']==Node['ELEMENT_NODE'])break;_0x2a4f5e['remove']();}}const _0x1db382=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x24ab12['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1db382);const _0x8c6ce4=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x30539a=this['editor']['data']['toModel'](_0x1db382);return _0x8c6ce4||_0x30539a['markers']['clear'](),this['editor']['data']['stringify'](_0x30539a);}['_normalizeResponseHeadings'](_0x2b64c9){const _0x1a7034=new _0x176332(this['editor']['editing']['view']['document']),_0x33d2e4=new _0x9dd39e({'name':/^h[1-5]$/}),_0x12bb16=[];let _0x379f51=!0x1;for(const _0x48178f of _0x2b64c9)_0x48178f['is']('element')&&_0x33d2e4['match'](_0x48178f)&&(_0x12bb16['push'](_0x48178f),'h1'==_0x48178f['name']&&(_0x379f51=!0x0));if(_0x379f51){for(const _0x5bf0aa of _0x12bb16)_0x1a7034['rename']('h'+(parseInt(_0x5bf0aa['name'][0x1])+0x1),_0x5bf0aa);}}['_isH1TagSupportEnabled'](){const {data:_0x396dfb,editing:_0x9d23c0}=this['editor'],_0x3b6614=_0x396dfb['htmlProcessor']['toView']('<h1></h1>'),_0x191584=_0x396dfb['toView'](_0x396dfb['toModel'](_0x3b6614));return!!_0x9d23c0['view']['domConverter']['viewToDom'](_0x191584)['querySelector']('h1');}['_sanitizeHTML'](_0x4c15ee){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4c15ee),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x574475){const _0x21a97b=_0x574475['trim']();return _0x21a97b['startsWith']('```html')?_0x21a97b['endsWith']('```')?_0x21a97b['substring'](0x7,_0x21a97b['length']-0x3):_0x21a97b['substring'](0x7):_0x574475;}}const pi={'REPLACE':'replace','INSERT':'insert'};class Er extends _0x39a08b{constructor(_0x54a9dd){super(_0x54a9dd),this['set']('isVisible',!0x1),this['set']('mainAction',pi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xfb808e=>Fn(_0x54a9dd,'AI_'+_0xfb808e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x54a9dd,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x54a9dd,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x54a9dd,'Stop'));const _0x389665=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x389665['if']('isVisible','ck-hidden',_0x147445=>!_0x147445)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x371030,_0x588f1b){const _0x5533ef=new _0x21bd9e(this['locale']);return _0x5533ef['set']({'label':_0x371030,'class':_0x588f1b||'','isVisible':!0x0,'withText':!0x0}),_0x5533ef;}}class Hr extends _0x492b6b{['contentFieldView'];['copyButtonView'];constructor(_0x302bbd,_0x4aa561=''){super(_0x302bbd),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3a543c=this['bindTemplate'];this['contentFieldView']=new Yn(_0x302bbd,_0x4aa561),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3a543c['if']('isVisible','ck-hidden',_0x3df118=>!_0x3df118)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3a543c['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 _0x10ede8=!0x1;this['on']('change:value',(_0x2f229b,_0xd05960,_0x555c66)=>{const _0x14c86d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x555c66),this['isProcessing']&&_0x14c86d&&!_0x10ede8&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4e2814,_0x443a9f,_0x32f404)=>{_0x10ede8=!0x1,_0x32f404?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x10ede8=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x10ede8=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x13b91d=this['locale'],_0x9c73f4=new _0x21bd9e(this['locale']),_0x47e5f6='ck-ai-form__copy-button';return _0x9c73f4['set']({'label':Fn(_0x13b91d,'Copy'),'icon':_0x4559bc,'class':_0x47e5f6,'tooltip':!0x0}),_0x9c73f4['bind']('isVisible')['to'](this,'value',_0x507a76=>!!_0x507a76),_0x9c73f4['bind']('isEnabled')['to'](this,'isProcessing',_0x2b0fa1=>!_0x2b0fa1),_0x9c73f4['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x9c73f4['icon']=_0x2a5a64,_0x9c73f4['class']=_0x47e5f6+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x9c73f4['icon']=_0x4559bc,_0x9c73f4['class']=_0x47e5f6;},0x3e8);}),_0x9c73f4;}['_copyHTMLToClipboard'](_0x12c16a){const {window:_0x495eeb,document:_0x40f798}=_0x384749;if(_0x495eeb['ClipboardItem']){const {Blob:_0x3ad645,ClipboardItem:_0x30db6c}=_0x495eeb,_0x2d03dd=[new _0x30db6c({'text/html':new _0x3ad645([_0x12c16a['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ad645([_0x12c16a['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2d03dd);}else{const _0x318da9=_0x40f798['createElement']('div');_0x318da9['style']['position']='absolute',_0x318da9['style']['left']='-9999px',_0x318da9['innerHTML']='<span>[</span>'+_0x12c16a['innerHTML']+'<span>]</span>',_0x40f798['body']['appendChild'](_0x318da9);const _0xd81bcd=_0x40f798['createRange']();_0xd81bcd['setStartAfter'](_0x318da9['firstElementChild']),_0xd81bcd['setEndBefore'](_0x318da9['lastElementChild']);const _0x4f08c4=_0x495eeb['getSelection']();_0x4f08c4['removeAllRanges'](),_0x4f08c4['addRange'](_0xd81bcd),_0x40f798['execCommand']('copy'),_0x318da9['remove']();}}}class Yn extends _0x492b6b{constructor(_0x472202,_0x1221f1=''){super(_0x472202),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1221f1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2da93a){this['element']['innerHTML']=_0x2da93a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5adfd0=new _0x492b6b(),_0x405f5d=this['locale'],_0xada4c7=new _0x1e37e5();return _0xada4c7['isVisible']=!0x0,_0x5adfd0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0xada4c7,{'text':Fn(_0x405f5d,'AI\x20is\x20writing...')}]}),_0x5adfd0['render'](),_0x5adfd0;}}class Rr extends _0x492b6b{constructor(_0x1e92b2,_0x168129=''){super(_0x1e92b2);const _0x4900f4=new _0x25e498(),_0x5571b0=this['bindTemplate'];this['set']('text',_0x168129),_0x4900f4['content']=_0x1b5390,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4900f4,{'text':_0x5571b0['to']('text')}]});}}class Tr extends _0x143cba{['submitButtonView'];['showHistoryButtonView'];constructor(_0xe51dfc,_0x1e7d54){super(_0xe51dfc,_0x1e7d54),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',(_0x3c7d47,_0x354d6c)=>{_0x3c7d47['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x354d6c());});}['_createSubmitButton'](){const _0x1a2894=new _0x21bd9e(this['locale']),_0x5bb6a4=this['locale'];return _0x1a2894['set']({'icon':_0x47a449,'label':Fn(_0x5bb6a4,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1a2894['on']('execute',()=>{this['submit']();}),_0x1a2894['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x19c125,_0x46ef87)=>!_0x19c125&&_0x46ef87),_0x1a2894;}['_createShowHistoryButton'](){const _0x4c8862=new _0x21bd9e(this['locale']),_0x42ccee=this['resultsView'],_0x184d51=this['locale'];_0x4c8862['set']({'label':Fn(_0x184d51,'History'),'withText':!0x1,'icon':It,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4c8862['bind']('isOn')['to'](_0x42ccee,'isVisible'),_0x4c8862['bind']('isEnabled')['to'](this,'isEnabled'),_0x4c8862['on']('execute',()=>{_0x42ccee['isVisible']=!_0x42ccee['isVisible'],_0x42ccee['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1b729f=()=>{_0x384749['window']['requestAnimationFrame'](()=>{if(_0x1ec9b5(this['element'])){const _0x435c5f=new _0x1ba12e(this['queryView']['fieldView']['element']),_0xc23493=_0x435c5f['width'],_0x457732='rtl'===_0x184d51['uiLanguageDirection']?'left':'right';_0x435c5f['excludeScrollbarsAndBorders'](),_0x4c8862['element']['style'][_0x457732]=_0xc23493-_0x435c5f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1b729f),this['on']('render',_0x1b729f),_0x4c8862;}['submit'](){const _0x5c52ee=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5c52ee);}['focus'](_0x429e71){-0x1===_0x429e71?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class qr extends _0x24784f{['historyGroupView'];['clearHistoryButton'];constructor(_0x5a3ddb){super(_0x5a3ddb),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x23de91(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x5a3ddb,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x27d7c5=0x0;for(const _0x137611 of this['items'])_0x27d7c5+=_0x137611['items']['length'];return{'resultsCount':_0x27d7c5,'totalItemsCount':_0x27d7c5};}['_createClearHistoryButton'](){const _0x1e77b8=this['locale'],_0x3356f9=new _0x21bd9e(this['locale']);return _0x3356f9['set']({'label':'('+Fn(_0x1e77b8,'Clear')+')','withText':!0x0}),_0x3356f9['on']('execute',()=>this['fire']('clearHistory')),_0x3356f9;}}class Fr extends _0x8a8c30{constructor(_0x16f48f){super();const _0x42670f=new _0xb0531d(),_0x2e56b6=new _0x21bd9e(this['locale'],_0x42670f);this['children']['add'](_0x2e56b6),_0x2e56b6['set']({'label':_0x16f48f['prompt'],'withText':!0x0}),_0x2e56b6['on']('execute',()=>{this['fire']('execute',{'value':_0x2e79bc(_0x16f48f['prompt'])});});}}const Jo='CKEditor/AIFormView/PromptHistory';class Or extends _0x1c36f7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x26dc57,_0x3a2ff4)=>{const _0xa230f2=Ko(_0x3a2ff4['prompt']);for(const _0x434b0d of this)if(_0x434b0d!=_0x3a2ff4&&Ko(_0x434b0d['prompt'])===_0xa230f2){this['remove'](_0x434b0d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x14b81a=sessionStorage['getItem'](Jo)||'[]';this['addMany'](JSON['parse'](_0x14b81a));}['_saveToSessionStorage'](){sessionStorage['setItem'](Jo,JSON['stringify'](this['map'](_0x4dce61=>_0x4dce61)));}}function Ko(_0xe118ac){return _0xe118ac['toLowerCase']()['trim']();}class ui extends _0x492b6b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x27cc81,_0x22316d,_0x4edde7=''){super(_0x27cc81),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',pi['REPLACE']),this['_promptHistory']=new Or(),this['errorView']=new Rr(_0x27cc81),this['contentArea']=new Hr(_0x27cc81,_0x4edde7),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 Bt(),this['keystrokes']=new Wt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Vt({'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 _0x25c940=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x22316d],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x25c940['if']('isError','ck-hidden',_0x5c014b=>!_0x5c014b)]},'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'](_0x3b4404=0x1){-0x1===_0x3b4404?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 _0x3aa2d1=this['locale'],_0xf85906=new Tr(_0x3aa2d1,{'queryView':{'label':Fn(_0x3aa2d1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1eaf41,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x3aa2d1,'Empty\x20history'),'secondary':Fn(_0x3aa2d1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf85906['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c03ff,_0x9b135a)=>_0x2c03ff&&!_0x9b135a),this['listenTo'](_0xf85906,'submit',(_0x16e2c4,_0x192c3c)=>{this['prompt']=_0x192c3c;const _0x2b7450=Zt(_0x192c3c);this['fire']('submitPrompt',_0x2b7450),_0x192c3c['trim']()&&this['_promptHistory']['add']({'prompt':_0x2b7450},0x0);},{'priority':'high'}),_0xf85906;}['_createHistoryView'](){const _0x2b5593=new qr(this['locale']);return _0x2b5593['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Fr),_0x2b5593['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2b5593;}['_createToolbar'](){const _0x59901d=new Er(this['locale']);return _0x59901d['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x68e2da,_0x125f74,_0x3b90e2)=>_0x68e2da&&!_0x125f74&&!!_0x3b90e2),_0x59901d['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x59901d['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3b0c21,_0x37c22,_0x1f3cc2)=>_0x3b0c21&&!_0x37c22&&!!_0x1f3cc2),_0x59901d['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x59901d['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4e0be8,_0x49e2df)=>_0x4e0be8&&!_0x49e2df),_0x59901d['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x59901d['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x59901d['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x59901d;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xb9e842=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0xb9e842,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x80ed9b){const _0x2d1532=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x80ed9b||Fn(_0x2d1532,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const dt=globalThis['DataTransfer'];class ee extends _0x2a4cc7{['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[_0x2c5fc2,te,li,_0x43b27c];}constructor(_0xec4f73){super(_0xec4f73),_0xec4f73['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xec4f73['config']['define']('ai.assistant.contentAreaCssClass',''),_0xec4f73['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xec4f73['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x36ea1e}=this;this['_aiAdapter']=_0x36ea1e['plugins']['get'](li),this['_dialog']=_0x36ea1e['plugins']['get'](_0x43b27c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x436460=new hi(_0x36ea1e,Array['from'](this['_commandDefinitions']['values']()));_0x36ea1e['commands']['add']('showAIAssistant',_0x436460),_0x36ea1e['ui']['componentFactory']['add']('aiCommands',_0x281a5d=>{const _0x202434=_0x35c3bd(_0x281a5d);return _0x202434['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x202434['buttonView']['set']({'label':Fn(_0x281a5d,'AI\x20Commands'),'icon':_0x5253a5,'tooltip':!0x0}),_0x202434['on']('execute',_0x45d99c=>this['_onExecute'](_0x45d99c['source']['id'])),_0x571ded(_0x202434,_0x36ea1e['ui']['view']['body'],function(_0x8b2cb2){const _0x30200c=ne(_0x8b2cb2['config']['get']('ai.assistant.commands'),_0x8b2cb2['locale']),_0x1e0bb7=wi(_0x8b2cb2,_0x30200c)['filter'](_0x4e115e=>_0x4e115e['commands']['length']);if(0x1===_0x1e0bb7['length'])return wi(_0x8b2cb2,_0x1e0bb7[0x0]['commands'])['map'](_0x459ad2=>({'id':_0x459ad2['id'],'label':_0x459ad2['label']}));return _0x1e0bb7['map'](_0x50a0fa=>{const {groupId:_0x498f87,groupLabel:_0xaf8e74,commands:_0x4b3c8f}=_0x50a0fa,_0x4247cd=wi(_0x8b2cb2,_0x4b3c8f)['map'](_0x4ea18f=>({'id':_0x4ea18f['id'],'label':_0x4ea18f['label']}));return{'id':_0x498f87,'menu':_0xaf8e74||_0x498f87,'children':_0x4247cd};});}(_0x36ea1e),{'ariaLabel':Fn(_0x281a5d,'AI\x20Commands')}),_0x202434['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x436460['on']('change:enabledCommandsIds',_0x15e762),_0x202434['menuView']['once']('render',_0x15e762),_0x202434;function _0x15e762(){_0x202434['isEnabled']=_0x436460['enabledCommandsIds']['length']>0x0;for(const _0x2827ea of _0x202434['menuView']['buttons'])_0x2827ea['isEnabled']=_0x436460['enabledCommandsIds']['includes'](_0x2827ea['id']);}}),_0x36ea1e['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3e108f=>{const _0x50caee=new _0xc03205(_0x3e108f);_0x50caee['buttonView']['set']({'label':Fn(_0x3e108f,'AI\x20Commands'),'icon':_0x5253a5}),_0x50caee['bind']('isEnabled')['to'](_0x436460,'enabledCommandsIds',_0x3c5783=>_0x3c5783['length']>0x0);const _0x4ec567=ne(_0x36ea1e['config']['get']('ai.assistant.commands'),_0x3e108f);return this['_populateMenuBarMenu'](_0x436460,_0x50caee,_0x4ec567,_0x3802e7=>this['_onExecute'](_0x3802e7)),_0x50caee;}),_0x36ea1e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4b1db8=this['_createAIAssistantUIButton'](_0x21bd9e);return _0x4b1db8['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4b1db8;}),_0x36ea1e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x454fd6=this['_createAIAssistantUIButton'](_0x4f4ee6);return _0x454fd6['set']({'role':'menuitemcheckbox'}),_0x454fd6;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xf56b4f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x6a3d6;for(const _0x3c15fc in _0xf56b4f){const _0x8e5292=_0x3c15fc,_0x1f18e2=_0xf56b4f[_0x8e5292];if('aiLicenseKeyValid'==_0x1f18e2||'aiLicenseKeyInvalid'==_0x1f18e2||'aiLicenseKeyExpired'==_0x1f18e2||'aiLicenseKeyDomainLimit'==_0x1f18e2||'aiLicenseKeyNotAllowed'==_0x1f18e2||'aiLicenseKeyEvaluationLimit'==_0x1f18e2||'aiLicenseKeyTrialLimit'==_0x1f18e2||'aiLicenseKeyUsageLimit'==_0x1f18e2){delete _0xf56b4f[_0x8e5292],_0x6a3d6=_0x1f18e2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x15db7f='',_0x3120fa='',_0x7579d9='custom'){const _0x979794=this['editor'],_0x8269d1=_0x979794['editing']['view'],_0xd1dd5a=_0x979794['plugins']['get'](te),_0xf883b9=_0x979794['plugins']['get'](_0x2c5fc2);_0xd1dd5a['showFakeVisualSelection']();const _0x4d9d9c=new dt(),_0x133b26=new ClipboardEvent('copy',{'clipboardData':_0x4d9d9c}),_0x3b5441=new ft(_0x4d9d9c),_0x48d6ff=new wt(_0x8269d1,_0x133b26,{'dataTransfer':_0x3b5441});_0xf883b9['_forceMarkersCopy']('comment',()=>{_0x8269d1['document']['fire']('copy',_0x48d6ff);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new di(_0x979794,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x573c9a=_0x3b5441['getData']('text/html');const _0x329c24=_0x979794['model']['document']['selection'],_0x5cfe1c=Array['from'](_0x329c24['getRanges']());0x1===_0x5cfe1c['length']&&_0x5cfe1c[0x0]['isFlat']&&!_0x329c24['getSelectedElement']()&&''!==_0x573c9a['replace'](/&nbsp;/g,'')['trim']()&&(_0x573c9a='<p>'+_0x573c9a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x7579d9,'query':_0x15db7f,'htmlContent':_0x573c9a,'label':_0x3120fa,'mainActionLabel':pi[_0x979794['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x6f5cfb['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xd1dd5a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x15e564=new Map(),_0x43d98e=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5c05ec of _0x43d98e)for(const _0x1c8c0f of _0x5c05ec['commands'])_0x15e564['set'](_0x1c8c0f['id'],{..._0x1c8c0f,'groupId':_0x5c05ec['groupId'],'groupLabel':_0x5c05ec['groupLabel']||_0x5c05ec['groupId']});return _0x15e564;}['_createAIAssistantUIButton'](_0x24fdac){const _0x174368=this['editor'],_0x444972=_0x174368['commands']['get']('showAIAssistant'),_0x1ea61e=new _0x24fdac(_0x174368['locale']);return _0x1ea61e['set']({'label':Fn(_0x174368['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x1ea61e['bind']('isEnabled')['to'](_0x444972),_0x1ea61e['bind']('isOn')['to'](this['_dialog'],'id',_0x298657=>'aiAssistant'===_0x298657),this['listenTo'](_0x1ea61e,'execute',()=>{_0x1ea61e['isOn']?this['hideUI']():_0x444972['execute']();}),_0x1ea61e;}['_initView'](){const _0x1d3e5c=this['editor']['plugins']['get'](te);this['_formView']=new ui(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x1d3e5c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1d3e5c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5c5770,ui:{ariaLiveAnnouncer:_0x4d196c}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4216f5,_0x1ff88d,_0x101ef3)=>{const _0x19aa17=this['_aiAssistantController']['currentContext'];_0x101ef3?_0x4d196c['announce'](Fn(_0x5c5770,'AI\x20is\x20writing')):_0x19aa17&&_0x4d196c['announce'](Fn(_0x5c5770,'Generated\x20content:\x20%0',_0x19aa17),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x362306,_0xb2c2f1,_0x1e7d76)=>{if(_0x1e7d76){const _0x3b85da=this['_formView']['errorView']['text'];_0x4d196c['announce'](Fn(_0x5c5770,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3b85da));}});}['_onExecute'](_0x40d4b2){const _0xe4e6a9=this['_commandDefinitions']['get'](_0x40d4b2),_0x12c68e=this['editor'],_0x341cd3=_0x12c68e['model']['document']['selection'],_0x26fa2e=_0x12c68e['commands']['get']('showAIAssistant'),_0x4aeedb=_0x12c68e['plugins']['get'](te),_0x4cc19d=''+(_0xe4e6a9['groupId']!==mi?_0xe4e6a9['groupLabel']+':\x20':'')+_0xe4e6a9['label'];if(!0x1!==_0xe4e6a9['requiresContent']&&_0x341cd3['isCollapsed']){const _0x282272=_0x4e3c0f(_0x341cd3['getSelectedBlocks']())||_0x12c68e['model']['schema']['getLimitElement'](_0x341cd3);_0x12c68e['model']['change'](_0x2b6722=>{_0x2b6722['setSelection'](_0x282272,'in');});}_0x4aeedb['showFakeVisualSelection'](),_0x26fa2e['execute'](_0xe4e6a9['prompt'],_0x4cc19d,'command:'+_0x40d4b2);}['_populateMenuBarMenu'](_0x7a5325,_0x1915a9,_0x1844ba,_0x30af4a){const _0x271d7a=this['editor'],_0x528ce6=_0x271d7a['locale'],_0x7a1bff=new _0x1c5a64(_0x528ce6),_0x106ba4=wi(_0x271d7a,_0x1844ba)['filter'](_0x1dbb92=>_0x1dbb92['commands']['length']);0x1===_0x106ba4['length']?this['_getMenuBarGroupButtons']({'command':_0x7a5325,'commands':_0x106ba4[0x0]['commands'],'parentMenuView':_0x1915a9,'onExecute':_0x30af4a})['forEach'](_0x49e078=>_0x7a1bff['items']['add'](_0x49e078)):_0x106ba4['forEach'](({groupId:_0xaa73a9,groupLabel:_0x3638c8,commands:_0xb25dce})=>{const _0x4660a3=new _0x4b1a57(_0x528ce6,_0x1915a9),_0x3f85ae=new _0xc03205(_0x528ce6),_0x4f2d06=new _0x1c5a64(_0x528ce6),_0x132d9a=this['_getMenuBarGroupButtons']({'command':_0x7a5325,'commands':_0xb25dce,'parentMenuView':_0x3f85ae,'onExecute':_0x30af4a});_0x3f85ae['buttonView']['set']({'label':_0x3638c8||_0xaa73a9}),_0x3f85ae['delegate']('execute')['to'](_0x1915a9),_0x4f2d06['items']['addMany'](_0x132d9a),_0x3f85ae['panelView']['children']['add'](_0x4f2d06),_0x4660a3['children']['add'](_0x3f85ae),_0x7a1bff['items']['add'](_0x4660a3);}),_0x1915a9['panelView']['children']['add'](_0x7a1bff);}['_getMenuBarGroupButtons']({command:_0x243b41,commands:_0x36a829,parentMenuView:_0x799f9d,onExecute:_0x382798}){const _0x2e4dcb=this['editor'],_0x3f5766=_0x2e4dcb['locale'];return wi(_0x2e4dcb,_0x36a829)['map'](_0x57f065=>{const _0xfb5ee7=new _0x4b1a57(_0x3f5766,_0x799f9d),_0x4a16b6=new _0x4f4ee6(_0x3f5766);return _0x4a16b6['set']({'label':_0x57f065['label']}),_0x4a16b6['delegate']('execute')['to'](_0x799f9d),_0x4a16b6['on']('execute',()=>_0x382798(_0x57f065['id'])),_0x4a16b6['bind']('isEnabled')['to'](_0x243b41,'enabledCommandsIds',_0x3784c5=>_0x3784c5['includes'](_0x57f065['id'])),_0xfb5ee7['children']['add'](_0x4a16b6),_0xfb5ee7;});}}function Ai(_0x2ac6a7,_0x51024b){return void 0x0!==_0x2ac6a7['order']&&void 0x0===_0x51024b['order']?0x1:void 0x0===_0x2ac6a7['order']&&void 0x0!==_0x51024b['order']?-0x1:void 0x0!==_0x2ac6a7['order']&&void 0x0!==_0x51024b['order']?_0x2ac6a7['order']-_0x51024b['order']:0x0;}function wi(_0x10e4dd,_0x569093){_0x569093['sort'](Ai);const _0x52127b={},_0x154128=[];for(const _0x5e3082 of _0x569093)if(void 0x0!==_0x5e3082['order']){if(_0x5e3082['order']in _0x52127b)throw new _0x19ee7d('ai-commands-config-order-collision',_0x10e4dd,{'conflictingDefinitions':[_0x5e3082,_0x52127b[_0x5e3082['order']]]});_0x52127b[_0x5e3082['order']]=_0x5e3082,_0x154128['splice'](_0x5e3082['order'],0x0,_0x5e3082);}else _0x154128['push'](_0x5e3082);return _0x154128;}class $n extends _0x2a4cc7{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2019c6){super(_0x2019c6);const _0x353c26=_0x2019c6['config'],_0x249178=_0x2019c6['locale'];_0x353c26['define']('ai.assistant.preserveComments',!0x0),_0x353c26['define']('ai.assistant.commands',qn(_0x249178)),_0x353c26['define']('ai.assistant.extraCommandGroups',[]),_0x353c26['define']('ai.assistant.removeCommands',[]);let _0x5a9d53=ne(_0x353c26['get']('ai.assistant.commands'),_0x249178);const _0x2b4294=_0x353c26['get']('ai.assistant.extraCommandGroups'),_0x4ef4a1=_0x353c26['get']('ai.assistant.removeCommands');_0x2b4294['forEach'](_0x380fb8=>{const _0x219947=_0x5a9d53['find'](_0x17cf67=>_0x17cf67['groupId']===_0x380fb8['groupId']);_0x219947?_0x219947['commands']=_0x219947['commands']['concat'](_0x380fb8['commands']):_0x5a9d53['push'](_0x380fb8);}),_0x5a9d53=_0x5a9d53['filter'](_0xed238a=>!_0x4ef4a1['includes'](_0xed238a['groupId'])),_0x5a9d53['forEach'](_0x53eb63=>{_0x53eb63['commands']=_0x53eb63['commands']['filter'](_0x30c7a1=>!_0x4ef4a1['includes'](_0x30c7a1['id']));}),_0x353c26['set']('ai.assistant.commands',_0x5a9d53);}}function qn(_0x19947a){return[{'groupId':'editOrReview','groupLabel':Fn(_0x19947a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x19947a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x19947a,'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(_0x19947a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x19947a,'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(_0x19947a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x19947a,'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(_0x19947a,'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(_0x19947a,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x19947a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x19947a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x19947a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x19947a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x19947a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x19947a,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x19947a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x19947a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x19947a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x19947a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x19947a,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x19947a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x19947a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x19947a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x19947a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x19947a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x19947a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x19947a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x19947a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Te extends _0x2a4cc7{['abortController'];static get['requires'](){return[li];}constructor(_0x404b9b){super(_0x404b9b),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](li)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x5bb988){return this['sendRequest'](_0x5bb988)['catch'](_0x979397=>{if(_0x979397 instanceof tr)return Promise['reject'](_0x979397);if('AbortError'==_0x979397['name'])return Promise['resolve']();throw console['error'](_0x979397),new _0x19ee7d('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x214157,_0x2705b8){const _0x56cc2b=this['editor']['locale'],_0x18231c={'Content-Type':'application/json'};if('object'==typeof _0x214157)Object['assign'](_0x18231c,_0x214157);else{if(_0x214157)try{const _0x2bb1aa=await _0x214157(_0x2705b8);Object['assign'](_0x18231c,_0x2bb1aa);}catch{return Promise['reject'](new tr(Fn(_0x56cc2b,'AI_ERROR_GET_HEADERS')));}}return _0x18231c;}async['_prepareRequestParameters'](_0x491794,_0x8ed49){const _0x41b897=this['editor']['locale'];if('object'==typeof _0x491794)return _0x491794;try{return await _0x491794(_0x8ed49);}catch{return Promise['reject'](new tr(Fn(_0x41b897,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends Te{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x28975c){super(_0x28975c),_0x28975c['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x28975c['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x28975c['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x28975c['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x28975c['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x28975c['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2b3b12,context:_0xe03a14,onData:_0x4d7aa7,actionId:_0x3b5224}){const _0x3e3fa0=this['editor']['locale'],_0x593eb6=await this['prepareMessages'](_0x2b3b12,_0xe03a14,_0x3b5224),_0xae0dba=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3b5224),_0x293af6=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3b5224),_0x43a657={'messages':_0x593eb6,..._0x293af6},_0x42bcf3={'method':'POST','headers':_0xae0dba,'body':JSON['stringify'](_0x43a657),'signal':this['abortController']['signal']},_0x519326=await fetch(this['_apiUrl'],_0x42bcf3);if(_0x519326['ok'])return _0x293af6['stream']?await this['_readStreamableResponse'](_0x519326,_0x4d7aa7):await this['_readStaticResponse'](_0x519326,_0x4d7aa7),Promise['resolve']();{const _0x2c3ba6=await _0x519326['text']();return _0x2c3ba6['includes']('context_length_exceeded')?Promise['reject'](new tr(Fn(_0x3e3fa0,'AI_ERROR_CONTEXT_LENGTH'))):_0x2c3ba6['includes']('Moderation')?Promise['reject'](new tr(Fn(_0x3e3fa0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2c3ba6));}}async['prepareMessages'](_0x464f8d,_0x114971,_0x5f3576){let _0x747ea2,_0x3eb253;return _0x114971?(_0x747ea2='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.',_0x3eb253='Instruction:\x0a'+_0x464f8d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x114971):(_0x747ea2='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.',_0x3eb253=_0x464f8d),[{'role':'system','content':_0x747ea2},{'role':'user','content':_0x3eb253}];}async['_readStreamableResponse'](_0x466d19,_0xefe150){const _0x1cb23c=_0x466d19['body']['getReader'](),_0x4c3f43=new TextDecoder();let _0x151220='',_0x2e2e63='',_0xa217ce='',_0x2cf0ae=!0x1;for(;!_0x2cf0ae;){const {done:_0x570a21,value:_0x665a85}=await _0x1cb23c['read'](),_0x391e11=_0x151220+_0x4c3f43['decode'](_0x665a85);let _0x4cfa3a='';_0x2cf0ae=_0x570a21;try{_0x4cfa3a=this['_cleanUpData'](_0x391e11),_0x151220='';}catch{_0x151220=_0x391e11;continue;}_0x2e2e63+=_0x4cfa3a,!_0x2cf0ae&&this['_isBufferIncomplete'](_0x2e2e63)||_0x2e2e63&&(_0xa217ce+=_0x2e2e63,_0x2e2e63='',_0xefe150(_0xa217ce));}return Promise['resolve']();}async['_readStaticResponse'](_0x5923ac,_0x4551d6){return _0x4551d6((await _0x5923ac['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1dd068){const _0x302c93=_0x1dd068['split']('<')['length']!==_0x1dd068['split']('>')['length'],_0x300c3d=_0x1dd068['length']<0x1e;return _0x302c93&&_0x300c3d;}['_cleanUpData'](_0x5d0365){return _0x5d0365['split'](/\n(?![^{]*\})/g)['map'](_0x486ccc=>_0x486ccc['replace']('data:\x20',''))['filter'](_0x284138=>_0x284138&&_0x284138['length']>0x0&&'[DONE]'!==_0x284138)['map'](_0x5bd9b0=>{const {choices:_0x327ef6}=JSON['parse'](_0x5bd9b0);if(_0x327ef6[0x0]?.['delta']?.['content'])return _0x327ef6[0x0]['delta']['content'];})['filter'](_0x525611=>_0x525611)['join']('');}}class Xn extends Te{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3195da){super(_0x3195da),_0x3195da['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x3195da['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x3195da['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x3195da['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3195da['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x3195da['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x6a0f68,context:_0x4c258a,onData:_0xebe5fa,actionId:_0x29361c}){const {model:_0x366695,stream:_0x350cd3,..._0x17e76d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x29361c),_0x12eefe={'prompt':await this['preparePrompt'](_0x6a0f68,_0x4c258a,_0x366695,_0x29361c),..._0x17e76d};this['_apiUrl']?await this['_processProxyRequest'](_0x12eefe,_0x366695,_0x350cd3,_0xebe5fa,_0x29361c):await this['_processAWSRequest'](_0x12eefe,_0x366695,_0x350cd3,_0xebe5fa);}async['preparePrompt'](_0x48bb81,_0x6daeef,_0xf9c5fd,_0x226d24){let _0x236b67,_0x4511df;return _0x6daeef?(_0x236b67='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.',_0x4511df='Instruction:\x0a'+_0x48bb81+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x6daeef):(_0x236b67='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.',_0x4511df=_0x48bb81),'meta.llama'==this['getModelFamily'](_0xf9c5fd)?'<<SYS>>\x0a'+_0x236b67+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4511df+'\x0a[/INST]':'Human:\x0a'+_0x236b67+'\x0a'+_0x4511df+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5ee31b){if(/^anthropic\.claude/['test'](_0x5ee31b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5ee31b))return'ai21.j2';if(/^cohere\.command/['test'](_0x5ee31b))return'cohere.command';if(/^meta\.llama/['test'](_0x5ee31b))return'meta.llama';throw new tr(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5ee31b));}async['_processProxyRequest'](_0x261381,_0x390e16,_0x274bf3,_0x16c371,_0x40ff2c){const _0x197eda={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x40ff2c),'body':JSON['stringify']({..._0x261381,'model':_0x390e16,'stream':_0x274bf3}),'signal':this['abortController']['signal']},_0x410274=await fetch(this['_apiUrl'],_0x197eda);_0x274bf3?await this['_readStreamableResponse'](_0x410274,_0x390e16,_0x16c371):await this['_readStaticResponse'](_0x410274,_0x390e16,_0x16c371);}async['_processAWSRequest'](_0x3f20f0,_0x2e4447,_0x192fbd,_0x1a0360){const _0x32f10e=new _0x21bcef(this['_bedrockClientConfig']),_0x25bdfb={'body':JSON['stringify'](_0x3f20f0),'contentType':'application/json','accept':'application/json','modelId':_0x2e4447};let _0x39c681;if(_0x192fbd){const _0x4c5f92=new _0x35b305(_0x25bdfb);_0x39c681=await _0x32f10e['send'](_0x4c5f92,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x39c681,_0x2e4447,_0x1a0360);}else{const _0x310bdc=new _0x8386c5(_0x25bdfb);_0x39c681=await _0x32f10e['send'](_0x310bdc,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x39c681,_0x2e4447,_0x1a0360);}}async['_readAsyncIterableResponse'](_0x5aa526,_0x4d8339,_0x21b6cf){const _0x563636=_0x5aa526['body'],_0xf4095b=new TextDecoder('utf-8');let _0x4f8459='';for await(const _0x28cf37 of _0x563636)if(_0x28cf37['chunk']){const _0xf7ebf4=_0xf4095b['decode'](_0x28cf37['chunk']['bytes']),_0x54fe49=JSON['parse'](_0xf7ebf4);_0x4f8459+=this['_getGeneratedText'](_0x54fe49,_0x4d8339),_0x21b6cf(_0x4f8459);}return Promise['resolve']();}async['_readStreamableResponse'](_0x596aa5,_0x1790d4,_0x1e769b){const _0x4b053c=_0x596aa5['body'],_0x1031fd=new TextDecoder('utf-8'),_0x36b339=_0x4b053c['getReader']();let _0x5aa8bd='',_0x95c794='',_0xbd052=!0x1;for(;!_0xbd052;){const {done:_0x25edc8,value:_0x4c732f}=await _0x36b339['read']();if(_0xbd052=_0x25edc8,_0xbd052)break;const _0x57ef64=(_0x5aa8bd+_0x1031fd['decode'](_0x4c732f))['split']('\x0a')['map'](_0x4e50f3=>{try{return _0x5aa8bd='',JSON['parse'](_0x4e50f3);}catch{return _0x5aa8bd=_0x4e50f3,null;}})['filter'](_0x5b11cb=>null!==_0x5b11cb);_0x57ef64['length']&&(_0x95c794+=_0x57ef64['map'](_0x249c68=>this['_getGeneratedText'](_0x249c68,_0x1790d4))['join'](''),_0x1e769b(_0x95c794));}return Promise['resolve']();}async['_readStaticResponse'](_0x6625a0,_0x332580,_0x385cb8){let _0x5d8ee3;return _0x5d8ee3=_0x6625a0 instanceof Response?await _0x6625a0['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x6625a0['body'])),(_0x385cb8(this['_getGeneratedText'](_0x5d8ee3,_0x332580)),Promise['resolve']());}['_getGeneratedText'](_0x299e6b,_0x34033c){switch(this['getModelFamily'](_0x34033c)){case'anthropic.claude':return _0x299e6b['completion'];case'ai21.j2':return _0x299e6b['completions'][0x0]['data']['text'];case'cohere.command':return _0x299e6b['generations'][0x0]['text'];case'meta.llama':return _0x299e6b['generation'];}}}class ia extends _0x21bd9e{constructor(_0x2e0459,_0x2f71de={}){super(_0x2e0459),this['isToggleable']=!0x0,this['set']('side',_0x2f71de['side']||'top');const _0x523338=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x719a8(_0x2f71de['class']||[]),_0x523338['to']('side',_0x4af477=>'ck-tab-button_'+_0x4af477),_0x523338['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x492b6b{['children'];constructor(_0x477807,_0x30130b={}){super(_0x477807);const _0x185378=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x719a8(_0x30130b['class']||[]),_0x185378['to']('class'),_0x185378['if']('isVisible','ck-hidden',_0x5779b4=>!_0x5779b4)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x492b6b{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xf8dc24,_0x326888={}){super(_0xf8dc24),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x326888['side']||'top'),this['set']('isMaximized',!0x1);const _0x24b563=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x719a8(_0x326888['class']||[]),_0x24b563['to']('side',_0x1f1f4b=>'ck-tabs_'+_0x1f1f4b),_0x24b563['to']('class'),_0x24b563['to']('isMaximized',_0x3f77a7=>_0x3f77a7?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x24b563['to']('side',_0x137865=>'ck-tabs__buttons-container_'+_0x137865)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x24b563['to']('side',_0x946a5f=>'ck-tabs__panels-container_'+_0x946a5f)]},'children':this['panelViews']},..._0x719a8(_0x326888['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4969b0){const _0x33d43c=this['_tabs']['get'](_0x4969b0);return _0x33d43c||null;}['addTab'](_0x3059d8){const _0x77cf8=this['_setupButton']({'id':_0x3059d8['id'],'label':_0x3059d8['buttonLabel'],'icon':_0x3059d8['buttonIcon'],'order':_0x3059d8['order']}),_0x53ee18=new ea(this['locale']);return _0x53ee18['render'](),_0x3059d8['content']&&_0x53ee18['children']['add'](_0x3059d8['content']),this['panelViews']['add'](_0x53ee18),this['_tabs']['set'](_0x3059d8['id'],{'button':_0x77cf8,'panel':_0x53ee18,'order':void 0x0!==_0x3059d8['order']?_0x3059d8['order']:null}),this['fire']('addTab:'+_0x3059d8['id'],{'id':_0x3059d8['id'],'button':_0x77cf8,'panel':_0x53ee18}),null===this['activeTab']?this['activateTab'](_0x3059d8['id']):this['_hidePanel'](_0x3059d8['id']),{'button':_0x77cf8,'panel':_0x53ee18};}['activateTab'](_0xba05bb){if(null!==_0xba05bb&&!this['getTab'](_0xba05bb))throw new _0x19ee7d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xba05bb});this['activeTab']!==_0xba05bb&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0xba05bb,_0xba05bb&&this['_showPanel'](_0xba05bb),this['fire']('activateTab:'+_0xba05bb,_0xba05bb));}['showTab'](_0xd8ef0a){if(!this['getTab'](_0xd8ef0a))throw new _0x19ee7d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd8ef0a});this['_showPanel'](_0xd8ef0a),this['_showButton'](_0xd8ef0a),this['fire']('show:'+_0xd8ef0a,_0xd8ef0a);}['hideTab'](_0x1c3fc2){if(!this['getTab'](_0x1c3fc2))throw new _0x19ee7d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1c3fc2});const _0x4e6975=this['activeTab'];this['_hidePanel'](_0x1c3fc2),this['_hideButton'](_0x1c3fc2);const _0x207f07=this['getTabIds']();_0x4e6975===_0x1c3fc2&&_0x207f07['length']>0x1&&this['activateTab'](_0x207f07['find'](_0xccf9e0=>_0xccf9e0!==_0x1c3fc2)),this['fire']('hide:'+_0x1c3fc2,_0x1c3fc2);}['_getPanel'](_0x414c40){const _0xe2d3ce=this['_tabs']['get'](_0x414c40);return _0xe2d3ce?_0xe2d3ce['panel']:null;}['_showPanel'](_0x4e9508){null!==this['activeTab']&&this['activeTab']!==_0x4e9508||this['_getPanel'](_0x4e9508)['show']();}['_hidePanel'](_0x4e101b){const _0x20db32=this['_getPanel'](_0x4e101b);_0x20db32['isVisible']&&(this['activeTab']===_0x4e101b&&(this['activeTab']=null),_0x20db32['hide']());}['_getButton'](_0x262055){const _0x378796=this['_tabs']['get'](_0x262055);return _0x378796?_0x378796['button']:null;}['_showButton'](_0x2d3723){this['_getButton'](_0x2d3723)['show']();}['_hideButton'](_0x32b879){this['_getButton'](_0x32b879)['hide']();}['_setupButton'](_0x578598){const _0x167b31=new ia(this['locale'],{'side':this['side']}),_0x11cebf=this['buttonViews'];if(_0x167b31['set']({'label':_0x578598['label'],'icon':_0x578598['icon'],'tooltip':!0x0,'withText':!0x0}),_0x167b31['bind']('isOn')['to'](this,'activeTab',_0x415a06=>_0x415a06===_0x578598['id']),_0x167b31['bind']('side')['to'](this,'side'),_0x578598['order']){const _0x5a2efd=[...this['_tabs']]['reduce']((_0x34c012,_0x4c1a65)=>{const _0x4fb481=_0x4c1a65[0x0],{order:_0x122c58}=_0x4c1a65[0x1];return!_0x122c58||_0x122c58>_0x578598['order']?_0x34c012:_0x122c58>=_0x34c012['order']?{'id':_0x4fb481,'order':_0x122c58}:_0x34c012;},{'id':'','order':0x0}),_0x1f3676=_0x11cebf['getIndex'](this['_getButton'](_0x5a2efd['id']));_0x11cebf['add'](_0x167b31,_0x1f3676+0x1);}else _0x11cebf['add'](_0x167b31);return _0x167b31['on']('execute',()=>{this['activateTab'](_0x578598['id']);}),_0x167b31;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x13eb97,_0x4b18ca={}){super(_0x13eb97,_0x4b18ca),this['set']('type',_0x4b18ca['type']||'sidebar'),this['set']('side',_0x4b18ca['side']||'right'),this['set']('isVisible',_0x4b18ca['visibleByDefault']??!0x0);const _0xaca920=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xaca920['if']('type','ck-ai-tabs__overlay',_0x169e02=>'overlay'===_0x169e02),_0xaca920['if']('type','ck-ai-tabs__sidebar',_0x34cc22=>'sidebar'===_0x34cc22),_0xaca920['if']('isVisible','ck-hidden',_0x4da9f0=>!_0x4da9f0)]}}),this['buttonViews']['on']('add',(_0x5f245f,_0x12b7bf)=>{_0x12b7bf['set']('withText',!0x1);});}}class $ extends _0x4404b9{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b30fb){super(_0x1b30fb);const _0x2e6454=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x2e6454)throw new _0x19ee7d('ai-tabs-configuration-not-found');if(void 0x0!==_0x2e6454['showResizeButton']&&(this['showResizeButton']=_0x2e6454['showResizeButton']),'sidebar'!==_0x2e6454['type']&&'overlay'!==_0x2e6454['type']||_0x2e6454['side']&&(this['side']=_0x2e6454['side']),'sidebar'===_0x2e6454['type']){if(this['container']=_0x2e6454['element'],this['set']('type','sidebar'),!this['container'])throw new _0x19ee7d('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x2e6454['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x2e6454['visibleByDefault']||_0x2e6454['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 _0x1e9e1e&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x1db16e){if(_0x1db16e&&this['type']!==_0x1db16e){if(!Ti['includes'](_0x1db16e))throw new _0x19ee7d('ai-tabs-unsupported-ui-type');this['type']=_0x1db16e;}}['switchSide'](_0x37e246){if(_0x37e246&&this['side']!==_0x37e246){if(!yi['includes'](_0x37e246))throw new _0x19ee7d('ai-tabs-unsupported-ui-side');this['side']=_0x37e246;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x4404b9{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c6703){super(_0x3c6703),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 _0x427c56=this['context']['plugins']['get']('CloudServices');if(!_0x427c56['token'])throw new _0x19ee7d('ai-missing-token',this);this['_token']=_0x427c56['token'];}['startConversation'](_0x107725,_0x255ab4){const _0x4e495f=this['_sendApiRequest']('/conversations','POST',{'id':_0x107725,'group':_0x255ab4});return{'getConversation':async()=>(await _0x4e495f['request'])['json'](),'abortController':_0x4e495f['abortController']};}['queryAssistant']({message:_0x10aa9a,conversationId:_0x10785f,parts:_0x13bc12,capabilities:_0xc58df3,model:_0x548323,quickActionData:_0x5e450c}){const _0x1977f3={..._0x5e450c&&{'quickActionData':_0x5e450c}},_0x5643ed={'prompt':_0x10aa9a,'content':_0x13bc12,'model':_0x548323,..._0xc58df3&&{'capabilities':_0xc58df3},...Object['keys'](_0x1977f3)['length']>0x0&&{'attributes':_0x1977f3}},_0x1db9de=this['_sendApiRequest']('/conversations/'+_0x10785f+'/messages','POST',_0x5643ed);return{'getStream':async()=>{const _0x25155b=(await _0x1db9de['request'])['body'];return this['_getStreamReader'](_0x25155b);},'abortController':_0x1db9de['abortController']};}['executeCustomAction']({content:_0x53d284,message:_0x13ccc2,model:_0x932921,outputFormat:_0xae0db1}){const _0x3a6865={'content':[{'type':'text','content':_0x53d284}],'prompt':_0x13ccc2,'model':_0x932921,'outputFormat':_0xae0db1},_0x13873a=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3a6865);return{'getStream':async()=>{const _0x2f0b66=(await _0x13873a['request'])['body'];return this['_getStreamReader'](_0x2f0b66);},'abortController':_0x13873a['abortController']};}['executeAction']({actionName:_0x299e04,content:_0x56358b,args:_0x6a9342}){const _0x11227d={'content':[{'type':'text','content':_0x56358b}],'args':_0x6a9342},_0x5cb2c6=this['_sendApiRequest']('/actions/system/'+_0x299e04+'/calls','POST',_0x11227d);return{'getStream':async()=>{const _0x500b30=(await _0x5cb2c6['request'])['body'];return this['_getStreamReader'](_0x500b30);},'abortController':_0x5cb2c6['abortController']};}['uploadFile'](_0x350e87,_0x242324,_0x50742e){const _0x5681d3=new FormData();_0x5681d3['append']('file',_0x242324,_0x242324['name']),_0x50742e&&_0x5681d3['append']('attributes',JSON['stringify'](_0x50742e));const _0x4f9072=this['_sendApiRequest']('/conversations/'+_0x350e87+'/files','POST',_0x5681d3);return{'getId':async()=>(await _0x4f9072['request'])['json'](),'abortController':_0x4f9072['abortController']};}['fetchDocument'](_0x24083a,_0x28ac6c){const _0x115521=this['_sendApiRequest']('/conversations/'+_0x24083a+'/documents/'+_0x28ac6c,'GET');return{'getDocument':async()=>(await _0x115521['request'])['json'](),'abortController':_0x115521['abortController']};}['uploadDocument'](_0x219a40,_0x47f579,_0x22331d){const _0x44b1a3={'content':_0x47f579};_0x22331d&&(_0x44b1a3['attributes']=_0x22331d);const _0x1a970d=this['_sendApiRequest']('/conversations/'+_0x219a40+'/documents','POST',_0x44b1a3);return{'getId':async()=>(await _0x1a970d['request'])['json'](),'abortController':_0x1a970d['abortController']};}['fetchConversations'](_0x37b692,_0xcb6764){const _0x180d2d=new URLSearchParams();_0x180d2d['append']('excludeEmpty','true'),_0x180d2d['append']('limit','100'),_0x180d2d['append']('group',_0x37b692),_0xcb6764&&_0x180d2d['append']('search',_0xcb6764);const _0x2ceda2=this['_sendApiRequest']('/conversations?'+_0x180d2d['toString'](),'GET');return{'getConversations':async()=>{const _0x3b6f81=await _0x2ceda2['request'];return(await _0x3b6f81['json']())['items'];},'abortController':_0x2ceda2['abortController']};}['deleteConversation'](_0x2a34c5){const _0x7f7ebc=this['_sendApiRequest']('/conversations/'+_0x2a34c5,'DELETE');return{'execute':async()=>{await _0x7f7ebc['request'];},'abortController':_0x7f7ebc['abortController']};}['updateConversation'](_0x29f42c,_0x349e43){const _0x30de37=this['_sendApiRequest']('/conversations/'+_0x29f42c,'PATCH',_0x349e43);return{'getResult':async()=>(await _0x30de37['request'],_0x349e43),'abortController':_0x30de37['abortController']};}['fetchConversation'](_0x13ebfe){const _0x453a46=this['_sendApiRequest']('/conversations/'+_0x13ebfe,'GET');return{'getConversation':async()=>(await _0x453a46['request'])['json'](),'abortController':_0x453a46['abortController']};}['fetchConversationMessages'](_0x4add5b){const _0x56c76a=this['_sendApiRequest']('/conversations/'+_0x4add5b+'/messages','GET');return{'getMessages':async()=>{const _0x540e58=await _0x56c76a['request'];return(await _0x540e58['json']())['items'];},'abortController':_0x56c76a['abortController']};}['uploadUrl'](_0x4245a4,_0x5a5ba5,_0x2da7aa){const _0x432712=this['_sendApiRequest']('/conversations/'+_0x4245a4+'/web-resources','POST',{'url':_0x5a5ba5,'attributes':_0x2da7aa});return{'getId':async()=>(await _0x432712['request'])['json'](),'abortController':_0x432712['abortController']};}['getModels'](){const _0x210ee7=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x210ee7['request'])['json'](),'abortController':_0x210ee7['abortController']};}['deleteFile'](_0x2b560d,_0x1a17f3){const _0x54f2a9=this['_sendApiRequest']('/conversations/'+_0x2b560d+'/files/'+_0x1a17f3,'DELETE');return{'execute':async()=>{await _0x54f2a9['request'];},'abortController':_0x54f2a9['abortController']};}['deleteDocument'](_0x12f3fc,_0x5945aa){const _0x59709a=this['_sendApiRequest']('/conversations/'+_0x12f3fc+'/documents/'+_0x5945aa,'DELETE');return{'execute':async()=>{await _0x59709a['request'];},'abortController':_0x59709a['abortController']};}['deleteWebResource'](_0x6cf114,_0x1ec9cb){const _0x471948=this['_sendApiRequest']('/conversations/'+_0x6cf114+'/web-resources/'+_0x1ec9cb,'DELETE');return{'execute':async()=>{await _0x471948['request'];},'abortController':_0x471948['abortController']};}['callSystemReview']({reviewName:_0x181318,content:_0x236b68,args:_0x48ce73}){const _0x1dda25=this['_sendApiRequest']('/reviews/system/'+_0x181318+'/calls','POST',{'content':[{'type':'text','content':_0x236b68}],'args':_0x48ce73});return{'getStream':async()=>{const _0x2c193f=(await _0x1dda25['request'])['body'];return this['_getStreamReader'](_0x2c193f);},'abortController':_0x1dda25['abortController']};}['callCustomReview']({content:_0x457cd1,prompt:_0x53cdf1,model:_0x518c02}){const _0x1ee866=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x457cd1}],'prompt':_0x53cdf1,'model':_0x518c02});return{'getStream':async()=>{const _0x42dcd8=(await _0x1ee866['request'])['body'];return this['_getStreamReader'](_0x42dcd8);},'abortController':_0x1ee866['abortController']};}['upsertAIChatRating'](_0x17f68f,_0xf79386,_0x2d6ec1){const _0x52db5c=this['_sendApiRequest']('/conversations/'+_0x17f68f+'/messages/'+_0xf79386+'/ratings','PUT',{'positiveCount':_0x2d6ec1['positiveCount'],'totalCount':_0x2d6ec1['totalCount'],'modificationId':_0x2d6ec1['modificationId']});return{'execute':async()=>{await _0x52db5c['request'];},'abortController':_0x52db5c['abortController']};}['upsertAIActionRating'](_0x52fced,_0x263aaa,_0x5e5308){const _0x540d92=this['_sendApiRequest']('/actions/system/'+_0x52fced+'/calls/'+_0x263aaa+'/ratings','PUT',{'positiveCount':_0x5e5308['positiveCount'],'totalCount':_0x5e5308['totalCount']});return{'execute':async()=>{await _0x540d92['request'];},'abortController':_0x540d92['abortController']};}['upsertCustomAIActionRating'](_0x4d99d2,_0x3ab2a2){const _0x53145e=this['_sendApiRequest']('/actions/custom/calls/'+_0x4d99d2+'/ratings','PUT',{'positiveCount':_0x3ab2a2['positiveCount'],'totalCount':_0x3ab2a2['totalCount']});return{'execute':async()=>{await _0x53145e['request'];},'abortController':_0x53145e['abortController']};}['upsertAIReviewRating'](_0x305e37,_0xeca5ef,_0x48c4b4,_0x2b795a){const _0x4b3534=this['_sendApiRequest']('/reviews/system/'+_0x305e37+'/calls/'+_0xeca5ef+'/ratings','PUT',{'positiveCount':_0x48c4b4['positiveCount'],'totalCount':_0x48c4b4['totalCount'],'dataId':_0x2b795a});return{'execute':async()=>{await _0x4b3534['request'];},'abortController':_0x4b3534['abortController']};}['upsertCustomAIReviewRating'](_0x39f944,_0x591380,_0x1eb465){const _0x2cff85=this['_sendApiRequest']('/reviews/custom/calls/'+_0x39f944+'/ratings','PUT',{'positiveCount':_0x591380['positiveCount'],'totalCount':_0x591380['totalCount'],'dataId':_0x1eb465});return{'execute':async()=>{await _0x2cff85['request'];},'abortController':_0x2cff85['abortController']};}['_sendApiRequest'](_0x1bb5bb,_0x39cdbd,_0x21390a){const _0x105234=new AbortController(),_0x2960a8=_0x21390a instanceof FormData,_0x473ccb={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x21390a&&!_0x2960a8&&(_0x473ccb['Content-Type']='application/json');const _0x5c15f0={'method':_0x39cdbd,'headers':_0x473ccb,'signal':_0x105234['signal']};return _0x21390a&&(_0x5c15f0['body']=_0x2960a8?_0x21390a:JSON['stringify'](_0x21390a)),{'request':fetch(''+this['_apiUrl']+_0x1bb5bb,_0x5c15f0)['catch'](_0x4b9235=>{this['_handleError'](_0x4b9235);})['then'](_0x1e49d3=>_0x1e49d3['ok']?_0x1e49d3:_0x1e49d3['json']()['then'](_0x3e59e3=>{throw{'url':this['_apiUrl'],'path':_0x1bb5bb,'method':_0x39cdbd,'body':_0x21390a,'status':(_0x1e49d3||{})['status'],'statusText':(_0x1e49d3||{})['statusText'],'code':_0x3e59e3['code'],'message':_0x3e59e3['message'],'traceId':_0x3e59e3['traceId']};})),'abortController':_0x105234};}async*['_getStreamReader'](_0x2fc916){const _0x2657a8=[],_0x24cf8e=_0x2fc916['getReader'](),_0x63ee4e=Ct({'onError':_0x40273a=>{this['_handleError'](_0x40273a);},'onEvent':_0x5adef6=>{_0x5adef6['data']=JSON['parse'](_0x5adef6['data']),_0x2657a8['push'](_0x5adef6);}});try{let _0x2f00a3=!0x1;for(;!_0x2f00a3;){const {done:_0xfebdbd,value:_0x419ae9}=await _0x24cf8e['read']();_0xfebdbd&&(_0x2f00a3=!0x0),_0x63ee4e['feed'](this['_decoder']['decode'](_0x419ae9,{'stream':!0x0})),yield*_0x2657a8,_0x2657a8['length']=0x0;}}catch(_0x4028ba){this['_handleError'](_0x4028ba);}finally{_0x24cf8e['releaseLock'](),_0x63ee4e['reset']();}}['_handleError'](_0xac009){if(_0xac009 instanceof _0x19ee7d)throw _0xac009;if(_0xac009 instanceof Error&&'AbortError'===_0xac009['name'])throw new _0x19ee7d('ai-request-aborted',this,{'originalError':_0xac009});throw new _0x19ee7d('ai-request-failed',this,{'originalError':_0xac009});}}function y(_0x43c77e,_0x513353,_0x34fff6){const t=_0x43c77e['t'];switch(_0x513353){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'},_0x34fff6);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x34fff6);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.'},_0x34fff6);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x34fff6);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x34fff6);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x34fff6);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.'},_0x34fff6);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.'},_0x34fff6);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.'},_0x34fff6);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.'},_0x34fff6);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'},_0x34fff6);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_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.'},_0x34fff6);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x513353;}}function ms(_0x5b5298,_0x2c2298){const _0x51e5c8=new _0x21bd9e(_0x5b5298),_0x34d8bd=y(_0x5b5298,'AI_TABS_LABEL_MINIMIZE'),_0x313a9e=y(_0x5b5298,'AI_TABS_LABEL_MAXIMIZE');return _0x51e5c8['set']({'withText':!0x1,'icon':_0x1d3e4d,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x51e5c8['bind']('label')['to'](_0x2c2298,'isMaximized',_0x31064b=>_0x31064b?_0x34d8bd:_0x313a9e),_0x51e5c8['bind']('icon')['to'](_0x2c2298,'isMaximized',_0x57843f=>_0x57843f?to:_0x1d3e4d),_0x51e5c8['bind']('isOn')['to'](_0x2c2298,'isMaximized'),_0x51e5c8['on']('execute',()=>{_0x2c2298['fire']('resizeTabs');}),_0x51e5c8;}function Ne(_0x2a7db7){return _0x8953d3(_0x2a7db7);}function tt(_0x5886f1){return _0x20dcd7(_0x5886f1);}function st(_0xc99426,_0x4ef6bc,_0x290e28){const _0x5c58be=null!==_0x4ef6bc?_0x2cf9fe=>_0x2cf9fe['attribs'][_0xc99426]===_0x4ef6bc:_0x2118d2=>Boolean(_0x2118d2['attribs'][_0xc99426]);return _0x3019e1(_0x59a0c6=>_0x1a9650(_0x59a0c6)&&_0x5c58be(_0x59a0c6),_0x290e28);}function Be(_0x3e3816,_0x3fa466,_0x4d865f){const _0x1c9a30=null!==_0x3fa466?_0x52eeda=>_0x52eeda['attribs'][_0x3e3816]===_0x3fa466:_0x4b4729=>Boolean(_0x4b4729['attribs'][_0x3e3816]);return _0x37808d(_0x27262f=>_0x1a9650(_0x27262f)&&_0x1c9a30(_0x27262f),_0x4d865f);}function K(_0x1cb727,_0x4c23d0){return _0x1cb727&&_0x1a9650(_0x1cb727)?_0x1cb727['attribs'][_0x4c23d0]:null;}function $e(_0x36e587,_0x480b5a,_0x1121d9){_0x1a9650(_0x36e587)&&(null===_0x1121d9?delete _0x36e587['attribs'][_0x480b5a]:_0x36e587['attribs'][_0x480b5a]=_0x1121d9);}function Ke(_0x470698,_0x17c2f9,_0x3da8fd){const _0x48356c=_0x17c2f9['cloneNode'](!0x0);'beforebegin'===_0x3da8fd?_0x4e9405(_0x470698,_0x48356c):'afterbegin'===_0x3da8fd?_0x5578be(_0x470698,_0x48356c):'beforeend'===_0x3da8fd?_0x4fe58e(_0x470698,_0x48356c):'afterend'===_0x3da8fd&&_0x41021b(_0x470698,_0x48356c);}function Le(_0x7e3cf1){const _0x297934=[];let _0x205500=_0x7e3cf1;for(;_0x205500;)_0x205500=_0x2ea8c9(_0x205500),_0x205500&&_0x297934['push'](_0x205500);return _0x297934;}function zn(_0x35db67){return _0x35db67['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ns(_0x2381ed){let _0xb3d965=0x0;for(;_0x2381ed['parentNode'];)_0x2381ed=_0x2381ed['parentNode'],_0xb3d965++;return _0xb3d965;}function gs(_0x238c5a){const _0x163ab8=[];let _0x3205f3=_0x238c5a['nextSibling'];for(;_0x3205f3;)_0x163ab8['push'](_0x3205f3),_0x3205f3=_0x3205f3['nextSibling'];_0x163ab8['forEach'](_0xfd4b39=>{_0x19c981(_0xfd4b39);});}class Ve extends/* #__PURE__ -- @preserve */
25
- $t(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5a2309();}['convertMarkdownToHTML'](_0x5b9d00){const _0x1491a1=this['_m2html']['parse'](_0x5b9d00);return this['parseAndNormalizeHTML'](_0x1491a1);}['parseAndNormalizeHTML'](_0x1dfa6a){return this['_parseHTML'](_0x1dfa6a);}['_parseHTML'](_0x57d000){const _0x4d6ea5=Ne('<dummy>'+_0x57d000['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4d6ea5['children']=_0x4d6ea5['children'][0x0]['children'],_0x4d6ea5;}}class We extends/* #__PURE__ -- @preserve */
26
- $t(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3f4daa){super(),this['_generateUid']=_0x3f4daa||_0x3bb1ce;}['merge'](_0x9c5b09,_0x368ddc,_0x141b7f){const _0x463c57=_0x9c5b09['cloneNode'](!0x0);if(0x0===_0x368ddc['childNodes']['length']){const _0x7a9aeb=[];return Be('data-id','new-element',_0x463c57)['forEach'](_0x575a16=>{const _0x4a8be3=this['_generateUid']();$e(_0x575a16,'data-id',_0x4a8be3),_0x7a9aeb['push'](_0x4a8be3);}),this['_removeSpecialComments'](_0x463c57),{'parsedContent':_0x463c57,'newNodeIds':_0x7a9aeb,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x141b7f&&_0x141b7f['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x463c57),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x368ddc)['map'](_0x16c0d7=>K(_0x16c0d7,'data-id'))['filter'](_0x35d764=>!!_0x35d764));let _0x1fcc64=-0x1,_0x4ec8fb=!0x1;const _0x1d6b05=_0x463c57['childNodes'],_0x225c1e=Array['from'](_0x1d6b05)['filter'](_0x1b890e=>!(0x3===_0x1b890e['nodeType']&&''===tt(_0x1b890e)['trim']())),_0x5570b1=_0x225c1e['length'];for(let _0x5b2a65=0x0;_0x5b2a65<_0x5570b1;_0x5b2a65++){const _0x282979=_0x225c1e[_0x5b2a65],_0x3c73fb=_0x225c1e[_0x5b2a65+0x1];if(this['_isNewNode'](_0x282979)){if(-0x1===_0x1fcc64&&(_0x1fcc64=_0x5b2a65),this['_markWrappedElements'](_0x282979),!this['_isNewNode'](_0x3c73fb)){const [_0x3e787e,_0x2fe96c]=this['_findReferenceNode'](_0x282979,_0x4ec8fb,_0x368ddc);if(_0x3e787e){const _0xce4c8a=Array['from'](_0x225c1e)['slice'](_0x1fcc64,_0x5b2a65+0x1);this['_insertNodes'](_0x3e787e,_0xce4c8a,_0x2fe96c),_0x1fcc64=-0x1;}}}else{if(this['_isExistingContentComment'](_0x282979))_0x4ec8fb=!0x0;else{if(this['_isExistingNode'](_0x282979)){const _0x1ebfb0=K(_0x282979,'data-id');if(_0x1ebfb0&&this['_existingDataIds']['has'](_0x1ebfb0)){const _0x3540ec=st('data-id',_0x1ebfb0,_0x368ddc);this['_replaceNode'](_0x3540ec,_0x282979);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1ebfb0)){const _0x13f12e=this['_touchedNodesState']['removedIds']['indexOf'](_0x1ebfb0);this['_touchedNodesState']['removedIds']['splice'](_0x13f12e,0x1);}}else{if(this['_isDelNode'](_0x282979)){const _0x1ec5ff=K(_0x282979,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1ec5ff)||this['_storeDeletedElementIds'](_0x282979);}}}}}for(const _0x4c5ca4 of this['_touchedNodesState']['removedIds']){const _0x33d505=st('data-id',_0x4c5ca4,_0x368ddc);if(_0x33d505){if(_0x141b7f&&_0x141b7f['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4c5ca4;const _0x3bf1f9=_0x141b7f['replaceRemovedWith']['cloneNode'](!0x0);$e(_0x3bf1f9,'data-id',_0x4c5ca4),$e(_0x3bf1f9,'data-removed','true'),_0x20fcd7(_0x33d505,_0x3bf1f9);}else _0x19c981(_0x33d505);}}if(Be('data-wrapped-id',null,_0x368ddc)['forEach'](_0x322bf3=>{const _0x22af74=st('data-id',K(_0x322bf3,'data-wrapped-id'),_0x368ddc);var _0x5021b2,_0x1a7ec2;_0x22af74&&(_0x1a7ec2=_0x322bf3,_0x19c981(_0x5021b2=_0x22af74),_0x20fcd7(_0x1a7ec2,_0x5021b2));}),Be('data-id','new-element',_0x368ddc)['forEach'](_0xb7ebd2=>{const _0x27a5e6=this['_getUid'](_0xb7ebd2);$e(_0xb7ebd2,'data-id',_0x27a5e6),this['_touchedNodesState']['newIds']['push'](_0x27a5e6);}),this['_removeSpecialComments'](_0x368ddc),_0x141b7f&&_0x141b7f['markUnstableElements']&&this['_markUnstableElements'](_0x368ddc,_0x141b7f['markUnstableElementsDepth']||0x0),_0x141b7f&&_0x141b7f['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x5ba567=st('data-id',this['_touchedNodesState']['lastTouchedId'],_0x368ddc);for(;_0x5ba567;)gs(_0x5ba567),_0x5ba567=_0x5ba567['parentNode'];}return{'parsedContent':_0x368ddc,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x51ca34,_0x5c8091,_0x364244){for(const _0x23f4cf of _0x5c8091){const _0x54b29e=this['_getUid'](_0x23f4cf);$e(_0x23f4cf,'data-id',_0x54b29e),this['_touchedNodesState']['newIds']['push'](_0x54b29e),this['_touchedNodesState']['lastTouchedId']=_0x54b29e;}const _0x1b542d='afterbegin'===_0x364244||'afterend'===_0x364244?_0x5c8091['reverse']():_0x5c8091;for(const _0x4a1f95 of _0x1b542d)Ke(_0x51ca34,_0x4a1f95,_0x364244);}['_replaceNode'](_0x1caa39,_0x41b919){if(!_0x1caa39)return;if(_0x4f9fb0=_0x41b919,zn(tt(_0x1caa39))===zn(tt(_0x4f9fb0)))return;var _0x4f9fb0;const _0x58c00c=this['_getUid'](_0x1caa39);$e(_0x41b919,'data-id',_0x58c00c),this['_touchedNodesState']['modifiedIds']['push'](_0x58c00c),this['_touchedNodesState']['lastTouchedId']=_0x58c00c,_0x20fcd7(_0x1caa39,_0x41b919['cloneNode'](!0x0));}['_findReferenceNode'](_0x41e5cc,_0x337744,_0x2542b3){const _0x77f97c=this['_findPrevElementWithDataId'](_0x41e5cc,!0x1);if(_0x77f97c){const _0x1c4e9c=this['_getNodeDataId'](_0x77f97c),_0x2c53c5=st('data-id',_0x1c4e9c,_0x2542b3);if(_0x2c53c5)return[_0x2c53c5,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1c4e9c);}const _0x7c582b=this['_findNextElementWithDataId'](_0x41e5cc,!0x1);if(_0x7c582b){const _0x38f6ab=this['_getNodeDataId'](_0x7c582b),_0x387856=st('data-id',_0x38f6ab,_0x2542b3);if(_0x387856)return[_0x387856,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x38f6ab);}return _0x337744?_0x41e5cc['nextSibling']?this['_findFallbackReferenceNode'](_0x41e5cc,_0x2542b3):[_0x2542b3['childNodes'][_0x2542b3['childNodes']['length']-0x1],'afterend']:[_0x2542b3['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x344354,_0x571f85){const _0x499d63=[],_0x4ff314=this['_findPrevElementWithDataId'](_0x344354,!0x0);if(_0x4ff314){const _0x15d2b4=st('data-id',this['_getNodeDataId'](_0x4ff314),_0x571f85);_0x15d2b4&&_0x499d63['push']([_0x15d2b4,'afterend']);}const _0x461d9c=this['_findNextElementWithDataId'](_0x344354,!0x0);if(_0x461d9c){const _0x399b80=st('data-id',this['_getNodeDataId'](_0x461d9c),_0x571f85);_0x399b80&&_0x499d63['push']([_0x399b80,'beforebegin']);}if(_0x499d63['length']>0x1)return Ns(_0x499d63[0x0][0x0])<=Ns(_0x499d63[0x1][0x0])?_0x499d63[0x0]:_0x499d63[0x1];return 0x1===_0x499d63['length']?_0x499d63[0x0]:[_0x571f85['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x2b3733,_0x582983){let _0x4bf80a=_0x2b3733['nextSibling'],_0x550f7a=null,_0xac637=!0x1;for(;_0x4bf80a;){if(_0x336631(_0x4bf80a)){if(this['_isDelNode'](_0x4bf80a)&&(_0x550f7a=_0x4bf80a),this['_isExistingContentComment'](_0x4bf80a)&&_0x582983&&!_0xac637){_0xac637=!0x0,_0x4bf80a=_0x4bf80a['nextSibling'];continue;}break;}const _0x56a56f=K(_0x4bf80a,'data-id');if(_0x56a56f&&'new-element'!==_0x56a56f&&this['_existingDataIds']['has'](_0x56a56f)){_0x550f7a=_0x4bf80a;break;}_0x4bf80a=_0x4bf80a['nextSibling'];}return _0x550f7a;}['_findPrevElementWithDataId'](_0x41b0f2,_0x2647c7){let _0x1a81f0=_0x41b0f2['previousSibling'],_0x5c3ed1=null,_0x306abb=!0x1;for(;_0x1a81f0;){if(_0x336631(_0x1a81f0)){if(this['_isDelNode'](_0x1a81f0)&&(_0x5c3ed1=_0x1a81f0),this['_isExistingContentComment'](_0x1a81f0)&&_0x2647c7&&!_0x306abb){_0x306abb=!0x0,_0x1a81f0=_0x1a81f0['previousSibling'];continue;}break;}const _0x1250cc=K(_0x1a81f0,'data-id');if(_0x1250cc&&'new-element'!==_0x1250cc&&this['_existingDataIds']['has'](_0x1250cc)){_0x5c3ed1=_0x1a81f0;break;}_0x1a81f0=_0x1a81f0['previousSibling'];}return _0x5c3ed1;}['_markWrappedElements'](_0xc1cacf){_0x1a9650(_0xc1cacf)&&Be('data-id',null,_0xc1cacf)['forEach'](_0x2df70e=>{this['_isExistingNode'](_0x2df70e)&&!this['_hasWrappedParent'](_0x2df70e)&&($e(_0x2df70e,'data-wrapped-id',K(_0x2df70e,'data-id')),$e(_0x2df70e,'data-id',null));});}['_getNodeDataId'](_0x119b70){if(!_0x119b70)return null;if(_0x1a9650(_0x119b70))return K(_0x119b70,'data-id');if(_0x336631(_0x119b70)){const _0x517fdb=tt(_0x119b70)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x517fdb&&_0x517fdb[0x1])return _0x517fdb[0x1];}return null;}['_storeDeletedElementIds'](_0x2488bd){if(_0x336631(_0x2488bd)){const _0x15f07e=tt(_0x2488bd)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x15f07e&&_0x15f07e[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x15f07e[0x1]);}}['_getUid'](_0x48a21a){return this['_isExistingNode'](_0x48a21a)?K(_0x48a21a,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x39ffeb){(function(_0x2125c2){return _0x4b09e5(_0x49f66e=>_0x336631(_0x49f66e),_0x2125c2,!0x0,0x1/0x0);}(_0x39ffeb)['filter'](_0x2b44e7=>this['_isDelNode'](_0x2b44e7)||this['_isExistingContentComment'](_0x2b44e7))['forEach'](_0x584c16=>{_0x19c981(_0x584c16);}));}['_markLastTagElementUnstable'](_0x538661){const _0x407a96=_0x538661['childNodes'],_0x1a7aaf=_0x407a96[_0x407a96['length']-0x1];_0x1a7aaf&&_0x1a9650(_0x1a7aaf)&&$e(_0x1a7aaf,'data-unstable','true');}['_markUnstableElements'](_0x2a4574,_0x5496bf){const _0x474646=st('data-unstable','true',_0x2a4574);if(!_0x474646)return;const _0x219fcf=Le(_0x474646)['slice'](0x0,-0x1),_0x208662=_0x219fcf['length'];let _0x5f2a8a=_0x474646;if(_0x208662>_0x5496bf){let _0x4efd56=_0x208662,_0x28956d=null;for(;_0x4efd56>_0x5496bf&&_0x4efd56>=0x0;)_0x4efd56--,_0x28956d=_0x219fcf[_0x4efd56];_0x28956d&&(_0x5f2a8a=_0x28956d,$e(_0x474646,'data-unstable',null),$e(_0x28956d,'data-unstable','true'));}else{if(_0x208662<_0x5496bf){let _0x32c10b=_0x208662,_0x1e3bf0=_0x474646;for(;_0x32c10b<_0x5496bf;){const _0x57cee2=_0x1e3bf0['childNodes']['filter'](_0x1e97a9=>_0x1a9650(_0x1e97a9));if(0x0===_0x57cee2['length'])break;_0x32c10b++,_0x1e3bf0=_0x57cee2[_0x57cee2['length']-0x1];}_0x1e3bf0&&(_0x5f2a8a=_0x1e3bf0,$e(_0x474646,'data-unstable',null),$e(_0x1e3bf0,'data-unstable','true'));}}let _0x31b50a=_0x5f2a8a;for(;_0x31b50a;){for(;_0x31b50a['nextSibling'];)_0x31b50a=_0x31b50a['nextSibling'],_0x1a9650(_0x31b50a)&&$e(_0x31b50a,'data-unstable','true');_0x31b50a=_0x31b50a['parentNode'];}}['_isNewNode'](_0x11d43e){return Boolean('new-element'===K(_0x11d43e,'data-id'));}['_isExistingNode'](_0x2aa334){return Boolean((K(_0x2aa334,'data-id')||'')['length']>0x0&&'new-element'!==K(_0x2aa334,'data-id'));}['_isDelNode'](_0x236a70){return!!_0x236a70&&Boolean(_0x336631(_0x236a70)&&tt(_0x236a70)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x15874f){let _0x3cf1cb=_0x15874f['parentNode'];for(;_0x3cf1cb;){if(K(_0x3cf1cb,'data-wrapped-id'))return!0x0;_0x3cf1cb=_0x3cf1cb['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x42fa01){return Boolean(_0x336631(_0x42fa01)&&tt(_0x42fa01)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function C({editor:_0x5b41cc,changeGroups:_0x3d492f,documentContextContent:_0x57184a,showDiff:_0x41dbff,trimUnchanged:_0x1c588b=!0x0}){return _0x3d492f['map'](_0x5f571f=>{const _0x31ef39=new it([]),_0x26c19d=new it([]);for(const _0x22ec07 of _0x5f571f['changes'])if(_0x41dbff&&'removed'==_0x22ec07['type']||_0x26c19d['children']['push'](_0x22ec07['node']['cloneNode'](!0x0)),'new'!=_0x22ec07['type']&&(_0x41dbff||'removed'!=_0x22ec07['type'])){const _0x370cdf=_0x3019e1(_0x4f2aed=>K(_0x4f2aed,'data-id')==_0x22ec07['id'],_0x57184a,!0x0);_0x370cdf&&_0x31ef39['children']['push'](_0x370cdf['cloneNode'](!0x0));}const {content:_0x544ac0,hasChanges:_0x14c871}=function(_0x2dacc1,_0x12e1b5,_0x3e0644,_0x3196bf,_0x3900e1=!0x0){const _0x129183=_0x2dacc1['plugins']['get']('DocumentCompare'),_0x214a54=tt(_0x12e1b5),_0x2dbdd9=tt(_0x3e0644),_0x2f5aa7=_0x2dacc1['data']['parse'](_0x214a54,'$root'),_0x2fbb49=_0x2dacc1['model']['createPositionAt'](_0x2f5aa7,0x0),_0x360633=_0x129183['getDiff'](_0x214a54,_0x2dbdd9,{'anchor':_0x2fbb49,'markDeletions':_0x3196bf}),_0x176928=_0x360633['getOperations']();if(0x0==_0x176928['length'])return{'content':_0x12e1b5['cloneNode'](!0x0),'hasChanges':!0x1};_0x3196bf?function(_0x3c3431,_0x4eb388,_0x3c02ef){if(0x0==_0x3c3431['length'])return;const _0x50e9f2=_0x3c02ef['plugins']['get']('DocumentCompare'),_0x18b06a=_0x3c02ef['plugins']['get']('SuggestionsConversion');_0x3c02ef['model']['change'](_0x12b6d3=>{const _0x3f9cdf=new Set();for(let _0x346479=0x0;_0x346479<_0x3c3431['length'];_0x346479++){const _0x293670=_0x3c3431[_0x346479];if(_0x293670['baseVersion']=null,_0x293670['isDocumentOperation']=!0x1,_0x50e9f2['isMarkedRemoveOperation'](_0x293670)){const _0x5ab318=_0x2fc611(_0x293670['newRange'],_0x3c02ef['model']),_0x384762='suggestion:deletion:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x384762,_0x5ab318);}else switch(_0x293670['type']){case'rename':{if(_0x293670['oldName']==_0x293670['newName'])break;_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);const _0x2089f4='$elementName',_0x60f876=_0x293670['position'],_0x46db28=_0x3c02ef['model']['createRange'](_0x60f876,_0x3c02ef['model']['createPositionAt'](_0x60f876['nodeAfter'],'end')),_0x1f0a82='suggestion:attribute:'+_0x2089f4+':'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x1f0a82,_0x46db28);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x293670['oldValue']==_0x293670['newValue'])break;_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);const _0x5a15f0=_0x293670['key'];if(!_0x18b06a['isRegisteredAttribute'](_0x5a15f0))break;const _0x1f036b=_0x2fc611(_0x293670['range'],_0x3c02ef['model']),_0x55a57b='suggestion:attribute:'+_0x5a15f0+':'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x55a57b,_0x1f036b);break;}case'insert':{_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);if(_0x3c3431[_0x346479+0x1]&&'move'==_0x3c3431[_0x346479+0x1]['type']){ro(_0x4eb388,_0x293670);break;}const _0x905ec=_0x293670['position'],_0x316b89=_0x293670['howMany'],_0x19d532=_0x2fc611(_0x3c02ef['model']['createRange'](_0x905ec,_0x905ec['getShiftedBy'](_0x316b89)),_0x3c02ef['model']),_0x229ab4='suggestion:insertion:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x229ab4,_0x19d532);break;}case'split':{_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);const _0x47da9f=_0x293670['splitPosition'],_0x519927=_0x293670['moveTargetPosition'],_0x48fa20=_0x3c02ef['model']['createRange'](_0x47da9f,_0x519927),_0x517a7c='suggestion:insertion:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x517a7c,_0x48fa20);break;}case'move':{_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670),_0x3c3431[_0x346479-0x1]&&'insert'==_0x3c3431[_0x346479-0x1]['type']&&ro(_0x4eb388,_0x293670);const _0x1a38e7=_0x293670['getMovedRangeStart'](),_0x58033d=_0x293670['howMany'];for(let _0x283e33=0x0;_0x283e33<_0x58033d;_0x283e33++){const _0x5f2a29=_0x1a38e7['getShiftedBy'](_0x283e33)['nodeAfter'];_0x3f9cdf['add'](_0x5f2a29);}break;}case'remove':{const _0x3470b6=_0x293670['sourcePosition'],_0x84a809=_0x293670['howMany'],_0xc12670=new _0x253f92(_0x3470b6,_0x84a809);_0x12b6d3['batch']['addOperation'](_0xc12670),_0x3c02ef['model']['applyOperation'](_0xc12670);break;}}}for(const _0x1817d2 of _0x3f9cdf){const _0x27c395=_0x3c02ef['model']['createRangeOn'](_0x1817d2),_0x1f711b='suggestion:formatBlock:$fakeWrap:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x1f711b,_0x2fc611(_0x27c395,_0x3c02ef['model']));}});}(_0x176928,_0x2f5aa7,_0x2dacc1):_0x2dacc1['model']['change'](_0x5e722a=>{for(const _0x32f942 of _0x176928)if('remove'==_0x32f942['type']){const _0x143262=_0x32f942['sourcePosition'],_0x4ec6b0=_0x32f942['howMany'],_0x7eb487=new _0x253f92(_0x143262,_0x4ec6b0);_0x5e722a['batch']['addOperation'](_0x7eb487),_0x2dacc1['model']['applyOperation'](_0x7eb487);}else{if('marker'==_0x32f942['type']){const _0x310ba2=_0x32f942['name'],_0x4392d7=_0x32f942['newRange'];_0x2f5aa7['markers']['set'](_0x310ba2,_0x4392d7);}else _0x32f942['baseVersion']=null,_0x32f942['isDocumentOperation']=!0x1,_0x5e722a['batch']['addOperation'](_0x32f942),_0x2dacc1['model']['applyOperation'](_0x32f942);}});if(_0x3900e1){const _0x4814d0=Z(_0x2dacc1,_0x176928,_0x2f5aa7);Q(_0x2dacc1['model'],_0x4814d0),function(_0x9b31fd,_0xc236c1){const _0x23926e=_0xc236c1['getFirstRange']()['start'];let _0x3dabd3=_0xc236c1['getFirstRange']()['end'];const _0x3ec9f0=_0x23926e['root'];(_0x3dabd3['textNode']||_0x3dabd3['nodeAfter']&&_0x3dabd3['nodeAfter']['is']('$text'))&&(_0xbc492c(_0x3dabd3,'...'),_0x3dabd3=_0x3dabd3['getShiftedBy'](0x3)),(_0x23926e['textNode']||_0x23926e['nodeBefore']&&_0x23926e['nodeBefore']['is']('$text'))&&(_0xbc492c(_0x23926e,'...'),function(_0x7084d2,_0x4ee732,_0x50f1c7){for(let [_0x51d8ea,_0x151e1a]of _0x7084d2['markers']){const _0x23ae0d=_0x151e1a['_getTransformedByInsertion'](_0x4ee732,_0x50f1c7,!0x1);_0x151e1a=_0x23ae0d[0x0],_0x7084d2['markers']['set'](_0x51d8ea,_0x151e1a);}}(_0x3ec9f0,_0x23926e,0x3),_0x23926e['parent']==_0x3dabd3['parent']&&(_0x3dabd3=_0x3dabd3['getShiftedBy'](0x3)));const _0x32cb24=_0x9b31fd['createRange'](_0x9b31fd['createPositionAt'](_0x3ec9f0,0x0),_0x23926e),_0x3a7f65=_0x9b31fd['createRange'](_0x3dabd3,_0x9b31fd['createPositionAt'](_0x3ec9f0,'end')),_0x43eb37=[..._0x32cb24['getMinimalFlatRanges'](),..._0x3a7f65['getMinimalFlatRanges']()];_0x43eb37['reverse']();for(const _0x46ecb7 of _0x43eb37)_0x5f0c2d(_0x46ecb7),Jn(_0x3ec9f0,_0x46ecb7);}(_0x2dacc1['model'],_0x4814d0);}const _0x373b6d=_0x2dacc1['data']['stringify'](_0x2f5aa7,{'showSuggestionHighlights':!0x0});return{'content':Ne(_0x373b6d),'hasChanges':!0x0};}(_0x5b41cc,_0x31ef39,_0x26c19d,_0x41dbff,_0x1c588b);return{'type':_0x5f571f['changes'][0x0]['type'],'index':_0x5f571f['index'],'content':_0x544ac0,'hasChanges':_0x14c871};});}function ro(_0x23dbda,_0x19d151){for(const [_0x57040c,_0x2e7a47]of _0x23dbda['markers']){const _0x3cb2ea=_0x184fda['_createFromRanges'](_0x2e7a47['getTransformedByOperation'](_0x19d151));_0x23dbda['markers']['set'](_0x57040c,_0x3cb2ea);}}function Z(_0x54cec3,_0x30b9c7,_0x45f403){const _0x1f4de7=_0x54cec3['plugins']['get']('DocumentCompare');let _0x318c2d=_0x54cec3['model']['createPositionAt'](_0x45f403,Number['POSITIVE_INFINITY']),_0x36ad31=_0x54cec3['model']['createPositionAt'](_0x45f403,0x0);for(const _0x139b16 of _0x30b9c7){let _0x508751,_0x390157;if(_0x1f4de7['isMarkedRemoveOperation'](_0x139b16))_0x508751=_0x139b16['newRange']['start'],_0x390157=_0x139b16['newRange']['end'];else switch(_0x318c2d=_0x318c2d['getTransformedByOperation'](_0x139b16),_0x36ad31=_0x36ad31['getTransformedByOperation'](_0x139b16),_0x139b16['type']){case'rename':_0x508751=_0x139b16['position'],_0x390157=_0x508751['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x508751=_0x139b16['range']['start'],_0x390157=_0x139b16['range']['end'];break;case'insert':_0x508751=_0x139b16['position'],_0x390157=_0x508751['getShiftedBy'](_0x139b16['howMany']);break;case'split':_0x508751=_0x139b16['splitPosition'],_0x390157=_0x139b16['moveTargetPosition'];break;case'merge':{const _0x2cbf39=_0x139b16['targetPosition']['path']['slice'](0x0,-0x1);_0x508751=_0x54cec3['model']['createPositionFromPath'](_0x45f403,_0x2cbf39),_0x390157=_0x508751['getShiftedBy'](0x1);break;}case'remove':{const _0x4b3187=_0x139b16['howMany'],_0x5acfa7=_0x139b16['sourcePosition']['_getTransformedByInsertion'](_0x139b16['targetPosition'],_0x4b3187),_0x16ebd8=_0x139b16['getMovedRangeStart']();'remove'==_0x139b16['type']?(_0x508751=_0x5acfa7,_0x390157=_0x5acfa7):(_0x508751=_0x16ebd8,_0x390157=_0x16ebd8['getShiftedBy'](_0x4b3187));break;}}_0x508751&&_0x508751['isBefore'](_0x318c2d)&&(_0x318c2d=_0x508751['clone'](),_0x318c2d['stickiness']='toNone'),_0x390157&&_0x390157['isAfter'](_0x36ad31)&&(_0x36ad31=_0x390157['clone'](),_0x36ad31['stickiness']='toNone');}return _0x54cec3['model']['createSelection'](_0x54cec3['model']['createRange'](_0x318c2d,_0x36ad31));}function Q(_0x58db15,_0x17744e){so(_0x58db15,_0x17744e,'forward');const _0x110322=_0x17744e['getFirstRange']();_0x17744e['setTo']([]),_0x17744e['setTo'](_0x110322,{'backward':!0x0}),so(_0x58db15,_0x17744e,'backward');}function so(_0x15a75d,_0x1f6470,_0x1b115b){let _0x2df029=0x14;for(;_0x2df029;){_0x15a75d['modifySelection'](_0x1f6470,{'unit':'word','direction':_0x1b115b}),_0x2df029--;const _0x34c162=_0x1f6470['focus']['forward'==_0x1b115b?'nodeBefore':'nodeAfter'];if(_0x34c162&&_0x34c162['is']('element')&&_0x15a75d['schema']['isBlock'](_0x34c162)&&_0x15a75d['schema']['isObject'](_0x34c162))break;}}function Jn(_0x269deb,_0x1bc2f6){for(const [_0x52f778,_0x3e0fa8]of _0x269deb['markers']){const _0x203edd=_0x3e0fa8['_getTransformedByDeletion'](_0x1bc2f6['start'],_0x1bc2f6['end']['offset']-_0x1bc2f6['start']['offset']);null!=_0x203edd?_0x269deb['markers']['set'](_0x52f778,_0x203edd):_0x269deb['markers']['delete'](_0x52f778);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],$r=['conversation-title'];class pe extends $t(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new it([]);['parsedMergedContent']=new it([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x5f36a5,content:_0x41568e='',isDone:_0x4b6644=!0x1,interactionId:_0x547611,areActionsDisabled:_0x4acf1a,documentContextContent:_0x5cfc0f,editor:_0x21fd3e,id:_0x2aa337}){super(),this['id']=_0x2aa337||_0x3bb1ce(),this['interactionId']=_0x547611,this['type']=_0x5f36a5,this['areActionsDisabled']=!!_0x4acf1a,this['editor']=_0x21fd3e,this['aiResponseParser']=new Ve(),this['aiResponseApplier']=new We(),this['documentContextContent']=Ne(_0x5cfc0f||''),this['set']('isDone',_0x4b6644),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x41568e);}['appendContent'](_0x3a16aa){this['set']('content',this['content']+_0x3a16aa);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x519907,_0x4ef2a2){this['changeGroups'][_0x519907]['state']=_0x4ef2a2,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x519907,'state':_0x4ef2a2});}['getContentParts']({showDiff:_0x114406,groupIndex:_0x5dd745}){if(!this['editor'])throw new _0x19ee7d('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x335789=this['_getCachedContentParts'](_0x114406,_0x5dd745);if(_0x335789)return _0x335789;let _0x296e72=[];if(void 0x0===_0x5dd745)_0x296e72=this['changeGroups'];else{const _0x148556=this['changeGroups']['find'](({index:_0x281860})=>_0x281860===_0x5dd745);if(!_0x148556)throw new _0x19ee7d('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5dd745});_0x296e72=[_0x148556];}const _0x20cadb=C({'editor':this['editor'],'showDiff':_0x114406,'changeGroups':_0x296e72,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x114406,_0x20cadb),_0x20cadb;}['_getCachedContentParts'](_0x143f26,_0x55a5f1){const _0x43a86a=_0x143f26?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x43a86a]['length'])return null;const _0x377d13=this['cachedSuggestionContentParts'][_0x43a86a];if(void 0x0===_0x55a5f1)return _0x4b1575(_0x377d13);{const _0x8fd990=_0x377d13['find'](({index:_0x555186})=>_0x555186===_0x55a5f1);if(_0x8fd990)return[_0x4b1575(_0x8fd990)];}return null;}['_setCachedContentParts'](_0x54a96c,_0x2dc762){const _0x4cca95=_0x54a96c?'withDiff':'withoutDiff';_0x2dc762['forEach'](_0x1bceaf=>{const _0x4cce50=this['cachedSuggestionContentParts'][_0x4cca95],_0x4bc3b2=_0x4cce50['find'](({index:_0x53ca16})=>_0x53ca16===_0x1bceaf['index']);if(_0x4bc3b2){const _0x446121=_0x4cce50['indexOf'](_0x4bc3b2);_0x4cce50['splice'](_0x446121,0x1,_0x1bceaf);}else _0x4cce50['push'](_0x1bceaf);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x51c0fd=this['changeGroups'];this['updateChangeGroups']();const _0x55d83b=this['_getDifferentChangeGroups'](_0x51c0fd,this['changeGroups']);(_0x55d83b['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x55d83b),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x54da90,_0x1c8d77){const _0x2d0fc6=[];for(const _0x1c8bd2 of _0x1c8d77){const _0x3f939c=_0x54da90[_0x1c8bd2['index']];_0x3f939c?_0x3f939c['changes']['length']!==_0x1c8bd2['changes']['length']?_0x2d0fc6['push'](_0x1c8bd2):_0x3f939c['changes']['forEach']((_0xe578ee,_0x2b396c)=>{const _0x5df646=_0x1c8bd2['changes'][_0x2b396c];_0xe578ee['id']!==_0x5df646['id']&&_0x2d0fc6['push'](_0x1c8bd2);}):_0x2d0fc6['push'](_0x1c8bd2);}return _0x2d0fc6;}['updateChangeGroups'](){const _0x39d129=new _0x1781b0('p',{},[new _0x1781b0('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xe506f9(y(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x311ae7=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x39d129,'cutAfterLastChange':!this['isDone']});if(!_0x311ae7['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x311ae7['parsedContent'];let _0x4ca87d=[];if(_0x37808d(_0x45ac72=>{const _0x52539c=K(_0x45ac72,'data-id');if(!_0x52539c||!_0x3ea603(_0x52539c))return!0x1;const _0xef1792=[_0x45ac72,...Le(_0x45ac72)]['at'](-0x2);if(_0x45ac72!=_0xef1792){const _0x9980e7=K(_0xef1792,'data-id');_0x3ea603(_0x9980e7)||(_0x4ca87d['push']({'node':_0xef1792,'id':_0x9980e7,'type':'modified'}),_0x311ae7['modifiedNodeIds']['push'](_0x9980e7));}else _0x311ae7['modifiedNodeIds']['includes'](_0x52539c)?_0x4ca87d['push']({'node':_0x45ac72,'type':'modified','id':_0x52539c}):_0x311ae7['newNodeIds']['includes'](_0x52539c)?_0x4ca87d['push']({'node':_0x45ac72,'type':'new','id':_0x52539c,'anchorId':K(_0x45ac72['previousSibling'],'data-id')}):_0x4ca87d['push']({'node':_0x45ac72,'type':'removed','id':_0x52539c});return!0x0;},this['parsedMergedContent']),_0x4ca87d=_0x4ca87d['filter'](({node:_0x122572})=>[...Le(_0x122572),_0x122572]['every'](_0x2cff84=>!K(_0x2cff84,'data-unstable'))),0x0==_0x4ca87d['length'])return;const _0x140a59=[[_0x4ca87d[0x0]]];for(let _0x1dd8b9=0x1;_0x1dd8b9<_0x4ca87d['length'];_0x1dd8b9++){const _0x353fec=_0x140a59[_0x140a59['length']-0x1],_0x5a4845=_0x353fec[_0x353fec['length']-0x1];_0x4ca87d[_0x1dd8b9]['node']['previousSibling']==_0x5a4845['node']&&'modified'!=_0x4ca87d[_0x1dd8b9]['type']&&'modified'!=_0x5a4845['type']?_0x353fec['push'](_0x4ca87d[_0x1dd8b9]):_0x140a59['push']([_0x4ca87d[_0x1dd8b9]]);}for(const _0x9e103f of _0x140a59){const _0x2ce5b7=_0x9e103f[0x0],_0x8327e8=_0x9e103f[_0x9e103f['length']-0x1],_0x1954ba=_0x90afb4(_0x2ce5b7['node']['previousSibling']);_0x1954ba&&_0x9e103f['unshift'](_0x1954ba);const _0x3fbb57=_0x90afb4(_0x8327e8['node']['nextSibling']);_0x3fbb57&&_0x9e103f['push'](_0x3fbb57);}function _0x3ea603(_0x36ddbb){return _0x311ae7['modifiedNodeIds']['includes'](_0x36ddbb)||_0x311ae7['newNodeIds']['includes'](_0x36ddbb)||_0x311ae7['removedNodeIds']['includes'](_0x36ddbb);}function _0x90afb4(_0xa3d999){if(_0xa3d999&&K(_0xa3d999,'data-id')&&!K(_0xa3d999,'data-unstable')){const _0x1c5d1f=K(_0xa3d999,'data-id');if(!_0x3ea603(_0x1c5d1f))return{'node':_0xa3d999,'type':'context','id':_0x1c5d1f};}return null;}this['changeGroups']=_0x140a59['map']((_0x4c3dce,_0x128c94)=>({'changes':_0x4c3dce,'state':'pending','index':_0x128c94}));}}function Fe(_0x5ba5a8){return Object['values'](Zn)['includes'](_0x5ba5a8);}function Ee(_0x12eca7){return $r['includes'](_0x12eca7);}function Ae(_0x30de7b){return'conversation-title'===_0x30de7b;}function Me(_0xee36de){return'source'===_0xee36de;}const qt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class jt extends _0x3dcb71(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x1f96ac,editor:_0x40f314}){super(),this['id']=_0x3bb1ce(),this['connector']=_0x1f96ac,this['isStopped']=!0x0,this['editor']=_0x40f314;}async['start'](){let _0x20182e;const _0x348686=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x283440=await this['currentRequest']['getStream']();for await(const _0x469aee of _0x283440){if(this['isStopped'])return;if('error'===_0x469aee['event'])return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-interaction-error',this)});if('message-metadata'!==_0x469aee['event']){if('action-metadata'!==_0x469aee['event']){if(Ae(_0x469aee['event'])&&this['setConversationTitle'](_0x469aee['data']['conversationTitle'],!0x0),Me(_0x469aee['event']))_0x348686['push'](_0x469aee['data']['source']);else{if(Fe(_0x469aee['event'])){if(_0x469aee['event']!==_0x20182e){if(_0x20182e=_0x469aee['event'],'web-search'===_0x469aee['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x469aee['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x469aee['event'],'interactionId':this['id'],'id':_0x469aee['data']?.['id']}),_0x348686['length']>0x0&&'modification-delta'===_0x469aee['event']&&(this['currentReply']['sources']=_0x348686['splice'](0x0));}_0x469aee['data']['textDelta']&&this['currentReply']['appendContent'](_0x469aee['data']['textDelta']);}else Ee(_0x469aee['event']);}}else this['actionCallId']=_0x469aee['data']['callId'];}else this['messageId']=_0x469aee['data']['messageId'];}}finally{this['isStopped']||(_0x348686['length']>0x0&&(this['currentReply']['sources']=_0x348686['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x153345){return this['replies']['find'](_0x57fb31=>_0x57fb31['id']===_0x153345);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x429c4d=>_0x429c4d['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x493f23){const _0x6a5ba=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x493f23});return this['replies']['push'](_0x6a5ba),_0x6a5ba['delegate'](...qt)['to'](this),this['fire']('replyCreated',_0x6a5ba),_0x6a5ba;}['setConversationTitle'](_0x946e8c,_0x594b46=!0x1){this['fire']('setConversationTitle',_0x946e8c,_0x594b46);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ft=function(_0x5d6d9b){return _0x5d6d9b['FILE']='file',_0x5d6d9b['DOCUMENT']='document',_0x5d6d9b['URL']='web-resource',_0x5d6d9b['TEXT']='text',_0x5d6d9b['SELECTION']='selection',_0x5d6d9b;}({}),Yt=function(_0x4479e4){return _0x4479e4['TEXT']='text',_0x4479e4['MARKDOWN']='markdown',_0x4479e4['HTML']='html',_0x4479e4;}({});const Ie=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']]),Si=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Di extends $t(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x252982,config:_0x4af77a,ownerId:_0x453a53}){super(),this['_connector']=_0x252982,this['_config']=_0x4af77a,this['_ownerId']=_0x453a53;}['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'](_0x3c52c6){const _0xd8d0c8=await this['_createContextItemFromContent'](_0x3c52c6);return this['_addToConversationContextItem'](_0xd8d0c8),'current-document'===_0xd8d0c8['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xd8d0c8;}async['_createContextItemFromContent'](_0x164fa1){if(_0x164fa1['type']===Ft['DOCUMENT']){const _0x43e018=await this['_connector']['fetchDocument'](this['_ownerId'],_0x164fa1['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x164fa1['type'],'content':_0x43e018['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x43e018['attributes']?.['version'],'sessionId':_0x43e018['attributes']?.['sessionId']};}return{'id':_0x164fa1['id'],'uiId':_0x164fa1['id'],'label':_0x164fa1['attributes']?.['label']||_0x164fa1['name']||_0x164fa1['url']||_0x164fa1['id'],'type':_0x164fa1['type'],..._0x164fa1?.['attributes']?.['resourceId']?{'resourceId':_0x164fa1['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1cdc08){const _0x6241dd=this['_pendingContextItems']['get'](_0x1cdc08);_0x6241dd?.['isReadOnly']||this['_removeContextItem'](_0x1cdc08);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x452892 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x452892['uiId']);const _0x360143=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x360143&&this['_addContextItem']({..._0x360143,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x47ddf1){for(const _0x166da9 of _0x47ddf1['values']())this['_addToConversationContextItem'](_0x166da9);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'](_0x2b8d98){return Array['from'](_0x2b8d98['values']())['map'](_0x210884=>this['_mapContextItemToRequestData'](_0x210884))['filter'](_0x5548a3=>null!==_0x5548a3);}async['addFilesToContext'](_0x2d3016,_0x2b1e7c,_0x450776=Ft['FILE']){const _0x47696a='files-'+_0x3bb1ce();this['_startUploadOperation'](_0x47696a);try{await Promise['all'](_0x2d3016['map'](async _0x475ae2=>{const _0x4b3e87='file-'+_0x3bb1ce(),_0x4e210b=Zt(_0x475ae2['name']);try{this['_addContextItem']({'type':_0x450776,'label':_0x2b1e7c?.['label']||_0x4e210b,'uiId':_0x4b3e87,'resourceId':_0x2b1e7c?.['resourceId']},!0x0);const _0x3b11f2=this['_connector']['uploadFile'](this['_ownerId'],_0x475ae2,_0x2b1e7c);this['_ongoingUploads']['set'](_0x4b3e87,_0x3b11f2['abortController']);const {id:_0x467ece}=await _0x3b11f2['getId']();this['_ongoingUploads']['delete'](_0x4b3e87),this['_finishContextItemLoading']({'type':_0x450776,'id':_0x467ece,'label':_0x2b1e7c?.['label']||_0x4e210b,'uiId':_0x4b3e87,'resourceId':_0x2b1e7c?.['resourceId']},!0x1);}catch(_0x16317a){this['_ongoingUploads']['delete'](_0x4b3e87);if(!(_0x16317a instanceof _0x19ee7d&&_0x16317a['message']['startsWith']('ai-request-aborted'))){const _0x4ee190=Ie['get'](_0x16317a['code'])||'ai-chat-file-upload-failed',_0x3ee922=new _0x19ee7d(_0x4ee190,null,{'fileName':_0x4e210b,..._0x16317a});_0x3ee922['stack']=_0x16317a['stack'],this['fire']('error',{'error':_0x3ee922});}this['_removeContextItem'](_0x4b3e87);}}));}finally{this['_finishUploadOperation'](_0x47696a);}}['addCurrentDocumentToContext'](_0x3a4666){if(this['isCurrentDocumentInContext']())return;const _0xdb9db={'type':Ft['DOCUMENT'],'uiId':'current-document','label':_0x3a4666,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0xdb9db);}async['updateCurrentDocument'](_0x1be0d5,_0x2f29ba,_0x5b9a9f,_0x59356e){const _0x38fdde=this['_pendingContextItems']['get']('current-document');if(_0x38fdde&&_0x1be0d5){_0x38fdde['selection']=_0x59356e?_0x59356e['map'](_0x332e05=>({'start':_0x332e05['start'],'end':_0x332e05['end']})):[];try{if(_0x38fdde['version']===_0x2f29ba)return;const {id:_0x591702}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1be0d5,{'version':_0x2f29ba,'sessionId':_0x5b9a9f})['getId']();_0x38fdde['id']=_0x591702,_0x38fdde['content']=_0x1be0d5,_0x38fdde['version']=_0x2f29ba,_0x38fdde['sessionId']=_0x5b9a9f;}catch(_0x76e8b1){const _0x6b0dc1=new _0x19ee7d('ai-chat-document-upload-failed',null);_0x6b0dc1['stack']=_0x76e8b1['stack'],this['fire']('error',{'error':_0x6b0dc1});}}}['addSelectionToContext'](_0x294721){this['_addContextItem']({'type':Ft['SELECTION'],'label':_0x294721,'uiId':'selection','content':_0x294721});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x52ca02,_0x19cf3d){const _0x421abf='url-'+_0x3bb1ce();this['_startUploadOperation'](_0x421abf);const _0x32cdd8='url-'+_0x3bb1ce();try{this['_addContextItem']({'type':Ft['URL'],'label':_0x19cf3d?.['label']||_0x52ca02,'uiId':_0x32cdd8,'resourceId':_0x19cf3d?.['resourceId']},!0x0);const _0x2f9f97=this['_connector']['uploadUrl'](this['_ownerId'],_0x52ca02,_0x19cf3d);this['_ongoingUploads']['set'](_0x32cdd8,_0x2f9f97['abortController']);const {id:_0x5afbb7}=await _0x2f9f97['getId']();this['_ongoingUploads']['delete'](_0x32cdd8),this['_finishContextItemLoading']({'type':Ft['URL'],'id':_0x5afbb7,'label':_0x19cf3d?.['label']||_0x52ca02,'uiId':_0x32cdd8,'resourceId':_0x19cf3d?.['resourceId']},!0x1);}catch(_0xed750){this['_ongoingUploads']['delete'](_0x32cdd8),(_0xed750['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x19ee7d('ai-chat-url-upload-failed',this,{'url':_0x52ca02,'originalError':_0xed750}),'url':_0x52ca02}),this['_removeContextItem'](_0x32cdd8));}finally{this['_finishUploadOperation'](_0x421abf);}}async['loadSourceResources'](_0x4138c7,_0x266927,_0x128991){const _0x5be863=this['_addContextOptionsState']['sources']['find'](_0x6c1ba6=>_0x6c1ba6['id']===_0x4138c7);if(!_0x5be863)return this['fire']('error',{'error':new _0x19ee7d('ai-chat-source-not-found',this,{'sourceId':_0x4138c7}),'sourceId':_0x4138c7}),[];try{const _0x713457=(await _0x5be863['getResources'](_0x266927))['map'](_0x1793c7=>{const _0x1a7e11=this['_isResourceInContext'](_0x1793c7['id']);return{..._0x1793c7,'isInContext':_0x1a7e11};});return _0x5be863['resources']=_0x713457,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4138c7,'source':_0x5be863,'resources':_0x713457,'uid':_0x128991}),_0x713457;}catch(_0x4ae194){return this['fire']('error',{'error':new _0x19ee7d('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4138c7,'originalError':_0x4ae194}),'sourceId':_0x4138c7,'sourceLabel':_0x5be863['label']}),[];}}async['addResourceToContext'](_0x35ec4f,_0x3083eb){if(this['_isResourceInContext'](_0x3083eb['id']))return;let _0x5c9b61=_0x3083eb['data'];if(!_0x5c9b61&&_0x35ec4f['getData'])try{_0x5c9b61=await _0x35ec4f['getData'](_0x3083eb['id']);}catch(_0x92a2cc){return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-resource-load-failed',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'originalError':_0x92a2cc}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});}if(_0x5c9b61)switch(_0x3083eb['type']){case Ft['URL']:if('string'!=typeof _0x5c9b61)return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-invalid-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'expectedType':'string','actualType':typeof _0x5c9b61}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});await this['addUrlToContext'](_0x5c9b61,{'label':_0x3083eb['label'],'resourceId':_0x3083eb['id']});break;case Ft['FILE']:if(!(_0x5c9b61 instanceof File))return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-invalid-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'expectedType':'File','actualType':typeof _0x5c9b61}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});await this['addFilesToContext']([_0x5c9b61],{'label':_0x3083eb['label'],'resourceId':_0x3083eb['id']});break;case Ft['TEXT']:if('object'!=typeof _0x5c9b61||!('content'in _0x5c9b61)||!('type'in _0x5c9b61))return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-invalid-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5c9b61}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});_0x5c9b61=Di['_convertTextResourceToFile'](_0x5c9b61,_0x3083eb['label']),await this['addFilesToContext']([_0x5c9b61],{'label':_0x3083eb['label'],'resourceId':_0x3083eb['id']},Ft['TEXT']);break;default:this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-unsupported-type',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'resourceType':_0x3083eb['type']}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});}else this['fire']('error',{'error':new _0x19ee7d('ai-chat-resource-no-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});}static['_convertTextResourceToFile'](_0x2752ab,_0x1fc4af){switch(_0x2752ab['type']){case Yt['MARKDOWN']:return new File([_0x2752ab['content']],_0x1fc4af,{'type':'text/markdown'});case Yt['HTML']:return new File([_0x2752ab['content']],_0x1fc4af,{'type':'text/html'});default:return new File([_0x2752ab['content']],_0x1fc4af,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5c44b0){switch(_0x5c44b0['type']){case Ft['FILE']:return{'type':Ft['FILE'],'id':_0x5c44b0['id']};case Ft['URL']:return{'type':Ft['URL'],'id':_0x5c44b0['id']};case Ft['DOCUMENT']:return{'type':Ft['DOCUMENT'],'id':_0x5c44b0['id'],..._0x5c44b0['selection']?.['length']&&{'selection':_0x5c44b0['selection']}};case Ft['TEXT']:return{'type':Ft['FILE'],'id':_0x5c44b0['id']};default:return null;}}['_addContextItem'](_0x3172dd,_0x48f0b0=!0x1){if(this['_pendingContextItems']['set'](_0x3172dd['uiId'],_0x3172dd),_0x3172dd['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3172dd,'isLoading':_0x48f0b0}),'current-document'===_0x3172dd['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3172dd['resourceId']){const _0x2df7dc=this['_findSourceIdsByResourceId'](_0x3172dd['resourceId']);_0x2df7dc&&_0x2df7dc['forEach'](_0x2554cf=>{this['_updateResourceInContextState'](_0x2554cf,_0x3172dd['resourceId'],!0x0);});}}['_removeContextItem'](_0x5c671b){const _0x3d4c86=this['_pendingContextItems']['get'](_0x5c671b),_0x2caaa5=this['_ongoingUploads']['get'](_0x5c671b);if(_0x2caaa5&&(_0x2caaa5['abort'](),this['_ongoingUploads']['delete'](_0x5c671b)),_0x3d4c86?.['resourceId']){const _0xe0765e=this['_findSourceIdsByResourceId'](_0x3d4c86['resourceId']);_0xe0765e&&_0xe0765e['forEach'](_0x223b87=>{this['_updateResourceInContextState'](_0x223b87,_0x3d4c86['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5c671b),this['fire']('contextItemRemoved',{'uiId':_0x5c671b,'type':_0x3d4c86?.['type']}),'current-document'===_0x5c671b&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0xcf6882,_0x3f755e){if(this['_pendingContextItems']['has'](_0xcf6882['uiId'])&&(this['_pendingContextItems']['set'](_0xcf6882['uiId'],_0xcf6882),this['fire']('contextItemLoadingEnded',{'contextItem':_0xcf6882,'isLoading':_0x3f755e}),_0xcf6882['resourceId'])){const _0x570beb=this['_findSourceIdsByResourceId'](_0xcf6882['resourceId']);_0x570beb&&_0x570beb['forEach'](_0xf7a319=>{this['_updateResourceInContextState'](_0xf7a319,_0xcf6882['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2f51e1){this['_conversationContextItems']['set'](_0x2f51e1['uiId'],_0x2f51e1);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x13578b=>({..._0x13578b,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3add10=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3add10,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x3e9e65){for(const _0xdef1be of this['_pendingContextItems']['values']())if(_0xdef1be['resourceId']===_0x3e9e65)return!0x0;for(const _0x49e217 of this['_conversationContextItems']['values']())if(_0x49e217['resourceId']===_0x3e9e65)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x448413){const _0x5ddb32=[];for(const _0xd3170c of this['_addContextOptionsState']['sources']){_0xd3170c['resources']['find'](_0x24ccbe=>_0x24ccbe['id']===_0x448413)&&_0x5ddb32['push'](_0xd3170c['id']);}return 0x0===_0x5ddb32['length']?null:_0x5ddb32;}['_updateResourceInContextState'](_0x543cb8,_0x3f730e,_0x3cee5b){const _0x5ba68a=this['_addContextOptionsState']['sources']['find'](_0x28aa50=>_0x28aa50['id']===_0x543cb8);if(!_0x5ba68a)return;const _0x42beff=_0x5ba68a['resources']['find'](_0x2b93d8=>_0x2b93d8['id']===_0x3f730e);_0x42beff&&(_0x42beff['isInContext']=_0x3cee5b,this['fire']('resourceStateChanged',{'sourceId':_0x543cb8,'resourceId':_0x3f730e,'isInContext':_0x3cee5b}));}['_startUploadOperation'](_0x25a3ec){this['_ongoingUploadOperations']['set'](_0x25a3ec,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x3d81aa){this['_ongoingUploadOperations']['delete'](_0x3d81aa),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Fi=['capabilitiesUpdated'];class qi extends _0x3dcb71(){['_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'](_0x49c4ff){const _0x515517={};return _0x49c4ff&&_0x49c4ff['isWebSearchEnabled']&&(_0x515517['webSearch']={}),_0x49c4ff&&_0x49c4ff['isReasoningEnabled']&&(_0x515517['reasoning']={}),_0x515517;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5e1ed4){_0x5e1ed4!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5e1ed4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x455a09){_0x455a09!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x455a09,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class zi extends jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x47de19){super(_0x47de19),this['conversationId']=_0x47de19['conversationId'],this['contextItems']=_0x47de19['contextItems'],this['capabilities']=_0x47de19['capabilities'],this['userMessage']=_0x47de19['userMessage'],this['model']=_0x47de19['model'],this['quickActionData']=_0x47de19['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Di['mapContextItemsToRequestData'](this['contextItems']),'capabilities':qi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class G extends _0x3dcb71(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4d1319){super(),this['options']=_0x4d1319,this['connector']=_0x4d1319['connector'],this['chatModels']=_0x4d1319['chatModels'],this['id']=_0x4d1319['conversationId'];}async['init'](_0x19fa88){try{this['chatContext']=new Di({'connector':this['connector'],'config':_0x19fa88,'ownerId':this['id']}),this['chatContext']['delegate'](...Si)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new qi(),this['chatCapabilities']['delegate'](...Fi)['to'](this),this['chatCapabilities']['init']();const _0x4c2b86=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x4c2b86});const _0x58f02f=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x58f02f&&await this['setModel'](_0x58f02f);}catch(_0x30d555){const _0x43bec1=new _0x19ee7d('ai-chat-conversation-init-failed',null,{'message':_0x30d555['message']||_0x30d555});_0x43bec1['stack']=_0x30d555['stack'],this['fire']('error',{'error':_0x43bec1});}}async['start'](){if(this['isStarted'])throw new _0x19ee7d('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x19ee7d('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0xa66aa6}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xa66aa6,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4d7c6c){const _0xb01af2=new _0x19ee7d('ai-chat-conversation-start-failed',null,{'message':_0x4d7c6c['message'],'conversationId':this['id']});throw _0xb01af2['stack']=_0x4d7c6c['stack'],this['fire']('error',{'error':_0xb01af2}),_0xb01af2;}}async['load'](_0xa2ed06,_0xedb787){try{const _0x469744=await this['connector']['fetchConversation'](_0xa2ed06)['getConversation'](),_0x3d07bb=await this['connector']['fetchConversationMessages'](_0xa2ed06)['getMessages'](),_0x22837f=_0x3d07bb[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x469744['id'],'title'in _0x469744?this['fire']('setConversationTitle',_0x469744['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x51ca5d=(await this['chatModels']['getAll']())['find'](_0x398ad3=>_0x398ad3['id']['toLowerCase']()===_0x22837f['toLowerCase']());return this['selectedModel']=_0x51ca5d,this['fire']('modelSelected',{'selectedModel':_0x51ca5d,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3d07bb,_0xedb787,_0x22837f),this['currentInteraction']=void 0x0,this;}catch(_0x16a7a8){const _0x2557cc=new _0x19ee7d('ai-chat-conversation-init-from-id-failed',null,{'message':_0x16a7a8['message'],'conversationId':_0xa2ed06});throw _0x2557cc['stack']=_0x16a7a8['stack'],this['fire']('error',{'error':_0x2557cc}),_0x2557cc;}}async['_processMessagesToInteractions'](_0x4d8e1f,_0x26b2aa,_0x40af88){let _0x59c108;for(const _0x23ddca of _0x4d8e1f)if('user'===_0x23ddca['role']){const _0x1ee5ca=await this['_extractContextItems'](_0x23ddca),_0x510e42={'isReasoningEnabled':Object['hasOwn'](_0x23ddca['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x23ddca['capabilities'],'webSearch')};_0x59c108=this['createInteraction']({'userMessage':_0x23ddca['prompt'],'contextItems':_0x1ee5ca,'capabilities':_0x510e42,'modelId':_0x40af88,'quickActionData':_0x23ddca['attributes']?.['quickActionData']}),this['currentInteraction']=_0x59c108,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x23ddca['role']&&_0x59c108)for(const _0x507e5f of _0x23ddca['content']){const _0x3be6f1='text'===_0x507e5f['type']?'text-delta':'modification-delta',_0x53edab=_0x59c108['getDocumentContext']()?.['sessionId']!==_0x26b2aa;_0x59c108['currentReply']=_0x59c108['createReply']({'type':_0x3be6f1,'isDone':!0x0,'interactionId':_0x59c108['id'],'areActionsDisabled':_0x53edab}),_0x59c108['currentReply']['appendContent'](_0x507e5f['content']);}}}async['_extractContextItems'](_0x28ece3){const _0x6fe7d4=new Map();if(!_0x28ece3['content'])return _0x6fe7d4;for(const _0x220996 of _0x28ece3['content']){const _0x24f19f=await this['chatContext']['populateFromMessage'](_0x220996);_0x24f19f&&_0x6fe7d4['set'](_0x24f19f['id'],_0x24f19f);}return _0x6fe7d4;}async['handleUserInteraction']({userMessage:_0x157eb2,quickActionData:_0x4e484d}){if(!this['isStarted'])throw new _0x19ee7d('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x19ee7d('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5e2329=this['chatContext']['getPendingContextItems'](),_0x4e1ef1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4f2c01=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x157eb2,'contextItems':_0x5e2329,'capabilities':_0x4e1ef1,'modelId':_0x4f2c01,'quickActionData':_0x4e484d}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x56a875){if(_0x56a875 instanceof _0x19ee7d)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x56a875});else{const _0x16a914=Ie['get'](_0x56a875['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x19ee7d(_0x16a914,null,{'error':_0x56a875})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3cc811,contextItems:_0x4dc3ed,capabilities:_0x4a7faf,modelId:_0x11c783,quickActionData:_0x2369ef}){const _0xac22da=new zi({'userMessage':_0x3cc811,'contextItems':_0x4dc3ed,'capabilities':_0x4a7faf,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x11c783,'quickActionData':_0x2369ef});return _0xac22da['delegate'](...qt)['to'](this),this['interactions']['push'](_0xac22da),this['fire']('interactionCreated',_0xac22da),_0xac22da;}['getInteraction'](_0x533429){return this['interactions']['find'](_0x5c7e43=>_0x5c7e43['id']===_0x533429);}['removeInteraction'](_0x38be12){const _0x42e3bc=this['getInteraction'](_0x38be12);_0x42e3bc&&(_0x42e3bc['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x42e3bc),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x432462){this['chatContext']['addCurrentDocumentToContext'](_0x432462);}async['updateCurrentDocumentInContext']({content:_0x226b58,version:_0x4d04b6,sessionId:_0x3d9d55,selections:_0x348158}){await this['chatContext']['updateCurrentDocument'](_0x226b58,_0x4d04b6,_0x3d9d55,_0x348158);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x504c13){this['chatContext']['addSelectionToContext'](_0x504c13);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5de5f3){this['chatContext']['addFilesToContext'](_0x5de5f3);}['addUrlToContext'](_0xf2b58d){this['chatContext']['addUrlToContext'](_0xf2b58d);}['addResourceToContext'](_0x5acc1e,_0x3aa104){this['chatContext']['addResourceToContext'](_0x5acc1e,_0x3aa104);}['loadSourceResources'](_0x26980f,_0x414582,_0x5a7f30){return this['chatContext']['loadSourceResources'](_0x26980f,_0x414582,_0x5a7f30);}['removeFromContext'](_0x24d91e){this['chatContext']['removeFromContext'](_0x24d91e);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x217fc7){_0x217fc7?!0x1===await this['chatModels']['isAvailable'](_0x217fc7)&&(_0xe189d1('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x217fc7}),_0x217fc7=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xe189d1('ai-chat-conversation-set-model-null',{'conversation':this}),_0x217fc7=(await this['chatModels']['getAvailableModels']())[0x0]),_0x217fc7['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x217fc7,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x217fc7}));}}function P(_0x288087){if(_0x288087 instanceof _0x1e9e1e)return _0x288087;if(_0x288087?.['editors']&&_0x288087['editors']['get'](0x0))return _0x288087['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.'),_0x288087['editors']['get'](0x0);throw new _0x19ee7d('ai-get-editor-from-context-no-editor');}const W='ai-selection';class c extends _0x4404b9{['_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 _0x11ade9=P(this['context']),_0x48767e=_0x11ade9['plugins']['has']('RealTimeCollaborationClient')&&_0x11ade9['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x48767e||_0x3bb1ce();}return this['_sessionId'];}['getDocumentData'](){const _0x39c1cf=P(this['context']),_0x3e0a8d=_0x39c1cf['model'],_0x5b8ee4=_0x39c1cf['data']['toView'](_0x3e0a8d['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0xdaf026=new gt(_0x39c1cf['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5b8ee4,_0xdaf026);let _0x25660b=_0x39c1cf['data']['processor']['toData'](_0x5b8ee4);const _0x3119e3=this['_getMarkersInDocumentOrder'](),_0x39274f=[];for(const _0x261a1d of _0x3119e3){const _0x5b5c92='<'+_0x261a1d['name']+':start></'+_0x261a1d['name']+':start>',_0xc54a78=_0x25660b['indexOf'](_0x5b5c92);_0x25660b=_0x25660b['substring'](0x0,_0xc54a78)+_0x25660b['substring'](_0xc54a78+_0x5b5c92['length']);const _0x2d7238='<'+_0x261a1d['name']+':end></'+_0x261a1d['name']+':end>',_0x1a7235=_0x25660b['indexOf'](_0x2d7238);_0x25660b=_0x25660b['substring'](0x0,_0x1a7235)+_0x25660b['substring'](_0x1a7235+_0x2d7238['length']),_0x39274f['push']({'markerName':_0x261a1d['name'],'start':_0xc54a78,'end':_0x1a7235,'htmlFragment':_0x25660b['substring'](_0xc54a78,_0x1a7235)});}return{'content':_0x25660b,'version':_0x39c1cf['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x39274f};}async['afterInit'](){this['context']instanceof _0x1e9e1e?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3dfa1d,_0x5b4be9)=>{_0x5b4be9['on']('ready',()=>{this['_integrateEditor'](_0x5b4be9);});});}['_integrateEditor'](_0x20e58e){_0x20e58e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':W,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x20e58e['conversion']['for']('dataDowncast')['markerToElement']({'model':W,'view':(_0x3cfec0,{writer:_0x51a0b7,options:_0x43f458})=>_0x43f458['convertAiChatSelectionMarker']?_0x51a0b7['createUIElement'](_0x3cfec0['markerName']+':'+(_0x3cfec0['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4a96df,_0x3d12f4,_0x54bebe=!0x1,_0x36b734=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x36b734)return!0x1;const _0x1244e2=P(this['context'])['model'];return _0x1244e2['change'](_0x291813=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x3d12f4,this['_displayedFakeSelectionLocked']=_0x54bebe;let _0x738a0b=0x0;for(let _0x5307ba of _0x4a96df){const _0x388fcd=W+':'+_0x738a0b;if(_0x5307ba['start']['isAtEnd']){const _0x379c30=_0x5307ba['start']['getLastMatchingPosition'](({item:_0x28c708})=>!_0x1244e2['schema']['isContent'](_0x28c708),{'boundaries':_0x5307ba});_0x5307ba=_0x291813['createRange'](_0x379c30,_0x5307ba['end']);}_0x291813['addMarker'](_0x388fcd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5307ba}),_0x738a0b++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x4252fb){if(this['_displayedFakeSelectionId']!=_0x4252fb)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x578c41=P(this['context']),_0x5dc081=_0x578c41['model']['markers']['getMarkersGroup'](W);return _0x578c41['model']['change'](_0x415f81=>{for(const _0x217c78 of _0x5dc081)_0x415f81['removeMarker'](_0x217c78);}),!0x0;}['modelToViewWithIds'](_0x27065e){const _0x5daf48=P(this['context']),_0x22b08b=_0x5daf48['data']['toView'](_0x27065e),_0x28241f=new gt(_0x5daf48['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x22b08b,_0x28241f),_0x22b08b;}['_setDataIdsOnChildren'](_0x346c21,_0x237df4){let _0x1dfd86=!0x1;const _0x46e956=new Set();for(const _0x1e4389 of _0x346c21['getChildren']()){const _0x5e0d34=_0x1e4389['is']('emptyElement')||_0x1e4389['is']('containerElement');if(!_0x1e4389['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1e4389,_0x237df4)||_0x5e0d34)&&(_0x237df4['setAttribute']('data-id',this['_nextDataId'](_0x46e956),_0x1e4389),_0x1dfd86=!0x0);}return _0x1dfd86;}['_nextDataId'](_0x292db8){let _0x467b51;do{_0x467b51='';for(let _0x15bd30=0x0;_0x15bd30<0x4;_0x15bd30++)_0x467b51+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x292db8['has'](_0x467b51));return _0x292db8['add'](_0x467b51),_0x467b51;}['getSelectionText'](){const {model:_0x20c626}=P(this['context']),_0x169c65=_0x20c626['document']['selection'],_0x42de86=_0x20c626['getSelectedContent'](_0x169c65),_0x4428db=[],_0x150a4e=_0x20c626['createRangeIn'](_0x42de86)['getWalker']();for(const {item:_0x2bb9f0}of _0x150a4e)_0x2bb9f0['is']('$textProxy')?_0x4428db['push'](_0x2bb9f0['data']):_0x2bb9f0['is']('element')&&_0x4428db['length']>0x0&&'\x20'!==_0x4428db[_0x4428db['length']-0x1]&&_0x4428db['push']('\x20');return'\x22'+_0x4428db['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x3ce231=P(this['context'])['model'];return Array['from'](_0x3ce231['markers']['getMarkersGroup'](W))['sort']((_0x44e0bb,_0x42ac24)=>_0x44e0bb['getStart']()['isBefore'](_0x42ac24['getStart']())?-0x1:_0x44e0bb['getStart']()['isAfter'](_0x42ac24['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x492b6b{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0xdacfc7,_0x30c451){super(_0xdacfc7),this['_dropdownOriginalConfig']=_0x30c451||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x68b46=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x1bf3fd({'label':Pn('applySuggestion',_0xdacfc7,this['_partsCount']),'icon':_0x2a5a64,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x1bf3fd({'label':Pn('showChangeInText',_0xdacfc7,this['_partsCount']),'icon':_0x4c9c07,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x1bf3fd({'label':Pn('insertSuggestion',_0xdacfc7,this['_partsCount']),'icon':_0x36635b,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0xdacfc7),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x68b46['if']('isVisible','ck-hidden',_0x433eac=>!_0x433eac)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0xcc1cc8=>'applySuggestion'!==_0xcc1cc8):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0xdacfc7);});}['_updateDropdownActions'](_0x4671ee){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x4671ee),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x57dee0){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x3ce2aa=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x57dee0):this['_createActionsDropdown'](_0x57dee0),_0x1cb0ca=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x3ce2aa['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x57dee0,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x57dee0,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x1cb0ca});for(const _0x3502d0 of this['_dropdownCurrentConfig'])_0x3ce2aa['on'](_0x3502d0,()=>{this['fire'](_0x3502d0);});return this['_firstRender']=!0x1,_0x3ce2aa;}['_createActionsButton'](_0x1f019b){const _0x22e28a=new _0x21bd9e(_0x1f019b);return _0x22e28a['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x22e28a['on']('execute',()=>{_0x22e28a['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x22e28a;}['_createActionsDropdown'](_0x301bde){const _0x35d930=new Nn(_0x301bde,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x466ae1=>{switch(_0x466ae1){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x35d930['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x301bde,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x301bde,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x35d930['bind']('isEnabled')['to'](this),_0x35d930;}['updateLabels'](_0x3784e1){const _0x5166aa=this['locale'];this['_partsCount']=_0x3784e1||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x5166aa,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x5166aa,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x5166aa,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x5166aa,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x5166aa,this['_partsCount']);}}class Nn extends _0x18c56d{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x3f6498,_0x4660b3){super(_0x3f6498),this['balloonPanelView']=new _0x257cec(this['locale']),this['bodyCollection']=new Kt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x4660b3['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',y(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x4ac530=_0x4660b3['listItemModels'][0x0]['actionName'];this['fire'](_0x4ac530),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),ts({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x4382b8){const _0x1b805b=this['locale'],_0x13c27e=new _0x24784f(_0x1b805b);for(const _0x254036 of _0x4382b8){const _0x29848f=new _0x8a8c30(_0x1b805b),_0x1c1e63=new _0x1bb418(_0x1b805b);_0x1c1e63['bind'](...Object['keys'](_0x254036))['to'](_0x254036),_0x1c1e63['delegate']('execute')['to'](_0x13c27e),_0x29848f['children']['add'](_0x1c1e63),_0x13c27e['items']['add'](_0x29848f);}return _0x13c27e['items']['delegate']('execute')['to'](this),_0x13c27e['on']('execute',_0x3000ec=>{const _0x18945c=_0x3000ec['source'];this['fire'](_0x18945c['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x13c27e;}['_setUpKeystrokes'](){this['keystrokeHandler']=new Wt(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x4dab11,_0x3d0c88)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x3d0c88();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0x463797){return{'top':_0x463797['bottom'],'left':_0x463797['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x2d79a7,_0x83afc4){return{'top':_0x2d79a7['bottom'],'left':_0x2d79a7['left']-(_0x83afc4['width']-_0x2d79a7['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x57b4b0,_0x282bf7,_0x3a286c){switch(_0x57b4b0){case'applySuggestion':return y(_0x282bf7,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x3a286c);case'showChangeInText':return y(_0x282bf7,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x3a286c);case'insertSuggestion':return y(_0x282bf7,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x3a286c);}}function Hn(_0x2f65bb,_0x23ccab,_0x2cd7b6){switch(_0x2f65bb){case'applySuggestion':return y(_0x23ccab,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x2cd7b6);case'showChangeInText':return y(_0x23ccab,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x2cd7b6);case'insertSuggestion':return y(_0x23ccab,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x2cd7b6);}}class Mt extends _0x3dcb71(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x2c6ba0,availableModels:_0x474496,defaultModelId:_0x3d2597}){super(),this['_connector']=_0x2c6ba0,this['_availableModels']=_0x474496,this['_defaultModelId']=_0x3d2597;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x58e1f9=this['_connector']['getModels'](),_0x43843f=await _0x58e1f9['list']();this['_modelList']=_0x43843f['items'];}catch(_0xc00964){throw _0x543541('ai-models-unable-to-retrieve',{'error':_0xc00964}),_0xc00964;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x19567=await this['getAll']();return this['_filterModels'](_0x19567,this['_availableModels']);}async['getModel'](_0x164d02){const _0x49b036=await this['getAll']();if(!_0x49b036['length'])return null;if(_0x164d02){const _0x38cde5=this['_getModelById'](_0x49b036,_0x164d02);if(_0x38cde5)return _0x38cde5;_0xe189d1('ai-chat-model-id-unrecognized',{'modelId':_0x164d02,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x366a31=await this['getAvailableModels']();if(!_0x366a31['length'])return null;if(this['_defaultModelId']){const _0x1c1d77=this['_getModelById'](_0x366a31,this['_defaultModelId']);if(_0x1c1d77)return _0x1c1d77;_0xe189d1('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x366a31[0x0]['id']});}return _0x366a31[0x0];}async['isAvailable'](_0x5e0a32){return(await this['getAvailableModels']())['some'](_0xf0fb6a=>_0xf0fb6a['name']===_0x5e0a32['name']&&_0xf0fb6a['provider']===_0x5e0a32['provider']);}['_filterModels'](_0x2a1d36,_0x32e989){let _0x6c3465;if(_0x32e989){_0x6c3465=[];const _0x55ab85='string'==typeof _0x32e989?[_0x32e989['toLocaleLowerCase']()]:_0x32e989['map'](_0x39aeda=>_0x39aeda['toLocaleLowerCase']());for(const _0x3b605c of _0x55ab85)for(const _0xf0bb7d of _0x2a1d36)(_0xf0bb7d['id']['toLocaleLowerCase']()===_0x3b605c||_0xf0bb7d['name']['toLocaleLowerCase']()===_0x3b605c||Oe(_0xf0bb7d)&&'auto'===_0x3b605c||_0xf0bb7d['provider']['toLocaleLowerCase']()===_0x3b605c||_0xf0bb7d['id']['toLocaleLowerCase']()['startsWith'](_0x3b605c))&&_0x6c3465['push'](_0xf0bb7d);}else _0x6c3465=_0x2a1d36;return _0x6c3465;}['_getModelById'](_0x3ab46d,_0x4e2fcb){return _0x3ab46d['find'](_0x2c6dc2=>Oe(_0x2c6dc2)&&'auto'===_0x4e2fcb?_0x2c6dc2:_0x2c6dc2['id']===_0x4e2fcb)||null;}static['getLocalized'](_0x117003,_0x57efb6){return _0x57efb6['map'](_0x474442=>{if(Oe(_0x474442))_0x474442['name']=y(_0x117003,'AI_MODEL_NAME_AUTO'),_0x474442['description']=y(_0x117003,'AI_MODEL_DESCRIPTION_AUTO');else y(_0x117003,'AI_MODEL_DESCRIPTION_'+_0x474442['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x474442['description']=y(_0x117003,'AI_MODEL_DESCRIPTION_'+_0x474442['id']['toUpperCase']()));return _0x474442;});}}function Oe(_0x278692){return _0x278692['id']['startsWith']('agent');}class z extends Mt{async['getAll'](){return(await super['getAll']())['sort']((_0x1a9acd,_0x5d7cb9)=>{const _0x598bd5=Object['values'](_0x1a9acd['capabilities'])['filter'](_0xfc607=>_0xfc607['enabled'])['length'];return Object['values'](_0x5d7cb9['capabilities'])['filter'](_0x53921f=>_0x53921f['enabled'])['length']-_0x598bd5;});}}function v({editor:_0x45f00b,interaction:_0x4879f0,reply:_0x2a0bcf,groups:_0xadf888,transform:_0xba3871,documentCompare:_0x5d6520,documentCompareOptions:_0x74cf45}){const _0x2d6bcd=_0x4879f0['getDocumentContext']();if(!_0x2d6bcd)return[];const _0x524f8b=_0x2d6bcd['content'],_0x4579d9=_0x2d6bcd['version'],_0x32fffa=_0x2a0bcf['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x327fb2}of _0xadf888){const _0x31efd3=_0x327fb2['filter'](_0x308059=>'new'!=_0x308059['type'])['map'](_0x5d28cc=>st('data-id',_0x5d28cc['id'],_0x32fffa)),_0x477187=_0x327fb2['filter'](_0x3f1012=>'removed'!=_0x3f1012['type'])['map'](_0x5df1e6=>_0x5df1e6['node']['cloneNode'](!0x0));let _0x2522f3=null;if(_0x31efd3['length']){_0x2522f3=_0x31efd3[0x0]['previousSibling'];for(let _0x4b4c47=0x0;_0x4b4c47<_0x31efd3['length'];_0x4b4c47++)_0x19c981(_0x31efd3[_0x4b4c47]);}if(_0x477187['length']){_0x2522f3||(_0x327fb2[0x0]['anchorId']?_0x2522f3=st('data-id',_0x327fb2[0x0]['anchorId'],_0x32fffa):(_0x2522f3=_0x477187['shift'](),_0x5578be(_0x32fffa,_0x2522f3)));for(let _0x3215c4=0x0;_0x3215c4<_0x477187['length'];_0x3215c4++)_0x41021b(_0x2522f3,_0x477187[_0x3215c4]),_0x2522f3=_0x477187[_0x3215c4];}}const _0x23768e=tt(_0x32fffa),_0x36dadd=_0x5d6520['getDiff'](_0x524f8b,_0x23768e,_0x74cf45)['getOperations']();if(_0xba3871){const _0x59b9d4=_0x45f00b['model']['document']['history']['getOperations'](_0x4579d9),_0x1ce265={'document':_0x45f00b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x39cd19(_0x36dadd,_0x59b9d4,_0x1ce265)['operationsA'];}return _0x36dadd;}function b(_0x514df2,_0x1037bd){if('marker'!=_0x1037bd['type'])return;const _0x3923e7=_0x514df2['model']['markers']['get'](_0x1037bd['name']);_0x3923e7&&(_0x1037bd['oldRange']=_0x3923e7['getRange']());}class Sr extends _0x39a08b{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x42af5a,_0x2c132b={},_0xd09d3){super(_0x42af5a),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2c132b};const _0x2071de=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x2071de?'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'](_0xd09d3),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x21bd9e(this['locale']),this['likeButton']['set']({'icon':_0x1e0de2,'label':y(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3c16f8=>!_0x3c16f8),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x21bd9e(this['locale']),this['dislikeButton']['set']({'icon':_0x1b416f,'label':y(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x48b140=>!_0x48b140),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x21bd9e(this['locale']),this['copyButton']['set']({'icon':_0x385135,'label':y(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x246617=>!_0x246617);const _0xc13d51=new _0x25e498();_0xc13d51['set']({'content':_0x347166}),_0xc13d51['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'](_0xc13d51);}['_setupShowChangesButton'](_0xeeb738){this['showChangesButton']=new _0x21bd9e(this['locale']),this['showChangesButton']['set']({'icon':_0x376600,'label':y(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0xeeb738}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x577e08=>!_0x577e08),this['showChangesButton']['on']('execute',()=>{const _0x48d00f=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x48d00f,'icon':_0x48d00f?_0x2eeddb:_0x376600}),this['fire']('toggleShowChanges',_0x48d00f);});}}class Lr extends _0x492b6b{['showChangesToggleView'];constructor(_0x39ac0f,_0x12472b){super(_0x39ac0f),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ra(_0x39ac0f),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':y(_0x39ac0f,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x12472b['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3754d0=>_0x3754d0?_0x7a6747:_0x5cd197),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x5a3531=new _0x25e498();_0x5a3531['content']=_0x7efb12,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x12472b['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x5a3531,{'tag':'span','children':[y(_0x39ac0f,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ra extends _0x21bd9e{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x2eab31){this['options']={'delay':_0x2eab31['delay']??0x14,'textNodeStyle':_0x2eab31['textNodeStyle'],'onStreamUpdate':_0x2eab31['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x2c9710,targetElement:_0x55c931,abortSignal:_0x291466}){this['isStreaming']&&this['stop'](),_0x291466?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2ef420(_0x2c9710,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0xe189d1('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x5b3f13=0x0;_0x5b3f13<this['currentIndex'];_0x5b3f13++)this['nodesList'][_0x5b3f13]['shouldBeStreamed']=!0x0;let _0x479ae4=0x0;for(let _0x41a34c=this['currentIndex'];_0x41a34c<this['nodesList']['length'];_0x41a34c++){const _0x9d2bea=Date['now'](),_0x33f7c7=this['nodesList'][_0x41a34c],_0x291271=_0x9d2bea-_0x479ae4;_0x33f7c7['shouldBeStreamed']=!0x0;let _0x2e8654=_0x33f7c7['parent'];for(;_0x2e8654;)_0x2e8654['shouldBeStreamed']=!0x0,_0x2e8654=_0x2e8654['parent'];if(_0x291271<this['options']['delay'])try{const {promise:_0x3ef0ba,abortController:_0x1c12be}=pr(this['options']['delay']-_0x291271);this['timeoutAbortController']=_0x1c12be,await _0x3ef0ba;}catch(_0x141c0a){return;}_0x1e000f(_0x55c931,'<'+_0x55c931['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x55c931['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x41a34c,_0x479ae4=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x2763ef}){Array['from'](_0x2763ef['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5ced4c=>{_0x5ced4c['replaceWith'](_0x5ced4c['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x203557){let _0x4f7282='';if(function(_0x2475ae){return _0xa44e7b(_0x2475ae);}(_0x203557)){for(const _0x4de38e of _0x203557['children'])_0x4f7282+=this['renderNode'](_0x4de38e);}else{if(dr(_0x203557)){if(!_0x203557['shouldBeStreamed'])return'';const _0x314aed=_0x203557,_0x1d8fe1=Object['entries'](_0x314aed['attribs'])['map'](([_0x5ec988,_0x5a2489])=>_0x5ec988+'=\x22'+_0x5a2489+'\x22')['join']('\x20');_0x4f7282+='<'+_0x314aed['tagName']+(_0x1d8fe1?'\x20'+_0x1d8fe1:'')+'>';for(const _0x260330 of _0x51e789(_0x314aed))_0x4f7282+=this['renderNode'](_0x260330);_0x4f7282+='</'+_0x314aed['tagName']+'>';}else{if(!ar(_0x203557))return'';if(!_0x203557['shouldBeStreamed'])return'';!function(_0x551f44){if(!_0x551f44['parent']||!dr(_0x551f44['parent']))return!0x1;if(!cr['includes'](_0x551f44['parent']['tagName']))return!0x1;return!_0x4b97d9(_0x551f44)['match'](/^\s*[<>]\s*$/);}(_0x203557)?_0x4f7282+=_0x20dcd7(_0x203557):_0x4f7282+=_0x20dcd7(new _0x1781b0('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x203557]));}}return _0x4f7282;}['getParsedDocumentNodeList'](){const _0xc84505=[];return function(_0x16dc15,_0x3d6882){const _0x142c62=_0x13a18b=>{if(_0x3d6882(_0x13a18b),_0x13a18b instanceof _0x19bfe3)for(let _0x5c3797=0x0;_0x5c3797<_0x13a18b['children']['length'];_0x5c3797++){const _0x44cbd8=_0x13a18b['children'][_0x5c3797];_0x142c62(_0x44cbd8);}};for(let _0x6cfc1e=0x0;_0x6cfc1e<_0x16dc15['children']['length'];_0x6cfc1e++)_0x142c62(_0x16dc15['children'][_0x6cfc1e]);}(this['document'],_0x5c1689=>{if(ar(_0x5c1689)){const _0x95dc=this['splitTextNodeIntoWordNodes'](_0x5c1689);_0x95dc['length']&&_0xc84505['push'](..._0x95dc);}_0x5c1689['isWordSplitSource']||_0x5c1689['isWordSplitResult']||_0xc84505['push'](_0x5c1689);}),_0xc84505;}['splitTextNodeIntoWordNodes'](_0x35e8de){if(_0x35e8de['isWordSplitSource']||_0x35e8de['isWordSplitResult'])return[];const _0x273898=_0x4b97d9(_0x35e8de)['match'](/(?:\s*\S+\s*)/g),_0x286c98=[];if(_0x273898&&_0x273898['length']>0x1){for(const _0x34b3f9 of _0x273898){const _0x7bd8f3=new _0xe506f9(_0x34b3f9);_0x7bd8f3['isWordSplitResult']=!0x0,_0x4e9405(_0x35e8de,_0x7bd8f3),_0x286c98['push'](_0x7bd8f3);}_0x35e8de['isWordSplitSource']=!0x0,_0x19c981(_0x35e8de);}return _0x286c98;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0xf5ab5c){return _0xb35865(_0xf5ab5c);}function dr(_0x10dd7b){return _0x1a9650(_0x10dd7b);}function pr(_0x6ba939){const _0x190d54=new AbortController();return{'promise':new Promise((_0x387511,_0x165733)=>{const _0x5dd721=setTimeout(_0x387511,_0x6ba939);_0x190d54['signal']['addEventListener']('abort',()=>{clearTimeout(_0x5dd721),_0x165733();});}),'abortController':_0x190d54};}const Ce=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x492b6b{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x1303fc,{part:_0x47ad07,uiIndex:_0x3a295f,areActionsDisabled:_0x481f09,availableActions:_0x5e45aa}){super(_0x1303fc),this['set']('partDefinition',_0x47ad07),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x28fa68=>'pending'==_0x28fa68&&!_0x481f09),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x1303fc,{'part':_0x47ad07,'uiIndex':_0x3a295f,'availableActions':_0x5e45aa}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ce)['to'](this);const _0x13e92c=this['bindTemplate'];this['contentView']=new _0x492b6b(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x13e92c['to']('state',_0x46c4ae=>'ck-ai-suggestion__body__content-part_'+_0x46c4ae),_0x13e92c['to']('isEnabled',_0x3b16d1=>_0x3b16d1?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x13e92c['if']('isVisible','ck-hidden',_0xe5bd0f=>!_0xe5bd0f)]},'children':this['children'],'on':{'mouseenter':_0x13e92c['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x47ad07['index']});}),'mouseleave':_0x13e92c['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x47ad07['index']});})}});}async['updateContent']({part:_0x2b1fac,renderingStrategy:_0x5d8ffe,showUnchangedParts:_0x5ba6f7=!0x1,abortSignal:_0x50265d}){this['partDefinition']=_0x2b1fac,this['isVisible']=this['partDefinition']['hasChanges']||_0x5ba6f7,this['isVisible']&&('streaming'===_0x5d8ffe?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x50265d}):this['contentView']['element']['innerHTML']=tt(this['partDefinition']['content']));}['toggleHeader'](_0x4b48d3){_0x4b48d3?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x492b6b{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x5e83a8,{part:_0x12f5c6,uiIndex:_0x13e265,availableActions:_0xbfe4ac}){super(_0x5e83a8),this['set']('partDefinition',_0x12f5c6),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x3db1f6=new _0x25e498();_0x3db1f6['content']=_0x4e7318,_0x3db1f6['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x2cacf1=[];if(_0xbfe4ac['includes']('showChangeInText')){const _0xe668d3=new _0x21bd9e(_0x5e83a8);_0xe668d3['set']({'label':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4c9c07}),_0xe668d3['bind']('isEnabled')['to'](this),_0xe668d3['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x12f5c6['index']});}),_0x2cacf1['push'](_0xe668d3);}if(_0xbfe4ac['includes']('insertSuggestion')){const _0x54e686=new _0x21bd9e(_0x5e83a8);_0x54e686['set']({'label':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x36635b}),_0x54e686['bind']('isEnabled')['to'](this),_0x54e686['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x12f5c6['index']});}),_0x2cacf1['push'](_0x54e686);}const _0x5844e5=new _0x21bd9e(_0x5e83a8);_0x5844e5['set']({'label':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x55fa0e}),_0x5844e5['bind']('isEnabled')['to'](this),_0x5844e5['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x12f5c6['index']});}),_0x2cacf1['push'](_0x5844e5),this['_toolbarView']=new _0x39a08b(_0x5e83a8),this['_toolbarView']['items']['addMany'](_0x2cacf1),this['_iconStateAccepted']=new _0x25e498(),this['_iconStateAccepted']['content']=_0x1fca69,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x25e498(),this['_iconStateRejected']['content']=_0x37a396,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x25e498(),this['_iconStateOutdated']['content']=_0x37a396,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x84ba98=new _0x492b6b(_0x5e83a8);_0x84ba98['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x13e265['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x3db1f6,_0x84ba98,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',(_0x2498a9,_0x505ea1,_0x3834a3,_0x2cbe65)=>{switch(_0x2cbe65){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x3834a3){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class _ extends _0x3dcb71(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x58073b){const _0x29fa6f=this['createTask'](_0x58073b);return this['queue']['push'](_0x29fa6f),this['_processQueue'](),_0x29fa6f['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(_0x4e7750=>{this['once']('_queueEmpty',()=>{_0x4e7750();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x12f841=this['queue']['shift']();try{await _0x12f841['callback'](this['_abortController']['signal']),_0x12f841['resolve']();}catch(_0x756bc7){_0x12f841['reject'](_0x756bc7);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3d5d33){let _0x398ae1,_0x5c9328;const _0x4de103=new Promise((_0x4a11f4,_0x2124df)=>{_0x398ae1=_0x4a11f4,_0x5c9328=_0x2124df;});return{'callback':_0x3d5d33,'resolve':_0x398ae1,'reject':_0x5c9328,'completePromise':_0x4de103};}}class xr extends _0x492b6b{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x2b5c53){super();const _0x585509=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']=_0x2b5c53,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x585509['if']('isDone','ck-ai-chat__feed__item_done'),_0x585509['if']('isVisible','ck-hidden',_0x33bb90=>!_0x33bb90),'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'](_0x38c59b=>{_0x38c59b['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2d2fdd,_0x12a037,_0x11b848){await this['htmlStreamer']['stream']({'document':_0x2d2fdd,'targetElement':_0x12a037,'abortSignal':_0x11b848});}}class ye extends xr{constructor(_0x552054){super(_0x552054),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x552054['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4875a7){this['element']['innerHTML']=_0x4875a7;}}class Dr extends _0x492b6b{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x2302c6,_0x1acec6){super(_0x2302c6);const {areActionsDisabled:_0x58e234,showUnchangedParts:_0x22964b,availableActions:_0x26172b}=_0x1acec6;this['_areActionsDisabled']=_0x58e234,this['_showUnchangedParts']=_0x22964b,this['_availableActions']=_0x26172b,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new ye({'id':'empty-parts-warning','initialContent':y(_0x2302c6,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x4d4a45,renderingStrategy:_0x5e2eef,abortSignal:_0x5a529b}){this['_children']['length']?_0x4d4a45['forEach'](_0x2af574=>{const _0x595dfc=this['_cachedContentParts']['findIndex'](_0x306705=>_0x306705['index']==_0x2af574['index']);-0x1===_0x595dfc?this['_cachedContentParts']['push'](_0x2af574):this['_cachedContentParts'][_0x595dfc]=_0x2af574;}):this['_cachedContentParts']=_0x4d4a45;for(const _0x123029 of _0x4d4a45['filter'](_0x43db3a=>_0x43db3a['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x4f6d2e=>{let _0x3fe627=this['getPartView'](_0x123029['index']);_0x3fe627||(_0x3fe627=new na(this['locale'],{'part':_0x123029,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3fe627['delegate'](...Ce)['to'](this),this['_children']['add'](_0x3fe627),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x3fe627['toggleHeader'](this['_children']['length']>0x1),await _0x3fe627['updateContent']({'part':_0x123029,'renderingStrategy':_0x5e2eef,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x4f6d2e});});return _0x5a529b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x307c39,_0x13b68c){const _0x50687f=this['getPartView'](_0x307c39);_0x50687f&&(_0x50687f['state']=_0x13b68c),this['hasPendingParts']='pending'==_0x13b68c||Array['from'](this['_children'])['some'](_0x163b26=>'pending'==_0x163b26['state']);}['getPartView'](_0x167ce8){return this['_children']['find'](_0x511832=>_0x511832['partDefinition']['index']==_0x167ce8)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2a2f54=!this['_cachedContentParts']['find'](({hasChanges:_0x34cdf6})=>_0x34cdf6),_0x4ad2ca=!!this['_cachedContentParts']['find'](({hasChanges:_0x9dfff5})=>!_0x9dfff5);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x4ad2ca,_0x2a2f54?this['_emptyPartsWarningView']['setContent'](y(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](y(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0xe5e71d=>_0xe5e71d['partDefinition']['hasChanges']);}}class je extends _0x1e37e5{constructor(_0x40df22=void 0x0){super();const _0x246c9a=_0x40df22?'ck-ai-spinner_'+_0x40df22:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x246c9a]}});}}class e extends _0x492b6b{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x5a0151,_0x4f4ab1){super(_0x5a0151);const {showDiff:_0x3e378a,areActionsDisabled:_0x286f96,miniToolbarConfig:_0x37585e,hideHeader:_0x5cc2c9,showLoader:_0x35a010,showUnchangedParts:_0x3e6d3c,availableActions:_0x4ff7de}=_0x4f4ab1;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x35a010),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x5cc2c9||(this['headerView']=new Lr(_0x5a0151,{'showDiff':_0x3e378a}),this['headerView']['on']('toggleShowChanges',(_0x4ed73b,_0x5c6beb)=>{this['areChangesVisible']=_0x5c6beb['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5c6beb['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x5a0151,{'areActionsDisabled':_0x286f96,'showUnchangedParts':!!_0x3e6d3c,'availableActions':_0x4ff7de}),this['bodyView']['delegate'](...Ce)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Sr(_0x5a0151,_0x37585e,_0x3e378a),this['miniToolbarView']['delegate'](...Ce)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x32f9bd,_0x5dfa86)=>{this['areChangesVisible']=_0x5dfa86,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5dfa86});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new yr(this['locale']),this['children']['add'](this['sourcesView']),_0x35a010&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4190fa){await this['bodyView']['updateContentParts'](_0x4190fa);}['updateSources'](_0x1225c3){this['sourcesView']['children']['addMany'](_0x1225c3['map'](_0x238c73=>new Cr(this['locale'],_0x238c73))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x4fe51){if(this['errorView']){const _0x1de110=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x1de110&&(_0x1de110['textContent']=_0x4fe51),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x560ea8){this['miniToolbarView']['items']['add'](_0x560ea8);}['removeNavigationItem'](_0x1bc639){this['miniToolbarView']['items']['remove'](_0x1bc639);}['_createLoaderView'](){const _0x5e631a=new _0x492b6b(this['locale']),_0x9d67df=new je('small');_0x9d67df['isVisible']=!0x0;const _0x562ab7=new _0x492b6b(this['locale']);return _0x562ab7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[y(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x5e631a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0xc8a688=>!_0xc8a688)]},'children':[_0x9d67df,_0x562ab7]}),_0x5e631a;}['_createErrorView'](){const _0x248679=new _0x492b6b(this['locale']),_0xd43959=new _0x492b6b(this['locale']);return _0xd43959['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[y(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x248679['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2b2ab3=>!_0x2b2ab3)]},'children':[_0xd43959]}),_0x248679;}}class yr extends _0x492b6b{['children'];constructor(_0x471d6e){super(_0x471d6e),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',_0x3d50a9=>!_0x3d50a9)]},'children':this['children']});const _0xf8fd76=new _0x492b6b(this['locale']),_0x348dda=new _0x25e498();_0x348dda['content']=_0x4f04ad,_0xf8fd76['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x348dda,{'tag':'span','children':[{'text':y(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xf8fd76);}}class Cr extends _0x21bd9e{constructor(_0x16065e,_0x15cfa2){super(_0x16065e),this['set']({'label':_0x15cfa2['title'],'tooltip':_0x15cfa2['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x28a00c=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x28a00c['to'](()=>{window['open'](_0x15cfa2['url'],'_blank');})}}),_0x15cfa2['favicon']){const _0x4b7bc3=new _0x492b6b(_0x16065e);_0x4b7bc3['setTemplate']({'tag':'img','attributes':{'src':_0x15cfa2['favicon']||_0x4f04ad,'alt':_0x15cfa2['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4b7bc3);}else this['set']('icon',_0x4f04ad);}}class Xt extends _0x39a08b{constructor(_0x1f5849,_0x4dfa0a=!0x0,_0x222da8=!0x0){super(_0x1f5849),this['set']('isLoading',!0x1),_0x4dfa0a&&(this['applyButton']=this['_createButton'](y(_0x1f5849,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xdfd8ad=>!_0xdfd8ad),this['items']['add'](this['applyButton'])),_0x222da8&&(this['suggestButton']=this['_createButton'](y(_0x1f5849,'AI_BALLOON_SUGGEST_BUTTON'),_0x4dfa0a?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x365433=>!_0x365433),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x5a2038,_0x578c15){const _0x100ca9=new _0x21bd9e(this['locale']);return _0x100ca9['set']({'label':_0x5a2038,'class':_0x578c15||'','isVisible':!0x0,'withText':!0x0}),_0x100ca9;}}class Gt extends _0x492b6b{constructor(_0x3f18a4){super(_0x3f18a4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':y(_0x3f18a4,'AI_DISCLAIMER_TEXT')}]}]});}}const As=['wheel','touchstart','pointerdown','keydown'],Fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Jt{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x1c785d){this['element']=_0x1c785d,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0xee23d4 of As){const _0x576efb='keydown'!==_0xee23d4;this['element']['addEventListener'](_0xee23d4,this['_onUserEvent']['bind'](this),{'passive':_0x576efb,'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'](_0x3ef65f){if(this['isRunning']){if('keydown'===_0x3ef65f['type']){const _0x5b40a=_0x3ef65f['key'];if(!Fs['includes'](_0x5b40a))return;}_0x3ef65f instanceof WheelEvent?_0x3ef65f['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x35f01c,scrollHeight:_0x243f28,clientHeight:_0x3b2d1d}=this['element'];return _0x243f28-_0x35f01c-_0x3b2d1d<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x492b6b{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0x51acdb,_0x58abd6,_0x436761,_0x1bc5a9){super(_0x51acdb),this['_availableActions']=_0x436761,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x1bc5a9),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new Bt(),this['keystrokes']=new Wt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x2b3021(),this['_addContentView'](_0x58abd6['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x58abd6['showApplyButton'],_0x58abd6['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x58abd6['showApplyButton'],_0x58abd6['showSuggestButton']);});}['render'](){super['render']();for(const _0x10fd2f of this['_focusables'])this['focusTracker']['add'](_0x10fd2f['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x2ba98c){-0x1===_0x2ba98c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x392a55){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x392a55,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x423ee0){this['showError'](_0x423ee0);}['showBlockingError'](_0x16d6e1){this['showError'](_0x16d6e1),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x4eb6d8){const _0x6c4085=this['_createNextButtonView'](),_0x1ae7ac=this['_createPreviousButtonView']();_0x4eb6d8['view']['headerView']['children']['add'](_0x6c4085,0x2),_0x4eb6d8['view']['headerView']['children']['add'](_0x1ae7ac,0x0),this['_focusables']['addMany']([_0x6c4085,_0x1ae7ac]),this['focusTracker']['add'](_0x6c4085['element']),this['focusTracker']['add'](_0x1ae7ac['element']);}['_addContentView'](_0x168361){this['_mainView']=_0x168361,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x184af7){const _0x282f4d=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x184af7,this['_dialogContent']['add'](this['_mainView'],_0x282f4d),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new Gt(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x5d26ce=!0x0,_0x6c2bb3=!0x0){_0x5d26ce=_0x5d26ce&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x6c2bb3=_0x6c2bb3&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new Xt(this['locale'],_0x5d26ce,_0x6c2bb3),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x10b229=new _0x21bd9e(this['locale']);return _0x10b229['set']({'icon':_0x395cb2,'tooltip':y(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x10b229['on']('execute',()=>{this['fire']('showNext');}),_0x10b229;}['_createPreviousButtonView'](){const _0x51a98a=new _0x21bd9e(this['locale']);return _0x51a98a['set']({'icon':_0x48be9f,'tooltip':y(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x51a98a['on']('execute',()=>{this['fire']('showPrevious');}),_0x51a98a;}['_createErrorView'](){const _0xeba3ef=new _0x492b6b(this['locale']),_0x2ec342=new _0x492b6b(this['locale']);return _0x2ec342['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0xeba3ef['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x259927=>!_0x259927)]},'children':[_0x2ec342]}),_0xeba3ef;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x25fd56=this['_getScrollableElement']();_0x25fd56&&!this['scrollManager']&&(this['scrollManager']=new Jt(_0x25fd56));}['_getScrollableElement'](){return this['_mainView']instanceof e&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const x=0xa;class w extends _0x4404b9{static get['requires'](){return[s,c];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x46f1b6){const _0x65daf3=P(this['context']);if(this['_config']=_0x46f1b6,this['isOpen'])return void this['_updateBalloon'](_0x46f1b6);const _0x5cc852=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x44866b=_0x65daf3?.['commands']['get']('trackChanges'),_0x3cb3ae=_0x44866b?.['value'];this['balloonView']=new R(_0x65daf3['locale'],_0x46f1b6,_0x5cc852,!!_0x3cb3ae),this['balloonView']['delegate'](...O)['to'](this),_0x44866b&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x44866b,'value'),this['_showDialog'](_0x46f1b6);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x426cbd){const _0x450e68=P(this['context']),_0x13bcb4=_0x450e68['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x450e68['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x13bcb4['view']?.['headerView']&&(_0x13bcb4['view']['headerView']['label']=_0x426cbd['title'],_0x13bcb4['view']['headerView']['iconView']&&_0x426cbd['icon']&&(_0x13bcb4['view']['headerView']['iconView']['content']=_0x426cbd['icon'])),this['balloonView']['updateContent'](_0x426cbd['mainView']),this['_setupVisualSelection'](_0x426cbd['ranges'],_0x426cbd['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x13bcb4['view']&&_0x13bcb4['view']['updatePosition']();},_0x450e68['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0xfba3f,_0x24cb0e){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0xfba3f,'ai-balloon-'+_0x24cb0e,!0x0,!0x0);}['_showDialog'](_0x13eca0){const _0x4e8405=P(this['context']);this['_setupVisualSelection'](_0x13eca0['ranges'],_0x13eca0['index']);const _0x30a830=this['_getSelectionElements']();_0x30a830&&_0x30a830[0x0]&&_0x414134({'target':_0x30a830[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x4e8405['plugins']['get']('Dialog')['show']({'title':_0x13eca0['title'],'icon':_0x13eca0['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x13eca0['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x13d4ee=>{_0x13eca0['showRotator']&&this['balloonView']['setupRotator'](_0x13d4ee),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5d229f,_0x13ff8b){if(!_0x13ff8b)return null;const _0x3deab6=this['_getSelectionElements']();if(!_0x3deab6||0x0===_0x3deab6['length'])return{'left':Math['round'](_0x13ff8b['left']+_0x13ff8b['width']/0x2-_0x5d229f['width']/0x2),'top':Math['round'](_0x13ff8b['top']+_0x13ff8b['height']/0x2-_0x5d229f['height']/0x2)};const _0x1e121c=Math['round'](_0x13ff8b['left']+_0x13ff8b['width']/0x2-_0x5d229f['width']/0x2),_0x304e22=new _0x1ba12e(_0x3deab6[0x0]),_0x43a6e1=new _0x1ba12e(_0x3deab6[_0x3deab6['length']-0x1]),_0x21e9b2=_0x5d229f['height'],_0x45867e=this['_config']['showRotator']?0x8:0x0;return{'left':_0x1e121c,'top':this['_calculateOptimalTopPosition'](_0x304e22,_0x43a6e1,_0x21e9b2,_0x45867e,_0x13ff8b)};}['_calculateOptimalTopPosition'](_0x4eac16,_0x553d,_0xc31ae,_0x18e3a0=0x0,_0x30c200){const _0x3f8d1c=_0xc31ae+_0x18e3a0,_0x42c439=new _0x1ba12e(_0x384749['window']),_0x4095c1=[_0x4eac16['getVisible'](),_0x553d['getVisible']()]['filter'](_0x529166=>_0x529166),_0x29ed91=_0x1ba12e['getBoundingRect'](_0x4095c1);if(!_0x29ed91)return Math['round'](_0x30c200['top']+_0x30c200['height']/0x2);const _0x29a530=_0x42c439['getIntersection'](_0x29ed91);if(!_0x29a530)return Math['round'](_0x30c200['top']+_0x30c200['height']/0x2);const _0x2ea8fd=_0x30c200['getVisible'](),_0x49a786=_0x2ea8fd&&_0x29ed91['height']>_0x2ea8fd['height'],_0x4850e9=_0x29a530['top'],_0xe7fe55=_0x29a530['bottom'];if(_0x49a786){const _0x157cc0=(_0x2ea8fd||_0x42c439)['height']/0x2-_0x3f8d1c/0x2,_0x37482c=_0x4850e9-x-_0x30c200['top'],_0x5a402d=_0x30c200['bottom']-_0xe7fe55-x;return _0x37482c>=_0x3f8d1c?Math['max'](x,_0x4850e9-_0x3f8d1c-x):_0x5a402d>=_0x3f8d1c?_0xe7fe55+x:Math['max'](x,_0x157cc0);}const _0x61b799=_0x4850e9-_0x3f8d1c,_0x1ff9ae=_0x30c200['bottom']-_0xe7fe55-x,_0x57857a=_0x4850e9-x-_0x30c200['top'];let _0x295593;if(_0x1ff9ae>=_0x3f8d1c)_0x295593=_0xe7fe55+x;else{if(_0x57857a>=_0x3f8d1c)_0x295593=_0x61b799-x;else _0x295593=_0x4850e9+_0x29ed91['height']/0x2-_0x3f8d1c/0x2;}return _0x295593;}['_setupMarkerRemovalListener'](){const _0x2ecf0e=P(this['context']);this['listenTo'](_0x2ecf0e['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x1e50ec,data:{newRange:_0x416ef6}}of _0x2ecf0e['model']['document']['differ']['getChangedMarkers']())if(_0x1e50ec['startsWith']('ai-selection:')&&(_0x416ef6&&(_0x416ef6['start']['isEqual'](_0x416ef6['end'])||'$graveyard'==_0x416ef6['root']['rootName'])||null==_0x416ef6)){const _0x355aa9=y(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x355aa9),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x4957d6=P(this['context']);this['stopListening'](_0x4957d6['model']['document']);}['_getSelectionElements'](){const _0x33f539=P(this['context']);return _0x489432(_0x33f539['editing'],[..._0x33f539['model']['markers']['getMarkersGroup']('ai-selection'),..._0x33f539['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class q extends _0x4404b9{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x1f61c4];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new z({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x507414=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x491e50,_0x302bbf)=>{this['_handleUIUserMessage']({'userMessage':_0x302bbf});}),this['listenTo'](_0x507414,'resizedTabs',(_0x4cd5d7,_0x478dd9)=>{this['_setIsMaximized'](_0x478dd9);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x507414['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5c5033,_0x533601)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x533601));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x323738,_0x580e35)=>{this['activeConversation']?.['addUrlToContext'](_0x580e35);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x1f813f,_0x830a31)=>{this['activeConversation']?.['addResourceToContext'](_0x830a31['source'],_0x830a31['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xec9165,_0x3da937)=>{this['_removeFromContext'](_0x3da937);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1d6919,_0x1eb230)=>{this['activeConversation']?.['loadSourceResources'](_0x1eb230['sourceId'],_0x1eb230['query'],_0x1eb230['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5d4781,_0x26e767)=>{this['activeConversation']?.['setModel'](_0x26e767);}),this['listenTo'](this['_aiChatUi'],'like',(_0x583698,{replyId:_0x232f80})=>{console['log']('Liked\x20response',_0x232f80);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1e72e5,{replyId:_0x5b9139})=>{console['log']('Disliked\x20response',_0x5b9139);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x4444ea,_0xc627c8)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0xc627c8);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xe29d05,{replyId:_0x2fcd10,partIndex:_0x2643fc})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2fcd10,_0x2643fc);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0xa96c6b,{replyId:_0x1eb414,partIndex:_0x3af83f})=>{const _0x59383a=this['_getDocumentRangeForReplyChanges'](_0x1eb414,_0x3af83f);_0x59383a&&'$graveyard'!=_0x59383a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x59383a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x22d7d2,_0x3790b3)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x3790b3);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x3335af,{replyId:_0x5341cb,showDiff:_0x442814})=>{const {reply:_0x2447b0}=this['getInteractionAndReplyById'](_0x5341cb),_0xf78853=_0x2447b0['getContentParts']({'showDiff':_0x442814});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2447b0['id'],'parts':_0xf78853,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x36f93c,{replyId:_0x3c58eb,partIndex:_0x2bec7b})=>{this['_previewedChangeGroup']?.['replyId']==_0x3c58eb&&this['_previewedChangeGroup']?.['partIndex']==_0x2bec7b&&this['context']['plugins']['get'](w)['close']();const {reply:_0xc5a9fb}=this['getInteractionAndReplyById'](_0x3c58eb);_0xc5a9fb['setChangeGroupState'](_0x2bec7b,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _0x1e9e1e?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2176e2,_0x370144)=>{_0x370144['on']('ready',()=>{this['_integrateEditor'](_0x370144);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x381eec){const _0x1a4003=P(this['context']);if(!_0x1a4003['plugins']['has']('TrackChanges'))throw new _0x19ee7d('ai-no-track-changes',null);const _0x15679a=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3a9298,interaction:_0x280937}=this['getInteractionAndReplyById'](_0x381eec['replyId']),_0xcfacc9=this['_getDocumentRangeForReplyChanges'](_0x381eec['replyId'],_0x381eec['partIndex']),_0x511280=void 0x0!==_0x381eec['partIndex']?[_0x3a9298['changeGroups'][_0x381eec['partIndex']]]:_0x3a9298['changeGroups']['filter'](_0x44496d=>'pending'==_0x44496d['state']),_0x5c157d=_0x511280['map'](_0x297bce=>_0x3a9298['changeGroups']['indexOf'](_0x297bce));if(!_0xcfacc9||'$graveyard'==_0xcfacc9['range']['root']['rootName'])return void _0x5c157d['forEach'](_0x34c1f9=>_0x3a9298['setChangeGroupState'](_0x34c1f9,'outdated'));_0x5c157d['forEach'](_0x283523=>_0x3a9298['setChangeGroupState'](_0x283523,'accepted'));const _0xfad151=v({'editor':_0x1a4003,'reply':_0x3a9298,'interaction':_0x280937,'groups':_0x511280,'transform':!0x0,'documentCompare':_0x15679a,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x549342;_0xcfacc9&&this['_scrollToSuggestionRange'](_0xcfacc9['range']),_0x1a4003['model']['change'](_0x13df39=>{_0x549342=_0x13df39['batch'],_0x1a4003['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xfad151),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x549342,{'interactionId':_0x280937['id'],'replyId':_0x3a9298['id'],'indexes':_0x5c157d['slice']()}),this['_updateRatings'](_0x3a9298);}['_applySuggestion'](_0x62ed23){const _0x2e58de=P(this['context']),_0xd3318f=this['context']['plugins']['get'](_0x1f61c4),{reply:_0x4b4138,interaction:_0x3350f0}=this['getInteractionAndReplyById'](_0x62ed23['replyId']),_0x16b389=this['_getDocumentRangeForReplyChanges'](_0x62ed23['replyId'],_0x62ed23['partIndex']),_0x26600d=void 0x0!==_0x62ed23['partIndex']?[_0x4b4138['changeGroups'][_0x62ed23['partIndex']]]:_0x4b4138['changeGroups']['filter'](_0x34a21a=>'pending'==_0x34a21a['state']),_0xda5c96=_0x26600d['map'](_0x3572d5=>_0x4b4138['changeGroups']['indexOf'](_0x3572d5));if(!_0x16b389||'$graveyard'==_0x16b389['range']['root']['rootName'])return void _0xda5c96['forEach'](_0x1bc388=>_0x4b4138['setChangeGroupState'](_0x1bc388,'outdated'));_0xda5c96['forEach'](_0x36e531=>_0x4b4138['setChangeGroupState'](_0x36e531,'accepted'));const _0xe7ef2d=v({'editor':_0x2e58de,'reply':_0x4b4138,'interaction':_0x3350f0,'groups':_0x26600d,'transform':!0x0,'documentCompare':_0xd3318f,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x1854cc;_0x16b389&&this['_scrollToSuggestionRange'](_0x16b389['range']),_0x2e58de['model']['change'](_0x4ca462=>{_0x1854cc=_0x4ca462['batch'];for(const _0x455126 of _0xe7ef2d)_0x455126['baseVersion']=_0x2e58de['model']['document']['version'],b(_0x2e58de,_0x455126),_0x4ca462['batch']['addOperation'](_0x455126),_0x2e58de['model']['applyOperation'](_0x455126);}),this['_batchToChanges']['set'](_0x1854cc,{'interactionId':_0x3350f0['id'],'replyId':_0x4b4138['id'],'indexes':_0xda5c96['slice']()}),this['_updateRatings'](_0x4b4138);}['_openBalloonFor'](_0x5d65ec,_0x49a476){const _0x2d3136=P(this['context']),_0x361d63=this['_getDocumentRangeForReplyChanges'](_0x5d65ec,_0x49a476),_0x1ac598=this['context']['plugins']['get'](w);if(!_0x361d63)return void _0x1ac598['close']();const {range:_0x21ed95,currentIndex:_0xabea26}=_0x361d63;if('$graveyard'==_0x21ed95['root']['rootName']){const {reply:_0xb713ee}=this['getInteractionAndReplyById'](_0x5d65ec);return _0xb713ee['setChangeGroupState'](_0xabea26,'outdated'),void _0x1ac598['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x5d65ec&&this['_previewedChangeGroup']?.['partIndex']==_0xabea26)return;this['stopListening'](_0x1ac598),this['_previewedChangeGroup']={'replyId':_0x5d65ec,'partIndex':_0xabea26};let _0x394685=_0x2d3136['config']['get']('ai.availableReplyActions')||[...k];_0x2d3136['plugins']['has']('TrackChanges')||(_0x394685=_0x394685['filter'](_0x43fb3a=>'insertSuggestion'!=_0x43fb3a));const _0x35cff9=new e(_0x2d3136['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x394685});this['stopListening'](_0x35cff9);const {reply:_0x382cde}=this['getInteractionAndReplyById'](_0x5d65ec),_0x12e29e=_0x382cde['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x728117=>_0x728117['hasChanges']),_0x3d4905=_0x12e29e['findIndex'](_0x4c3a48=>_0x4c3a48['index']==_0xabea26);if(-0x1==_0x3d4905)return;const _0x4c0a5f=_0x12e29e[_0x3d4905],_0x1a943e=_0x12e29e['at']((_0x3d4905-0x1)%_0x12e29e['length'])?.['index'],_0x2c3a08=_0x12e29e['at']((_0x3d4905+0x1)%_0x12e29e['length'])?.['index'];_0x35cff9['updateContent']({'parts':[_0x4c0a5f],'renderingStrategy':'static'});const _0x5d4570=_0xabea26!==_0x1a943e;this['_scrollToSuggestionRange'](_0x21ed95,!0x0),_0x1ac598['open']({'index':_0xabea26,'title':y(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3d4905+0x1)['toString']()),'icon':et,'mainView':_0x35cff9,'showRotator':_0x5d4570,'showApplyButton':!0x0,'showSuggestButton':_0x2d3136['plugins']['has']('TrackChanges'),'ranges':[_0x21ed95]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5d65ec,_0xabea26),this['listenTo'](_0x35cff9,'toggleSuggestionDisplayMode',(_0x12a378,{showDiff:_0x49e5f1})=>{this['_balloonShowDiff']=_0x49e5f1;const {reply:_0x152ab3}=this['getInteractionAndReplyById'](_0x5d65ec),_0x2eb7e4=_0x152ab3['getContentParts']({'showDiff':_0x49e5f1,'groupIndex':_0xabea26});_0x35cff9['updateContent']({'parts':_0x2eb7e4,'renderingStrategy':'static'});}),this['listenTo'](_0x1ac598,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x5d65ec,'partIndex':_0xabea26}),_0x5d4570?this['_openBalloonFor'](_0x5d65ec,_0x2c3a08):_0x1ac598['close']();}),this['listenTo'](_0x1ac598,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x5d65ec,'partIndex':_0xabea26}),_0x5d4570?this['_openBalloonFor'](_0x5d65ec,_0x2c3a08):_0x1ac598['close']();}),_0x5d4570&&(this['listenTo'](_0x1ac598,'showNext',()=>{this['_openBalloonFor'](_0x5d65ec,_0x2c3a08);}),this['listenTo'](_0x1ac598,'showPrevious',()=>{this['_openBalloonFor'](_0x5d65ec,_0x1a943e);})),this['listenTo'](_0x1ac598,'dialogClosed',()=>{this['stopListening'](_0x1ac598),this['stopListening'](_0x35cff9),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x5d681b,_0x5280fa){const _0x55f157=P(this['context']),{reply:_0x3df2c8,interaction:_0x166058}=this['getInteractionAndReplyById'](_0x5d681b),_0x34f3d2=_0x3df2c8['changeGroups']['filter'](_0x889748=>'pending'==_0x889748['state']),_0x4d6aa1=_0x34f3d2['map'](_0x1b0c09=>_0x3df2c8['changeGroups']['indexOf'](_0x1b0c09));void 0x0===_0x5280fa&&(_0x5280fa=_0x4d6aa1[0x0]);const _0x2913be=_0x4d6aa1['indexOf'](_0x5280fa);if(-0x1==_0x2913be)return null;const _0x425630=_0x34f3d2[_0x2913be],_0x4bfd36=new it([]),_0xf1fa4=new it([]);for(const _0x433261 of _0x425630['changes'])if('removed'!=_0x433261['type']&&_0xf1fa4['children']['push'](_0x433261['node']['cloneNode'](!0x0)),'new'!=_0x433261['type']){const _0x2e4d5a=_0x3019e1(_0x433592=>K(_0x433592,'data-id')==_0x433261['id'],_0x3df2c8['documentContextContent'],!0x0);_0x4bfd36['children']['push'](_0x2e4d5a['cloneNode'](!0x0));}if(0x0==_0x4bfd36['children']['length']){if(_0x425630['changes'][0x0]['anchorId']){const _0x332d46=st('data-id',_0x425630['changes'][0x0]['anchorId'],_0x3df2c8['documentContextContent']);_0x4bfd36['children']['unshift'](_0x332d46['cloneNode'](!0x0)),_0xf1fa4['children']['unshift'](_0x332d46['cloneNode'](!0x0)),_0x332d46['nextSibling']&&(_0x4bfd36['children']['push'](_0x332d46['nextSibling']['cloneNode'](!0x0)),_0xf1fa4['children']['push'](_0x332d46['nextSibling']['cloneNode'](!0x0)));}else{const _0x3274e6=_0x3df2c8['documentContextContent']['children'][0x0];if(!_0x3274e6)return null;_0x4bfd36['children']['push'](_0x3274e6['cloneNode'](!0x0)),_0xf1fa4['children']['push'](_0x3274e6['cloneNode'](!0x0));}}const _0x4c6800=_0x166058['getDocumentContext'](),_0x331a27=_0x55f157['data']['parse'](_0x4c6800['content']),_0x310989=tt(_0x4bfd36),_0x955634=_0x55f157['data']['parse'](_0x310989),_0x2068c5=_0x55f157['data']['parse'](_0x310989),_0xbbb5e8=_0x55f157['model']['createPositionAt'](_0x955634,0x0),_0x40d4f8=tt(_0xf1fa4),_0x131ea7={'anchor':_0xbbb5e8,'markDeletions':!0x1},_0x47e735=_0x55f157['plugins']['get'](_0x1f61c4)['getDiff'](_0x310989,_0x40d4f8,_0x131ea7)['getOperations']();if(!_0x47e735['length'])return null;_0x55f157['model']['change'](_0x234708=>{for(const _0x9bcec0 of _0x47e735)if('remove'==_0x9bcec0['type']){const _0xdd78f7=_0x9bcec0['sourcePosition'],_0x4a43f0=_0x9bcec0['howMany'],_0x4ed9df=new _0x253f92(_0xdd78f7,_0x4a43f0);_0x234708['batch']['addOperation'](_0x4ed9df),_0x55f157['model']['applyOperation'](_0x4ed9df);}else'marker'!==_0x9bcec0['type']&&(_0x9bcec0['baseVersion']=null,_0x9bcec0['isDocumentOperation']=!0x1,_0x234708['batch']['addOperation'](_0x9bcec0),_0x55f157['model']['applyOperation'](_0x9bcec0));});const _0x3bbd5b=Z(_0x55f157,_0x47e735,_0x955634);Q(_0x55f157['model'],_0x3bbd5b);const _0x309a73=_0x3bbd5b['getFirstRange']()['start']['path']['slice'](),_0x248524=_0x3bbd5b['getFirstRange']()['end']['path']['slice'](),_0x4d8f03=[];let _0xc7b149=_0x955634,_0x6431fc=_0x2068c5;for(let _0x569dc4=0x0;_0x569dc4<_0x248524['length'];_0x569dc4++){const _0x1669dd=_0xc7b149['maxOffset']-_0x248524[_0x569dc4];_0x4d8f03[_0x569dc4]=_0x6431fc['maxOffset']-_0x1669dd,_0xc7b149=_0xc7b149['getChildAtOffset'](_0x248524[_0x569dc4]),_0x6431fc=_0x6431fc['getChildAtOffset'](_0x4d8f03[_0x569dc4]);}const _0x5e7a02=_0x55f157['model']['createRange'](_0x55f157['model']['createPositionFromPath'](_0x2068c5,_0x309a73),_0x55f157['model']['createPositionFromPath'](_0x2068c5,_0x4d8f03)),_0x6d4891=_0x2068c5['getChild'](0x0)['getAttribute'](_0x359efb),_0x31a750=Array['from'](_0x331a27['getChildren']())['find'](_0x1cab7b=>_0x1cab7b['getAttribute'](_0x359efb)==_0x6d4891)['getPath'](),_0x505140=_0x5e7a02['start']['path']['slice'](),_0x4360db=_0x5e7a02['end']['path']['slice']();_0x505140[0x0]=_0x31a750[0x0]+_0x505140[0x0],_0x4360db[0x0]=_0x31a750[0x0]+_0x4360db[0x0];let _0x1a2ed6=_0x55f157['model']['createRange'](_0x55f157['model']['createPositionFromPath'](_0x55f157['model']['document']['getRoot'](),_0x505140),_0x55f157['model']['createPositionFromPath'](_0x55f157['model']['document']['getRoot'](),_0x4360db));const _0x4ca0af=_0x55f157['model']['document']['history']['getOperations'](_0x4c6800['version']);for(const _0x84bd6d of _0x4ca0af)_0x1a2ed6=_0x184fda['_createFromRanges'](_0x1a2ed6['getTransformedByOperation'](_0x84bd6d));return{'range':_0x1a2ed6,'currentIndex':_0x5280fa};}['_integrateEditor'](_0x284d1f){if(!_0x284d1f['plugins']['has']('Undo'))return;const _0x1e91a2=_0x284d1f['commands']['get']('undo'),_0x4c39c8=_0x284d1f['commands']['get']('redo');this['listenTo'](_0x1e91a2,'revert',(_0x248e25,_0x360bec,_0x4cd27b)=>{const _0x16c85c=this['_batchToChanges']['get'](_0x360bec);if(!_0x16c85c)return;const _0x4a1ae8=this['activeConversation']['getInteraction'](_0x16c85c['interactionId'])['getReply'](_0x16c85c['replyId']);_0x16c85c['indexes']['forEach'](_0x503a35=>_0x4a1ae8['setChangeGroupState'](_0x503a35,'pending')),this['_batchToChanges']['delete'](_0x360bec),this['_batchToChanges']['set'](_0x4cd27b,_0x16c85c);}),this['listenTo'](_0x4c39c8,'revert',(_0x1e257f,_0x429753,_0x3cbcfd)=>{const _0xdf4ce3=this['_batchToChanges']['get'](_0x429753);if(!_0xdf4ce3)return;const _0xceead3=this['activeConversation']['getInteraction'](_0xdf4ce3['interactionId'])['getReply'](_0xdf4ce3['replyId']);_0xdf4ce3['indexes']['forEach'](_0x38bf9d=>_0xceead3['setChangeGroupState'](_0x38bf9d,'accepted')),this['_batchToChanges']['delete'](_0x429753),this['_batchToChanges']['set'](_0x3cbcfd,_0xdf4ce3);});}async['loadConversation'](_0xeafdf7){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0xeafdf7)['getConversation'](),await this['_startConversationSafely'](_0xeafdf7),this['updateConversationTitle']('\x20');const {sessionId:_0x5e1675}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0xeafdf7,_0x5e1675),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x1eb61e){this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0xeafdf7}),this['_logError'](new _0x19ee7d('ai-chat-conversation-not-found',this,{'error':_0x1eb61e}));}finally{this['context']['plugins']['get']($)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x372847){this['activeConversation']['id']===_0x372847&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x514c71=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x514c71),this['activeConversation']?.['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3cfa25,quickActionData:_0x48eb03}){await this['_handleUIUserMessage']({'userMessage':_0x3cfa25,'quickActionData':_0x48eb03});}['getGroupId'](){const _0x2f28b3=this['context']['config']['get']('collaboration.channelId');if(!_0x2f28b3)throw new _0x19ee7d('ai-chat-missing-channel-id',this);return _0x2f28b3;}async['_startConversationSafely'](_0x409cdb){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x409cdb);}catch(_0x54d43e){_0x543541('ai-chat-conversation-start-failed',_0x54d43e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xa52882){const _0x5ba86a=this['context']['plugins']['get'](w);let _0x240cad;_0x5ba86a['isOpen']&&_0x5ba86a['close'](),_0xa52882||!this['activeConversation']?_0x240cad=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x240cad=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x35d70a=this['getGroupId'](),_0x25c8de=_0xa52882||_0x3bb1ce();this['activeConversation']=new G({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x240cad,'conversationId':_0x25c8de,'group':_0x35d70a,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x4dd9ed,_0x151044)=>{this['_aiChatUi']['createConversation'](_0x151044),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xa52882||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x2744c8,_0x2dcba1)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2dcba1['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0xae529d,_0x4270ae)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4270ae);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x5eb839,_0x496691)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x496691,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x583111,_0x16e0fd)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x16e0fd,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x54ef5d,_0x106ccf)=>{this['_aiChatUi']['removeFeedInteraction'](_0x106ccf['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3c62a4,_0xdf51c4,_0x6d8311)=>{this['updateConversationTitle'](_0xdf51c4,_0x6d8311);}),this['activeConversation']['on']('replyCreated',(_0x1aeb81,_0x598288)=>{'text-delta'===_0x598288['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x598288):this['_aiChatUi']['addFeedItemAISuggestion'](_0x598288);}),this['activeConversation']['on']('replyContentUpdated',async(_0x22ddc8,_0x3505b9)=>{await this['_updateReplyContent']({'reply':_0x3505b9});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x57f070,{reply:_0x1df7c1,index:_0xfb6aa9,state:_0x163ffa})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x1df7c1['id'],'index':_0xfb6aa9,'state':_0x163ffa});}),this['activeConversation']['on']('contextItemAdded',(_0x15b8c8,_0x1de2ae)=>{if(this['_aiChatUi']['addContextItem'](_0x1de2ae['contextItem'],_0x1de2ae['isLoading']),'selection'===_0x1de2ae['contextItem']['type']){const _0x32b518=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x32b518,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x5c7692,_0x1ad939)=>{this['_aiChatUi']['removeContextItem'](_0x1ad939['uiId']),'current-document'==_0x1ad939['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1ad939['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3be097,_0x20f30c)=>{this['_aiChatUi']['setContextItemLoading'](_0x20f30c['contextItem']['uiId'],_0x20f30c['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3a0d84,_0x273af9)=>{this['_aiChatUi']['setConversationContext'](_0x273af9['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x565ce5,_0x46e2b9)=>{this['_aiChatUi']['setAddContextOptions'](_0x46e2b9['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3f030d,_0xe523a8)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xe523a8['sourceId'],_0xe523a8['source'],_0xe523a8['resources'],_0xe523a8['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x426c55,_0xba54e9)=>{this['_aiChatUi']['updateResourceState'](_0xba54e9['sourceId'],_0xba54e9['resourceId'],_0xba54e9['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3e3371,_0x87559)=>{this['_aiChatUi']['updateCapabilities'](_0x87559);}),this['activeConversation']['on']('modelSelected',(_0x2bf12c,_0x209ce3)=>{this['_aiChatUi']['setSelectedModel'](_0x209ce3['selectedModel'],_0x209ce3['isDisabled']);}),this['activeConversation']['on']('error',(_0x355d3e,{error:_0x5ec92b,interactionId:_0xbad1f0,fileName:_0x48547a,url:_0x7ba7f2,sourceId:_0x36e709,sourceLabel:_0x381e9d})=>{const _0x4b3369=_0xbad1f0?_0xbad1f0+':'+_0x3bb1ce():_0x3bb1ce();_0x5ec92b['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':y(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-conversation-init-failed')||_0x5ec92b['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x48547a),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x7ba7f2),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x36e709&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x36e709),this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x381e9d||'source'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x4b3369}),this['_logError'](_0x5ec92b));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xa52882||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x11e4a4,quickActionData:_0x2e8a4c}){if(!this['activeConversation'])throw new _0x19ee7d('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x11e4a4,'quickActionData':_0x2e8a4c}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x2f2627=P(this['context'])['model'],_0x5d9fae=Array['from'](_0x2f2627['markers']['getMarkersGroup'](W));_0x2f2627['change'](_0x44873f=>{_0x5d9fae['forEach'](_0x47010e=>_0x44873f['removeMarker'](_0x47010e));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x1bb84e){this['_aiChatUi']['setIsMaximized'](_0x1bb84e);}['_logError'](_0x46a678){_0x543541(_0x46a678['message']);}['_removeFromContext'](_0x1c26c9){this['activeConversation']?.['removeFromContext'](_0x1c26c9);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x32170f){const [_0xd9eb52,_0x2d30b4]=_0x32170f['split'](':'),_0x8c8ad5=this['activeConversation']['getInteraction'](_0xd9eb52),_0x191bfc=_0x8c8ad5['getReply'](_0x2d30b4);return{'interaction':_0x8c8ad5,'reply':_0x191bfc};}['_scrollToSuggestionRange'](_0x10ff01,_0x2f2df9=!0x1){const _0x101a4e=P(this['context']),_0x8972a5={'target':_0x101a4e['editing']['view']['domConverter']['viewRangeToDom'](_0x101a4e['editing']['mapper']['toViewRange'](_0x10ff01)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2f2df9};_0x2f2df9&&(_0x8972a5['alignToTop']=!0x0),_0x414134(_0x8972a5);}['updateConversationTitle'](_0x9b70c6,_0x214ff8=!0x1){this['_aiChatUi']['setConversationTitle'](_0x9b70c6||y(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x214ff8);}async['_updateReplyContent']({reply:_0x529901,renderingStrategy:_0x2fb980}){const {id:_0x3cd4fe,isDone:_0x394074,type:_0x12f663,parsedContent:_0xa1f85a}=_0x529901;if('modification-delta'===_0x12f663){const _0x5f5159=_0x529901['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3cd4fe,'parts':_0x5f5159,'renderingStrategy':_0x2fb980,'isDone':_0x394074});}else'text-delta'===_0x12f663&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3cd4fe,'parsedContent':_0xa1f85a,'renderingStrategy':_0x2fb980,'isDone':_0x394074});_0x394074&&_0x529901['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3cd4fe,_0x529901['sources']);}async['_stopLastInteraction'](){const _0x277cc4=this['activeConversation']?.['lastInteraction'];_0x277cc4&&(_0x277cc4['stop'](),this['_aiChatUi']['stopInteraction'](_0x277cc4));}async['_flushLastInteractionUI'](){const _0x15c846=this['activeConversation']?.['lastInteraction'];if(_0x15c846){for await(const _0x3656de of _0x15c846['replies'])await this['_updateReplyContent']({'reply':_0x3656de,'renderingStrategy':'static'});}}['_updateRatings'](_0x319345){const _0x445bed={'positiveCount':_0x319345['changeGroups']['filter'](_0x76d11b=>'accepted'===_0x76d11b['state'])['length'],'totalCount':_0x319345['changeGroups']['length'],'modificationId':_0x319345['id']},_0xf3662f=this['activeConversation']['getInteraction'](_0x319345['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0xf3662f,_0x445bed);}}const ht=[...Ce,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ke extends xr{['containerView'];['actionsView'];constructor(_0x13ede6,_0x4e1acb){super(_0x4e1acb),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x13ede6,{'showDiff':_0x4e1acb['showDiff'],'areActionsDisabled':_0x4e1acb['areActionsDisabled'],'availableActions':_0x4e1acb['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4f43cf,_0x1e0303)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x1e0303['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x3f75b5,{index:_0x5c6ee1})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x5c6ee1});}),this['containerView']['on']('insertSuggestion',(_0x14783f,{index:_0x556b29})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x556b29});}),this['containerView']['on']('rejectSuggestion',(_0x5ae54b,{index:_0x6a9163})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x6a9163});}),this['containerView']['on']('mouseOverSuggestion',(_0x35d2e1,{index:_0xf96e04})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0xf96e04});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x375b0c,{index:_0x4464c7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4464c7});}),this['actionsView']=new ah(_0x13ede6,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x4e1acb['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x451b72){await this['containerView']['updateContent'](_0x451b72),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x106254,_0x1c6293){this['containerView']['bodyView']['updatePartState'](_0x106254,_0x1c6293);}['updateSources'](_0x18932c){this['containerView']['updateSources'](_0x18932c);}['getPartView'](_0x4f9212){return this['containerView']['bodyView']['getPartView'](_0x4f9212);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends xr{['replyContainer'];constructor(_0x57c9fd,_0x1f7d13){super(_0x1f7d13),this['locale']=_0x57c9fd,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x492b6b(),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':Ne(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x40edd5,renderingStrategy:_0x36ba9a,abortSignal:_0x8a0909}){'streaming'===_0x36ba9a?await this['streamIntoElement'](_0x40edd5,this['replyContainer']['element'],_0x8a0909):this['replyContainer']['element']['innerHTML']=_0x20dcd7(_0x40edd5);}['updateSources'](_0xbd7816){const _0x14fb98=new yr(this['locale']);_0x14fb98['children']['addMany'](_0xbd7816['map'](_0xc477ad=>new Cr(this['locale'],_0xc477ad))),_0x14fb98['isVisible']=!0x0,this['children']['add'](_0x14fb98);}}const xn={'file':_0x241668,'document':_0x3fd5d1,'web-resource':_0x3fc296,'text':_0x241668,'selection':_0x25d747},oa='ck-ai-chat-context-chip',ca='ck-ai-chat-context-chip_wide',la='ck-ai-chat-context-chip_document',da='ck-ai-chat-context-chip__label',ua='ck-ai-chat-context-chip__type-icon',_a='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Co extends _0x21bd9e{constructor(_0x455cf4,_0x577f69,_0x1e83f8,_0x2a442f,_0x2112b4=!0x1){super(_0x455cf4),this['_isAnimationOnEnterEnabled']=_0x2a442f,this['_initializeProperties'](_0x577f69,_0x1e83f8,_0x2112b4),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'](_0x24dd48,_0x30a7bf,_0x1dc218){this['set']('label',_0x24dd48['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x24dd48['type']),this['set']('id',_0x24dd48['uiId']),this['set']('readonly',_0x30a7bf),this['set']('isLoading',_0x1dc218);}['_setupTemplate'](){const _0x144c52=this['_createIconView'](),_0x1a7a73=this['_createRemoveButton'](),_0x1d70ed=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1d70ed),'children':this['_createTemplateChildren'](_0x144c52,_0x1a7a73,_0x1d70ed)});}['_createTemplateAttributes'](_0x1b1996){return{'class':[oa,_0x1b1996['if']('itemType',la,_0x394d9e=>'document'==_0x394d9e),_0x1b1996['if']('itemType',ca,_0x1ea0c6=>'selection'==_0x1ea0c6)],'data-cke-tooltip-text':_0x1b1996['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':_a};}['_createTemplateChildren'](_0x82f7c,_0x526172,_0x145124){const _0x2fe9bc=this['_createLabelElement'](_0x145124),_0xe62c25=this['_createLoaderIcon']();return this['readonly']?[_0x82f7c,_0x2fe9bc]:[_0x82f7c,_0xe62c25,_0x2fe9bc,_0x526172];}['_createLabelElement'](_0x10b2a8){return{'tag':'span','attributes':{'class':da},'children':[{'text':_0x10b2a8['to']('label')}]};}['_createRemoveButton'](){const _0x30a701=new _0x21bd9e(this['locale']);return _0x30a701['set']({'label':y(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3a2bed}),this['_setupRemoveButtonEvent'](_0x30a701),_0x30a701;}['_setupRemoveButtonEvent'](_0x1543c7){_0x1543c7['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4f562e=this['bindTemplate'],_0x5a6277=new _0x25e498();return _0x5a6277['content']=xn[this['itemType']],_0x5a6277['extendTemplate']({'attributes':{'class':[ua,_0x4f562e['if']('isLoading','ck-hidden',_0xb273b=>_0xb273b)]}}),_0x5a6277;}['_handleAnimationEndOnce'](_0x320197,_0x44b2a1){if(!_0x320197)return;const _0x468a3c=()=>{_0x44b2a1(),_0x320197['removeEventListener']('animationend',_0x468a3c),_0x320197['removeEventListener']('webkitAnimationEnd',_0x468a3c);};_0x320197['addEventListener']('animationend',_0x468a3c),_0x320197['addEventListener']('webkitAnimationEnd',_0x468a3c);}['_createLoaderIcon'](){const _0xeb4d86=new je('small');return _0xeb4d86['bind']('isVisible')['to'](this,'isLoading',_0x3cfc6b=>_0x3cfc6b),_0xeb4d86;}}function In(_0x451dc3){if(!_0x451dc3)return _0x451dc3;if(_0x451dc3['length']<=0x78)return _0x451dc3;const _0x277748=_0x451dc3['slice'](0x0,0x78),_0x2efa4e=_0x277748['lastIndexOf']('\x20');return(_0x2efa4e>0x0?_0x277748['slice'](0x0,_0x2efa4e):_0x277748)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class mo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xe4e170,_0x5819b5,_0x4b774d,_0x57ac44,_0x24cc41){this['_locale']=_0xe4e170,this['_visibleChips']=_0x5819b5,this['_config']={...hn,..._0x4b774d,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x4b774d['cssClasses']}},this['_overflowChips']=new _0x1c36f7(),this['_bodyCollection']=_0x57ac44,this['_parentView']=_0x24cc41||null;}['setContainerElement'](_0x3c5f59){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3c5f59,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 _0x50d713=[...this['_visibleChips'],...this['_overflowChips']],_0x45b037=this['_createCalculationContainer'](),_0x34da9b=this['_calculateOverflowInContainer'](_0x45b037,_0x50d713),_0x56688b=_0x45b037['_ancestorsToRestore'];_0x56688b&&this['_restoreAncestorVisibility'](_0x56688b),_0x45b037['remove'](),this['_applyOverflowResults'](_0x50d713,_0x34da9b);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),ts({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x4d3c31=new _0x21bd9e(this['_locale']);_0x4d3c31['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x215063=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x215063['push'](this['_config']['cssClasses']['controlsButton']),_0x4d3c31['extendTemplate']({'attributes':{'class':_0x215063}}),_0x4d3c31;}['_createShowMoreBalloonPanelView'](){const _0x91419=new _0x257cec(this['_locale']);return _0x91419['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x91419),_0x91419;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x345f1c=>{_0x345f1c['disableAnimationOnEnter']();});const _0x340548=new _0x492b6b(this['_locale']);_0x340548['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x340548);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x361d5a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x361d5a?'':'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'](_0x5966ff){const _0x2b2e59=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3f6528=this['_containerElement']?.['classList'];if(_0x3f6528){const _0x2c88b6=_0x3f6528[0x0]||'',_0x34d846=_0x5966ff['querySelector']('.'+_0x2c88b6),_0x15d9c3=_0x5966ff['querySelector'](_0x2b2e59);return _0x34d846||_0x15d9c3||_0x5966ff;}return _0x5966ff['querySelector'](_0x2b2e59)||_0x5966ff;}['_calculateContainerWidth'](){const _0x24e709=this['_parentView']?.['element']||this['_containerElement'];if(!_0x24e709)return an;const _0x166ae7=window['getComputedStyle'](_0x24e709)['width'];if('auto'===_0x166ae7||'0px'===_0x166ae7||!_0x166ae7){const _0x40b175=_0x24e709['parentElement'];if(_0x40b175){const _0x30bcc0=window['getComputedStyle'](_0x40b175);return'auto'!==_0x30bcc0['width']?_0x30bcc0['width']:an;}return an;}return _0x166ae7;}['_applyCalculationStyles'](_0x4ada0a,_0x28adf9){this['_config']['cssClasses']['calculationContainer']&&_0x4ada0a['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4ada0a['style']['width']=_0x28adf9,_0x4ada0a['style']['position']='absolute',_0x4ada0a['style']['top']='-9999px',_0x4ada0a['style']['left']='-9999px',_0x4ada0a['style']['opacity']='0',_0x4ada0a['style']['pointerEvents']='none',_0x4ada0a['style']['zIndex']='-1',_0x4ada0a['style']['visibility']='visible\x20!important',_0x4ada0a['style']['display']='block\x20!important',_0x4ada0a['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4b479a){_0x4b479a['forEach'](({element:_0x67095a,originalDisplay:_0x2df555,originalVisibility:_0x56eaf3})=>{_0x67095a['style']['display']=_0x2df555,_0x67095a['style']['visibility']=_0x56eaf3;});}['_makeAncestorsVisible'](_0x4adeaa){const _0x3b11ef=[];let _0x55c3fb=_0x4adeaa;for(;_0x55c3fb&&_0x55c3fb!==document['body'];){const _0x4d1bbe=window['getComputedStyle'](_0x55c3fb);'none'!==_0x4d1bbe['display']&&'hidden'!==_0x4d1bbe['visibility']||(_0x3b11ef['push']({'element':_0x55c3fb,'originalDisplay':_0x55c3fb['style']['display'],'originalVisibility':_0x55c3fb['style']['visibility']}),_0x55c3fb['style']['display']='block',_0x55c3fb['style']['visibility']='visible'),_0x55c3fb=_0x55c3fb['parentElement'];}return _0x3b11ef;}['_createContainerElements'](){let _0x33cc06,_0x56652c;return this['_parentView']?.['element']?(_0x33cc06=this['_parentView']['element']['cloneNode'](!0x0),_0x56652c=this['_findTargetContainer'](_0x33cc06)):(_0x33cc06=document['createElement']('div'),_0x56652c=_0x33cc06),{'calculationContainer':_0x33cc06,'targetContainer':_0x56652c};}['_createCalculationContainer'](){const {calculationContainer:_0x4edcce,targetContainer:_0x213877}=this['_createContainerElements'](),_0x116267=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4edcce,_0x116267);const _0x4566d8=this['_parentView']?.['element']||this['_containerElement'],_0x31ac38=_0x4566d8?.['parentElement'];_0x31ac38?_0x31ac38['appendChild'](_0x4edcce):document['body']['appendChild'](_0x4edcce),_0x4edcce['_targetContainer']=_0x213877;const _0x51cdb8=this['_makeAncestorsVisible'](_0x31ac38||null);return _0x4edcce['offsetWidth'],_0x4edcce['_ancestorsToRestore']=_0x51cdb8,_0x4edcce;}['_calculateOverflowInContainer'](_0x18231b,_0x83c957){const _0x32cdb6=_0x18231b['_targetContainer']||_0x18231b,_0x10a860=[],{rowCount:_0x296516}=this['_renderChipsAndCountRows'](_0x32cdb6,_0x83c957);if(_0x296516<=this['_config']['maxVisibleRows'])return _0x10a860;const _0x466dc2=_0x83c957['slice']();for(;_0x466dc2['length']>0x0;){if(this['_testButtonFit'](_0x18231b,_0x32cdb6,_0x466dc2)){const _0x32fb43=_0x83c957['filter'](_0x17984=>!_0x466dc2['includes'](_0x17984));_0x10a860['push'](..._0x32fb43);break;}if(!_0x466dc2['pop']())break;}return _0x10a860;}['_renderChipsAndCountRows'](_0x2fda4a,_0x44476c){_0x2fda4a['innerHTML']='',_0x44476c['forEach'](_0xa14a3=>{if(_0xa14a3['element']){const _0x4af440=_0xa14a3['element']['cloneNode'](!0x0);_0x2fda4a['appendChild'](_0x4af440);}}),_0x2fda4a['offsetWidth'];const _0x386474=_0x2fda4a['children'],_0x2b5a1a=[];return Array['from'](_0x386474)['forEach'](_0x538044=>{const _0x15bd5a=_0x538044['getBoundingClientRect']()['top'];_0x2b5a1a['some'](_0x567b32=>Math['abs'](_0x567b32-_0x15bd5a)<this['_config']['rowDetectionTolerance'])||_0x2b5a1a['push'](_0x15bd5a);}),{'rowCount':_0x2b5a1a['length']};}['_createMockButton'](){const _0x30c472=document['createElement']('button');return _0x30c472['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x30c472['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x30c472['textContent']='+\x201',_0x30c472;}['_testButtonFit'](_0x40c5e0,_0x33f5ab,_0x22e179){this['_renderChipsAndCountRows'](_0x33f5ab,_0x22e179);const _0x11b859=this['_createMockButton']();_0x40c5e0['appendChild'](_0x11b859),_0x40c5e0['offsetWidth'];const _0x822efb=[..._0x33f5ab['children'],_0x11b859],_0x22697e=[];_0x822efb['forEach'](_0x2250cd=>{const _0x2dd55c=_0x2250cd['getBoundingClientRect']()['top'];_0x22697e['some'](_0x2483e1=>Math['abs'](_0x2483e1-_0x2dd55c)<this['_config']['rowDetectionTolerance'])||_0x22697e['push'](_0x2dd55c);});const _0x4550cb=_0x22697e['length'];return _0x11b859['remove'](),_0x4550cb<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x12af3e,_0xa55f31){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x12af3e['forEach'](_0x467dab=>{_0xa55f31['includes'](_0x467dab)?this['_overflowChips']['add'](_0x467dab):this['_visibleChips']['add'](_0x467dab);});}['_updateOverflowUI'](_0x28eedf){if(_0x28eedf>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x28eedf>0x0&&this['_showMoreButtonView']){const _0x200aa1=''+this['_config']['showMoreLabelPrefix']+(_0x28eedf<0x63?_0x28eedf:'99');this['_showMoreButtonView']['label']=_0x200aa1;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x2b1e4a,_0x4fea4c){this['_distributeChips'](_0x2b1e4a,_0x4fea4c),this['_updateOverflowUI'](_0x4fea4c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x3e4015=>{_0x3e4015[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 _0x342e0a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x342e0a['width']||0x0===_0x342e0a['height'])return!0x1;const _0x143b2a=window['innerHeight']||document['documentElement']['clientHeight'],_0x2389cd=window['innerWidth']||document['documentElement']['clientWidth'],_0x3fad77=0xc8;return _0x342e0a['bottom']>=-0xc8&&_0x342e0a['top']<=_0x143b2a+_0x3fad77&&_0x342e0a['right']>=-0xc8&&_0x342e0a['left']<=_0x2389cd+_0x3fad77;}}const Ia='ck-ai-chat__feed__context-chips',Aa='ck-ai-chat-context-chips-wrapper',ga='ck-ai-chat-context-chips-wrapper-balloon',Ea='ck-ai-chat-controls-button',ma='ck-ai-chat-controls_context_show-more-button',pa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x492b6b{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x12413a,_0x3f4b3a,_0x5b1b1b){super(_0x12413a),this['_bodyCollection']=_0x5b1b1b,this['_createContextChips'](_0x3f4b3a);const _0x3031ba={'cssClasses':{'showMoreButton':ma,'showMoreBalloon':pa,'overflowContainer':ga,'controlsButton':Ea}};this['_overflowManager']=new mo(_0x12413a,this['_contextChips'],_0x3031ba,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ia,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Aa},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3c0b82=this['element']['querySelector']('.'+Aa);_0x3c0b82&&(this['_overflowManager']['setContainerElement'](_0x3c0b82),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x478e8){for(const _0x3fe2f9 of _0x478e8){const _0xdb8ef6=new Co(this['locale'],_0x3fe2f9,!0x0,!0x1);this['_contextChips']['add'](_0xdb8ef6);}}}class ve extends xr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2d9c41,_0x85f6de,_0x274777){super(_0x85f6de),this['_locale']=_0x2d9c41,this['_bodyCollection']=_0x274777,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'](_0x50ca7e=>!_0x50ca7e['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x492b6b(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class rt extends xr{['capabilities'];constructor(_0x5dea46,_0xd65f78){super(_0xd65f78);const {isWebSearchEnabled:_0x269052,isReasoningEnabled:_0x550549}=_0xd65f78['capabilities'],_0x2cbe0a=[];let _0xac84b8='';_0x269052&&_0x550549?(_0xac84b8=y(_0x5dea46,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x2cbe0a['push'](aa(_0x4f04ad)),_0x2cbe0a['push'](aa(_0x4bb0b4))):_0x269052?(_0xac84b8=y(_0x5dea46,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x2cbe0a['push'](aa(_0x4f04ad))):_0x550549&&(_0xac84b8=y(_0x5dea46,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x2cbe0a['push'](aa(_0x4bb0b4))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0xac84b8?'':'ck-hidden']}});const _0x2c2122=new _0x492b6b();_0x2c2122['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x2cbe0a,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0xac84b8]}]}),this['children']['add'](_0x2c2122),this['capabilities']=_0xd65f78['capabilities'];}}function aa(_0x4454fb){const _0x53ef78=new _0x25e498();return _0x53ef78['content']=_0x4454fb,_0x53ef78;}class _e extends _0x492b6b{constructor(_0x3b0ec7,_0x1615cc){super(_0x3b0ec7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1615cc)});}['_createSkeletonItems'](_0x45fb45){const _0x18d836=['ck','ck-ai-skeleton__item'];return _0x45fb45['map'](_0x45de46=>{let _0x1ece3a='';switch(_0x45de46['attributes']['align']){case'right':_0x1ece3a='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1ece3a='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1ece3a='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x45de46['tag'],'attributes':{'class':[..._0x18d836,_0x45de46['attributes']['class']?_0x45de46['attributes']['class']:''],'style':'width:\x20'+_0x45de46['attributes']['width']+';\x20height:\x20'+_0x45de46['attributes']['height']+';'+_0x1ece3a}};});}}const be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x5c9dcc,_0x213942,_0xb1cf67,_0x33e0f6){return new Array(_0x5c9dcc)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x213942,'height':_0xb1cf67,'align':_0x33e0f6}}));}class Bi extends _0x492b6b{['children'];['scrollManager'];['_bodyCollection'];constructor(_0xe81c7c,_0x31be9c){super(_0xe81c7c),this['_bodyCollection']=_0x31be9c,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ht)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jt(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x427e31,_0x342e69){let _0x1557c3;'ai-reply'===_0x427e31?_0x1557c3=new Se(this['locale'],_0x342e69):'ai-suggestion-reply'===_0x427e31?(_0x1557c3=new ke(this['locale'],_0x342e69),_0x1557c3['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x1557c3='user-message'===_0x427e31?new ve(this['locale'],_0x342e69,this['_bodyCollection']):'interaction-header'===_0x427e31?new rt(this['locale'],_0x342e69):new ye(_0x342e69),this['children']['add'](_0x1557c3);}async['updateReplyItem']({id:_0x1288d4,parsedContent:_0x10f359,renderingStrategy:_0x4a5701,abortSignal:_0x170302}){const _0x593567=this['getItemById'](_0x1288d4);if(!(_0x593567 instanceof Se))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x593567,'id':_0x1288d4,'parsedContent':_0x10f359});await _0x593567['updateContent']({'parsedContent':_0x10f359,'renderingStrategy':_0x4a5701,'abortSignal':_0x170302});}async['updateWebSources'](_0x3d0d54,_0x5a4ca3){const _0x2a66a2=this['getItemById'](_0x3d0d54);if(_0x2a66a2 instanceof ke)_0x2a66a2['updateSources'](_0x5a4ca3);else{if(!(_0x2a66a2 instanceof Se))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2a66a2,'id':_0x3d0d54,'sources':_0x5a4ca3});_0x2a66a2['updateSources'](_0x5a4ca3);}}async['updateSuggestionItem']({id:_0x10a209,parts:_0x4d8bcb,renderingStrategy:_0x5378ce,abortSignal:_0x15ea72}){const _0x36fd02=this['getItemById'](_0x10a209);if(!(_0x36fd02 instanceof ke))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x36fd02,'id':_0x10a209,'parts':_0x4d8bcb});await _0x36fd02['updateContent']({'parts':_0x4d8bcb,'renderingStrategy':_0x5378ce,'abortSignal':_0x15ea72});}['updateSuggestionPartState']({id:_0x1458cf,index:_0x2b6fe6,state:_0x94982f}){const _0x42b799=this['getItemById'](_0x1458cf);if(!(_0x42b799 instanceof ke))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1458cf});_0x42b799['updatePartState'](_0x2b6fe6,_0x94982f);}['markItemAsDone'](_0x520c34){this['getItemById'](_0x520c34)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1bdf35=>_0x1bdf35['options']['id']);}['removeItem'](_0x251340){this['children']['remove'](this['getItemById'](_0x251340));}['scrollToSuggestion'](_0x4412f7,_0x45b152){const _0x3abc49=this['getItemById'](_0x4412f7);if(!(_0x3abc49 instanceof ke))return void _0xe189d1('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4412f7,'partIndex':_0x45b152});const _0x387fcc=_0x3abc49['getPartView'](_0x45b152);_0x387fcc?_0x414134({'target':_0x387fcc['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0xe189d1('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4412f7,'partIndex':_0x45b152});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2e8be1=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2e8be1,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x36aeed=new _e(this['locale'],be['aiFeed']);return _0x36aeed['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2d161f=>!_0x2d161f)]}}),_0x36aeed;}['_createFeedItems'](){const _0x379bcb=new _0x492b6b(this['locale']);return _0x379bcb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x379bcb;}['_createFeedLoader'](){const _0x45f568=new _0x492b6b(this['locale']);return _0x45f568['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x520dbb=>!_0x520dbb)]},'children':this['_createLoaderChildren']()}),_0x45f568;}['_createLoaderChildren'](){const _0x1f4e14=new je();return _0x1f4e14['isVisible']=!0x0,[_0x1f4e14,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4669f5){const _0x40f9ab=this['children']['find'](_0x3d333c=>_0x3d333c['options']['id']['includes'](_0x4669f5));if(!_0x40f9ab)throw new _0x19ee7d('ai-chat-feed-view-item-not-found',this,{'id':_0x4669f5});return _0x40f9ab;}['setLoadingMessage'](_0x527677){this['set']('loadingMessage',_0x527677);}['toggleLoadingSkeleton'](_0xb5a46f){this['set']('isLoadingSkeletonVisible',_0xb5a46f);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x24784f{['filter'](){let _0x52a650=0x0;for(const _0x57a9e1 of this['items'])_0x52a650+=_0x57a9e1['items']['length'];return{'resultsCount':_0x52a650,'totalItemsCount':_0x52a650};}}class es extends _0x143cba{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4a1719,_0x381f28){super(_0x4a1719,{'queryView':{'label':'','creator':_0x1eaf41,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x4a1719),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x381f28,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=es['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=es['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',(_0x213c99,_0x118b49)=>!_0x213c99&&!_0x118b49),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3dd8f6,_0x67ce46)=>{this['isUploadInProgress']||this['isEmpty']||_0x3dd8f6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x67ce46());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x20786f=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x20786f)return this['queryView']['errorText']=y(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2e8c8c=Zt(_0x20786f);this['fire']('sendUserMessage',_0x2e8c8c),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x292bb1){this['queryView']['fieldView']['set']('placeholder',_0x292bb1);}['_createSubmitButton'](){const _0x257e9d=new _0x21bd9e(this['locale']);return _0x257e9d['set']({'icon':_0x47a449,'label':y(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x257e9d['on']('execute',()=>{this['submit']();}),_0x257e9d;}['setIsUploadInProgress'](_0x2d0c16){this['isUploadInProgress']=_0x2d0c16;}['_setUpAddContextButtonPositioning'](){const _0x34185b=this['locale'],_0x20e691=()=>{_0x384749['window']['requestAnimationFrame'](()=>{if(_0x1ec9b5(this['element'])){const _0x43395d=new _0x1ba12e(this['queryView']['fieldView']['element']),_0x3f60a7=new _0x1ba12e(this['_addContextButtonView']['element']),_0x2d7037=_0x43395d['width'],_0x406856='rtl'===_0x34185b['uiLanguageDirection']?'right':'left';_0x43395d['excludeScrollbarsAndBorders']();const _0x41ce96=_0x2d7037-_0x43395d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x406856]='calc('+(_0x2d7037-_0x3f60a7['width']-_0x41ce96)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x20e691),this['on']('render',()=>{_0x20e691(),this['_queryViewResizeObserver']=new _0x488e19(this['queryView']['fieldView']['element'],()=>{_0x20e691();});});}}const Ta='ck-ai-chat__prompt-capabilities',Ca='ck-ai-chat-controls-button',wa='ck-ai-chat-controls-button--commands',fa='ck-ai-chat-controls__model-selection',Sa='ck-ai-chat-controls__model-selection__item-name',Oa='ck-ai-chat-controls__model-selection__item-description',ba='ck-ai-chat-controls__model-selection__item-capabilities',Ra='n';class is extends _0x492b6b{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x453e9f){super(_0x453e9f),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x28b6d8=>_0x28b6d8),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x1d1b8a=>_0x1d1b8a?this['_modelSelectionDropdown']['buttonView']['label']:y(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xc8a671=>_0xc8a671),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0xa6b247=>_0xa6b247),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x206a73=>!_0x206a73),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x5d88e9=>y(this['locale'],_0x5d88e9?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x24c0a0=>_0x24c0a0),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x3150d2=>!_0x3150d2),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x18bf29=>y(this['locale'],_0x18bf29?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ta]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x1c36f7(),_0x1cd684(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3dfe3f,_0x5d29b4){if(this['set']('modelSelectorVisible',!(_0x5d29b4&&_0x3dfe3f['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x3dfe3f?.['length']){const _0x4f9fc2=Mt['getLocalized'](this['locale'],_0x3dfe3f);for(const _0x59a4d2 of _0x4f9fc2){const _0x4c6da5=new _0x1bf3fd({'label':_0x59a4d2['name'],'withText':!0x0,'role':'menuitemradio','id':_0x59a4d2['id'],'model':_0x59a4d2});_0x4c6da5['bind']('isOn')['to'](this,'activeModelId',_0x412b29=>_0x412b29===_0x59a4d2['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4c6da5,'labelView':new Na(this['locale'],_0x59a4d2)});}}}['setWebSearch'](_0x425a73){this['set']('webSearchActive',_0x425a73);}['setReasoning'](_0x5ce4e4){this['set']('reasoningActive',_0x5ce4e4);}['setModel'](_0xa8974e){if(!_0xa8974e)return;this['activeModelId']=_0xa8974e['id'],this['activeModelName']=_0xa8974e['name']||_0xa8974e['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0xa8974e['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0xa8974e['name']);const _0x38f10d=_0xa8974e['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x38f10d),this['_webSearchButton']['set']('isVisible',_0x38f10d);const _0x158762=_0xa8974e['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x158762),this['_reasoningButton']['set']('isVisible',_0x158762);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x443c24){this['set']('modelSelectorEnabled',!0x1),_0x443c24&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x393381=new _0x21bd9e();return _0x393381['set']({'label':y(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4f04ad,'class':Ca,'isToggleable':!0x0,'tooltipPosition':Ra}),_0x393381['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x393381;}['_createReasoningButton'](){const _0x3a704d=new _0x21bd9e();return _0x3a704d['set']({'label':y(this['locale'],'AI_CHAT_REASONING'),'icon':_0x4bb0b4,'class':Ca,'isToggleable':!0x0,'tooltipPosition':Ra}),_0x3a704d['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x3a704d;}['_createCommandsButton'](){const _0x252da3=new _0x21bd9e();return _0x252da3['set']({'label':y(this['locale'],'AI_CHAT_COMMANDS'),'icon':et,'withText':!0x0,'class':Ca,'isToggleable':!0x0,'tooltip':y(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ra}),_0x252da3['extendTemplate']({'attributes':{'class':[wa]}}),_0x252da3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x252da3;}['_createModelSelectionDropdown'](){const _0x8da767=_0x35c3bd(this['locale']);return _0x8da767['set']({'panelPosition':'ne','class':[fa]}),_0x8da767['buttonView']['set']({'label':y(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ra}),this['listenTo'](_0x8da767,'execute',_0x48efd8=>{this['fire']('selectModel',_0x48efd8['source']['model']);}),_0x8da767;}['_createModelNameView'](){const _0x25461a=new jo(this['locale']);return _0x25461a['bind']('text')['to'](this,'activeModelName',_0x224ae4=>_0x224ae4??''),_0x25461a['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x246f58,_0x3584de)=>!_0x246f58&&!_0x3584de?.['toLowerCase']()['startsWith']('agent')),_0x25461a;}}let Na=class extends _0xb0531d{constructor(_0x420cc7,_0x2151fa){super();const _0x4423ca=this['bindTemplate'],_0xe97ff=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4423ca['to']('style'),'id':_0x4423ca['to']('id')},'children':[{'tag':'div','attributes':{'class':[Sa]},'children':[{'text':_0x4423ca['to']('text')}]},{'tag':'div','attributes':{'class':[Oa]},'children':[{'tag':'span','children':[{'text':_0x2151fa['description']}]}]},{'tag':'div','attributes':{'class':[ba]},'children':_0xe97ff}]}),_0xe97ff['addMany'](this['_getCapabilityParts'](_0x420cc7,_0x4f04ad,'AI_CHAT_SEARCH_WEB',_0x2151fa['capabilities']['webSearch']?.['enabled']??!0x1)),_0xe97ff['addMany'](this['_getCapabilityParts'](_0x420cc7,_0x4bb0b4,'AI_CHAT_REASONING',_0x2151fa['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x5a2e3a,_0x329d25,_0x38cf87,_0x122117){const _0x111a5d=new _0x25e498();_0x111a5d['content']=_0x329d25;const _0x822a4=new _0x492b6b(_0x5a2e3a);_0x822a4['setTemplate']({'tag':'span','children':[{'text':y(_0x5a2e3a,_0x38cf87)+':\x20'}]});const _0x228f0f=new _0x492b6b(_0x5a2e3a);return _0x228f0f['setTemplate']({'tag':'span','children':[{'text':y(_0x5a2e3a,_0x122117?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x111a5d,_0x822a4,_0x228f0f];}};class jo extends _0x492b6b{constructor(_0x5c8dbb){super(_0x5c8dbb),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x23ff46=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x23ff46['if']('isVisible','ck-hidden',_0x271d3a=>!_0x271d3a)]},'children':[{'text':_0x23ff46['to']('text')}]});}}const ka='ck-ai-chat-context-controls__url-form',ya='ck-ai-chat-context-controls__url-input-section';class xo extends _0x492b6b{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x227884){super(_0x227884),this['focusTracker']=new Bt(),this['keystrokes']=new Wt(),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 Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x349705=>{this['focusTracker']['add'](_0x349705['element']),this['keystrokes']['listenTo'](_0x349705['element']);}),_0x7b6908({'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'](_0x1ce63c){this['urlInputField']['errorText']=_0x1ce63c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x1ccf4a=new _0x21bd9e(this['locale']);return _0x1ccf4a['set']({'icon':_0x48be9f,'tooltip':y(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x1ccf4a;}['_createUrlInputField'](){const _0x35876f=new _0x94787a(this['locale'],_0x52c7a3);return _0x35876f['set']({'label':y(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x35876f['fieldView']['set']({'placeholder':y(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x35876f;}['_createConfirmButton'](){const _0x1f1ed6=new _0x21bd9e(this['locale']);return _0x1f1ed6['set']({'icon':_0x347166,'tooltip':y(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1f1ed6;}['_setupTemplate'](){const _0x4cc37c=new _0x5e5898(this['locale'],{'label':y(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x4cc37c['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ka,'tabindex':'-1'},'children':[_0x4cc37c,{'tag':'div','attributes':{'class':ya},'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',_0x1db405=>{_0x1db405['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x39eeb9,_0xc850f0)=>{this['clear'](),this['fire']('cancel'),_0xc850f0();});}['_handleSubmit'](){const _0x149ed7=this['getValue']()['trim']();_0x149ed7?this['_isValidUrl'](_0x149ed7)?(this['clearError'](),this['fire']('submitUrl',_0x149ed7)):this['setError'](y(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](y(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x17dc54=this['getValue']()['trim'](),_0xfc13f7=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x17dc54['length']>0x0&&!_0xfc13f7;}['_isValidUrl'](_0x2a9836){try{return!!new URL(_0x2a9836);}catch{return!0x1;}}}const va='ck-ai-chat-resources__item',xa='ck-ai-chat-resources__item--in-context',La='ck-ai-chat-resources__item-title',Da='ck-ai-chat-resources__item__icon';class Xo extends _0x8a8c30{['resource'];['_titleView'];['_iconView'];constructor(_0x4207d4,_0x1c7b81){super(_0x4207d4),this['resource']=_0x1c7b81,this['set']('isInContext',!!_0x1c7b81['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x59827b){if(_0x59827b['isInContext'])return _0x347166;switch(_0x59827b['type']){case Ft['DOCUMENT']:return _0x3fd5d1;case Ft['URL']:return _0x3fc296;case Ft['FILE']:case Ft['TEXT']:return _0x241668;default:return _0x169e77;}}['highlightText'](_0x1123dc){if(!_0x1123dc||''===_0x1123dc['trim']())return void this['_titleView']['highlightText'](null);const _0x8e776d=new RegExp(_0xfb43f9(_0x1123dc),'gi');this['_titleView']['highlightText'](_0x8e776d);}['updateResourceState'](_0x17b676){this['resource']['isInContext']=_0x17b676,this['isInContext']=_0x17b676,this['_updateIcon']();}['_createTitleView'](){const _0x4f282d=new _0x1f83e8();return _0x4f282d['text']=this['resource']['label'],_0x4f282d['extendTemplate']({'tag':'span','attributes':{'class':[La]}}),_0x4f282d;}['_createIconView'](){const _0x292993=new _0x25e498();return _0x292993['content']=this['getResourceIcon'](this['resource']),_0x292993;}['_setupTemplate'](){const _0x135e6f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[va,_0x135e6f['if']('isVisible','ck-hidden',_0x104c6a=>!_0x104c6a),_0x135e6f['if']('isInContext',xa)]},'children':[{'tag':'div','attributes':{'class':[Da]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x135e6f['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Pa='ck-ai-chat-resources__list';class Ur extends _0x24784f{['_source'];constructor(_0x4bbb8c,_0x3a9073){super(_0x4bbb8c),this['_source']=_0x3a9073,this['extendTemplate']({'attributes':{'class':[Pa]}});}['setResources'](_0x28201a,_0x369eea){this['items']['clear']();let _0xb83dee=_0x28201a;if(this['_source']['useDefaultFiltering']&&_0x369eea&&''!==_0x369eea['trim']()){const _0x4174ed=new RegExp(_0x369eea['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0xb83dee=_0x28201a['filter'](_0x2edca1=>_0x4174ed['test'](_0x2edca1['label']));}for(const _0x65cfee of _0xb83dee){const _0x3ff9d7=new Xo(this['locale'],_0x65cfee);_0x3ff9d7['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x65cfee);}),this['items']['add'](_0x3ff9d7);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x369eea);}['highlightText'](_0x569c5a){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x311ece=>{_0x311ece['highlightText'](_0x569c5a);});}['updateResourceState'](_0x562de9,_0x489c62){for(const _0x3cad38 of this['items']){const _0x511144=_0x3cad38;_0x511144['resource']['id']===_0x562de9&&_0x511144['updateResourceState'](_0x489c62);}}['_handleResourceSelection'](_0x3a2e4b,_0x402f09){this['fire']('addResourceToContext',{'source':_0x3a2e4b,'resource':_0x402f09});}}class zr extends _0x94787a{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x514609){const t=_0x514609['t'],_0x47cc0b={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x52c7a3,'label':y(_0x514609,'AI_CHAT_SEARCH_RESOURCES')};super(_0x514609,_0x47cc0b['creator']),this['label']=_0x47cc0b['label'],this['_viewConfig']=_0x47cc0b,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x514609,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3b242b){this['fire']('search',_0x3b242b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x25e498(),this['iconView']['content']=_0x23aea4,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x6921a1,t){this['resetButtonView']=new _0x21bd9e(_0x6921a1),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2c2a0c,'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',_0x3af894=>!_0x3af894),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 Xr extends _0x492b6b{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xd86e86,_0x33cedb){super(_0xd86e86),this['_source']=_0x33cedb['source'],this['_searchInputVisibleFrom']=_0x33cedb['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 _0x2b3021([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x12aa14=new _0x492b6b(this['locale']);return _0x12aa14['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x295e8e,_0x2ce2f3)=>{this['loadResources'](_0x2ce2f3),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2ce2f3);}),_0x12aa14;}['_createResourcesListView'](){const _0x19c54c=new Ur(this['locale'],this['_source']);return _0x19c54c['delegate']('addResourceToContext')['to'](this),_0x19c54c['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x19c54c;}['_createSkeletonView'](){const _0x4973de=new _e(this['locale'],be['aiChatResources']);return _0x4973de['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xed65a5=>!_0xed65a5)]}}),_0x4973de;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x11a14e){const _0x3387da=_0x3bb1ce();this['_latestLoadResourcesUid']=_0x3387da,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x11a14e,'uid':_0x3387da}),this['isLoading']=!0x0;}['setResources'](_0x26d927,_0x2418f5){if(_0x2418f5&&_0x2418f5!==this['_latestLoadResourcesUid'])return;const _0x4d5ad8=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x26d927,_0x4d5ad8),_0x26d927['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x23a416,_0x12999f){this['_resourcesListView']['updateResourceState'](_0x23a416,_0x12999f);}}const Ha='ck-ai-chat-context-controls__source-balloon-panel',Ma='ck-button-icon\x20ck-button-back',Ua='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class wo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x410f5e,_0x2c233c,_0x327b9d){this['_locale']=_0x410f5e,this['_bodyCollection']=_0x2c233c,this['_config']=_0x327b9d;}['showSourceResourcesBalloon'](_0x5a4641){let _0x12fd0a=this['_sourceResourceBalloons']['get'](_0x5a4641['id']);_0x12fd0a||(_0x12fd0a=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5a4641['id'],_0x12fd0a),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x12fd0a)),this['_addSourceResourceContent'](_0x12fd0a,_0x5a4641),_0x12fd0a['show']();const _0x3818ba=this['_config']['getTargetElement']();_0x3818ba&&_0x12fd0a['pin']({'target':_0x3818ba,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0xdf965e,_0x473639,_0x2092f6){const _0x11a93d=this['_sourceResourceBalloons']['get'](_0xdf965e);if(!_0x11a93d)return;const _0x1eb6b0=this['_getResourcesViewFromBalloon'](_0x11a93d);_0x1eb6b0&&(_0x1eb6b0['setResources'](_0x473639,_0x2092f6),_0x1eb6b0['once']('change:isLoading',()=>{_0x11a93d['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x33a783){const _0x5adcc5=this['_sourceResourceBalloons']['get'](_0x33a783);_0x5adcc5&&requestAnimationFrame(()=>{_0x5adcc5['hide'](),this['_sourceResourceBalloons']['delete'](_0x33a783),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x45614e of this['_sourceResourceBalloons']['values']())if(_0x45614e['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4437a6,_0x466214,_0x2318c4){const _0x1f542c=this['_sourceResourceBalloons']['get'](_0x4437a6);if(!_0x1f542c||!_0x1f542c['isVisible'])return;const _0x188489=this['_config']['getTargetElement']();if(!_0x188489)return;_0x1f542c['pin']({'target':_0x188489,'limiter':this['_config']['getLimiterElement']()});const _0x578884=this['_getResourcesViewFromBalloon'](_0x1f542c);_0x578884&&_0x578884['updateResourceState'](_0x466214,_0x2318c4);}['destroy'](){for(const _0x2a3eb3 of this['_sourceResourceBalloons']['values']())_0x2a3eb3['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x19c5d7=new _0x257cec(this['_locale']);return _0x19c5d7['extendTemplate']({'attributes':{'class':Ha}}),this['_bodyCollection']['add'](_0x19c5d7),_0x19c5d7;}['_addSourceResourceContent'](_0x9959,_0x289e8c){_0x9959['content']['clear']();const _0x9d51d2=this['_createBalloonHeader'](_0x9959,_0x289e8c);_0x9959['content']['add'](_0x9d51d2);const _0x1bf795=this['_createBalloonResourcesView'](_0x289e8c);_0x9959['content']['add'](_0x1bf795);}['_createBalloonHeader'](_0x5ee5e0,_0x3d5c45){const _0x5c1652=this['_createBackButton'](_0x5ee5e0),_0x4c3ddf=new _0x5e5898(this['_locale'],{'label':_0x3d5c45['label'],'class':Ua});return _0x4c3ddf['children']['add'](_0x5c1652,0x0),_0x4c3ddf;}['_createBackButton'](_0x1dffff){const _0x333ead=new _0x21bd9e(this['_locale']);return _0x333ead['set']({'icon':_0x48be9f,'tooltip':y(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ma}),_0x333ead['on']('execute',()=>{_0x1dffff['hide'](),this['_config']['onBackToContext']();}),_0x333ead;}['_createBalloonResourcesView'](_0x2507f1){const _0x246935=new Xr(this['_locale'],{'source':_0x2507f1,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x246935['on']('loadSourceResources',(_0xb3149b,_0x1f630d)=>{this['_config']['onLoadSourceResources'](_0x1f630d);}),_0x246935['on']('addResourceToContext',(_0x37f869,_0x1a8f47)=>{this['_config']['onResourceSelected'](_0x1a8f47['source'],_0x1a8f47['resource']),this['closeSourceResourceBalloon'](_0x2507f1['id']);}),_0x246935;}['_getResourcesViewFromBalloon'](_0x370a3d){const _0x5de881=_0x370a3d['content']['get'](0x1);return _0x5de881 instanceof Xr?_0x5de881:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4a1232){ts({'emitter':_0x4a1232,'contextElements':[_0x4a1232['element']],'callback':()=>{_0x4a1232['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4a1232['isVisible']});}}const as=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],po='ck-ai-chat-context-controls',Bo='ck-ai-chat-context-controls__pending-contexts',bo='ck-ai-chat-context-controls__add-context-balloon-panel',To='ck-ai-chat-context-controls__add-context-button',Ao='ck-ai-chat-context-controls__url-balloon-panel',ko='ck-ai-chat-context-controls__balloon-button',Eo='ck-ai-chat-context-controls__balloon-button-source',vo='ck-ai-chat-controls-button',Vo='ck-ai-chat-context-chips-wrapper-balloon',fo='ck-ai-chat-controls_context_show-more-button',Io='ck-ai-chat-context-controls__show-more-balloon-panel',Po='ck-ai-chat',Ro=[_0x257cec['defaultPositions']['northArrowSouthWest'],_0x257cec['defaultPositions']['northArrowSouth'],_0x257cec['defaultPositions']['northArrowSouthEast'],_0x257cec['defaultPositions']['southArrowNorthWest'],_0x257cec['defaultPositions']['southArrowNorth'],_0x257cec['defaultPositions']['southArrowNorthEast']];class os extends _0x492b6b{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x18b164,_0x42e9e0){super(_0x18b164),this['bodyCollection']=_0x42e9e0['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x18b164),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x18b164),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x18b164),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x18b164,_0x42e9e0);const _0x3cea03={'cssClasses':{'showMoreButton':fo,'showMoreBalloon':Io,'overflowContainer':Vo,'controlsButton':vo}};this['_overflowManager']=new mo(_0x18b164,this['_currentContextsChips'],_0x3cea03,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'](_0x4cb7f8,_0x1ae2ba){const _0x168d35=this['_createContextButton'](_0x4cb7f8,'current',!0x0,_0x1ae2ba);this['_addContextToCollection'](_0x168d35,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3bcb24){this['_removeContextFromCollection'](_0x3bcb24,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3bcb24,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x264f1f,_0x432e37){let _0x2ac321=this['_currentContextsChips']['find'](_0x107803=>_0x107803['id']===_0x264f1f);_0x2ac321||(_0x2ac321=this['_overflowManager']['overflowChips']['find'](_0xa54764=>_0xa54764['id']===_0x264f1f)),_0x2ac321&&(_0x2ac321['isLoading']=_0x432e37);}['setConversationContext'](_0xc26d4e){this['_conversationContextsChips']['clear']();for(const _0x4d1f30 of _0xc26d4e){const _0x511918=this['_createContextButton'](_0x4d1f30,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x511918,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x24de6b,_0x17f840,_0x4a34ae){this['_resourcesBalloonView']['updateResourceState'](_0x24de6b,_0x17f840,_0x4a34ae);}['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'](_0x564aa9){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x564aa9),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xce5574,_0xa774d9,_0x34a04c,_0x561ff3){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xce5574,_0x34a04c,_0x561ff3);}['closeSourceResourceBalloon'](_0x368c3a){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x368c3a),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xc56daa){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xc56daa),this['_setAddContextButtonEnabled'](_0xc56daa);}['_setAddContextButtonEnabled'](_0x4669fa){const _0x335e49=!_0x4669fa['document']['isHidden']&&_0x4669fa['document']['enabled'],_0x3e092b=_0x4669fa['urls']['enabled'],_0x278311=_0x4669fa['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x335e49||_0x3e092b||_0x278311;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[po,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x435c90){const _0x10df98=new _0x21bd9e(_0x435c90);return _0x10df98['set']({'label':y(_0x435c90,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':vo+'\x20'+To,'icon':_0x4d54fb,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x10df98;}['_createAddContextBalloonPanelView'](_0x3e2859){return this['_createBaseBalloonPanel'](_0x3e2859,bo);}['_createUrlBalloonPanelView'](_0x1d388a){const _0x2160e2=this['_createBaseBalloonPanel'](_0x1d388a,Ao);return this['_addUrlContent'](_0x2160e2,_0x1d388a),_0x2160e2;}['_createResourcesBalloonView'](_0x18753e,_0x32b50c){const _0x6877a2={'searchInputVisibleFrom':_0x32b50c['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});},'onResourceSelected':(_0xca2890,_0x2fef70)=>{this['fire']('addResourceToContext',{'source':_0xca2890,'resource':_0x2fef70});},'onLoadSourceResources':_0x4efaf1=>{this['fire']('loadSourceResources',_0x4efaf1);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new wo(_0x18753e,_0x32b50c['bodyCollection'],_0x6877a2);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Po)||document['body'];}['_createBaseBalloonPanel'](_0x2358aa,_0x1a2401){const _0x12a2c9=new _0x257cec(_0x2358aa);return _0x12a2c9['extendTemplate']({'attributes':{'class':_0x1a2401}}),this['bodyCollection']['add'](_0x12a2c9),_0x12a2c9;}['_setBalloonPanelContent'](_0x1d5173,_0x2502c0,_0x50f944){if(_0x1d5173['content']['clear'](),!_0x50f944['document']['isHidden']&&_0x50f944['document']['enabled']){const _0x3c9e6c=this['_createBalloonButton'](_0x2502c0,{'label':y(_0x2502c0,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3fd5d1});_0x3c9e6c['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1d5173['content']['add'](_0x3c9e6c);}if(_0x50f944['urls']['enabled']){const _0x5ee85e=this['_createBalloonButton'](_0x2502c0,{'label':y(_0x2502c0,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3fc296});_0x5ee85e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}),this['_urlInputView']['focus']();}),_0x1d5173['content']['add'](_0x5ee85e);}if(_0x50f944['files']['enabled']){const _0x44fd82=new _0x45b20c(_0x2502c0);_0x44fd82['set']({'label':y(_0x2502c0,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x257af9,'withText':!0x0,'tooltip':!0x0,'class':ko,'allowMultipleFiles':!0x0}),_0x44fd82['on']('done',(_0xce940d,_0x44b6c2)=>{this['fire']('addFileToContext',_0x44b6c2),this['hideAddContextBalloonPanel']();}),_0x44fd82['tooltip']=!0x0,_0x1d5173['content']['add'](_0x44fd82);}for(const _0x1ba7d1 of _0x50f944['sources']){const _0x4af988=this['_createBalloonButton'](_0x2502c0,{'label':_0x1ba7d1['label'],'icon':_0x1ba7d1['icon']||_0x169e77,'type':'source'});_0x1d5173['content']['add'](_0x4af988),_0x4af988['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x1ba7d1);});}}['_addUrlContent'](_0x4d3942,_0x3a596f){this['_urlInputView']=new xo(_0x3a596f),this['_urlInputView']['on']('submitUrl',(_0x582865,_0x2809de)=>{this['_handleUrlSubmit'](_0x2809de);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),_0x4d3942['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x37781a,_0x2a10ef){const _0x1008b4='source'===_0x2a10ef['type']?new Va(_0x37781a):new _0x21bd9e(_0x37781a);return _0x1008b4['set']({'label':_0x2a10ef['label'],'icon':_0x2a10ef['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':ko}),_0x1008b4;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){ts({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x10f895){const _0x47049f=this['_addContextBalloonConfig'];_0x47049f['buttonView']['isOn']=_0x10f895,_0x10f895?_0x47049f['balloonView']['show']():_0x47049f['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xf37336,buttonView:_0x46aaa0,hideMethod:_0x4a6793}=this['_addContextBalloonConfig'];ts({'emitter':_0xf37336,'contextElements':[_0xf37336['element'],_0x46aaa0['element']],'callback':()=>{_0x4a6793();},'activator':()=>_0x46aaa0['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0xc5db2e,_0x117a69,_0x5698bb=!0x1,_0x399e0d=!0x1){const _0x407c8a='conversation'===_0x117a69||!0x0===_0xc5db2e['isReadOnly'],_0x7e5fee=new Co(this['locale'],_0xc5db2e,_0x407c8a,_0x5698bb,_0x399e0d);return _0x407c8a||_0x7e5fee['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x7e5fee['id']);}),_0x7e5fee;}['_addContextToCollection'](_0x8cebec,_0x495631){_0x495631['add'](_0x8cebec,0x0);}['_removeContextFromCollection'](_0x531936,_0x376643){const _0xc18ac=_0x376643['find'](_0x860e02=>_0x860e02['id']===_0x531936);_0xc18ac&&_0x376643['remove'](_0xc18ac);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}));}['_handleUrlSubmit'](_0x4f4e04){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4f4e04);}}class Va extends _0x21bd9e{['arrowView'];constructor(_0x197b0b){super(_0x197b0b),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Eo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xa6dd9b=new _0x25e498();return _0xa6dd9b['content']=_0x39e693,_0xa6dd9b['extendTemplate']({'attributes':{'class':Eo+'__arrow'}}),_0xa6dd9b;}}class rs extends _0x492b6b{['_cancelButtonView'];['_loaderView'];constructor(_0x285b64){super(_0x285b64),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 _0x25a414=new _0x21bd9e(this['locale']);return _0x25a414['set']({'label':y(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x16a978}),_0x25a414['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x25a414;}['_createLoaderView'](){const _0x2ffea2=new _0x492b6b(this['locale']);return _0x2ffea2['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':y(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x2ffea2;}}class Vi extends _0x492b6b{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x296697,_0x2ab7f2){super(_0x296697),this['_contextPanelView']=this['_createContextPanelView'](_0x296697,{'bodyCollection':_0x2ab7f2['bodyCollection'],'searchInputVisibleFrom':_0x2ab7f2['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x296697),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x296697),this['_loaderView']=this['_createLoaderView'](_0x296697),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x296697),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'](...as)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x52da42=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x52da42['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x52da42['if']('isLoading','ck-hidden',_0x1256f7=>_0x1256f7||!this['isModelAvailable']),_0x52da42['if']('isModelAvailable','ck-hidden',_0x23bea1=>!_0x23bea1||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x52da42['if']('isLoading','ck-hidden',_0x433571=>!_0x433571)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x52da42['if']('isModelAvailable','ck-hidden',_0x204099=>_0x204099)]},'children':[this['_modelUnavailableMessageView']]}]}),ts({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x34031d,_0x3ab2b9){return new os(_0x34031d,_0x3ab2b9);}['_createPromptInputView'](_0x3c1c6a){return new es(_0x3c1c6a,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x157bfc){return new is(_0x157bfc);}['_createLoaderView'](_0x35326d){return new rs(_0x35326d);}['_createModelUnavailableMessageView'](_0x5adfdf){const _0x15eb18=new hs(_0x5adfdf);return _0x15eb18['delegate']('startConversation')['to'](this),_0x15eb18;}['_handlePromptInputFocus'](_0x5c2a32,_0x25fe99,_0x590a65){_0x590a65?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1156f0,_0x49948e){this['_contextPanelView']['addContextItem'](_0x1156f0,_0x49948e);}['removeContextItem'](_0x763628){this['_contextPanelView']['removeContextItem'](_0x763628);}['setContextItemLoading'](_0x228bbe,_0x59cb27){this['_contextPanelView']['setContextItemLoading'](_0x228bbe,_0x59cb27);}['setIsUploadInProgress'](_0x3fbfaa){this['_promptInputView']['setIsUploadInProgress'](_0x3fbfaa);}['setConversationContext'](_0x2b3c83){this['_contextPanelView']['setConversationContext'](_0x2b3c83);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x14852f,_0x480aaa,_0x1cf5f9){this['_contextPanelView']['updateResourceState'](_0x14852f,_0x480aaa,_0x1cf5f9);}['setWebSearch'](_0x1016b6){this['_promptCapabilitiesView']['setWebSearch'](_0x1016b6);}['setReasoning'](_0x10403c){this['_promptCapabilitiesView']['setReasoning'](_0x10403c);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2a1d00){this['_contextPanelView']['setAddContextOptions'](_0x2a1d00);}['setInputPlaceholder'](_0xfc1ce){this['_promptInputView']['setPlaceholderText'](_0xfc1ce);}['setModelList'](_0x4c379a,_0x5dbdf9){this['_displayedModels']=_0x4c379a,this['_promptCapabilitiesView']['setModelList'](_0x4c379a,_0x5dbdf9);}['setModel'](_0x474edf){(_0x474edf?this['_displayedModels']['find'](_0x14a74a=>_0x14a74a['id']===_0x474edf['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x474edf)):_0x474edf?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3b889e){this['_promptCapabilitiesView']['disableModelSelector'](_0x3b889e);}['populateSourceResourceBalloon'](_0x37a8c7,_0x4947b,_0x48b022,_0x572e40){this['_contextPanelView']['populateSourceResourceBalloon'](_0x37a8c7,_0x4947b,_0x48b022,_0x572e40);}['closeSourceResourceBalloon'](_0x1dbc25){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1dbc25);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class hs extends _0x492b6b{constructor(_0x39f58d){super(_0x39f58d);const _0x1348a7=new _0x21bd9e(_0x39f58d);_0x1348a7['set']({'label':y(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x1348a7['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':y(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x1348a7]}]});}}class Hi extends _0x5e5898{['conversationStartButton'];['resizeButton'];constructor(_0x3210d1,_0x26c42a){super(_0x3210d1,{'label':y(_0x3210d1,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':ot}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3210d1),this['children']['add'](this['conversationStartButton']),_0x26c42a&&(this['resizeButton']=ms(_0x3210d1,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x482147){const _0x3a084b=new _0x21bd9e(_0x482147);return _0x3a084b['set']({'label':y(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x22fde5,'class':'ck-ai-chat__start-conversation'}),_0x3a084b['on']('execute',()=>{this['fire']('startConversation');}),_0x3a084b;}}class Ei extends _0x492b6b{constructor(_0x5db6b3){super(_0x5db6b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':y(_0x5db6b3,'AI_DISCLAIMER_TEXT')}]}]});}}class nt extends _0x492b6b{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x332776,_0x3f80f3){super(_0x332776),this['_bodyCollection']=new Kt(_0x332776),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Hi(_0x332776,_0x3f80f3['showResizeButton']),this['chatHeader']['delegate'](...ht)['to'](this),this['chatFeed']=new Bi(_0x332776,this['_bodyCollection']),this['chatFeed']['delegate'](...ht)['to'](this),this['chatControls']=new Vi(_0x332776,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x3f80f3['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ht)['to'](this),this['chatDisclaimer']=new Ei(_0x332776),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x332776['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4e35b9,_0x10ecc7,_0xc00446,_0x2d3b35){this['chatControls']['populateSourceResourceBalloon'](_0x4e35b9,_0x10ecc7,_0xc00446,_0x2d3b35);}['closeSourceResourceBalloon'](_0x31fc48){this['chatControls']['closeSourceResourceBalloon'](_0x31fc48);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class F extends _0x4404b9{static get['requires'](){return[$];}['_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(_0x177c3b){super(_0x177c3b);const _0x59ed20=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new nt(this['context']['locale'],{'showResizeButton':_0x59ed20['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...ht)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x461361,{showDiff:_0x3662f2})=>{this['showDiff']=_0x3662f2;}),_0x59ed20['view']['addTab']({'id':'chat','buttonLabel':y(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':ot,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x30aed5=>_0x30aed5),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x375a00=>_0x375a00),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0xa73211){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0xa73211['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':y(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x345148,staticMessage:_0x3340c7}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x345148,'initialContent':'<p>'+_0x3340c7+'</p>'});}['addFeedItemUserMessage'](_0x225ed1){const _0x204e95=_0x225ed1['quickActionData']?.['displayedPrompt']||_0x225ed1['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x225ed1['contextItems']['values']()),'initialContent':'<p>'+_0x204e95+'</p>','id':_0x225ed1['id']});}['addFeedItemError']({errorMessage:_0x300bbe,id:_0x2f5525}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x300bbe+'</p>','id':_0x2f5525});}['addFeedItemAIReply'](_0x4b751c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4b751c['interactionId']+':'+_0x4b751c['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x177677){const _0x235532=P(this['context']);let _0x19bd24=_0x235532['config']['get']('ai.availableReplyActions')||[...k];if(_0x235532['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0xa8a481=_0x235532['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0xa8a481,'value');}}else _0x19bd24=_0x19bd24['filter'](_0x84e0be=>'insertSuggestion'!=_0x84e0be);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x177677['interactionId']+':'+_0x177677['id'],'areActionsDisabled':_0x177677['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x19bd24}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x17a1bd,_0x25e7a2){const _0x2410b5=this['_view']['chatFeed']['children']['last'];if(_0x2410b5 instanceof rt)return this['_view']['chatFeed']['children']['remove'](_0x2410b5),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x17a1bd['id'],'capabilities':{'isWebSearchEnabled':_0x2410b5['capabilities']['isWebSearchEnabled']||_0x25e7a2['isWebSearchEnabled'],'isReasoningEnabled':_0x2410b5['capabilities']['isReasoningEnabled']||_0x25e7a2['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x17a1bd['id'],'capabilities':_0x25e7a2});}['updateFeedInteractionHeader'](_0x2171d5){const _0x4ab8e4=this['_view']['chatFeed']['children']['find'](_0x186696=>_0x186696['options']['id']==_0x2171d5['id']&&_0x186696 instanceof rt);_0x4ab8e4&&_0x4ab8e4['set']('isVisible',_0x2171d5['isVisible']);}async['updateFeedItemAIReplyContent'](_0x33c9c4){const _0xb1ce32=_0x33c9c4['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x417a04=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x33c9c4,'abortSignal':_0x417a04,'renderingStrategy':_0xb1ce32}),_0x33c9c4['isDone']&&this['markFeedItemAsDone'](_0x33c9c4['id']);});}['updateFeedItemAIReplySources'](_0x256887,_0x556311){this['_view']['chatFeed']['updateWebSources'](_0x256887,_0x556311);}async['updateFeedItemAIReplySuggestionContent'](_0x22a560){const _0x401fda=_0x22a560['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x16d24b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x22a560,'abortSignal':_0x16d24b,'renderingStrategy':_0x401fda}),_0x22a560['isDone']&&this['markFeedItemAsDone'](_0x22a560['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xd257ee){this['_view']['chatFeed']['updateSuggestionPartState'](_0xd257ee);}['markFeedItemAsDone'](_0x1a50dc){this['_view']['chatFeed']['markItemAsDone'](_0x1a50dc);}['removeFeedInteraction'](_0x15df18){this['_view']['chatFeed']['getItemIds']()['filter'](_0x47702b=>_0x47702b['startsWith'](_0x15df18))['forEach'](_0x15422f=>this['_view']['chatFeed']['removeItem'](_0x15422f));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x49299b){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1ed6ed=>_0x1ed6ed['startsWith'](_0x49299b['id']))['forEach'](_0x442bf8=>this['markFeedItemAsDone'](_0x442bf8)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x1458b2,_0x4afe95){this['_view']['chatControls']['addContextItem'](_0x1458b2,_0x4afe95);}['removeContextItem'](_0x59914f){this['_view']['chatControls']['removeContextItem'](_0x59914f);}['setContextItemLoading'](_0x29f650,_0x5e4983){this['_view']['chatControls']['setContextItemLoading'](_0x29f650,_0x5e4983);}['setIsUploadInProgress'](_0x5db283){this['_view']['chatControls']['setIsUploadInProgress'](_0x5db283);}['setConversationContext'](_0x3c4617){this['_view']['chatControls']['setConversationContext'](_0x3c4617);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2b0f14,_0x48d69a,_0x1191b8){this['_view']['chatControls']['updateResourceState'](_0x2b0f14,_0x48d69a,_0x1191b8);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x47cd23){this['_view']['chatControls']['setAddContextOptions'](_0x47cd23);}['updateCapabilities'](_0x3bf5f0){this['_view']['chatControls']['setWebSearch'](_0x3bf5f0['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x3bf5f0['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x3bf5f0));}['setSelectedModel'](_0x38b7b7,_0x26617c){this['_view']['chatControls']['setModel'](_0x38b7b7),_0x26617c&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5be915){this['feedItemRenderingStrategy']=_0x5be915;}['toggleLoadingSkeleton'](_0x31d041){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x31d041);}['resetConversationTitle'](){this['setConversationTitle'](y(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4226e1,_0x374886=!0x1){if(_0x374886&&!at()&&_0x4226e1['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4226e1);this['_view']['chatHeader']['label']=_0x4226e1;}['setLoadingMessage'](_0x3b1e6e){const _0x2bb80a=this['_getLoadingMessage'](_0x3b1e6e);this['_view']['chatFeed']['setLoadingMessage'](_0x2bb80a);}['_animateConversationTitle'](_0xd89ba9){let _0x38861a=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0xd89ba9[_0x38861a],_0x38861a++,_0x38861a===_0xd89ba9['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x15d480){this['_view']['chatHeader']['isMaximized']=_0x15d480;}['_getLoadingMessage'](_0x156850){return _0x156850?_0x156850['isWebSearchEnabled']&&_0x156850['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x156850['isWebSearchEnabled']?y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x156850['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x21131e){return _0x21131e?_0x21131e['isWebSearchEnabled']&&_0x21131e['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x21131e['isWebSearchEnabled']?y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x21131e['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4ce342,_0x3ec611,_0x321d8c,_0x2a7909){this['_view']['populateSourceResourceBalloon'](_0x4ce342,_0x3ec611,_0x321d8c,_0x2a7909);}['closeSourceResourceBalloon'](_0x140fc8){this['_view']['closeSourceResourceBalloon'](_0x140fc8);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x5dfa2a,_0xab7623){this['_view']['chatFeed']['scrollToSuggestion'](_0x5dfa2a,_0xab7623);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class $i extends _0x24784f{['sections'];constructor(_0x29076b,_0x209a38){super(_0x29076b),this['sections']=_0x209a38,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2e45fa){let _0x222624=0x0,_0x401e9d=0x0;for(const _0xe12dfa of this['sections']){const {resultsCount:_0x2b0379,totalItemsCount:_0x5da902}=_0xe12dfa['filter'](_0x2e45fa);_0x222624+=_0x2b0379,_0x401e9d+=_0x5da902;}return{'resultsCount':_0x222624,'totalItemsCount':_0x401e9d};}}class _s extends _0x8a8c30{['title'];['itemsViews'];['_itemsListView'];constructor(_0x9fbf6,{title:_0x5e4287,items:_0x3bc157}){super(_0x9fbf6);const _0x5ddaf2=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x5e4287,this['itemsViews']=_0x3bc157;const _0x7ea302=new _0x492b6b(_0x9fbf6);_0x7ea302['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x24784f(_0x9fbf6),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5ddaf2['if']('isVisible','ck-hidden',_0x220b99=>!_0x220b99)]},'children':[_0x7ea302,this['_itemsListView']]});}['filter'](_0x55396d){const _0x5da006=this['itemsViews']['length'];let _0x260876=0x0;for(const _0x434810 of this['itemsViews']){if(_0x55396d){const _0x771d71=_0x434810['isMatching'](_0x55396d);_0x434810['isVisible']=!!_0x771d71,_0x434810['highlightText'](_0x55396d);}else _0x434810['isVisible']=!0x0,_0x434810['highlightText'](null);_0x434810['isVisible']&&_0x260876++;}return this['isVisible']=_0x260876>0x0,{'resultsCount':_0x260876,'totalItemsCount':_0x5da006};}['getItem'](_0x465901){return this['itemsViews']['find'](_0x1a934d=>_0x1a934d['id']===_0x465901);}['removeItem'](_0x257e58){const _0x5c8522=this['itemsViews']['indexOf'](_0x257e58);-0x1!==_0x5c8522&&(this['itemsViews']['splice'](_0x5c8522,0x1),this['_itemsListView']['items']['remove'](_0x257e58));}}class ls extends/* #__PURE__ -- @preserve */
27
- _0x4bf1f4(_0x8a8c30){['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(_0x567197,_0x19a83b){super(_0x567197);const _0x2ce224=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x19a83b['pinned']),this['set']('loadingState',null),this['id']=_0x19a83b['id'];const {title:_0x29efe3,createdAt:_0x30945c,active:_0x724661=!0x1}=_0x19a83b;this['_titleView']=new _0x1f83e8(),this['_titleView']['text']=_0x29efe3,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x477dbc=this['_createCheckView'](),_0x28cc6f=this['_createPinButtonView'](_0x567197),_0xa8a8fd=this['_createMenuDropdownView'](),_0x5613e5=this['_createEditInputView'](_0x567197,_0x29efe3),_0x6e3d1=this['_createAcceptEditButtonView'](_0x567197,_0x5613e5),_0xf97119=this['_createCancelEditButtonView'](_0x567197,_0x5613e5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x28cc6f),this['actions']['add'](_0xa8a8fd),this['on']('change:isEdit',(_0x11187a,_0x2df324,_0x2d47a0)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2d47a0?(this['actions']['add'](_0x6e3d1),this['actions']['add'](_0xf97119),this['mainContent']['add'](_0x5613e5),_0x5613e5['element']['focus']()):(this['actions']['add'](_0x28cc6f),this['actions']['add'](_0xa8a8fd),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x724661?'ck-ai-chat-history__item--active':'',_0x2ce224['if']('isVisible','ck-hidden',_0x3ecb21=>!_0x3ecb21),_0x2ce224['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',_0x2ce224['if']('loadingState','ck-hidden',_0x856b84=>!!_0x856b84)]},'children':_0x724661?[_0x477dbc]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2ce224['if']('loadingState','ck-hidden',_0x484b21=>!_0x484b21)]},'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',_0x2ce224['if']('loadingState','ck-hidden',_0x4c8986=>!!_0x4c8986)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2ce224['if']('loadingState','ck-hidden',_0x28f5e5=>!_0x28f5e5)]},'children':[{'text':_0x2ce224['to']('loadingState',_0x142c90=>_0x142c90?y(this['locale'],ls['LOADING_LABELS'][_0x142c90]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x30945c]}]},{'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'](_0x113958){this['_titleView']['text']=Zt(_0x113958);}['updateLoadingState'](_0x16d968,_0x3ef0db){this['set']('loadingState',_0x3ef0db?_0x16d968:null);}['_createCheckView'](){const _0x2ce2f0=new _0x25e498();return _0x2ce2f0['set']({'content':_0x2a5a64}),_0x2ce2f0;}['_createPinButtonView'](_0x13c5a5){const _0x4c0115=new _0x21bd9e(_0x13c5a5);return _0x4c0115['set']({'label':y(_0x13c5a5,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1dd126,'withText':!0x1,'tooltip':!0x0}),_0x4c0115['bind']('isOn')['to'](this,'pinned'),_0x4c0115['on']('execute',()=>{const _0x139d9d=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x139d9d});}),_0x4c0115;}['_createMenuDropdownView'](){const _0x43a888=_0x35c3bd(this['locale'],_0x5a11e2),_0x218da2=_0x43a888['panelView']['children'];_0x43a888['buttonView']['set']({'label':y(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x40bfd1}),_0x43a888['panelPosition']='sw';const _0x15ced0=new _0x21bd9e(this['locale']);_0x15ced0['label']=y(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x15ced0['withText']=!0x0,_0x15ced0['on']('execute',()=>{this['isEdit']=!0x0;});const _0x4dec4e=new _0x21bd9e(this['locale']);_0x4dec4e['label']=y(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x4dec4e['withText']=!0x0,_0x4dec4e['on']('execute',()=>{this['showConfirm'](y(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1b82b3=new _0x24784f(this['locale']),_0x72ed82=new _0x8a8c30(this['locale']);_0x72ed82['children']['add'](_0x15ced0);const _0x5d2f47=new _0x8a8c30(this['locale']);return _0x5d2f47['children']['add'](_0x4dec4e),_0x1b82b3['items']['addMany']([_0x72ed82,_0x5d2f47]),_0x218da2['add'](_0x1b82b3),_0x43a888;}['_createEditInputView'](_0x515042,_0x2cb25a){const _0x4630ca=new _0x257805(_0x515042),_0x1e561c=_0x4630ca['bindTemplate'];return _0x4630ca['value']=_0x2cb25a,_0x4630ca['extendTemplate']({'on':{'keydown':_0x1e561c['to'](_0x9384ce=>{'Enter'==_0x9384ce['key']&&this['_commitEditInputValue'](_0x4630ca);})}}),_0x4630ca;}['_createAcceptEditButtonView'](_0x10eca3,_0x53dee8){const _0x330d4d=new _0x21bd9e(_0x10eca3);return _0x330d4d['set']({'icon':_0x2a5a64,'withText':!0x1,'tooltip':y(_0x10eca3,'AI_CHAT_HISTORY_ACCEPT')}),_0x330d4d['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x330d4d['on']('execute',()=>{this['_commitEditInputValue'](_0x53dee8);}),_0x330d4d;}['_commitEditInputValue'](_0x7ca9e2){const _0x321796=_0x7ca9e2['element']['value']||'';this['_titleView']['text']=_0x321796,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x321796});}['_createCancelEditButtonView'](_0x26bace,_0x110012){const _0x4432e9=new _0x21bd9e(_0x26bace);return _0x4432e9['set']({'icon':_0x2c2a0c,'withText':!0x1,'tooltip':y(_0x26bace,'AI_CHAT_HISTORY_CANCEL')}),_0x4432e9['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4432e9['on']('execute',()=>{this['isEdit']=!0x1,_0x110012['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4432e9;}['_createSpinnerView'](){const _0x2e95c4=new je('tiny');return _0x2e95c4['isVisible']=!0x0,_0x2e95c4;}['isMatching'](_0x11bfb4){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x11bfb4)?{'title':!0x0}:null;}['highlightText'](_0x2cc09b){this['_titleView']['highlightText'](_0x2cc09b);}}class ut extends _0x492b6b{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x31b4f2,_0x18b448){super(_0x31b4f2),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x40ae17=new _0x5e5898(_0x31b4f2,{'label':y(_0x31b4f2,'AI_CHAT_HISTORY_HEADING'),'icon':It,'class':'ck-ai-header\x20ck-ai-header_history'});_0x18b448&&(this['resizeButton']=ms(_0x31b4f2,this),_0x40ae17['children']['add'](this['resizeButton'])),this['sectionsView']=new $i(_0x31b4f2,[]),this['sectionsView']['delegate'](...ds)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x40ae17,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x4cfcbf=new _0xc3c8d(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':y(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x303b23=>y(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x303b23),'secondary':y(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x4cfcbf['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x4cfcbf['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1c62ae=>!_0x1c62ae)]}}),_0x4cfcbf;}['_createSkeletonView'](){const _0x209eaf=new _e(this['locale'],be['aiHistory']);return _0x209eaf['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3dfc24=>!_0x3dfc24)]}}),_0x209eaf;}['_createErrorView'](){const _0x30333f=new _0x492b6b(this['locale']),_0x9b95af=new _0x21bd9e(this['locale']);return _0x9b95af['set']({'withText':!0x1,'icon':_0x2c2a0c,'class':'ck-ai-notification_error__dismiss-button'}),_0x9b95af['bind']('isVisible')['to'](this,'hasItems',_0x3ff758=>!!_0x3ff758),_0x9b95af['on']('execute',()=>{this['errorMessage']='';}),_0x30333f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x51f632=>!_0x51f632)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x9b95af]}),_0x30333f;}['_createEmptyStateView'](){const _0x55ce52=new _0x21bd9e(this['locale']);_0x55ce52['set']({'label':y(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x22fde5,'class':'ck-ai-chat__start-conversation'}),_0x55ce52['on']('execute',()=>{this['fire']('openChat');});const _0x50eecc=new _0x492b6b(this['locale']);return _0x50eecc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x34f1e5=>!_0x34f1e5)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[y(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x55ce52]}),_0x50eecc;}['_createListItemViews'](_0xc57524,_0x425327){const _0x25a3b6=[];for(const _0x5edcbb of _0xc57524){const _0x40b530=new ls(_0x425327,_0x5edcbb);_0x40b530['delegate'](...ds)['to'](this),_0x25a3b6['push'](_0x40b530);}return _0x25a3b6;}['updateHistoryItemsWithCategories'](_0x318610){const _0x23e598=this['locale']||'en',_0x310caf=[];for(const _0x52ed5b of _0x318610){const _0x2af04a=this['_createListItemViews'](_0x52ed5b['items'],_0x23e598);_0x310caf['push'](new _s(_0x23e598,{'title':_0x52ed5b['title'],'items':_0x2af04a}));}this['sectionsView']['sections']=_0x310caf,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x310caf),this['hasItems']=_0x318610['some'](_0x5705f7=>_0x5705f7['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2c45b3){for(const _0x14a09a of this['sectionsView']['sections']){const _0x4d3f55=_0x14a09a['getItem'](_0x2c45b3);if(_0x4d3f55){if(_0x14a09a['removeItem'](_0x4d3f55),0x0===_0x14a09a['itemsViews']['length']){const _0x5d76bd=this['sectionsView']['sections']['indexOf'](_0x14a09a);-0x1!==_0x5d76bd&&(this['sectionsView']['sections']['splice'](_0x5d76bd,0x1),this['sectionsView']['items']['remove'](_0x14a09a));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x12a0f9,_0x5f468e){for(const _0x326838 of this['sectionsView']['sections']){const _0x42b7ed=_0x326838['getItem'](_0x12a0f9);if(_0x42b7ed){_0x42b7ed['updateTitle'](_0x5f468e);break;}}}['updateItemLoadingState'](_0x42fd4c,_0x4a3002,_0xb1ac3e){for(const _0x24695b of this['sectionsView']['sections']){const _0x27cac7=_0x24695b['getItem'](_0x42fd4c);if(_0x27cac7){_0x27cac7['updateLoadingState'](_0x4a3002,_0xb1ac3e);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x53648f=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x53648f);}}}const ds=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class mt extends _0x4404b9{static get['requires'](){return[$];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x106ffe){super(_0x106ffe);const _0x1a9d04=this['context']['plugins']['get']('AITabs');this['_historyView']=new ut(this['context']['locale'],_0x1a9d04['showResizeButton']),this['_historyView']['delegate'](...ds)['to'](this),_0x1a9d04['view']['addTab']({'id':'history','buttonLabel':y(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':It,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x33710b){this['_historyView']['removeHistoryItem'](_0x33710b);}['updateItems'](_0x531391){this['_historyView']['updateHistoryItemsWithCategories'](_0x531391);}['updateItemTitle'](_0x3700a2,_0xa278af){this['_historyView']['updateItemTitle'](_0x3700a2,_0xa278af);}['updateItemLoadingState'](_0x3e0806,_0x2d577d,_0x2a3184){this['_historyView']['updateItemLoadingState'](_0x3e0806,_0x2d577d,_0x2a3184);}['setLoadingSkeleton'](_0x3ea17f){this['_historyView']['isLoading']=_0x3ea17f;}['showError'](_0x183e14){this['_historyView']['errorMessage']=_0x183e14;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x498a10){this['_historyView']['isMaximized']=_0x498a10;}}class De extends $t(){['id'];['createdAt'];constructor({id:_0xf66d8d,title:_0x3ed37a,createdAt:_0x222471,updatedAt:_0x66632a,pinned:_0x3b01ce}){super(),this['id']=_0xf66d8d,this['createdAt']=new Date(_0x222471),this['set']('title',_0x3ed37a),this['set']('updatedAt',_0x66632a?new Date(_0x66632a):null),this['set']('pinned',_0x3b01ce||!0x1);}['updateTitle'](_0x26bf58){this['set']('title',Zt(_0x26bf58)),this['updatedAt']=new Date();}['updatePinned'](_0x9f9d26){this['set']('pinned',_0x9f9d26),this['updatedAt']=new Date();}}class _t extends _0x3dcb71(){['items']=[];['connector'];['group'];constructor({connector:_0x2feb0c,group:_0x4b750b}){super(),this['connector']=_0x2feb0c,this['group']=_0x4b750b;}async['init'](){try{const _0x542968=this['connector']['fetchConversations'](this['group']),_0x5c3b9b=await _0x542968['getConversations']();this['loadItems'](_0x5c3b9b);}catch(_0x56c41a){this['fire']('error',{'error':_0x56c41a,'operation':'init'});}}['addItem'](_0x5d3bc8){this['items']['push'](_0x5d3bc8);}async['removeItem'](_0x2640bd){const _0x59f7a0=this['items']['findIndex'](_0x109f2a=>_0x109f2a['id']===_0x2640bd);if(-0x1===_0x59f7a0)return!0x1;try{return await this['connector']['deleteConversation'](_0x2640bd)['execute'](),this['items']['splice'](_0x59f7a0,0x1),this['fire']('itemRemoved',{'itemId':_0x2640bd}),!0x0;}catch(_0x233289){return this['fire']('error',{'error':_0x233289,'operation':'removeItem','itemId':_0x2640bd}),!0x1;}}['getItem'](_0x34e650){return this['items']['find'](_0x4dd919=>_0x4dd919['id']===_0x34e650);}async['updateItemTitle'](_0xaad91c,_0x592f51){const _0x3b7703=this['getItem'](_0xaad91c);if(!_0x3b7703)return!0x1;try{return await this['connector']['updateConversation'](_0xaad91c,{'title':_0x592f51})['getResult'](),_0x3b7703['updateTitle'](_0x592f51),this['fire']('itemUpdated',{'itemId':_0xaad91c,'updates':{'title':_0x592f51}}),!0x0;}catch(_0x1bd329){return this['fire']('error',{'error':_0x1bd329,'operation':'updateItemTitle','itemId':_0xaad91c}),!0x1;}}async['updateItemPinned'](_0x590d5f,_0x38096f){const _0x527cf2=this['getItem'](_0x590d5f);if(!_0x527cf2)return!0x1;try{return await this['connector']['updateConversation'](_0x590d5f,{'pinned':_0x38096f})['getResult'](),_0x527cf2['updatePinned'](_0x38096f),this['fire']('itemUpdated',{'itemId':_0x590d5f,'updates':{'pinned':_0x38096f}}),!0x0;}catch(_0x581c97){return this['fire']('error',{'error':_0x581c97,'operation':'updateItemPinned','itemId':_0x590d5f}),!0x1;}}['loadItems'](_0x298066){try{this['items']=[],_0x298066['map'](_0x18f919=>{this['addItem'](new De(_0x18f919));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x39afd4){this['fire']('error',{'error':_0x39afd4,'operation':'loadItems'});}}['getItems'](_0x30bd9e={}){const _0x7df63=void 0x0!==_0x30bd9e['pinned']&&_0x30bd9e['pinned'],_0x3515e7=_0x30bd9e['from']?new Date(_0x30bd9e['from']['getFullYear'](),_0x30bd9e['from']['getMonth'](),_0x30bd9e['from']['getDate']()):null,_0x5bf5f0=_0x30bd9e['to']?new Date(_0x30bd9e['to']['getFullYear'](),_0x30bd9e['to']['getMonth'](),_0x30bd9e['to']['getDate']()):null;return this['items']['filter'](_0x1e04f4=>{if(_0x1e04f4['pinned']!==_0x7df63)return!0x1;if(_0x5bf5f0){const _0x32ae49=new Date(_0x1e04f4['createdAt']['getFullYear'](),_0x1e04f4['createdAt']['getMonth'](),_0x1e04f4['createdAt']['getDate']());return _0x3515e7?_0x3515e7['getTime']()===_0x5bf5f0['getTime']()?_0x32ae49['getTime']()===_0x3515e7['getTime']():_0x32ae49<_0x5bf5f0&&_0x32ae49>=_0x3515e7:_0x32ae49<_0x5bf5f0;}return!0x0;});}}class ct extends _0x4404b9{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,q,mt,$];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](mt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x397210=this['context']['plugins']['get']($),_0x19cf44=this['_aiChatController']['getGroupId']();this['history']=new _t({'connector':this['_aiConnector'],'group':_0x19cf44}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2da82d,_0x3351e6)=>{this['_setItemLoading'](_0x3351e6['id'],'remove'),this['_handleRemove'](_0x3351e6['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x216bb4,_0x25e777)=>{this['_setItemLoading'](_0x25e777['id'],'rename'),this['_handleEditTitle'](_0x25e777['id'],_0x25e777['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x3eab71,_0x491f7f)=>{void 0x0!==_0x491f7f['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x491f7f['itemId'],_0x491f7f['updates']['title']),void 0x0!==_0x491f7f['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x491f7f['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x23132f,_0x1d9b16)=>{this['_aiChatController']['handleRemovedConversation'](_0x1d9b16['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1d9b16['itemId']),this['_clearItemLoading'](_0x1d9b16['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x399e7b,_0x124aa5)=>{this['_handleHistoryErrorUI'](_0x124aa5['error'],_0x124aa5['operation'],_0x124aa5['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x61db9b,_0x3d8cb2)=>{this['_handleSelectConversation'](_0x3d8cb2['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x39d9b3,_0x2b78fe)=>{const _0x31b679=_0x2b78fe['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2b78fe['id'],_0x31b679),this['_handleTogglePin'](_0x2b78fe['id'],_0x2b78fe['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x397210['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x397210['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x397210,'resizedTabs',(_0x23b9c9,_0xffee09)=>{this['_setIsMaximized'](_0xffee09);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x397210['resize']();});}async['_handleEditTitle'](_0x18eaec,_0x3b7e0d){await this['history']['updateItemTitle'](_0x18eaec,_0x3b7e0d);}async['_handleTogglePin'](_0x19b7a5,_0x5cd86e){await this['history']['updateItemPinned'](_0x19b7a5,_0x5cd86e);}async['_handleRemove'](_0x49f062){await this['history']['removeItem'](_0x49f062);}async['_handleSelectConversation'](_0xfbd13){await this['_aiChatController']['loadConversation'](_0xfbd13);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x45c83c=this['_aiChatController']['activeConversation']?.['id'],_0x260468=this['_getCategorizedItems']()['map'](_0xa6b2ef=>({'title':_0xa6b2ef['title'],'items':_0xa6b2ef['items']['map'](_0x3fe992=>({'id':_0x3fe992['id'],'title':_0x3fe992['title']||y(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x3fe992['createdAt'])['toLocaleDateString'](),'active':_0x3fe992['id']===_0x45c83c,'pinned':_0x3fe992['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x260468);}['_setItemLoading'](_0x9c60ab,_0x3723ac){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x9c60ab,_0x3723ac,!0x0);}['_clearItemLoading'](_0x228626){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x228626,null,!0x1);}['_handleHistoryErrorUI'](_0x562bf7,_0x3e8453,_0x58e877){const _0x3aaf60=this['_generateErrorMessage'](_0x3e8453,_0x58e877);this['_aiChatHistoryUi']['showError'](_0x3aaf60),_0x58e877&&this['_clearItemLoading'](_0x58e877),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x485aba,_0x5b23b1){const _0x47c65a=_0x5b23b1?this['history']['getItem'](_0x5b23b1):null,_0x470fbf=_0x47c65a?.['title']||y(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x485aba){case'updateItemTitle':return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x470fbf);case'updateItemPinned':{const _0x3e36ca=y(this['context']['locale'],_0x47c65a?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3e36ca,_0x470fbf]);}case'removeItem':return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x470fbf);case'init':case'loadItems':return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4caa99=new Date(),_0x398888=new Date(_0x4caa99['getFullYear'](),_0x4caa99['getMonth'](),_0x4caa99['getDate']()),_0x16438f=new Date(_0x398888);_0x16438f['setDate'](_0x16438f['getDate']()-0x1);const _0x263299=new Date(_0x398888);_0x263299['setDate'](_0x263299['getDate']()-0xe);const _0x322b30=this['history']['getItems']({'pinned':!0x0}),_0x198ad5=this['history']['getItems']({'from':_0x398888,'to':_0x398888}),_0x58193f=this['history']['getItems']({'from':_0x16438f,'to':_0x16438f}),_0x3c6e86=this['history']['getItems']({'from':_0x263299,'to':_0x16438f}),_0x490244=this['history']['getItems']({'to':_0x263299}),_0x274ee8=[];return _0x322b30['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x322b30}),_0x198ad5['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x198ad5}),_0x58193f['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x58193f}),_0x3c6e86['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x3c6e86}),_0x490244['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x490244}),_0x274ee8;}['_setIsMaximized'](_0x3e6920){this['_aiChatHistoryUi']['setIsMaximized'](_0x3e6920);}}class V extends _0x4404b9{static get['requires'](){return[ct,mt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ga extends _0x4404b9{static get['requires'](){return[q,c,F,V];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a8b11){super(_0x3a8b11),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0xa6fd5a,quickActionData:_0x2cc2fc}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0xa6fd5a,'quickActionData':_0x2cc2fc});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}}class co extends At{constructor(_0x419e56){super(_0x419e56);const _0x1893f6=_0x419e56['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1893f6,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x3f7524=this['editor']['plugins']['get']('AITabs')['view'];_0x3f7524['isVisible']=!_0x3f7524['isVisible'];}}class bt extends _0x2a4cc7{static get['requires'](){return[$];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x28827b=this['editor'];_0x28827b['commands']['add']('toggleAi',new co(_0x28827b)),_0x28827b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x200c15=this['_createAIUIButton'](_0x21bd9e);return _0x200c15['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x200c15;}),_0x28827b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x15c960=this['_createAIUIButton'](_0x4f4ee6);return _0x15c960['set']({'role':'menuitemcheckbox'}),_0x15c960;});}['_createAIUIButton'](_0x3c3334){const _0x16df4e=this['editor'],_0x139326=_0x16df4e['commands']['get']('toggleAi'),_0x167dbb=new _0x3c3334(_0x16df4e['locale']);return _0x167dbb['set']({'label':y(_0x16df4e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5bf2c9,'isToggleable':!0x0}),_0x167dbb['bind']('isEnabled')['to'](_0x139326),_0x167dbb['bind']('isOn')['to'](_0x139326,'value',_0x228f37=>!!_0x228f37),this['listenTo'](_0x167dbb,'execute',()=>{_0x139326['execute']();}),_0x167dbb;}}class Ba extends _0x2a4cc7{static get['requires'](){return[bt,kt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Pt(_0x24ffcc){const {editor:_0x59a468,action:_0x5bf960,withText:_0x22e483=!0x1,withIcon:_0x39177b=!0x0,isInDropdown:_0x2afe60=!0x0,shouldPreventFocus:_0x1bb2e7=!0x1}=_0x24ffcc;return()=>{const _0x51cbc7=_0x59a468['locale'],_0x2383fe=new _0x21bd9e(_0x51cbc7),_0x27dedf=_0x2383fe['bindTemplate'];_0x2afe60&&_0x2383fe['extendTemplate']({'on':{'mouseenter':_0x27dedf['to'](()=>{_0x1bb2e7&&_0x1bb2e7()||_0x2383fe['focus']();})}});const _0x5d5fc5=_0x5bf960['icon']??_0x5bf960['parent']?.['icon'];return _0x2383fe['set']({'label':_0x5bf960['displayedPrompt'],'withText':_0x22e483,'role':'menuitem','icon':_0x39177b?_0x5d5fc5??_0x2e8536:void 0x0,'tooltip':!_0x22e483,'class':'ck-ai-quick-actions-button','isEnabled':_0x5bf960['isEnabled']}),_0x2383fe['on']('execute',()=>{_0x59a468['editing']['view']['focus'](),_0x59a468['commands']['execute']('aiQuickAction',_0x5bf960);}),_0x2383fe;};}class Ss extends _0x1bb418{['arrowView'];constructor(_0xb963d,_0x496d6d){super(_0xb963d,_0x496d6d);const _0x58c351=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',_0x284f5e=>String(_0x284f5e)),'data-cke-tooltip-disabled':_0x58c351['to']('isOn')},'on':{'mouseenter':_0x58c351['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4c5be3=new _0x25e498();return _0x4c5be3['content']=_0x39e693,_0x4c5be3['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4c5be3;}}class ys extends _0x24784f{['_allListItems'];['_allSearchableItems'];constructor(_0xa82bde,_0x1a71a5,_0x8d6a3e){super(_0xa82bde),this['_allListItems']=_0x1a71a5,this['_allSearchableItems']=_0x8d6a3e;}['filter'](_0x380794){if(!_0x380794)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4e5d70=_0x380794['source']['toLowerCase']()['trim'](),_0x450ecb=this['_allSearchableItems']['filter'](_0x531be2=>(_0x531be2['groupLabel']?_0x531be2['label']+'\x20('+_0x531be2['groupLabel']+')':_0x531be2['label'])['toLowerCase']()['includes'](_0x4e5d70));return this['items']['clear'](),this['items']['addMany'](_0x450ecb['map'](_0x5cc809=>_0x5cc809['item'])),this['_highlightQuery'](_0x4e5d70,_0x450ecb),{'resultsCount':_0x450ecb['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x570932,_0x13c018){if(!_0x570932)return;const _0x7ad856=new RegExp(_0xfb43f9(_0x570932),'gi');_0x13c018['forEach'](_0x5790e9=>{_0x5790e9['highlightViews']&&_0x5790e9['highlightViews']['forEach'](_0x410261=>{'function'==typeof _0x410261['highlightText']&&_0x410261['highlightText'](_0x7ad856);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3a66c4=>{_0x3a66c4['highlightViews']&&_0x3a66c4['highlightViews']['forEach'](_0x45c3e9=>{'function'==typeof _0x45c3e9['highlightText']&&_0x45c3e9['highlightText'](null);});});}}const Ts='menu',Rs='menuitem';class ao extends _0x492b6b{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x29b917,_0x52aa02,_0x2a407a,_0x2ec3ea,_0x5eadb1=!0x1){const _0x94ef87=_0x29b917['locale'];super(_0x94ef87),this['_bodyCollection']=_0x2ec3ea,this['_hasSearch']=_0x5eadb1;const _0x4360fc=this['_createListItems'](_0x29b917,_0x52aa02,_0x2a407a);this['optionsListView']=new ys(_0x94ef87,_0x4360fc,this['_allSearchableItems']),this['optionsListView']['role']=Ts,this['optionsListView']['items']['addMany'](_0x4360fc),this['focusTracker']=new Bt(),this['keystrokes']=new Wt(),_0x5eadb1&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4360fc,this['focusCycler']=new Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5eadb1&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1ec83b=_0x5eadb1&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x2b3021(_0x1ec83b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x94ef87['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0xc3c8d(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':y(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':y(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x466d14=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x466d14);}['_createListItems'](_0x12824b,_0x22d10b,_0x244039){const _0x1f59fc=new _0x2b3021();return _0x22d10b['forEach'](_0x437462=>{if('actions'in _0x437462){const {listItem:_0x39f5df}=this['_createActionGroupButton'](_0x12824b,_0x437462,_0x244039);_0x1f59fc['add'](_0x39f5df),_0x437462['actions']['forEach'](_0x4dc5eb=>{this['_createActionButton'](_0x12824b,_0x4dc5eb,_0x437462['label'],_0x437462['icon']);const {listItem:_0xce6895,highlightViews:_0x255548}=this['_createSearchResultActionButton'](_0x12824b,_0x4dc5eb,_0x437462['label'],_0x437462['icon']);this['_allSearchableItems']['push']({'item':_0xce6895,'label':_0x4dc5eb['displayedPrompt'],'groupLabel':_0x437462['label'],'highlightViews':_0x255548});});}else{const {listItem:_0x4c0785}=this['_createActionButton'](_0x12824b,_0x437462);_0x1f59fc['add'](_0x4c0785);const _0x3cbe82=_0x4c0785['children']['first'];if(_0x3cbe82){const {listItem:_0x3cbf8c,highlightViews:_0x471393}=this['_createSearchResultActionButton'](_0x12824b,_0x437462);this['_allSearchableItems']['push']({'item':_0x3cbf8c,'label':_0x3cbe82['label']||'','highlightViews':_0x471393});}}}),_0x1f59fc;}['_createActionButton'](_0x13c166,_0x5b0f37,_0x2547f9,_0x29741b){const _0x183bc7=new _0x8a8c30(this['locale']);if(_0x2547f9&&_0x29741b){const _0x32215c=new _0x21bd9e(this['locale']),_0x14d23f=_0x32215c['bindTemplate'],_0x5ecf24=new _0x1f83e8();_0x5ecf24['text']=_0x5b0f37['displayedPrompt'];const _0x5d4e11=new _0x1f83e8();_0x5d4e11['text']=_0x2547f9;const _0x2bfb70=new _0x25e498();_0x2bfb70['content']=_0x29741b,_0x2bfb70['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xb37c69=new _0x492b6b(this['locale']);_0xb37c69['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x29737e=new _0x492b6b(this['locale']);return _0x29737e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x32215c['set']({'label':_0x5b0f37['displayedPrompt']+'\x20('+_0x2547f9+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x32215c['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':[_0x5ecf24,_0xb37c69,_0x2bfb70,_0x5d4e11,_0x29737e],'on':{'mouseenter':_0x14d23f['to'](()=>{this['_isSearchFocused']()||_0x32215c['focus']();}),'click':_0x14d23f['to'](()=>{_0x32215c['fire']('execute');})}}),_0x32215c['on']('execute',()=>{_0x13c166['editing']['view']['focus'](),_0x13c166['commands']['execute']('aiQuickAction',_0x5b0f37);}),_0x183bc7['children']['add'](_0x32215c),{'listItem':_0x183bc7,'highlightViews':[_0x5ecf24,_0x5d4e11]};}{const _0x2502fc=new _0x1c8ce8(),_0xc03044=new _0x21bd9e(this['locale'],_0x2502fc),_0x54194b=_0xc03044['bindTemplate'],_0x34341d=_0x5b0f37['icon']??_0x5b0f37['parent']?.['icon'],_0x49e416=void 0x0!==_0x5b0f37['icon'];return _0xc03044['set']({'label':_0x5b0f37['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x49e416?_0x34341d??_0x2e8536:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0xc03044['extendTemplate']({'on':{'mouseenter':_0x54194b['to'](()=>{this['_isSearchFocused']()||_0xc03044['focus']();})}}),_0xc03044['on']('execute',()=>{_0x13c166['editing']['view']['focus'](),_0x13c166['commands']['execute']('aiQuickAction',_0x5b0f37);}),_0x183bc7['children']['add'](_0xc03044),{'listItem':_0x183bc7,'highlightViews':[_0x2502fc]};}}['_createSearchResultActionButton'](_0xea41fc,_0x496a17,_0x100f91,_0x42b0ad){return _0x100f91&&_0x42b0ad?this['_createSearchResultGroupedActionButton'](_0xea41fc,_0x496a17,_0x100f91,_0x42b0ad):this['_createSearchResultIndividualActionButton'](_0xea41fc,_0x496a17);}['_createSearchResultGroupedActionButton'](_0x126127,_0x30b0ff,_0x1b5178,_0x46d0ef){const _0x4b4b04=new _0x8a8c30(this['locale']),_0x2be3dc=new _0x21bd9e(this['locale']),_0x248136=_0x2be3dc['bindTemplate'],{view:_0x5d3220,highlightView:_0x1a9271}=this['_createSearchResultGroupRow'](_0x1b5178,_0x46d0ef),{view:_0x4f80ec,highlightView:_0x8f5780}=this['_createSearchResultActionRow'](_0x30b0ff['displayedPrompt']),_0x5af8b4=this['_createSearchResultContentView'](_0x5d3220,_0x4f80ec);return _0x2be3dc['set']({'label':_0x30b0ff['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}),_0x2be3dc['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':[_0x5af8b4],'on':{'mouseenter':_0x248136['to'](()=>{this['_isSearchFocused']()||_0x2be3dc['focus']();}),'click':_0x248136['to'](()=>{this['_handleSearchResultButtonClick'](_0x2be3dc);})}}),this['_setupActionButtonExecution'](_0x2be3dc,_0x126127,_0x30b0ff),_0x4b4b04['children']['add'](_0x2be3dc),{'listItem':_0x4b4b04,'highlightViews':[_0x1a9271,_0x8f5780]};}['_createSearchResultIndividualActionButton'](_0x5e12b8,_0x52d9ce){const _0x2e1b81=new _0x8a8c30(this['locale']),_0x5a01df=new _0x1c8ce8(),_0x2be4a7=new _0x21bd9e(this['locale'],_0x5a01df),_0x2a731f=_0x2be4a7['bindTemplate'];return _0x2be4a7['set']({'label':_0x52d9ce['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x2be4a7['extendTemplate']({'on':{'mouseenter':_0x2a731f['to'](()=>{this['_isSearchFocused']()||_0x2be4a7['focus']();})}}),this['_setupActionButtonExecution'](_0x2be4a7,_0x5e12b8,_0x52d9ce),_0x2e1b81['children']['add'](_0x2be4a7),{'listItem':_0x2e1b81,'highlightViews':[_0x5a01df]};}['_createSearchResultGroupRow'](_0xe2515f,_0x2604fe){const _0x199228=new _0x492b6b(this['locale']),_0x293d2b=new _0x25e498();_0x293d2b['content']=_0x2604fe,_0x293d2b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x24616e=new _0x1f83e8();return _0x24616e['text']=_0xe2515f,_0x199228['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x293d2b,_0x24616e]}),{'view':_0x199228,'highlightView':_0x24616e};}['_createSearchResultActionRow'](_0x145d5f){const _0x2a19c1=new _0x492b6b(this['locale']),_0xc8b80a=new _0x1f83e8();return _0xc8b80a['text']=_0x145d5f,_0x2a19c1['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0xc8b80a]}),{'view':_0x2a19c1,'highlightView':_0xc8b80a};}['_createSearchResultContentView'](_0x53433c,_0x189598){const _0x37b2b0=new _0x492b6b(this['locale']);return _0x37b2b0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x53433c,_0x189598]}),_0x37b2b0;}['_setupActionButtonExecution'](_0x1a0020,_0x3774bb,_0x2dd6f9){_0x1a0020['on']('execute',()=>{_0x3774bb['editing']['view']['focus'](),_0x3774bb['commands']['execute']('aiQuickAction',_0x2dd6f9);});}['_createActionGroupButton'](_0x1be027,_0x3d9e89,_0x42666a){const _0x41cd88=new _0x8a8c30(this['locale']),_0x225b8a=new _0x1c8ce8(),_0x567a36=new Ss(this['locale'],_0x225b8a),_0x471eb9=_0x567a36['bindTemplate'],_0x5bf88b=this['_getPanelKeystroke'](_0x42666a),_0x1225a6=this['_createGroupActionsList'](_0x1be027,_0x3d9e89['actions'],_0x42666a);_0x567a36['set']({'label':_0x3d9e89['label'],'withText':!0x0,'role':Rs,'icon':_0x3d9e89['icon']??_0x2e8536,'isEnabled':_0x3d9e89['actions']['some'](_0x589ea5=>_0x589ea5['isEnabled'])}),_0x567a36['extendTemplate']({'on':{'mouseenter':_0x471eb9['to'](()=>{this['_isSearchFocused']()||_0x567a36['focus']();})}});const _0xddf4c=new _0x257cec(this['locale']);return _0xddf4c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x471eb9['to'](_0x2f5450=>{this['_handlePanelKeydown'](_0x2f5450,_0x5bf88b,_0x567a36,_0xddf4c);})}}),_0x567a36['bind']('isOn')['to'](_0xddf4c,'isVisible'),this['_bodyCollection']['add'](_0xddf4c),_0xddf4c['content']['add'](_0x1225a6),this['_setupGroupMenuBehavior'](_0x567a36,_0xddf4c),_0x41cd88['children']['add'](_0x567a36),{'listItem':_0x41cd88,'highlightView':_0x225b8a};}['_createGroupActionsList'](_0x3aa3a3,_0x4eacd9,_0x5156c9){const _0x3ab81c=new _0x24784f(this['locale']);return _0x3ab81c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4eacd9['forEach'](_0x488b55=>{const _0x3e7694=new _0x8a8c30(this['locale']),_0x281245=Pt({'editor':_0x3aa3a3,'action':_0x488b55,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3e7694['children']['add'](_0x281245),_0x5156c9['focusTracker']['add'](_0x281245),_0x3ab81c['items']['add'](_0x3e7694);}),_0x3ab81c;}['_setupGroupMenuBehavior'](_0x72897d,_0x422b91){const _0x133b0f=_0x72897d['bindTemplate'],_0x174351=this['_getButtonKeystroke'](_0x72897d);_0x72897d['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x133b0f['to'](()=>{this['_showNestedPanel'](_0x422b91,_0x72897d);}),'mouseleave':_0x133b0f['to'](_0xfce333=>{const _0x886b31=_0xfce333['relatedTarget'];this['_isMovingToNestedMenu'](_0x886b31,_0x422b91)||this['_hideNestedPanel'](_0x422b91);}),'keydown':_0x133b0f['to'](_0x2d88e3=>{_0x2d88e3['key']==_0x174351&&(this['_showNestedPanel'](_0x422b91,_0x72897d),_0x422b91['content']['get'](0x0)['focus']());})}}),_0x422b91['on']('render',()=>{_0x422b91['element']?.['addEventListener']('mouseleave',_0xcbe7ef=>{const _0x5873ac=_0xcbe7ef['relatedTarget'];_0x72897d['element']?.['contains'](_0x5873ac)||this['_isMovingToNestedMenu'](_0x5873ac,_0x422b91)||this['_hideNestedPanel'](_0x422b91);});});}['_showNestedPanel'](_0x3be0f6,_0x1be810){this['_openNestedPanels']['forEach'](_0x2b733f=>{_0x2b733f!==_0x3be0f6&&_0x2b733f['isVisible']&&_0x2b733f['hide']();}),_0x3be0f6['show'](),_0x3be0f6['pin']({'positions':[_0x3f95b9['eastSouth']],'target':_0x1be810['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3be0f6);}['_hideNestedPanel'](_0x5a3aac){_0x5a3aac['hide'](),this['_openNestedPanels']['delete'](_0x5a3aac);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1823a0=>_0x1823a0['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2cfc4d,_0x192398){if(!_0x2cfc4d)return!0x1;if(_0x192398['element']?.['contains'](_0x2cfc4d))return!0x0;const _0x24788f=_0x2cfc4d;return _0x24788f['closest']&&(null!==_0x24788f['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x24788f['closest']('.ck-ai-quick-actions-group-list')||null!==_0x24788f['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'](_0xb5b093){return'rtl'===_0xb5b093['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x980caf){return'rtl'===_0x980caf['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x246ef7,_0xaf50b7,_0x39c933,_0x1fd313){_0x246ef7['key']==_0xaf50b7&&(_0x39c933['focus'](),this['_hideNestedPanel'](_0x1fd313));}['_handleSearchResultButtonClick'](_0x1126e1){_0x1126e1['fire']('execute');}}function Ut(_0x25252c){const {editor:_0x5aea41,content:_0x58dd57,buttonDefinition:_0x164701,bodyCollection:_0x1e3518,hasSearch:_0x48f0b4=!0x1}=_0x25252c;return()=>{const _0x47dd53=_0x5aea41['locale'],_0x4e8227=_0x35c3bd(_0x47dd53);_0x4e8227['buttonView']['set']({'icon':_0x164701['icon']??_0x2e8536,'label':_0x164701['label'],'tooltip':!0x0}),_0x4e8227['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x22fc81=new ao(_0x5aea41,_0x58dd57,_0x4e8227,_0x1e3518,_0x48f0b4);if(_0x4e8227['panelView']['children']['add'](_0x22fc81),_0x48f0b4){const _0x17d7ef='ai-quick-actions-dropdown-selection';_0x4e8227['on']('change:isOpen',(_0x92f098,_0x3e5e0d,_0x35be8b)=>{if(_0x35be8b){if(_0x5aea41['plugins']['has']('AIEditing')){const _0x531592=_0x5aea41['plugins']['get'](c),_0x377f3e=_0x5aea41['model']['document']['selection'],_0x5bb0a1=Array['from'](_0x377f3e['getRanges']());_0x5bb0a1['length']>0x0&&_0x531592['showFakeVisualSelection'](_0x5bb0a1,_0x17d7ef,!0x1,!0x0);}}else _0x5aea41['plugins']['has']('AIEditing')&&_0x5aea41['plugins']['get'](c)['hideFakeVisualSelection'](_0x17d7ef),_0x22fc81['resetSearch']();});}return _0x4e8227;};}const Lt='<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>',Dt='<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>',Ht='<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 Nt=function(_0x18c4e2){return _0x18c4e2['CHAT']='CHAT',_0x18c4e2['ACTION']='ACTION',_0x18c4e2['REVIEW']='REVIEW',_0x18c4e2;}({}),Ka=function(_0x588cad){return _0x588cad['CHAT']='AIChat',_0x588cad['ACTION']='AIActions',_0x588cad['REVIEW']='AIReviewMode',_0x588cad;}({});class gi extends _0x2a4cc7{static get['requires'](){return[Rt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x13979f=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x13979f),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x31a452){return function(_0x118573){const _0xed06a1=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x118573['uiLanguage']),_0x2e8a61=_0xed06a1||'English',_0x29b14f=[{'id':'ask-ai','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Qt},{'id':'chat-commands','label':y(_0x118573,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Qt,'actions':[{'id':'explain','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Lt['replace']('%0',_0x2e8a61),'type':'CHAT'},{'id':'summarize','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Dt['replace']('%0',_0x2e8a61),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ht['replace']('%0',_0x2e8a61),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Ot},{'id':'continue','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':St},{'id':'fix-grammar','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':xt},{'id':'adjust-length','label':y(_0x118573,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':y(_0x118573,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Tt,'actions':[{'id':'make-tone-casual','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':vt,'actions':[{'id':'translate-to-english','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':y(_0x118573,'AI_QUICK_ACTIONS_OTHER'),'icon':Et,'actions':[]}];return _0x29b14f;}(_0x31a452);}async['_getDefaultAndCustomActions'](){const _0x5b59cf=gi['getDefaultQuickActions'](this['editor']['locale']),_0x230f83=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2441c3=[];try{_0x2441c3=await new Mt({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels')})['getAvailableModels']();}catch(_0x176f1f){const _0x51bcde=new _0x19ee7d('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x176f1f});_0x543541(_0x51bcde['message']);}finally{const _0x448d35=_0x230f83['map'](_0x8fee36=>({..._0x8fee36,'icon':void 0x0}));_0x5b59cf['find'](_0x190376=>'other'===_0x190376['id'])['actions']['push'](..._0x448d35),_0x5b59cf['forEach'](_0x3cf452=>{if('actions'in _0x3cf452)_0x3cf452['actions']['forEach'](_0x1c9dcd=>{if(_0x1c9dcd['isEnabled']=!!_0x2441c3['find'](_0x5d5dbc=>_0x5d5dbc['id']===_0x1c9dcd['model'])||void 0x0===_0x1c9dcd['model'],!_0x1c9dcd['isEnabled']){const _0x41fe29=new _0x19ee7d('ai-quick-actions-unavailable-model',this,{'actionId':_0x1c9dcd['id'],'modelId':_0x1c9dcd['model']});_0x543541(_0x41fe29['message']);}});else{if(_0x3cf452['isEnabled']=!!_0x2441c3['find'](_0x4a725e=>_0x4a725e['id']===_0x3cf452['model'])||void 0x0===_0x3cf452['model'],!_0x3cf452['isEnabled']){const _0x165f26=new _0x19ee7d('ai-quick-actions-unavailable-model',this,{'actionId':_0x3cf452['id'],'modelId':_0x3cf452['model']});_0x543541(_0x165f26['message']);}}});}return _0x5b59cf;}['_initializeQuickActionsComponentsAndCommands'](){const _0xede036=new Kt(this['editor']['locale']);_0xede036['attachToDom'](),this['_initializeQuickActionsDropdown'](_0xede036),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0xede036);}['_initializeQuickActionsDropdown'](_0x272e80){const _0x54ab8b=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ut({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x2e8536,'label':y(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x272e80,'hasSearch':_0x54ab8b}));}['_prepareQuickActionsDefinition'](_0x294225){this['_quickActionsDefinition']=_0x294225['map'](_0x48a1b3=>{if('actions'in _0x48a1b3){const _0x4f57e1=_0x48a1b3;return{..._0x4f57e1,'actions':_0x4f57e1['actions']['map'](_0x3dffe7=>{const {actions:_0xb85a02,..._0x5f4561}=_0x4f57e1;return{..._0x3dffe7,'parent':_0x5f4561};})['filter'](_0xac5a91=>this['_shouldIncludeAction'](_0xac5a91))};}return _0x48a1b3;})['filter'](_0x584f6e=>'actions'in _0x584f6e?_0x584f6e['actions']['length']>0x0:this['_shouldIncludeAction'](_0x584f6e));}['_shouldIncludeAction'](_0x210634){const _0x48ca7b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ka[_0x210634['type']])&&!_0x48ca7b['includes'](_0x210634['id']);}['_initializeQuickActionsComponents'](_0x42e16f){this['_quickActionsDefinition']['forEach'](_0x5c47b2=>{if('actions'in _0x5c47b2){const _0x10cfb8=Ut({'editor':this['editor'],'content':_0x5c47b2['actions'],'buttonDefinition':_0x5c47b2,'bodyCollection':_0x42e16f});this['editor']['ui']['componentFactory']['add'](_0x5c47b2['id'],_0x10cfb8),_0x5c47b2['actions']['forEach'](_0x81a6c8=>{const _0x368555=Pt({'editor':this['editor'],'action':_0x81a6c8});this['editor']['ui']['componentFactory']['add'](_0x81a6c8['id'],_0x368555);});}else{const _0x4733b0=Pt({'editor':this['editor'],'action':_0x5c47b2,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x5c47b2['id'],_0x4733b0);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x75e355=>{const _0x41b11c=new _0xc03205(_0x75e355),_0x171470=y(_0x75e355,'AI_QUICK_ACTIONS_HEADING');_0x41b11c['buttonView']['set']({'label':_0x171470,'icon':_0x2e8536});const _0xd4aa3=new _0x1c5a64(_0x75e355);_0xd4aa3['set']({'ariaLabel':_0x171470,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x54ca23=>{if('actions'in _0x54ca23){const _0x118eb6=_0x54ca23,_0xf5aace=new _0x4b1a57(_0x75e355,_0x41b11c),_0xa8efee=new _0xc03205(_0x75e355),_0x49d75a=new _0x1c5a64(_0x75e355);_0xa8efee['buttonView']['set']({'label':_0x118eb6['label'],'icon':_0x118eb6['icon']}),_0x118eb6['actions']['forEach'](_0x356b39=>{const _0x3a5dc1=new _0x4b1a57(_0x75e355,_0xa8efee),_0x6ff6d9=new _0x4f4ee6(_0x75e355);_0x6ff6d9['set']({'label':_0x356b39['displayedPrompt'],'icon':_0x356b39['icon'],'role':'menuitem','isEnabled':_0x356b39['isEnabled']}),_0x6ff6d9['on']('execute',()=>{this['_executeQuickAction'](_0x356b39);}),_0x6ff6d9['delegate']('execute')['to'](_0xa8efee),_0x3a5dc1['children']['add'](_0x6ff6d9),_0x49d75a['items']['add'](_0x3a5dc1);}),_0xa8efee['panelView']['children']['add'](_0x49d75a),_0xf5aace['children']['add'](_0xa8efee),_0xd4aa3['items']['add'](_0xf5aace);}else{const _0x237447=_0x54ca23,_0x401096=new _0x4b1a57(_0x75e355,_0x41b11c),_0x5028fa=new _0x4f4ee6(_0x75e355);_0x5028fa['set']({'label':_0x237447['displayedPrompt'],'icon':_0x237447['icon'],'role':'menuitem','isEnabled':_0x237447['isEnabled']}),_0x5028fa['on']('execute',()=>{this['_executeQuickAction'](_0x237447);}),_0x5028fa['delegate']('execute')['to'](_0x41b11c),_0x401096['children']['add'](_0x5028fa),_0xd4aa3['items']['add'](_0x401096);}});const _0xf71241=Object['values'](Ka)['some'](_0x4ceaad=>this['editor']['plugins']['has'](_0x4ceaad));return _0x41b11c['set']({'isEnabled':_0xf71241}),_0x41b11c['panelView']['children']['add'](_0xd4aa3),_0x41b11c;});}['_executeQuickAction'](_0xd95f14){const _0x51615f=this['editor'];_0x51615f['editing']['view']['focus'](),_0x51615f['commands']['execute']('aiQuickAction',_0xd95f14);const _0x18679c=_0x51615f['ui']['view']['menuBarView'];_0x18679c&&_0x18679c['close']&&_0x18679c['close']();}}class Ii extends At{['execute'](_0xd7750f){switch(this['_expandSelectionIfCollapsed'](),_0xd7750f['type']){case Nt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x158aaf=y(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x19ee7d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x158aaf});}this['_handleAIChatAction'](_0xd7750f);break;case Nt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x2dc3f6=y(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x19ee7d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2dc3f6});}this['_handleAIActionsAction'](_0xd7750f);break;case Nt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x2e5f7c=y(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x19ee7d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2e5f7c});}this['_handleAIReviewAction'](_0xd7750f);}}async['_handleAIChatAction'](_0x1a5cb2){const _0x5d6080=this['editor']['plugins']['get']('AIChat'),_0x537af5=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x1a5cb2['id'])_0x537af5['removeSelectionFromChatContext'](),await _0x5d6080['addSelectionToChatContext'](),_0x5d6080['focusPromptInput']();else await _0x5d6080['startConversation'](),_0x537af5['removeSelectionFromChatContext'](),await _0x5d6080['addSelectionToChatContext'](),_0x5d6080['focusPromptInput'](),await _0x5d6080['sendMessage']({'message':_0x1a5cb2['prompt']||_0x1a5cb2['displayedPrompt'],'quickActionData':{'id':_0x1a5cb2['id'],'displayedPrompt':_0x1a5cb2['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x1f7c4f=this['editor'],_0x44f153=_0x1f7c4f['model']['document']['selection'];if(!_0x44f153['isCollapsed'])return;const _0x1c17e0=_0x4e3c0f(_0x44f153['getSelectedBlocks']())||_0x1f7c4f['model']['schema']['getLimitElement'](_0x44f153);_0x1f7c4f['model']['change'](_0x1dac7a=>{_0x1dac7a['setSelection'](_0x1c17e0,'in');});}['_handleAIActionsActionLabel'](_0x54235b){return _0x54235b['parent']?.['label']&&'other'!==_0x54235b['parent']?.['id']?_0x54235b['parent']['label']+':\x20'+_0x54235b['displayedPrompt']:_0x54235b['displayedPrompt'];}async['_handleAIActionsAction'](_0x4a5d9b){const _0x36c6a7=this['editor']['plugins']['get']('AIActions'),_0x286bb3=_0x4a5d9b['prompt']?{'userMessage':_0x4a5d9b['prompt'],'model':_0x4a5d9b['model']}:{'actionName':_0x4a5d9b['actionName']||_0x4a5d9b['id'],'args':_0x4a5d9b['args']},_0x3d4cb6=this['_handleAIActionsActionLabel'](_0x4a5d9b);await _0x36c6a7['executeAction'](_0x286bb3,_0x3d4cb6,_0x4a5d9b['icon']);}async['_handleAIReviewAction'](_0x199acb){console['log']('handleAIReviewAction',_0x199acb);}}class ki extends _0x2a4cc7{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x39704a=this['editor'],_0x2ffa73=new Ii(this['editor']);if(_0x39704a['commands']['add']('aiQuickAction',_0x2ffa73),_0x39704a['plugins']['has']('AIChat')){const _0x46a783=this['editor']['plugins']['get']('AIChat');_0x39704a['model']['document']['selection']['on']('change:range',(_0x41131c,_0x15e8b3)=>{_0x15e8b3['directChange']&&_0x46a783['removeSelectionFromChatContext']();});}}}class zt extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0xc84277=this['documentContextContent']['children']['map'](_0x4447d0=>({'node':_0x4447d0,'id':K(_0x4447d0,'data-id')})),_0x5621c9=this['parsedMergedContent']['children']['map'](_0x4653ab=>({'node':_0x4653ab,'id':K(_0x4653ab,'data-id')||_0x3bb1ce()})),_0x126175=_0x26ee2a(_0xc84277,_0x5621c9,{'comparator':(_0x25e74b,_0x1945a3)=>_0x25e74b['id']==_0x1945a3['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x126175['length']&&_0x126175[_0x126175['length']-0x1]['removed'];)_0x126175['pop']();}const _0x2a7191=_0x126175['map'](_0x1267fc=>{const _0x1d6ca4=_0x1267fc['added']?'new':_0x1267fc['removed']?'removed':'modified';return{'node':_0x1267fc['value'][0x0]['node'],'type':_0x1d6ca4,'id':_0x1267fc['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2a7191,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x551e4c,_0x4b9732){return _0x4b9732;}}class l extends jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2228d2){super(_0x2228d2),this['content']=_0x2228d2['content'],this['version']=_0x2228d2['version'],this['actionName']=_0x2228d2['actionName'],this['args']=_0x2228d2['args'],this['userMessage']=_0x2228d2['userMessage'],this['model']=_0x2228d2['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':Ft['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x551756){const _0xa28130=new zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x551756});return this['replies']['push'](_0xa28130),_0xa28130['delegate'](...qt)['to'](this),this['fire']('replyCreated',_0xa28130),_0xa28130;}}class ji extends _0x2a4cc7{static get['requires'](){return[s,_0x43b27c,c,w,_0x1f61c4];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x2b3021();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x6a0249){super(_0x6a0249),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x4da1df,_0x490756,_0xd9f14f){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x39c505,anchorData:_0x3f0b4a}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x4da1df,_0x39c505,_0x3f0b4a,_0x490756,_0xd9f14f);}}const {modelFragment:_0x2b13cb,anchorData:_0x4c0f45}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x4da1df,_0x2b13cb,_0x4c0f45,_0x490756,_0xd9f14f);}['_getExecuteDataRegular'](){const _0x486d79=this['editor']['model']['document']['selection'];if(_0x486d79['isCollapsed']){const _0x8faf0b=_0x4e3c0f(_0x486d79['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x486d79);this['editor']['model']['change'](_0xda9a78=>{_0xda9a78['setSelection'](_0x8faf0b,'in');});}const _0x558efc=_0x486d79['getFirstRange'](),_0x27419d=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x486d79),_0x558efc['start'],_0x558efc['end']),_0x3b65c5=_0x486d79['getFirstRange']()['start'],_0xc74ef5=new Map();let _0x3bbacf=_0x27419d;for(let _0x4fa76e=0x0;_0x4fa76e<_0x3b65c5['path']['length'];_0x4fa76e++)_0xc74ef5['set'](_0x3bbacf,_0x3b65c5['path'][_0x4fa76e]),_0x3bbacf=_0x3bbacf['getChild'](0x0);return{'modelFragment':_0x27419d,'anchorData':_0xc74ef5};}['_getExecuteDataInTable'](){const _0x4705d6=this['editor']['model']['document']['selection'],_0x537156=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4af8eb=_0x4705d6['getFirstRange']()['start']['parent']['parent'],_0x470479=this['_wrapWithCommonAncestors'](_0x537156,this['editor']['model']['createPositionBefore'](_0x4af8eb),this['editor']['model']['createPositionAfter'](_0x4af8eb)),_0x316a13=_0x4705d6['getFirstRange']()['start'],_0x1449e5=new Map();let _0x56304b=_0x470479;for(let _0x25ecf1=0x0;_0x25ecf1<_0x316a13['path']['length'];_0x25ecf1++)if(_0x1449e5['set'](_0x56304b,_0x316a13['path'][_0x25ecf1]),_0x25ecf1<_0x316a13['path']['length']-0x1)_0x56304b=_0x56304b['getChild'](0x0);else{let _0x2d0286=_0x56304b['nextSibling'];for(;_0x2d0286;)_0x1449e5['set'](_0x2d0286,_0x316a13['path'][_0x25ecf1]),_0x2d0286=_0x2d0286['nextSibling'];}return{'modelFragment':_0x470479,'anchorData':_0x1449e5};}['_executeAction'](_0xa03494,_0x36a47a,_0x194111,_0x30d8f8,_0x1257aa){const _0x4bca4f=this['editor']['plugins']['get'](c),_0x12014d=this['editor']['plugins']['get'](w),_0x51610f=this['editor']['model']['document']['selection'],_0xf28e81=_0x4bca4f['modelToViewWithIds'](_0x36a47a),_0x3646c9=this['editor']['data']['processor']['toData'](_0xf28e81),_0x1f6724=this['editor']['model']['document']['version'],_0x4752be=[..._0x51610f['getRanges']()];let _0x5d7c0a=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x5d7c0a=_0x5d7c0a['filter'](_0x379806=>'insertSuggestion'!=_0x379806));const _0x3d1c30=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x5d7c0a});return _0x12014d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x30d8f8,'icon':_0x1257aa||_0x2e8536,'mainView':_0x3d1c30,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x4752be}),this['_setLoadingState'](_0x3d1c30,_0x12014d),this['listenTo'](_0x12014d,'applySuggestion',()=>{this['_applyChanges'](_0x36a47a,_0x194111,!0x1);}),this['listenTo'](_0x12014d,'insertSuggestion',()=>{this['_applyChanges'](_0x36a47a,_0x194111,!0x0);}),this['listenTo'](_0x12014d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x12014d,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x33a7fc=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x463282=_0x33a7fc['changeGroups'][0x0];_0x463282&&'pending'===_0x463282['state']&&_0x33a7fc['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x12014d);}),this['_createInteraction'](_0x3646c9,_0x1f6724,_0x3d1c30,_0x12014d,_0xa03494);}['_wrapWithCommonAncestors'](_0x22e717,_0x6beec9,_0x1e7b0b){const _0x374f41=this['editor']['model']['createRange'](_0x6beec9,_0x1e7b0b)['getCommonAncestor'](),_0x13a5cf=_0x374f41['is']('documentFragment')?[]:_0x374f41['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x13a5cf['length']){const _0x2decc2=_0x13a5cf['map'](_0x4a131b=>_0x4a131b['_clone'](!0x1));for(let _0x58cb53=0x1;_0x58cb53<_0x2decc2['length'];_0x58cb53++)_0x2decc2[_0x58cb53-0x1]['_appendChild'](_0x2decc2[_0x58cb53]);return _0x2decc2[_0x2decc2['length']-0x1]['_appendChild'](_0x22e717),new _0x246996(_0x2decc2[0x0]);}return _0x22e717;}async['_createInteraction'](_0x3ebfc4,_0x3d0cae,_0x3f0880,_0x158acc,_0x5b53e8){const _0x3000f4=this['editor'];this['_interactionParams']={'action':_0x5b53e8,'content':_0x3ebfc4,'version':_0x3d0cae,'mainView':_0x3f0880,'aiBalloon':_0x158acc};const _0x32114d=new l({'connector':this['_aiConnector'],'editor':_0x3000f4,'content':_0x3ebfc4,'version':_0x3d0cae,..._0x5b53e8});this['_interactions']['push'](_0x32114d),_0x3f0880['hideError']();const _0x251ae0=(_0xe5791f,_0x143b18,_0x133ab4=!0x1,_0x119916='streaming')=>this['_promiseQueue']['enqueue'](async _0x495f85=>{try{const _0x272246=C({'editor':_0x3000f4,'changeGroups':_0xe5791f['changeGroups'],'documentContextContent':_0xe5791f['documentContextContent'],'showDiff':_0x133ab4,'trimUnchanged':!0x1});await _0x143b18['updateContent']({'parts':_0x272246,'renderingStrategy':_0x119916,'abortSignal':_0x495f85});}catch(_0x40f7f5){if(this['_isAbortError'](_0x40f7f5))return;throw _0x40f7f5;}});this['_interaction']['on']('replyCreated',(_0x4fe03c,_0x14898f)=>{_0x3f0880['hideLoader'](),_0x158acc['startAutoScroll'](),_0x251ae0(_0x14898f,_0x3f0880)['catch'](_0x1d9441=>{this['_isAbortError'](_0x1d9441)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x1d9441),this['_setErrorState'](_0x32114d,_0x3f0880));});}),this['_interaction']['on']('replyContentUpdated',(_0x52e101,_0x463038)=>{_0x251ae0(_0x463038,_0x3f0880)['catch'](_0x361e8a=>{this['_isAbortError'](_0x361e8a)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x361e8a),this['_setErrorState'](_0x32114d,_0x3f0880));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x3f0880,_0x158acc),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x31aa9d){this['_isAbortError'](_0x31aa9d)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x31aa9d),this['_setErrorState'](_0x32114d,_0x3f0880));}finally{_0x158acc['stopAutoScroll']();}}),this['listenTo'](_0x3f0880,'toggleSuggestionDisplayMode',async(_0x1afff5,{showDiff:_0x4709d4})=>{try{this['_balloonShowDiff']=_0x4709d4;const _0x4675f9=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4675f9&&await _0x251ae0(_0x4675f9,_0x3f0880,_0x4709d4,'static');}catch(_0x395a77){this['_isAbortError'](_0x395a77)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x395a77),this['_setErrorState'](_0x32114d,_0x3f0880));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x4bb128,{reply:_0x2fe850})=>{const _0x5487fa={'positiveCount':_0x2fe850['changeGroups']['filter'](_0x2c4961=>'accepted'===_0x2c4961['state'])['length'],'totalCount':_0x2fe850['changeGroups']['length']},_0x307d4a=this['_interaction']['actionCallId'],_0x276a99=this['_interaction']['actionName'];_0x276a99?this['_aiConnector']['upsertAIActionRating'](_0x276a99,_0x307d4a,_0x5487fa):this['_aiConnector']['upsertCustomAIActionRating'](_0x307d4a,_0x5487fa);}),this['_setLoadingState'](_0x3f0880,_0x158acc);try{const _0x1c3523=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x1c3523;}catch(_0x24d3b5){if(this['_isAbortError'](_0x24d3b5))return;_0x3f0880['hideLoader'](),this['_setErrorState'](_0x32114d,_0x3f0880);}}['_applyChanges'](_0xd50c05,_0x4f6c6e,_0x51f31b){const _0x47d577=this['editor'];if(_0x51f31b&&!_0x47d577['plugins']['has']('TrackChanges'))throw new _0x19ee7d('ai-no-track-changes',null);const _0x4bfb39=this['editor']['plugins']['get'](_0x1f61c4),_0xbb8c3=this['_interaction'],_0x4a5657=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x49d146=_0x4a5657['changeGroups'];_0x4a5657['setChangeGroupState'](0x0,'accepted');let _0x10cb57=v({'editor':_0x47d577,'reply':_0x4a5657,'interaction':_0xbb8c3,'groups':_0x49d146,'transform':!0x1,'documentCompare':_0x4bfb39,'documentCompareOptions':{'anchor':_0x47d577['model']['createPositionAt'](_0xd50c05,0x0),'markDeletions':_0x51f31b}});_0x10cb57=this['_filterOperationsOutsideRange'](_0x10cb57,_0x4f6c6e);for(const _0x4b4849 of _0x10cb57)this['_anchorOperation'](_0x4f6c6e,_0x4b4849,_0x47d577['model']['document']['getRoot']());const _0x72c723=_0xbb8c3['getDocumentContext']()['version'],_0x7a32af=_0x47d577['model']['document']['history']['getOperations'](_0x72c723),_0x4d68a3={'document':_0x47d577['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x13eb0c=_0x39cd19(_0x10cb57,_0x7a32af,_0x4d68a3)['operationsA'];_0x47d577['model']['change'](_0x31fce5=>{if(_0x31fce5['setSelection'](_0x47d577['model']['document']['selection']['focus']),_0x51f31b)_0x47d577['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x13eb0c);else{for(const _0x59c530 of _0x13eb0c)_0x59c530['baseVersion']=_0x47d577['model']['document']['version'],b(_0x47d577,_0x59c530),_0x31fce5['batch']['addOperation'](_0x59c530),_0x47d577['model']['applyOperation'](_0x59c530);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x125c76,_0x22fbc3){return _0x125c76['filter'](_0x24dcaf=>{if('rename'==_0x24dcaf['type']){const _0xc1a4db=_0x24dcaf['position']['nodeAfter'];return!_0x22fbc3['has'](_0xc1a4db);}if(_0x24dcaf['type']['indexOf']('Attribute')>-0x1){const _0x2b9082=_0x24dcaf['range']['start']['nodeAfter'];return!_0x22fbc3['has'](_0x2b9082);}return!0x0;});}['_anchorOperation'](_0x141145,_0xc4ff74,_0x319c21){const _0x1e1244=_0xc4ff74['clone']();for(const _0x3ec564 in _0xc4ff74){const _0x49258d=_0xc4ff74[_0x3ec564];_0x49258d instanceof _0x184fda?_0xc4ff74[_0x3ec564]=new _0x184fda(_0x32bf2e(_0x49258d['start']),_0x32bf2e(_0x49258d['end'])):_0x49258d instanceof _0x5a23f1&&(_0xc4ff74[_0x3ec564]=_0x32bf2e(_0x49258d));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1e1244['type'])){if(_0x1e1244['isDocumentOperation']=!0x1,_0x1e1244['baseVersion']=null,'remove'==_0x1e1244['type']){const _0x38a4b6=_0x1e1244['sourcePosition'],_0x2e132f=_0x1e1244['howMany'];new _0x253f92(_0x38a4b6,_0x2e132f)['_execute']();}else _0x1e1244['_execute']();}function _0x32bf2e(_0x51ae91){if('$graveyard'==_0x51ae91['root']['rootName'])return _0x51ae91;const _0x34dd88=[];let _0x3cea4e=_0x51ae91['root'];for(let _0x111c1c=0x0;_0x111c1c<_0x51ae91['path']['length'];_0x111c1c++){const _0x4961f9=_0x141145['get'](_0x3cea4e)||0x0;_0x34dd88[_0x111c1c]=_0x51ae91['path'][_0x111c1c]+_0x4961f9,_0x3cea4e=_0x3cea4e['getChildAtOffset'](_0x51ae91['path'][_0x111c1c]);}return new _0x5a23f1(_0x319c21,_0x34dd88,_0x51ae91['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2281c5,content:_0x431aaa,version:_0x34e979,mainView:_0x4b3a32,aiBalloon:_0xebe38d}=this['_interactionParams'];_0x4b3a32['areChangesVisible']=!0x1,_0x4b3a32['hideError'](),this['_clearErrorState'](_0x4b3a32,_0xebe38d);const _0x4efab7=_0x4b3a32;_0x4efab7['miniToolbarView']&&_0x4efab7['miniToolbarView']['showChangesButton']&&_0x4efab7['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x376600}),this['_clearSuggestionContent'](_0x4b3a32),_0x4b3a32['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x4b3a32),this['_createInteraction'](_0x431aaa,_0x34e979,_0x4b3a32,_0xebe38d,_0x2281c5)['catch'](_0x4c5ec2=>{this['_isAbortError'](_0x4c5ec2)||console['error']('Error\x20refreshing\x20interaction:',_0x4c5ec2);});}['_clearSuggestionContent'](_0x303c9d){const _0x449935=_0x303c9d['bodyView']['_children'];for(;_0x449935['length']>0x0;)_0x449935['remove'](_0x449935['first']);_0x303c9d['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x19c473){return!!_0x19c473['message']&&_0x19c473['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x826cf5=new _0x21bd9e(this['editor']['locale']),_0x25e4a0=new _0x21bd9e(this['editor']['locale']),_0x55f268=new _0x492b6b(this['editor']['locale']),_0x5716e9=new _0x21bd9e(this['editor']['locale']);_0x826cf5['set']({'icon':_0x4e53d3,'label':y(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x25e4a0['set']({'icon':_0x48be9f,'tooltip':y(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x55f268['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x5716e9['set']({'icon':_0x395cb2,'tooltip':y(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x826cf5['bind']('isEnabled')['to'](this,'isBusy',_0x457e9c=>!_0x457e9c),_0x826cf5['on']('execute',()=>{this['_refreshInteraction']();}),_0x25e4a0['bind']('isEnabled')['to'](this,'isBusy',_0x206a42=>!_0x206a42),_0x25e4a0['on']('execute',()=>{this['_navigateToPrevious']();}),_0x5716e9['bind']('isEnabled')['to'](this,'isBusy',_0x21d052=>!_0x21d052),_0x5716e9['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x25e4a0,this['_navigationCounter']=_0x55f268,this['_navigationNextButton']=_0x5716e9,this['_customViews']['add'](_0x826cf5);}['_navigateToPrevious'](){const _0x16c219=this['_interactions']['length'];this['_currentInteractionIndex']<_0x16c219-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4fb78a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4fb78a;const {mainView:_0x23a8b0}=this['_interactionParams'],_0x3b26fe=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3b26fe)return;if(_0x3b26fe['hasError'])return this['_setErrorState'](_0x3b26fe,_0x23a8b0),void this['_updateNavigationUI']();if(!_0x3b26fe['replies']['length'])return;_0x23a8b0['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x23a8b0,this['_interactionParams']['aiBalloon']);const _0x2fe4b7=_0x3b26fe['replies'][_0x3b26fe['replies']['length']-0x1];if(_0x2fe4b7){const _0x881225=this['editor'];this['_clearSuggestionContent'](_0x23a8b0);try{const _0x5d928b=C({'editor':_0x881225,'changeGroups':_0x2fe4b7['changeGroups'],'documentContextContent':_0x2fe4b7['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x23a8b0),await new Promise(_0x5bfcf3=>setTimeout(_0x5bfcf3,0x32)),await _0x23a8b0['updateContent']({'parts':_0x5d928b,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x4cc839){this['_isAbortError'](_0x4cc839)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x4cc839);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0xfbdb8d=this['_interactions']['length'],_0x10df58=_0xfbdb8d>0x1,_0x5eb52a=this['_interactionParams']?.['mainView'];if(_0x10df58){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x5eb52a?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x5eb52a?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x5eb52a?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x744859=_0xfbdb8d-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x744859+'/'+_0xfbdb8d),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0xfbdb8d-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x5eb52a?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x5eb52a?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x5eb52a?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x1dd0fb,_0x380928){_0x1dd0fb['setLoading'](),_0x380928['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x490b89,_0x13eb2b){const _0x1c5e4b=y(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x13eb2b['showError'](_0x1c5e4b),_0x490b89['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x13eb2b['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x5a546c,_0x4d21f2){_0x5a546c['clearErrorState'](),_0x4d21f2['balloonView']['toolbar']&&(_0x4d21f2['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x4d2014,_0x50b00a){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x4d2014['clearLoading'](),_0x50b00a['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x102aaa=>{'isEnabled'in _0x102aaa&&(_0x102aaa['isEnabled']=!0x1);});}}class Wa extends _0x2a4cc7{static get['requires'](){return[gi,ki,ji];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9d3bc9){super(_0x9d3bc9),_0x9d3bc9['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x19935c,title:_0x213fef,description:_0x349a09,isParameterized:_0x31339d,useArgs:_0x3dd923,options:_0x221592}){this['id']=_0x19935c,this['title']=_0x213fef,this['description']=_0x349a09,this['isParameterized']=_0x31339d,this['useArgs']=_0x3dd923,this['options']=_0x221592;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x5ee0a1){this['_models']=_0x5ee0a1;}}class Ri extends $t(){['_checks'];constructor(_0x2f622d){super(),this['_checks']=this['_mapCheckDefinitions'](_0x2f622d);}get['checks'](){return this['_checks'];}['getCheckById'](_0x11a407){return this['checks']['find'](_0x1c8a43=>_0x1c8a43['id']===_0x11a407);}['removeCheckById'](_0x23b172){this['_checks']=this['_checks']['filter'](_0x4916eb=>_0x4916eb['id']!==_0x23b172);}['_mapCheckDefinitions'](_0x53bce1){return _0x53bce1['map'](_0x53cbb8=>'custom'===_0x53cbb8['id']?new Bs(_0x53cbb8):new js(_0x53cbb8));}}class Ds extends _0x3dcb71(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x16183f,contentNew:_0x2997ab,contentInitial:_0x3309f1,documentVersion:_0x1cce16}){super(),this['id']=_0x16183f,this['contentNew']=_0x2997ab,this['contentInitial']=_0x3309f1,this['documentVersion']=_0x1cce16;}}class Es extends $t(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x59dae2,_0x4fab11,_0x10bb10){super(),this['id']=_0x59dae2,this['parent']=_0x10bb10,this['_data']=_0x4fab11,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class zs extends $t(){['id']=_0x3bb1ce();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x5a059f,_0x385f4d,_0x250a4f,_0xb1f14b,_0x1d4a83){super(),this['_sourceCheck']=_0x385f4d,this['_documentData']=_0x5a059f,this['_aiConnector']=_0x250a4f,this['_reviewParams']=_0xb1f14b,this['_reviewArgs']=_0x1d4a83,this['on']('change:status',(_0x5aa44d,_0x5ed137,_0x68dbbe)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x68dbbe,'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'](_0x586d8f=>'pending'===_0x586d8f['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x482e28){this['_documentData']=_0x482e28;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3082ee=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x18944b of _0x3082ee)'unmodified'!==_0x18944b['data']['operation']&&('error'!==_0x18944b['data']['operation']?'review-metadata'!==_0x18944b['event']?this['_addReviewCheckResult'](_0x18944b['data']['dataId'],_0x18944b['data']['textDelta']):this['callId']=_0x18944b['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x317920){this['_currentError']=_0x317920,_0x317920 instanceof Error&&_0x317920['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'](_0x378ea8,_0x53c8c4){const _0xaff160=this['_results']['get'](_0x378ea8);if(!_0xaff160)return;const _0x2dab24=[];_0x53c8c4['forEach']((_0x10bcb0,_0x105b24)=>{const _0x1cc74d=new Es(_0xaff160['id']+'-'+_0x105b24,_0x10bcb0,_0xaff160);_0x1cc74d['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1cc74d,'status':_0x1cc74d['status']});}),_0x1cc74d['on']('change:isActivated',()=>{_0x1cc74d['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1cc74d}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1cc74d});}),this['_changes']['push'](_0x1cc74d),_0x2dab24['push'](_0x1cc74d);}),this['fire']('reviewCheckResultReady',{'changes':_0x2dab24,'result':_0xaff160,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x16e0d9){const _0x14c27e=this['_changes']['find'](_0x44e995=>_0x44e995['id']===_0x16e0d9);return!(!_0x14c27e||'pending'!==_0x14c27e['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xf9ed58=>!0x0===_0xf9ed58['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x5a91c2=>'pending'===_0x5a91c2['status']);}['getChangeById'](_0xa2930d){return this['_changes']['find'](_0x58c033=>_0x58c033['id']===_0xa2930d);}['markAllChangesAsAccepted'](){for(const _0x3bb7fa of this['_changes'])'pending'===_0x3bb7fa['status']&&(_0x3bb7fa['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1b3426){const _0x58eddd=this['_changes']['find'](_0x240f47=>_0x240f47['id']===_0x1b3426);_0x58eddd&&'pending'===_0x58eddd['status']&&(_0x58eddd['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x502678){const _0x572770=this['_changes']['find'](_0xf8f2e5=>_0xf8f2e5['id']===_0x502678);_0x572770&&'pending'===_0x572770['status']&&(_0x572770['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xa90690){const _0x5912b2=this['_changes']['find'](_0x244e52=>_0x244e52['id']===_0xa90690);_0x5912b2&&'pending'===_0x5912b2['status']&&(_0x5912b2['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x43ff15){const _0x3d2aa0=this['_changes']['find'](_0x89bc85=>_0x89bc85['id']===_0x43ff15);_0x3d2aa0&&'outdated'===_0x3d2aa0['status']&&(_0x3d2aa0['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3eb3ab){this['_changes']['filter'](_0x5f3a1d=>_0x5f3a1d['isActivated']&&_0x5f3a1d['id']!==_0x3eb3ab)['forEach'](_0x2281e6=>{_0x2281e6['isActivated']=!0x1;});const _0x17952b=this['_changes']['find'](_0x3895c9=>_0x3895c9['id']===_0x3eb3ab);_0x17952b&&'pending'===_0x17952b['status']&&(_0x17952b['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3f5e90=>_0x3f5e90['isActivated'])['forEach'](_0x30edcd=>{_0x30edcd['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x446e29){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x63d52;if(_0x446e29){const _0x531a06=this['_changes']['find'](_0x4568f4=>_0x4568f4['id']===_0x446e29);if(_0x531a06&&_0x531a06['isRated'])return;_0x531a06&&(_0x63d52=_0x531a06['parent']['id'],_0x531a06['isRated']=!0x0);}const _0x54fe9c={'positiveCount':this['_changes']['filter'](_0x3c1b96=>'accepted'===_0x3c1b96['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x54fe9c,this['callId'],_0x63d52);}['_addReviewCheckResult'](_0x3bdc9b,_0x5c1944){const _0x59fab4=this['_documentData']['elements']['get'](_0x3bdc9b);if(!_0x59fab4)return;const _0x3e38c9=_0x59fab4['getContent']();if(_0x3e38c9===_0x5c1944)return;const _0x58dac4=new Ds({'id':_0x3bdc9b,'contentInitial':_0x3e38c9,'contentNew':_0x5c1944,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x58dac4['id'],_0x58dac4),this['fire']('reviewCheckResultAdded',{'result':_0x58dac4,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x55ba65=>'pending'===_0x55ba65['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x243e3b=>'pending'===_0x243e3b['status'])['length']&&(this['status']='finished'));}}class _i extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x4affce=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x171df2=0x0;_0x171df2<this['_reviewParams']['length'];_0x171df2++){if(!this['_reviewParams'][_0x171df2]||!this['_sourceCheck']['options'][_0x171df2])continue;const _0x456c8=this['_sourceCheck']['options'][_0x171df2],_0xf441f9=_0x456c8['data']?.['find'](_0x5d7758=>_0x5d7758['id']===this['_reviewParams'][_0x171df2]);_0xf441f9&&_0x4affce['push'](_0xf441f9['label']);}return _0x4affce['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3378b4,_0x249164,_0x518fb2){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x249164,_0x3378b4,_0x518fb2);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class Ci extends zs{['_prompt'];['_model'];constructor(_0xbd2ea0,_0x339e9a,_0x4493dd,_0x2a9487,_0x50b9e4){super(_0x4493dd,_0x2a9487,_0x50b9e4),this['_prompt']=_0xbd2ea0,this['_model']=_0x339e9a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xfe653e,_0x44ca7b,_0xb217b2){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x44ca7b,_0xfe653e,_0xb217b2);}}const Mi=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class ie extends _0x4404b9{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x46dee2=this['context']['config']['get']('ai.reviewMode.translations');if(_0x46dee2){for(const _0x245727 of Mi)'translate'===_0x245727['id']&&(_0x245727['options'][0x0]['data']=_0x46dee2);}const _0x53185c=this['_translateReviewChecks'](Mi);this['_aiReviewCheckList']=new Ri(_0x53185c);const _0x1991cf=this['_aiReviewCheckList']['checks']['find'](_0x11c693=>'custom'===_0x11c693['id']);if(_0x1991cf)try{const _0x2821cf=await new Mt({'connector':this['_aiConnector']})['getAll']();_0x1991cf['models']=_0x2821cf['map'](_0xd0993e=>({..._0xd0993e,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0xd0993e['id']['toUpperCase'](),_0xd0993e['description'])}));}catch(_0x1255b0){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x19ee7d('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x1255b0}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x43955b,_0x5d1654)=>{const _0x8cd2af=this['_aiReviewCheckList']['getCheckById'](_0x5d1654['id']);if(_0x8cd2af){this['_onDiffChange'](this['_isDiffOn']),_0x5d1654['isCustom']?this['_currentReviewCheckRun']=new Ci(_0x5d1654['args']['prompt'],_0x5d1654['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x8cd2af,this['_aiConnector']):this['_currentReviewCheckRun']=new _i(this['_aiReviewModeEditing']['getDocumentData'](),_0x8cd2af,this['_aiConnector'],_0x5d1654['params'],_0x5d1654['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x74cbfe,_0x54500d)=>{'data'===_0x54500d['status']||'loading'===_0x54500d['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x54500d)):'finished'===_0x54500d['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x54500d['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x54500d['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x54500d['status']?(this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x19ee7d('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x54500d['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x19ee7d('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x54500d['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x54500d['status']&&'error-chunk'!==_0x54500d['status']&&'error-general'!==_0x54500d['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x80fa57,_0x29d25d)=>{if(!this['_currentReviewCheckRun'])throw new _0x19ee7d('ai-review-mode-no-current-check-run',this);const _0x528996=this['_aiReviewModeEditing']['diffContent'](_0x29d25d['result']['contentInitial'],_0x29d25d['result']['contentNew']);_0x29d25d['source']['addResultChanges'](_0x29d25d['result']['id'],_0x528996);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x990327,_0x1580a7)=>{for(const _0x78be4 of _0x1580a7['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x78be4);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x1580a7['changes'],_0x1580a7['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x46e4e9,_0x53f7d5)=>{this['_aiReviewModeUi']['updateChangeState'](_0x53f7d5['change']['id'],_0x53f7d5['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4b3ce7,_0x33cac4)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x33cac4['change']['id']);const _0x7f1de1=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x33cac4['change']['id']);if(!_0x7f1de1)return;if('content'===this['_changeActivationSource']){const _0x495c8f=this['_aiReviewModeUi']['getChangeElement'](_0x33cac4['change']['id']);_0x495c8f&&_0x4446ba(_0x495c8f['closest']('.ck-ai-review-mode__check-run-result')||_0x495c8f);}else{if('panel'===this['_changeActivationSource']){const _0x4a8427={'target':_0x7f1de1['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x414134(_0x4a8427);}}const _0x17f2b7=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x33cac4['change'],_0x7f1de1['domElement'],void 0x0,'click',_0x17f2b7?.['editing']?.['view']?.['getDomRoot'](),_0x17f2b7?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x44abc1){_0x44abc1 instanceof Error&&_0x44abc1['message']['includes']('ai-request-aborted')||(_0x44abc1 instanceof _0x19ee7d?this['_logError'](_0x44abc1):this['_logError'](new _0x19ee7d('ai-review-mode-check-run-failed',this,{'error':_0x44abc1})));}}else this['_logError'](new _0x19ee7d('ai-review-mode-source-check-not-found',this,{'checkId':_0x5d1654['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x1dd161=this['_currentReviewCheckRun']['getActiveChanges']();_0x1dd161['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x1dd161['map'](_0x257455=>_0x257455['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x4bf30a,_0x3730ff)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3730ff['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x3730ff['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x3730ff['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3730ff['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x82c649,_0x5374b8)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5374b8['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x5374b8['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5374b8['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5374b8['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x38e9f8,_0x5d64be)=>{this['_isDiffOn']=_0x5d64be['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x3faf8c,_0x3f5a99)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3f5a99['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x57302d,_0x493e4c)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x493e4c['changeId']);const _0x1d213a=this['_currentReviewCheckRun']['getChangeById'](_0x493e4c['changeId']);if(!_0x1d213a)return;const _0x4c3a38=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x1d213a,_0x493e4c['markerElement'],_0x493e4c['domEvent'],'click',_0x4c3a38?.['editing']?.['view']?.['getDomRoot'](),_0x4c3a38?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x3943de,_0x435768)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x3e9441=this['_currentReviewCheckRun']['getChangeById'](_0x435768['changeId']);if(!_0x3e9441)return;const _0x569f23=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x3e9441,_0x435768['markerElement'],_0x435768['domEvent'],'hover',_0x569f23?.['editing']?.['view']?.['getDomRoot'](),_0x569f23?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x40564b,_0x5a88de)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5a88de['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0xb51f98,_0x1ac734)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1ac734['changeId']);});}['_onReviewModeRunLeave'](_0x51aae8=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x51aae8&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x9befc3=this['_aiReviewModeEditing']['getEditor']();_0x9befc3&&_0x9befc3['editing']['view']['change'](_0x338007=>{const _0x16a943=_0x9befc3['editing']['view']['document']['getRoot']();_0x338007['removeClass']('ck-ai-review-mode-diff',_0x16a943),_0x338007['removeClass']('ck-ai-review-mode-highlights',_0x16a943);});}['_onDiffChange'](_0x439a79){const _0x4e529c=this['_aiReviewModeEditing']['getEditor']();_0x439a79?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x4e529c&&_0x4e529c['editing']['view']['change'](_0x35bc78=>{const _0x16b1b4=_0x4e529c['editing']['view']['document']['getRoot']();_0x35bc78['removeClass']('ck-ai-review-mode-diff',_0x16b1b4),_0x35bc78['removeClass']('ck-ai-review-mode-highlights',_0x16b1b4),_0x35bc78['addClass'](_0x439a79?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x16b1b4);});}['_translateReviewChecks'](_0xb655a8){return _0xb655a8['map'](_0x10335d=>{const _0x5682da='AI_REVIEW_CHECK_'+_0x10335d['id']['toUpperCase']()['replaceAll']('-','_'),_0x364db3={..._0x10335d,'title':this['_getTranslationWithDefault'](_0x5682da+'_TITLE',_0x10335d['title']),'description':this['_getTranslationWithDefault'](_0x5682da+'_DESCRIPTION',_0x10335d['description'])};return _0x10335d['options']&&(_0x364db3['options']=_0x10335d['options']['map'](_0x5c6c6d=>({..._0x5c6c6d,'label':this['_getTranslationWithDefault'](_0x5682da+'_OPTIONS_LABEL',_0x5c6c6d['label']||''),'data':_0x5c6c6d['data']?_0x5c6c6d['data']['map'](_0x42d283=>({..._0x42d283,'label':this['_getTranslationWithDefault'](_0x5682da+'_OPTIONS_DATA_'+_0x42d283['id']['toUpperCase'](),_0x42d283['label'])})):void 0x0}))),_0x364db3;});}['_getTranslationWithDefault'](_0x3f6d57,_0x3a2e63){const _0x3f085a=y(this['context']['locale'],_0x3f6d57);return _0x3f085a===_0x3f6d57?_0x3a2e63:_0x3f085a;}['_logError'](_0x5c552c){_0x543541(_0x5c552c['message']),_0x5c552c['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x492b6b{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xb1d784,_0x1e25ea){super(_0xb1d784),this['_defaultValue']=_0x1e25ea['default']||(_0x1e25ea['data']['length']>0x0?_0x1e25ea['data'][0x0]['id']:''),this['_defaultLabel']=_0x1e25ea['data']['find'](_0xc4c8ef=>_0xc4c8ef['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x35c3bd(this['locale']);const _0x4e2f43=this['_prepareListOptions'](_0x1e25ea['data']);_0x1cd684(this['_dropdownView'],_0x4e2f43,{'role':'menu','ariaLabel':_0x1e25ea['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x289c46=>{_0x289c46['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4a61c1=>{this['formValue']=_0x4a61c1['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4a61c1['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x5c3710=[]){const _0x53258c=new _0x1c36f7();this['resetToDefault']();for(const _0x45c861 of _0x5c3710){const _0x3b619a=new _0x1bf3fd({'label':_0x45c861['label'],'withText':!0x0,'role':'menuitemradio','id':_0x45c861['id'],'model':_0x45c861});_0x3b619a['bind']('isOn')['to'](this,'formValue',_0x16d875=>_0x16d875===_0x3b619a['id']);const _0x111155={'type':'button','model':_0x3b619a};_0x53258c['add'](_0x111155);}return _0x53258c;}}class ic extends _0x8a8c30{['_formItem']=null;constructor(_0x599d5d,_0x3132ad,_0x10357c){super(_0x599d5d),this['argsKey']=_0x3132ad?.['argsKey'];if('dropdown'===_0x3132ad['formType'])this['_formItem']=new Mr(this['locale'],_0x3132ad);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x39711f=new _0x523985(this['locale'],{'children':[this['_formItem']],'class':[_0x10357c?'ck-form__row_with-submit':'']});_0x10357c&&_0x39711f['children']['add'](_0x10357c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x39711f]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Us extends _0x225711{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x62ee02){super(_0x62ee02),this['set']('isEmpty',!0x0),this['keystrokes']=new Wt(),this['minRows']=Us['MIN_ROWS'],this['maxRows']=Us['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends _0x492b6b{['focusTracker']=new Bt();['keystrokes']=new Wt();['focusCycler'];['_focusables']=new _0x2b3021();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x456a22,_0x2d894b){super(_0x456a22),this['_check']=_0x2d894b,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x2d894b['models']&&_0x2d894b['models']['length']>0x0?_0x2d894b['models'][0x0]['id']:'',this['_defaultLabel']=_0x2d894b['models']&&_0x2d894b['models']['length']>0x0?_0x2d894b['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x94787a(this['locale'],()=>new Us(_0x456a22)),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 _0x1c36f7(),this['_setModelList'](),_0x1cd684(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x523985(this['locale'],{'children':[this['promptInputView']]}),new _0x523985(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x444b93,_0x511476)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x511476()):_0x511476();}),this['focusCycler']=new Vt({'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'](_0xfc7e4d=>{this['_focusables']['add'](_0xfc7e4d),this['focusTracker']['add'](_0xfc7e4d['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 _0x217883 of this['_getFormValidators']()){const _0x2e4884=_0x217883();if(_0x2e4884)return this['promptInputView']['errorText']=_0x2e4884,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return y(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x1386d9=new _0x21bd9e(this['locale']),t=this['locale']['t'];return _0x1386d9['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1386d9['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x1386d9;}['_createCancelButtonView'](){const _0x2c2ddf=new _0x21bd9e(this['locale']),t=this['locale']['t'];return _0x2c2ddf['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x2c2ddf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x29289d=>{_0x29289d['stopPropagation']();})}}),_0x2c2ddf['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x2c2ddf;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x1b029a=this['_check']['models'];if(this['resetToDefault'](),_0x1b029a?.['length']){const _0x5861ab=Mt['getLocalized'](this['locale'],_0x1b029a);for(const _0xe72a6d of _0x5861ab){const _0x1d1763=new _0x1bf3fd({'label':_0xe72a6d['name'],'withText':!0x0,'role':'menuitemradio','id':_0xe72a6d['id'],'model':_0xe72a6d});_0x1d1763['bind']('isOn')['to'](this,'modelId',_0x211bff=>_0x211bff===_0xe72a6d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1d1763,'labelView':new Xs(this['locale'],_0xe72a6d)});}}}['_createModelSelectionDropdown'](){const _0x3bf808=_0x35c3bd(this['locale']);return _0x3bf808['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x3bf808['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x3bf808,'execute',_0x257407=>{this['modelId']=_0x257407['source']['model']['id'],_0x3bf808['buttonView']['label']=_0x257407['source']['label'];}),_0x3bf808;}['_createActionsFooterView'](){const _0x5ac25c=new _0x492b6b(this['locale']);return _0x5ac25c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x5ac25c;}}class Xs extends _0xb0531d{constructor(_0xaab448,_0x6e24c4){super();const _0x8b50d7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x8b50d7['to']('style'),'id':_0x8b50d7['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x8b50d7['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x6e24c4['description']||'']}]}]});}}class Zs extends _0x8a8c30{['_formItemsCollection']=new _0x2b3021();['_customCheckView']=null;constructor(_0x23c5f7,_0x48c959,_0x23cbcb){super(_0x23c5f7),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x48c959['isParameterized']);const _0x5af996=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x150eaf=>_0x150eaf),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x24692d=>_0x24692d)],'style':{'--ck-ai-review-check-list-item-index':_0x23cbcb}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x48c959['title']}]},_0x5af996]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x48c959['description']}]}]}]},..._0x48c959['isParameterized']?[this['_createParameterizedView'](_0x48c959)]:[],...'custom'===_0x48c959['id']?[this['_createCustomView'](_0x48c959)]:[]]}),this['on']('click',()=>{_0x48c959['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x48c959['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&ts({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x386b16=>{_0x386b16['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x834098=new _0x25e498();return _0x834098['content']=_0x341b4d,_0x834098['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x834098;}['_createParameterizedView'](_0x2fae89){const _0x4a2848=new _0x492b6b(),_0x14d03a=this['_createFormView'](_0x2fae89);return _0x4a2848['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x4cc25d=>!_0x4cc25d)]},'children':[_0x14d03a]}),_0x4a2848;}['_createFormView'](_0x299945){const _0xd4ace9=new _0x492b6b(),_0x2ed619=Array['isArray'](_0x299945['options'])?_0x299945['options']:[],_0x44d3f2=new _0x21bd9e(this['locale']),t=this['locale']['t'];_0x44d3f2['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x44d3f2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2916f6=>{_0x2916f6['stopPropagation']();})}}),_0x44d3f2['on']('execute',()=>{const _0x18b01d=[],_0x40e0d8={};this['_formItemsCollection']['forEach'](_0x588948=>{_0x18b01d['push'](_0x588948['value']),_0x299945['useArgs']&&_0x299945['options']&&(_0x40e0d8[_0x588948['argsKey']]=_0x588948['value']);}),this['fire']('runReviewCheck',{'id':_0x299945['id'],'params':_0x18b01d['length']?_0x18b01d:void 0x0,'args':Object['keys'](_0x40e0d8)['length']?_0x40e0d8:void 0x0});});const _0x7adf02=_0x2ed619['length'];return _0x2ed619['forEach']((_0x3bd3e4,_0x454ffd)=>{const _0x49757a=_0x454ffd===_0x7adf02-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0x3bd3e4,_0x49757a?_0x44d3f2:null));}),_0xd4ace9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0xd4ace9;}['_createCustomView'](_0x316c09){return this['_customCheckView']=new tc(this['locale'],_0x316c09),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3359ae=>!_0x3359ae)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x180e28,_0x30d71e,_0x7e29e4)=>{_0x7e29e4||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x8a8c30{['_checkViews'];constructor(_0x216777){super(_0x216777),this['_checkViews']=new _0x2b3021();const _0x703232=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x703232['if']('isVisible','ck-hidden',_0x111374=>!_0x111374)]},'children':this['_checkViews']});}['setChecks'](_0xc32c25){this['_checkViews']['clear']();for(const [_0x29086a,_0x437a88]of _0xc32c25['entries']()){const _0x1cc719=new Zs(this['locale'],_0x437a88,_0x29086a);_0x1cc719['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1cc719);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x18114c of this['_checkViews'])_0x18114c instanceof Zs&&_0x18114c['resetToDefault']();}}class Ps extends _0x492b6b{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x5db3e2,_0x1b8402){super(_0x5db3e2),this['id']=_0x1b8402,this['set']('status','pending'),this['set']('changeId',_0x1b8402),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x1b8402,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4679be=new _0x492b6b(this['locale']);return _0x4679be['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x26a9b2=>!_0x26a9b2)]}}),_0x4679be;}['_createAcceptButtonView'](){const _0x22956e=new _0x21bd9e(this['locale']);return _0x22956e['set']({'label':y(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x22956e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4f1615=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x4f1615['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x166f4c=>'pending'!==_0x166f4c)]}}),_0x22956e;}['_createDismissButtonView'](){const _0x5a8e36=new _0x21bd9e(this['locale']);return _0x5a8e36['set']({'label':y(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5a8e36['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x8f2397=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x8f2397['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x2c6be4=>'pending'!==_0x2c6be4)]}}),_0x5a8e36;}['_createInfoButtonView'](){const _0x1d37fc=new _0x21bd9e(this['locale']);return _0x1d37fc['set']({'label':y(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x1e356f,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x1d37fc['bind']('isOn')['to'](this,'isInfoToggleOn',_0x482cce=>_0x482cce),_0x1d37fc['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1d37fc;}['_createStatusButtonView'](){const _0x26e0b1=new _0x21bd9e(this['locale']);return _0x26e0b1['set']({'withText':!0x0,'isEnabled':!0x1}),_0x26e0b1['bind']('label')['to'](this,'status',_0x20d964=>y(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x20d964['toUpperCase']())),_0x26e0b1['bind']('icon')['to'](this,'status',_0xefdc0f=>'ACCEPTED'===_0xefdc0f['toUpperCase']()?_0x2a5a64:'REJECTED'===_0xefdc0f['toUpperCase']()?_0x2c2a0c:_0x596197),_0x26e0b1['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x35cb86=>'pending'===_0x35cb86)],'disabled':'disabled'}}),_0x26e0b1;}}class vr extends _0x21bd9e{constructor(_0x26a240){super(_0x26a240),this['set']({'label':y(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x8a8c30{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x5f49cc){super(_0x5f49cc),this['_resultViews']=new _0x2b3021(),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 Ei(_0x5f49cc),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 _0x4a0d2c=this['_createCombinedSkeletonLoader'](),_0x12c5eb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x12c5eb['if']('isVisible','ck-hidden',_0x1635d4=>!_0x1635d4)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x24a81d=>_0x24a81d)]},'children':this['_resultViews']},_0x4a0d2c]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0xe74906){const _0x2f333b=new Ps(this['locale'],_0xe74906['id']);_0x2f333b['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x2f333b),_0x2f333b['resultResponseView']['element']['innerHTML']=_0xe74906['contentDiffed'];}['hideResult'](_0x16934f,_0x2d3909){if('pending'===_0x2d3909)return;const _0x2e2f29=this['_resultViews']['find'](_0x4645d0=>_0x4645d0['id']===_0x16934f);_0x2e2f29&&(_0x2e2f29['status']=_0x2d3909,_0x2e2f29['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x118df5,_0x1b6034){if('pending'!==_0x1b6034)return;const _0x4e7e2b=this['_resultViews']['find'](_0x2ffffb=>_0x2ffffb['id']===_0x118df5);_0x4e7e2b&&(_0x4e7e2b['status']=_0x1b6034,_0x4e7e2b['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x364787,_0x183a35){this['headerTitle']=_0x364787,this['headerSubtitle']=_0x183a35||'';}['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 _e(this['locale'],be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x245d1e=new _0x492b6b(this['locale']),_0x8551a=[];for(let _0x78aadc=0x0;_0x78aadc<0x10;_0x78aadc++){const _0x276d68=this['_createSkeletonLoader']();_0x276d68['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x8551a['push'](_0x276d68);}return _0x245d1e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1e912e=>!_0x1e912e)]},'children':_0x8551a}),_0x245d1e;}['_createErrorView'](){const _0x2fd74a=new _0x492b6b(this['locale']),_0x59ae95=new _0x21bd9e(this['locale']),t=this['locale']['t'];return _0x2fd74a['delegate']('retryReview')['to'](this),_0x59ae95['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x59ae95['on']('execute',()=>{this['fire']('retryReview');}),_0x2fd74a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x229412=>!_0x229412),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x55e21a=>'chunk'===_0x55e21a)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x5167bb=>'chunk'===_0x5167bb)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x23749e=>'general'!==_0x23749e)]},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x29b220=>'chunk'!==_0x29b220)]},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x59ae95]}),_0x2fd74a;}['_createCancelButtonView'](){const _0x5ad1bb=new _0x21bd9e(this['locale']);return _0x5ad1bb['set']({'label':y(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x16a978}),_0x5ad1bb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x50d3a6=>_0x50d3a6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c52af=>_0x1c52af)]}}),_0x5ad1bb['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5ad1bb;}['_createToggleDiffButtonView'](){const _0x44eb41=new _0x21bd9e(this['locale']);_0x44eb41['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x44eb41['bind']('isEnabled')['to'](this,'isError',_0x4ce2e7=>!_0x4ce2e7),_0x44eb41['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x238d90=>!_0x238d90),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x523cab=>_0x523cab)]}});const _0x3d324e=y(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x8409f5=y(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x44eb41['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2e9c9e=>_0x2e9c9e),_0x44eb41['bind']('icon')['to'](this,'isToggleDiffOn',_0x33d59a=>_0x33d59a?_0x3868ae:_0x4a4f33),_0x44eb41['bind']('label')['to'](this,'isToggleDiffOn',_0x10d09f=>_0x10d09f?_0x3d324e:_0x8409f5),_0x44eb41['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x44eb41;}['_createAcceptAllButtonView'](){const _0x3585f1=new _0x21bd9e(this['locale']);return _0x3585f1['set']({'label':y(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3585f1['bind']('isEnabled')['to'](this,'isError',_0x2287a8=>!_0x2287a8),_0x3585f1['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2ee36e=>!_0x2ee36e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x47b6cf=>_0x47b6cf)]}}),_0x3585f1['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3585f1;}['_createExitReviewButtonView'](){const _0xd0b164=new _0x21bd9e(this['locale']);return _0xd0b164['set']({'label':y(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xd0b164['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xd5ee17=>!_0xd5ee17),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x338626=>_0x338626)]}}),_0xd0b164['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0xd0b164;}['_createResultHeaderView'](){const _0x2f62f3=new _0x492b6b(this['locale']),_0x4ac4ea=this['_createTitleView']();return _0x2f62f3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x746575=>_0x746575)]},'children':[_0x4ac4ea,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2f62f3;}['_createTitleView'](){const _0x3a3ff9=new _0x492b6b(this['locale']),_0x438a90=new je();return _0x438a90['bind']('isVisible')['to'](this,'isResultReady',_0xbff822=>!_0xbff822),_0x3a3ff9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x438a90,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3b0c5f=>_0x3b0c5f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4a14bc=>!_0x4a14bc)]},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x3a3ff9;}['_createFinishReviewButtonView'](){const _0x15b4d1=new vr(this['locale']);return _0x15b4d1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ddc4f=>!_0x3ddc4f)]}}),_0x15b4d1['delegate']('finishReview')['to'](this),_0x15b4d1;}}class th extends _0x8a8c30{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x155987){super(_0x155987),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x364c0c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x364c0c['if']('isVisible','ck-hidden',_0x3cf2bb=>!_0x3cf2bb)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':y(_0x155987,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x54edda=new vr(this['locale']);return _0x54edda['delegate']('finishReview')['to'](this),_0x54edda;}['_createResultHeaderView'](){const _0x4ac394=new _0x492b6b(this['locale']);return _0x4ac394['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4ac394;}}class hh extends _0x492b6b{constructor(_0x2fceb8){super(_0x2fceb8),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2e22e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x2e22e7['if']('isVisible','ck-hidden',_0x4c0565=>!_0x4c0565)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2e22e7['to']('errorMessage')}]}]});}}class ue extends _0x492b6b{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x183699){super(_0x183699),this['reviewModeHeader']=new _0x5e5898(_0x183699,{'label':y(_0x183699,'AI_REVIEW_MODE'),'icon':_0x48c39b,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x183699),this['reviewCheckListView']=new ih(_0x183699),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x183699),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x183699),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x1c59e3){this['reviewCheckResultsView']['addResult'](_0x1c59e3),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewModeErrorView'](_0x5dc6f1){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5dc6f1;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Re extends _0x257cec{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x1d73cf,_0x5d3179){super(_0x1d73cf),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']()),_0x5d3179['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x8a98e0){this['resultItemView']['changeId']=_0x8a98e0['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x8a98e0['contentDiffed'];}['showBalloon'](_0x2bd245,_0x1db0de,_0x535ab5,_0x133ef5,_0x25776a,_0x478133){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x2bd245),this['show']();const _0x5b9555=Array['from'](_0x1db0de['getClientRects']())['reverse'](),_0x308bbb=this['_getPointedRectIndexFromEvent'](_0x535ab5,_0x5b9555);'click'===_0x133ef5?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x2bd245['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1db0de,_0x308bbb,_0x2bd245['id'],_0x25776a,_0x478133)})):'hover'===_0x133ef5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1db0de,_0x308bbb,_0x2bd245['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_removeActiveClassFromMarkers'](){_0x384749['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0x3cd19f=>{_0x3cd19f['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x3935eb){_0x384749['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x3935eb+'\x22]')['forEach'](_0x7129d1=>{_0x7129d1['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){ts({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1425c3=[this['element']];return this['_pinnedTargetElement']&&_0x1425c3['push'](this['_pinnedTargetElement']),_0x1425c3;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0xca325c=new _0x492b6b();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0xca325c['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0xca325c;}['_getBestRectPositionOnClick'](_0x595945,_0xefdea1,_0x371c96,_0x6b909d,_0xfeb17a){const _0x25fae5=this['position']['replace']('arrow_',''),_0x22db20=Array['from'](_0x595945['getClientRects']());let _0x402021,_0x5b95de=_0x22db20['reverse']();return void 0x0!==_0xefdea1&&this['_isPinnedRectVisible'](_0x5b95de[_0xefdea1],_0x6b909d,_0xfeb17a)?(_0x402021=_0x5b95de[_0xefdea1],this['_pinnedRectIndex']=_0xefdea1):this['_isPinnedRectVisible'](_0x5b95de[0x0],_0x6b909d,_0xfeb17a)&&void 0x0===_0xefdea1?_0x402021=_0x5b95de[0x0]:(_0x5b95de='s'==_0x25fae5[0x0]?[..._0x22db20]['reverse']():_0x22db20,_0x5b95de['forEach'](_0x318912=>{this['_isPinnedRectVisible'](_0x318912,_0x6b909d,_0xfeb17a)&&(_0x402021=_0x318912);})),this['_pinnedTargetChangeId']=_0x371c96,this['_pinnedTargetElement']=_0x595945,_0x402021||_0x595945['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x312bb5,_0x1b50cc,_0x42304e){const _0x35eb45=Array['from'](_0x312bb5['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1b50cc&&this['_pinnedTargetChangeId']!==_0x42304e)return this['_pinnedRectIndex']=_0x1b50cc,this['_pinnedTargetElement']=_0x312bb5,this['_pinnedTargetChangeId']=_0x42304e,_0x35eb45[_0x1b50cc];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x42304e){if(_0x312bb5!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x35eb45[this['_pinnedRectIndex']];}return void 0x0!==_0x1b50cc&&this['_pinnedTargetChangeId']!==_0x42304e?(this['_pinnedRectIndex']=_0x1b50cc,this['_pinnedTargetElement']=_0x312bb5,this['_pinnedTargetChangeId']=_0x42304e,_0x35eb45[_0x1b50cc]):_0x312bb5['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x1912c9,_0x5422ec){if(_0x1912c9)for(let _0x10c893=0x0;_0x10c893<_0x5422ec['length'];_0x10c893++){const _0x7f9d7d=_0x5422ec[_0x10c893];if(_0x1912c9['clientX']>=_0x7f9d7d['left']-0x3&&_0x1912c9['clientX']<=_0x7f9d7d['right']+0x3&&_0x1912c9['clientY']>=_0x7f9d7d['top']-0x3&&_0x1912c9['clientY']<=_0x7f9d7d['bottom']+0x3)return _0x10c893;}}['_isPinnedRectVisible'](_0x39730c,_0x492d4a,_0x31fa71){const _0x3dff6a=new _0x1ba12e(_0x39730c),_0x4d0664=_0x492d4a||document['documentElement'],_0xa93ef9=_0x3dff6a['getIntersection'](_0x4fae9d(_0x31fa71)),_0x41ff26=new _0x1ba12e(_0x4d0664)['getIntersection'](_0x3dff6a);return!!(_0xa93ef9&&_0x41ff26&&_0x3dff6a['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class re extends _0x4404b9{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[$];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x808258){super(_0x808258),this['_bodyCollection']=new Kt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ue(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Re(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x2faeea=this['context']['plugins']['get']('AITabs');_0x2faeea['view']['on']('activateTab',(_0x33fc5c,_0x4afd1f)=>{'reviewMode'===_0x4afd1f?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x2faeea['view']['addTab']({'id':'reviewMode','buttonLabel':y(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x48c39b,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3979d1){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x3979d1),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3c45fe){_0x3c45fe&&('error-general'!==_0x3c45fe['status']?'error-chunk'!==_0x3c45fe['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3b24ab){this['_reviewModeView']['addCheckRunResult'](_0x3b24ab);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x15c815){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x15c815??y(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x45f578,_0x30112d){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x45f578,_0x30112d);}['setActiveStateInResults'](_0x27a2bf){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4cf0fe=>{_0x4cf0fe['id']===_0x27a2bf&&_0x4cf0fe['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0xe49218=>_0xe49218['setItemAsInactive']());}['updateChangeState'](_0x8cd51a,_0x28594c){'accepted'===_0x28594c||'rejected'===_0x28594c||'outdated'===_0x28594c?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x8cd51a,_0x28594c):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x8cd51a,_0x28594c);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1fb931,_0xcc8f5c,_0x215e19,_0x241c7b,_0x1339e8,_0x592901){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x1fb931,_0xcc8f5c,_0x215e19,_0x241c7b,_0x1339e8,_0x592901);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x297d15){const _0x51b47c=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x23c2a2=>_0x23c2a2['id']===_0x297d15);return _0x51b47c?_0x51b47c['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const le='reviewmode-';class oe extends _0x4404b9{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x1f61c4,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x59c220){super(_0x59c220),this['_domEmitter']=new(_0x22fceb())(),this['_eventEmitter']=new(_0x3dcb71())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x43090d=P(this['context']);_0x43090d['conversion']['for']('editingDowncast')['markerToElement']({'model':le+'insert','view':(_0x5e1e3e,{writer:_0x224776})=>{const _0xb4914d=this['_markers']['get'](_0x5e1e3e['markerName']),_0x479f81={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x5e1e3e['markerName']};return _0x224776['createUIElement']('span',_0x479f81,function(_0x4c5c0b){const _0x3e7eda=this['toDomElement'](_0x4c5c0b);return _0x3e7eda['innerHTML']=_0xb4914d?.['text']||'',_0x3e7eda;});}}),_0x43090d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-only','view':_0x41d829=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x41d829['markerName']}})}),_0x43090d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-context','view':_0x390d10=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x390d10['markerName']}})}),_0x43090d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-text','view':_0x26bd95=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x26bd95['markerName']}})}),_0x43090d['conversion']['for']('dataDowncast')['markerToElement']({'model':le+'suggestion-context','view':(_0x1f8413,{writer:_0x3c21d5})=>_0x3c21d5['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1f8413['isOpening']?'start':'end')})}),_0x43090d['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x359efb,'view':_0x5438d9}),this['_domEmitter']['listenTo'](document,'click',(_0x4dfae3,_0x13e257)=>{const _0x148dfc=_0x13e257['target'],_0x232fff=this['_findMarkerElement'](_0x148dfc);if(!_0x232fff)return;const _0x4acb06=_0x232fff['getAttribute']('data-marker-id'),_0x2b219c=_0x4acb06['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x4acb06,'changeId':_0x2b219c,'markerElement':_0x232fff,'domEvent':_0x13e257});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x4f9f80,_0x1b03b5)=>{const _0x22a5f9=_0x1b03b5['target'],_0x45f62a=_0x1b03b5['relatedTarget'];let _0x37acaf=this['_findMarkerElement'](_0x22a5f9);if(!_0x37acaf&&_0x45f62a&&(_0x37acaf=this['_findMarkerElement'](_0x45f62a)),!_0x37acaf)return;const _0x2e719d=_0x37acaf['getAttribute']('data-marker-id'),_0x36b5ea=_0x2e719d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x36b5ea,'markerElement':_0x37acaf,'domEvent':_0x1b03b5});}),this['_domEmitter']['listenTo'](document,'mouseover',_0xa4b43((_0x343acf,_0xbd4efe)=>{const _0x342c9f=_0xbd4efe['target'];if(this['_findMarkerElement'](_0x342c9f))return;_0x342c9f['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x43090d['model']['document']['registerPostFixer'](_0x513d9=>this['_validateMarkers'](_0x43090d,_0x513d9)),_0x43090d['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x43090d));}['getDocumentData'](){const _0x29480d=this['context']['plugins']['get']('AIEditing'),_0x1f4e20=P(this['context']),_0x3d5487=_0x1f4e20['model'],_0x58a84e=new _0x246996();for(const _0x182f68 of _0x3d5487['document']['getRoot']()['getChildren']()){const _0x5319b3=_0x182f68['_clone'](!0x0);_0x58a84e['_appendChild'](_0x5319b3);}for(const _0x2e1321 of _0x3d5487['markers'])_0x58a84e['markers']['set'](_0x2e1321['name'],this['_changeRangeOwnerDocument'](_0x2e1321['getRange']()['clone'](),_0x58a84e));const _0x5ef2de=new _0x31667d({'ignoreElementEnd':!0x0,'startPosition':_0x3d5487['createPositionAt'](_0x58a84e,0x0)}),_0x44ad4c=new Set(),_0x3f875b=new Map();for(const {item:_0x358c1e}of _0x5ef2de){if(!_0x358c1e['is']('$textProxy'))continue;const _0x5e7d80=_0x358c1e['parent'];if(_0x5e7d80&&_0x5e7d80['is']('element')){const _0x2b4057=this['_upsertDataId'](_0x5e7d80,()=>_0x29480d['_nextDataId'](_0x44ad4c));_0x44ad4c['add'](_0x2b4057);for(const _0xc66eaf of _0x5e7d80['getChildren']())_0xc66eaf['is']('element')&&_0x44ad4c['add'](this['_upsertDataId'](_0xc66eaf,()=>_0x29480d['_nextDataId'](_0x44ad4c)));let _0x5c0758=_0x5e7d80;for(;_0x5c0758['parent']&&!_0x5c0758['parent']['is']('documentFragment');)_0x5c0758=_0x5c0758['parent'],_0x5c0758['hasAttribute'](_0x359efb)&&_0x5c0758['_removeAttribute'](_0x359efb);_0x3f875b['set'](_0x2b4057,{'path':_0x5e7d80['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x5c0758['_clone'](!0x0),_0x2b4057,_0x1f4e20['data'])}),_0x5ef2de['jumpTo'](_0x3d5487['createPositionAfter'](_0x5e7d80));}}return{'content':_0x1f4e20['data']['processor']['toData'](_0x1f4e20['data']['toView'](_0x58a84e)),'version':_0x1f4e20['model']['document']['version'],'elements':_0x3f875b};}['diffContent'](_0x45d34f,_0x5de3f4){const _0x147e79=[],_0x6397fd=P(this['context']),_0x483c8f=_0x6397fd['data']['parse'](_0x5de3f4,'$documentFragment'),_0x27e0f3=_0x6397fd['data']['parse'](_0x45d34f,'$documentFragment'),_0x1b926d=_0x6397fd['model']['createPositionAt'](_0x27e0f3,0x0);if(this['_haveSingleTopLevelElement'](_0x483c8f)){if(!this['_hasSameTopLevelElement'](_0x27e0f3,_0x483c8f))return _0x147e79;}else{const _0x55e567=_0x6397fd['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x27e0f3,_0x55e567)||!this['_haveOnlyInlineContent'](_0x483c8f,_0x55e567))return _0x147e79;}const _0x56581e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x45d34f,_0x5de3f4,{'anchor':_0x1b926d,'markDeletions':!0x0})['getOperations']()['filter'](_0x55c8f7=>'insert'===_0x55c8f7['type']||'marker'===_0x55c8f7['type']&&_0x55c8f7['name']['startsWith']('$markedRemove')),_0x44cc9f=this['_groupAdjacentOperations'](_0x56581e);let _0xd5afbd=0x0;return _0x6397fd['model']['change'](_0xf4e93a=>{for(let _0x3b981a=0x0;_0x3b981a<_0x44cc9f['length'];_0x3b981a++){const _0x5c889a=_0x44cc9f[_0x3b981a],_0x3e6199=_0xf4e93a['createDocumentFragment']();for(const _0xe0a14b of _0x27e0f3['getChildren']())_0xf4e93a['append'](_0xe0a14b['_clone'](!0x0),_0x3e6199);for(const _0x44af29 of _0x5c889a['operationsIsolated'])if('insert'===_0x44af29['type']){const _0x19e756=_0x44af29;_0x19e756['baseVersion']=null,_0x19e756['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x19e756,_0x3e6199),_0xf4e93a['batch']['addOperation'](_0x44af29),_0x6397fd['model']['applyOperation'](_0x44af29);const _0x17c77c='suggestion:insertion:id:authorId:'+_0xd5afbd++,_0x23260d=_0x6397fd['model']['createRange'](_0x19e756['position'],_0x19e756['position']['getShiftedBy'](_0x19e756['howMany']));_0x3e6199['markers']['set'](_0x17c77c,_0x23260d);}else{if('marker'===_0x44af29['type']&&_0x44af29['name']['startsWith']('$markedRemove')){const _0x3eb5b6=_0x44af29,_0x4cde53='suggestion:deletion:id:authorId:'+_0xd5afbd++;this['_changeOperationOwnerDocument'](_0x3eb5b6,_0x3e6199),_0x3e6199['markers']['set'](_0x4cde53,_0x3eb5b6['newRange']);}}const _0x584fc0=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5c889a['operationsIsolated'][0x0]),_0x3e6199),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5c889a['operationsIsolated'][_0x5c889a['operationsIsolated']['length']-0x1]),_0x3e6199));_0x3e6199['markers']['set'](le+'suggestion-context',new _0x184fda(_0x584fc0['start'],_0x584fc0['end'])),_0x147e79['push']({..._0x5c889a,'context':this['_createGetContextFn'](_0x3e6199,_0x6397fd['data'],{'ellipsisBefore':_0x584fc0['hasContentBefore'],'ellipsisAfter':_0x584fc0['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3e6199,_0x6397fd['data'])});}}),_0x147e79;}['markChangePositionInEditorContent'](_0x53cc02,_0x43d3e1){if(!_0x53cc02['length'])return;const _0x44577e=_0x53cc02[0x0]['parent']['id'],_0x5ee02d=_0x43d3e1['elements']['get'](_0x44577e);if(!_0x5ee02d)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x44577e);const _0x23ae62=_0x5ee02d['path'],_0x2251b4=P(this['context']),_0x548846=_0x2251b4['model']['document']['history']['getOperations'](_0x43d3e1['version']),_0x423235=[];for(const _0x1f8b44 of _0x53cc02){const _0x17b728=_0x1f8b44['operationsIsolated']['map'](_0x4f319f=>this['_translateOperationToEditorContent'](_0x4f319f,_0x23ae62,_0x2251b4['model']['document']['getRoots']()[0x0]));if(!_0x17b728||!_0x17b728['length'])continue;const _0x4de2a3=_0x17b728['every'](_0x403f6e=>'marker'===_0x403f6e['type']&&_0x403f6e['name']['startsWith']('$markedRemove')),_0x16493d={'document':_0x2251b4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x14c693=_0x39cd19(_0x17b728,_0x548846,_0x16493d)['operationsA'];for(const _0x13d503 of _0x14c693)if('insert'===_0x13d503['type']){const _0x34e9a5=_0x13d503,_0x25852f=_0x34e9a5['nodes'];let _0x25ce95='';for(const _0x1d7ee0 of _0x25852f)_0x1d7ee0&&_0x1d7ee0['is']('model:$text')&&(_0x25ce95+=_0x1d7ee0['data']);_0x423235['push']({'start':_0x34e9a5['position'],'end':_0x34e9a5['position'],'type':'insert','groupId':_0x1f8b44['id'],'text':_0x25ce95});}else{if('marker'===_0x13d503['type']&&_0x13d503['name']['startsWith']('$markedRemove')){const _0x14c8e5=_0x13d503;let _0x633ea0='remove-text';if(_0x4de2a3){const _0x4063f5=this['_findAdjacentContextDistance'](_0x14c8e5['newRange']['start'],'backward',_0x2251b4['model']['schema']),_0xfdb7b9=this['_findAdjacentContextDistance'](_0x14c8e5['newRange']['end'],'forward',_0x2251b4['model']['schema']);if(_0x4063f5||_0xfdb7b9){const _0x717540=_0x14c8e5['newRange']['start']['getShiftedBy'](-_0x4063f5),_0x4fa7e2=_0x14c8e5['newRange']['end']['getShiftedBy'](_0xfdb7b9);_0x423235['push']({'start':_0x717540,'end':_0x4fa7e2,'groupId':_0x1f8b44['id'],'type':'remove-context'});}else _0x633ea0='remove-only';}_0x423235['push']({'start':_0x14c8e5['newRange']['start'],'end':_0x14c8e5['newRange']['end'],'groupId':_0x1f8b44['id'],'type':_0x633ea0});}}}this['_insertMarkers'](_0x423235);}['clearAllMarkers'](){const _0x4769db=P(this['context']);_0x4769db['model']['change'](_0x1e5b9f=>{for(const _0x1c7e5c of this['_markers']['keys']())_0x4769db['model']['markers']['get'](_0x1c7e5c)&&_0x1e5b9f['removeMarker'](_0x1c7e5c);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x584e30){const _0x571b2e=P(this['context']),_0x453dc4=_0x571b2e['model'],_0x29a13b=_0x584e30['map'](_0x55e374=>this['_getMarkersDataForGroup'](_0x55e374))['flat']();_0x453dc4['change'](_0x25e332=>{for(const _0x3cfecd of _0x29a13b){const _0x549af0=_0x571b2e['model']['markers']['get'](_0x3cfecd['id']);_0x549af0&&('insert'===_0x3cfecd['type']?_0x453dc4['insertContent'](_0x25e332['createText'](_0x3cfecd['text']||''),_0x549af0['getRange']()['start']):'remove-text'!==_0x3cfecd['type']&&'remove-only'!==_0x3cfecd['type']||_0x453dc4['deleteContent'](_0x453dc4['createSelection'](_0x549af0['getRange']())),_0x25e332['removeMarker'](_0x3cfecd['id']),this['_markers']['delete'](_0x3cfecd['id']));}});}['rejectChange'](_0x1ad72a){const _0x1b35d0=P(this['context']),_0x4fa63b=this['_getMarkersDataForGroup'](_0x1ad72a);_0x1b35d0['model']['change'](_0x44e72f=>{for(const _0x25bc8d of _0x4fa63b)_0x44e72f['removeMarker'](_0x25bc8d['id']),this['_markers']['delete'](_0x25bc8d['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x33283){const _0x3a82b9=Array['from'](this['_markers']['values']())['filter'](_0x1a2718=>_0x1a2718['groupId']===_0x33283);if(!_0x3a82b9['length'])return null;const _0x3b1aa6=0x1===_0x3a82b9['length']?_0x3a82b9[0x0]:this['_sortMarkers'](_0x3a82b9)[0x0],_0x34a9a2=P(this['context']),_0xe8240b=_0x34a9a2['model']['markers']['get'](_0x3b1aa6['id']);if(!_0xe8240b)return null;const _0x3bd558=_0xe8240b['getRange'](),_0x4ddf6c=_0x34a9a2['editing']['view']['getDomRoot']();if(!_0x4ddf6c||!_0x3bd558)return null;const _0x480db8=_0x4ddf6c['querySelector']('[data-marker-id=\x22'+_0x3b1aa6['id']+'\x22]');return _0x480db8?{'modelRange':_0x3bd558,'domElement':_0x480db8}:null;}['_validateMarkers'](_0x2751f1,_0x4b75fe){const _0x5a2c07=Array['from'](this['_markers']['keys']()),_0xbd597d=new Map();for(const _0x1356db of _0x5a2c07){const _0x183848=_0x2751f1['model']['markers']['get'](_0x1356db);if(!_0x183848)continue;const _0x565593=_0x183848['getStart']()['path'][0x0];_0xbd597d['has'](_0x565593)||_0xbd597d['set'](_0x565593,[]),_0xbd597d['get'](_0x565593)['push'](_0x183848);}const _0x1b3425=new Set();for(const _0x3e2f91 of _0x2751f1['model']['document']['differ']['getChanges']()){let _0x751451=-0x1,_0x113b26=null;if('insert'===_0x3e2f91['type'])_0x113b26=new _0x184fda(_0x3e2f91['position'],_0x3e2f91['position']['getShiftedBy'](_0x3e2f91['length'])),_0x751451=_0x3e2f91['position']['path'][0x0];else{if('remove'!==_0x3e2f91['type'])continue;_0x113b26=new _0x184fda(_0x3e2f91['position']),_0x751451=_0x3e2f91['position']['path'][0x0];}const _0x439bb7=_0xbd597d['get'](_0x751451)||[];if(_0x439bb7['length']){for(const _0xaa0df of _0x439bb7)if(_0x113b26['root']['rootName']===_0xaa0df['getRange']()['root']['rootName']&&('insert'!==_0x3e2f91['type']||!_0x113b26['containsRange'](_0xaa0df['getRange']()))&&(_0x113b26['isIntersecting'](_0xaa0df['getRange']())||_0x113b26['start']['isTouching'](_0xaa0df['getRange']()['end'])||_0x113b26['end']['isTouching'](_0xaa0df['getRange']()['start']))){const _0x3ff015=this['_parseMarkerName'](_0xaa0df['name']);Array['from'](this['_markers']['values']())['filter'](_0x3a3976=>_0x3a3976['groupId']===_0x3ff015['groupId'])['forEach'](_0x57569a=>_0x1b3425['add'](_0x57569a['id']));}}}if(_0x1b3425['size']){for(const _0x10084f of _0x1b3425)_0x4b75fe['removeMarker'](_0x10084f);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x304bc9){for(const {name:_0x52c1aa,data:_0xe4f177}of _0x304bc9['model']['document']['differ']['getChangedMarkers']()){if(!_0x52c1aa['startsWith'](le))continue;const _0x58b381=_0xe4f177['oldRange'],_0x3a5c56=_0xe4f177['newRange'],_0x1e7502=_0x58b381&&'$graveyard'===_0x58b381['root']['rootName'],_0x454b2e=_0x3a5c56&&'$graveyard'===_0x3a5c56['root']['rootName'];if(_0x1e7502&&_0x454b2e)continue;const _0x55b0f8=this['_parseMarkerName'](_0x52c1aa);this['_markers']['get'](_0x52c1aa)&&(_0x454b2e||!_0x3a5c56?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x52c1aa,'changeId':_0x55b0f8['groupId']}):_0x1e7502&&_0x3a5c56&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x52c1aa,'changeId':_0x55b0f8['groupId']}));}}['_parseMarkerName'](_0x2b4ecf){const _0x6d8e8f=_0x2b4ecf['split'](':'),_0x1a85fd=(_0x6d8e8f[0x1]||'')['split']('_');return{'prefix':_0x6d8e8f[0x0],'groupId':_0x1a85fd[0x0],'suffix':_0x1a85fd[0x1]};}['_translateOperationToEditorContent'](_0x272812,_0x514aed,_0x3bf8f1){if('insert'===_0x272812['type']){const _0x357a1d=_0x272812;return new _0x207529(this['_changePosition'](_0x514aed['concat'](_0x357a1d['position']['offset']),_0x3bf8f1),_0x357a1d['nodes'],_0x357a1d['baseVersion']);}if('marker'===_0x272812['type']&&_0x272812['name']['startsWith']('$markedRemove')){const _0x5a132c=_0x272812;return new _0xd05c7f(_0x5a132c['name'],_0x5a132c['oldRange'],this['_changeRange'](_0x5a132c['newRange'],_0x514aed['concat'](_0x5a132c['newRange']['start']['offset']),_0x514aed['concat'](_0x5a132c['newRange']['end']['offset']),_0x3bf8f1),_0x5a132c['_markers'],_0x5a132c['affectsData'],_0x5a132c['baseVersion']);}return _0x272812;}['_groupAdjacentOperations'](_0x51eaec){if(!_0x51eaec['length'])return[];const _0x31167d=[];let _0x2267bd=0x0,_0x58616f=0x0,_0x95526=[];for(let _0x48cc2e=0x0;_0x48cc2e<=_0x51eaec['length'];_0x48cc2e++){const _0x567add=_0x51eaec[_0x48cc2e],_0x4e2ba7=_0x51eaec[_0x48cc2e-0x1];!_0x567add||_0x4e2ba7&&!this['_getOperationEnd'](_0x4e2ba7)['isTouching'](this['_getOperationStart'](_0x567add))?(_0x31167d['push']({'operations':_0x95526,'operationsIsolated':_0x95526['map'](_0xcad83e=>this['_shiftOperation'](_0xcad83e['clone'](),-_0x58616f)),'groupOffset':_0x2267bd}),_0x95526=_0x567add?[_0x567add]:[],_0x58616f+=_0x2267bd,_0x2267bd=0x0):_0x95526['push'](_0x567add),_0x567add&&'insert'===_0x567add['type']&&(_0x2267bd+=_0x567add['howMany']);}return _0x31167d;}['_findAdjacentContextDistance'](_0x4ce89d,_0x22370c,_0x48ab4a,_0x38602e=0x1){const _0x3d6f39=new _0x31667d({'startPosition':_0x4ce89d,'direction':_0x22370c});let _0x4aceb1=0x0;for(let _0x17e885=0x0;_0x17e885<_0x38602e;_0x17e885++){let _0x2452b5=0x0,_0xa2093=!0x1,_0x312cea='forward'===_0x22370c?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x54ac67}of _0x3d6f39)if(_0x54ac67['is']('$textProxy')){const _0x54ae64=_0x312cea['exec'](_0x54ac67['data']);if(_0x54ae64&&_0x54ae64['length']){if(_0x2452b5+='forward'===_0x22370c?_0x54ae64['index']+_0x54ae64[0x0]['length']:_0x54ac67['data']['length']-_0x54ae64['index'],_0x54ae64[0x0]['length']!==_0x54ac67['data']['length'])break;_0xa2093=!0x0,_0x312cea='forward'===_0x22370c?/^\w+/:/\w+$/;}else{if(_0xa2093)break;_0x2452b5+=_0x54ac67['offsetSize'];}}else{if(_0x54ac67['is']('element')){_0x48ab4a['isInline'](_0x54ac67)&&!_0xa2093&&(_0x2452b5+=0x1);break;}}_0x4aceb1+=_0x2452b5,_0x3d6f39['jumpTo'](_0x4ce89d['getShiftedBy']('forward'===_0x22370c?_0x4aceb1:-_0x4aceb1));}return _0x4aceb1;}['_getChangeContext'](_0x120206,_0x158030){const _0x4bb5fd=P(this['context'])['model']['schema'],_0x279935=this['_findAdjacentContextDistance'](_0x120206,'backward',_0x4bb5fd,0x6),_0x756a13=this['_findAdjacentContextDistance'](_0x158030,'forward',_0x4bb5fd,0x6),_0x1e6408=_0x120206['getShiftedBy'](-_0x279935),_0x536f76=_0x158030['getShiftedBy'](_0x756a13);return{'start':_0x1e6408,'end':_0x536f76,'hasContentBefore':!_0x1e6408['isAtStart'],'hasContentAfter':!_0x536f76['isAtEnd']};}['_insertMarkers'](_0x3b6f70){const _0x201682=this['context']['plugins']['get']('AIEditing'),_0x5a3b21=new Set();P(this['context'])['model']['change'](_0x314954=>{for(const _0x5b3f62 of _0x3b6f70){const _0x8ac840=''+le+_0x5b3f62['type']+':'+_0x5b3f62['groupId']+'_'+_0x201682['_nextDataId'](_0x5a3b21);this['_markers']['set'](_0x8ac840,{'id':_0x8ac840,'groupId':_0x5b3f62['groupId'],'type':_0x5b3f62['type'],'text':_0x5b3f62['text']}),_0x314954['addMarker'](_0x8ac840,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x314954['createRange'](_0x5b3f62['start'],_0x5b3f62['end'])});}});}['_createGetContextFn'](_0x13866e,_0x4bc667,_0x992a36){let _0x2d7d5d='';return()=>{if(!_0x2d7d5d){const _0x3c0e2d=_0x4bc667['toView'](_0x13866e,{'showSuggestionHighlights':!0x0});let _0x2406d9=_0x3c0e2d['getChild'](0x0);if(_0x2406d9['is']('containerElement')||(_0x2406d9=_0x3c0e2d),!_0x2406d9)return'';let _0x2a23b5=!0x1;const _0x34853f=[];for(const _0x17fe2c of _0x2406d9['getChildren']())_0x17fe2c['is']('element','span')&&_0x17fe2c['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x2a23b5=!0x1),_0x2a23b5&&_0x34853f['push'](_0x17fe2c),_0x17fe2c['is']('element','span')&&_0x17fe2c['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x2a23b5=!0x0);_0x2406d9['_removeChildren'](0x0,_0x2406d9['childCount']),_0x992a36?.['ellipsisBefore']&&_0x2406d9['_appendChild']('…'),_0x2406d9['_appendChild'](_0x34853f),_0x992a36?.['ellipsisAfter']&&_0x2406d9['_appendChild']('…');const _0x8858d9=_0x4bc667['htmlProcessor']['domConverter']['viewToDom'](_0x3c0e2d),_0x821a25=_0x4bc667['htmlProcessor']['htmlWriter']['getHtml'](_0x8858d9);_0x2d7d5d=_0x821a25;}return _0x2d7d5d;};}['_createGetContentFn'](_0x5b967c,_0x4a6b8e){let _0x279cd2='';return()=>(_0x279cd2||(_0x279cd2=_0x4a6b8e['stringify'](_0x5b967c,{'showSuggestionHighlights':!0x0})),_0x279cd2);}['_createGetContentUsingDataIdFn'](_0x3f1ef8,_0x166fae,_0x2ba8ce){let _0x5925cd='';return()=>{if(!_0x5925cd){const _0x333c3d=_0x2ba8ce['toView'](new _0x246996(_0x3f1ef8)),_0x98dcca=_0x2ba8ce['htmlProcessor']['domConverter']['viewToDom'](_0x333c3d)['querySelector']('[data-id=\x22'+_0x166fae+'\x22]');_0x5925cd=_0x98dcca?.['outerHTML']||'';}return _0x5925cd;};}['_findMarkerElement'](_0x16d653,_0x840f2b=0x5){let _0x3916db=_0x16d653,_0x1f73d9=null;for(let _0x242c69=0x0;_0x242c69<_0x840f2b&&_0x3916db;_0x242c69++){if(!_0x3916db['className']){_0x3916db=_0x3916db['parentElement'];continue;}if(!(''+_0x3916db['className'])['includes']('ck-ai_review-mode-marker_')){_0x3916db=_0x3916db['parentElement'];continue;}if(!_0x3916db['getAttribute']('data-marker-id'))break;_0x1f73d9=_0x3916db;break;}return _0x1f73d9;}['_getMarkersDataForGroup'](_0x727e1b){return Array['from'](this['_markers']['values']())['filter'](_0x4508b4=>_0x4508b4['groupId']===_0x727e1b);}['_getOperationStart'](_0x5f3405){return'insert'===_0x5f3405['type']?_0x5f3405['position']:_0x5f3405['newRange']['start'];}['_getOperationEnd'](_0x4a94b1,_0x5f5dd3=!0x1){return'insert'===_0x4a94b1['type']?_0x5f5dd3?_0x4a94b1['position']:_0x4a94b1['position']['getShiftedBy'](_0x4a94b1['howMany']):_0x4a94b1['newRange']['end'];}['_shiftOperation'](_0x2ad849,_0x3fa26b){return'insert'===_0x2ad849['type']?_0x2ad849['position']=_0x2ad849['position']['getShiftedBy'](_0x3fa26b):'marker'===_0x2ad849['type']&&_0x2ad849['newRange']&&(_0x2ad849['newRange']=new _0x184fda(_0x2ad849['newRange']['start']['getShiftedBy'](_0x3fa26b),_0x2ad849['newRange']['end']['getShiftedBy'](_0x3fa26b))),_0x2ad849;}['_changeOperationOwnerDocument'](_0x1c7bae,_0x1a6566){'insert'===_0x1c7bae['type']?_0x1c7bae['position']=this['_changePositionOwnerDocument'](_0x1c7bae['position'],_0x1a6566):'marker'===_0x1c7bae['type']&&_0x1c7bae['newRange']&&(_0x1c7bae['newRange']=this['_changeRangeOwnerDocument'](_0x1c7bae['newRange'],_0x1a6566));}['_changePositionOwnerDocument'](_0x34cba8,_0x240cc9){return new _0x5a23f1(_0x240cc9,_0x34cba8['path']);}['_changeRangeOwnerDocument'](_0x22ac5a,_0x5a7356){return new _0x184fda(this['_changePositionOwnerDocument'](_0x22ac5a['start'],_0x5a7356),this['_changePositionOwnerDocument'](_0x22ac5a['end'],_0x5a7356));}['_changePosition'](_0x12ee4d,_0x38fd21){return new _0x5a23f1(_0x38fd21,[..._0x12ee4d]);}['_changeRange'](_0x150115,_0xd4b007,_0xdbb0c0,_0x19a32a){return new _0x184fda(this['_changePosition'](_0xd4b007,_0x19a32a),this['_changePosition'](_0xdbb0c0,_0x19a32a));}['_sortMarkers'](_0x5a748d){const _0x38ab31=_0x3a3bd8=>{switch(_0x3a3bd8){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x5a748d['sort']((_0x3ffa26,_0x90dade)=>_0x38ab31(_0x3ffa26['type'])-_0x38ab31(_0x90dade['type']));}['_hasSameTopLevelElement'](_0x2c6783,_0x539b0f){const _0x4aad9d=_0x2c6783['getChild'](0x0),_0x5b7b54=_0x539b0f['getChild'](0x0);return!(!_0x4aad9d||!_0x5b7b54)&&((!_0x4aad9d['is']('element')||!_0x5b7b54['is']('element')||_0x4aad9d['name']===_0x5b7b54['name'])&&!(_0x4aad9d['is']('element')&&!_0x5b7b54['is']('element')||!_0x4aad9d['is']('element')&&_0x5b7b54['is']('element')));}['_haveSingleTopLevelElement'](_0x462b66){return 0x1===_0x462b66['childCount'];}['_haveOnlyInlineContent'](_0x1177f,_0x3bf80b){for(const _0x4d5fb7 of _0x1177f['getChildren']())if(_0x4d5fb7['is']('element')&&!_0x3bf80b['isInline'](_0x4d5fb7))return!0x1;return!0x0;}['_upsertDataId'](_0xf4dab6,_0x1d7e8d){let _0x41694b=_0xf4dab6['getAttribute'](_0x359efb);return _0x41694b||(_0x41694b=_0x1d7e8d(),_0xf4dab6['_setAttribute'](_0x359efb,_0x41694b)),_0x41694b;}}class Fa extends _0x4404b9{static get['requires'](){return[ie,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ji as AIActions,li as AIAdapter,$n as AIAssistant,ee as AIAssistantUI,w as AIBalloon,Ga as AIChat,q as AIChatController,V as AIChatHistory,ct as AIChatHistoryController,mt as AIChatHistoryUI,F as AIChatUI,s as AIConnector,c as AIEditing,Ba as AIEditorIntegration,Nt as AIQuickActionType,Wa as AIQuickActions,gi as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Ds as AIReviewCheckResult,zs as AIReviewCheckRun,Fa as AIReviewMode,ie as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,$ as AITabs,Te as AITextAdapter,bt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,hi as ShowAIAssistantCommand,co as ToggleAICommand,ms as createResizeButton,qn as getDefaultAICommands};
23
+ import{Plugin as _0x45b3aa,Command as Qt,ContextPlugin as _0x36f460,Editor as _0x4999b5}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x12f16c,IconCheck as _0x2eaecc,IconError as _0x5c1eb8,IconSubmit as _0x4f3f38,IconAIHistory as Ut,IconMagicWand as _0xf80c17,IconRobotPencil as _0x298a17,IconMaximize as _0x2475ae,IconMinimize as to,IconDocumentWithLoupe as _0x3a7531,IconAddComment as _0x18dc33,IconShowChangesOn as _0x8a4b4a,IconShowChangesOff as _0x5e9380,IconDocument as _0x39221a,IconThreeStars as _0x23bdb1,IconRemove as _0x94a10e,IconDocumentWithCheckmark as _0x3ccf4d,IconDocumentWithCross as _0x69b87c,IconLoupe as _0x2963a8,IconCancel as _0x4f3ae4,IconStop as _0x1fefe2,IconAIChat as Et,IconPlus as _0x220078,IconPin as _0x5a39a8,IconThreeHorizontalDots as _0xa05572,IconChevronRight as _0x4c63dc,IconInfo as _0x26136b,IconOutdated as _0x28b226,IconEye as _0x3ea555,IconEyeCrossedOut as _0x5811d0,IconAIReview as _0x17a750}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x418744,CKEditorError as _0x3384e8,ObservableMixin as ts,global as _0x47832a,isVisible as _0x5b6c97,Rect as _0x444add,Collection as _0x5c5f1f,FocusTracker as _0x3b8d6f,KeystrokeHandler as _0x11d7cc,first as _0x2897cc,toArray as _0x4efba8,EmitterMixin as _0xe5b3f8,logWarning as _0x586800,logError as _0x49f6d0,scrollViewportToShowTarget as _0x2618c2,ResizeObserver as _0x4accb7,_isMotionReduced as It,scrollAncestorsToShowTarget as _0x597cbc,getConstrainedViewportRect as _0x2db8df,DomEmitterMixin as _0x18713c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x294050,ButtonView as _0x5c8003,View as wt,SpinnerView as _0x2ac9f7,IconView as _0x314c7c,AutocompleteView as _0x424376,ListView as _0x50cbf8,ListItemGroupView as _0x99e449,ListItemView as _0x47f6ca,ButtonLabelView as _0x8cf3b6,FocusCycler as _0x767b6d,createLabeledTextarea as _0x3e1046,Dialog as _0x57edf4,createDropdown as _0x2b674a,addMenuToDropdown as _0x3eb0b9,MenuBarMenuView as _0x25f09c,MenuBarMenuListItemButtonView as _0x42978b,DialogViewPosition as _0x5c3a77,MenuBarMenuListView as _0x445524,MenuBarMenuListItemView as _0x2d3211,UIModel as _0x9d6116,SplitButtonView as _0x35fd09,BalloonPanelView as _0x43f8f9,BodyCollection as _0x2c3837,clickOutsideHandler as _0x5478fb,ListItemButtonView as _0xc13ac5,ViewCollection as ft,addListToDropdown as _0x562328,submitHandler as _0x2837a1,LabeledFieldView as _0x114356,createLabeledInputText as _0x17f05b,FormHeaderView as _0x24123a,HighlightedTextView as _0x10267b,FileDialogButtonView as _0x4385b1,InputTextView as _0x374ad0,SearchTextView as _0x57285a,ButtonLabelWithHighlightView as _0x25926c,DropdownMenuPanelPositioningFunctions as _0x459c71,BalloonToolbar as _0xce2884,FormRowView as _0xa23978,TextareaView as _0x56bdff}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3a6629,ClipboardMarkersUtils as _0x227cd2}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x22f7ef,ViewDataTransfer as _0x31dfed,ViewUpcastWriter as _0x342490,Matcher as _0x85cbb9,_DetachOperation as ht,_insertIntoModelNodeList as _0x4b0d66,_removeFromModelNodeList as _0x70394c,ModelRange as nt,ViewDowncastWriter as Mt,transformOperationSets as Ot,ModelDocumentFragment as jt,ModelPosition as Dt,ModelTreeWalker as _0x8f92f6,InsertOperation as _0x382a49,MarkerOperation as _0x118e33}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x52add3,escape as _0x423ab9,escapeRegExp as _0x4da077,debounce as _0x3de0e3}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x9aa991,InvokeModelWithResponseStreamCommand as _0x54f3b5,InvokeModelCommand as _0x2f31bb}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x994a28}from'htmlparser2';import{isTag as _0x53fb25,findOne as ct,getParent as _0x1eaa78,findAll as _0x175b52,removeElement as _0x3dc7bd,replaceElement as _0x86eb75,prepend as _0x2f9325,prependChild as _0x74c0d7,appendChild as _0x41f937,append as _0x5e4293,find as _0x18de35,isComment as _0x1bc1ce,getChildren as _0x5531ba,textContent as _0x59f1f7}from'domutils';import _0x4c489b from'dom-serializer';import{Document as gt,Element as _0xfaa538,Text as _0x1b6656,cloneNode as _0x475ed4,isDocument as _0x55b786,isText as _0x3f891f,NodeWithChildren as _0x5c713e}from'domhandler';import{MarkdownGfmMdToHtml as _0x500a7f}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x461c8f,getAllMarkersDomElementsSorted as _0x5ca2d3,DocumentCompare as it,DATA_ID_MODEL_ATTRIBUTE as st,ConfirmMixin as _0x20c2d4,LateFocusDropdownButtonView as _0x5c9840,DATA_ID_VIEW_ATTRIBUTE as _0x29fc86}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x30ef56}from'es-toolkit';import{IconThumbUp as _0x38a6d0,IconThumbDown as _0x4e9e7c,IconCopy as _0x247399,IconCheck as _0x382d3e,IconShowChangesOff as kt,IconShowChangesOn as _0x24ed8d,IconWeb as _0x36dfa2,IconNextArrow as Tt,IconPreviousArrow as Nt,IconAI as ut,IconClose as _0xaaa2ee,IconSelection as _0x85bd51,IconFileUpload as _0x15b10c,IconLink as _0x228b90,IconDocument as _0x314ba7,IconBulb as _0x11be31,IconDocumentOutline as _0xf0382d,IconPaperClip as _0x198d62,IconBrowseFiles as _0x20ccd8,IconDropdownArrow as _0x3a7f1c,IconAIAskAI as _0x2b574a,IconAIQuickActions as bt,IconAIChatCommands as Wt,IconAIImproveWriting as Vt,IconAIContinueWriting as Bt,IconAIGrammarCheck as Jt,IconAIAdjustLength as Kt,IconAIChangeTone as Gt,IconAITranslate as Zt,IconAIOther as Xt,IconRefresh as vt}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x236918 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x33fd73}from'diff';const K='_ungrouppedCommands';function o(_0x23ce16,_0x3b90f1){const _0x4d618d=(0x0,_0x3b90f1['t'])('Other');return _0x23ce16['length']?'groupId'in _0x23ce16[0x0]?_0x23ce16:[{'groupId':K,'groupLabel':_0x4d618d,'order':0x1/0x0,'commands':_0x23ce16}]:[{'groupId':K,'groupLabel':_0x4d618d,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x45b3aa{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x48a4b2}=this,_0x10111c=['ck-fake-ai-selection'];_0x48a4b2['config']['get']('ai.assistant.useTheme')&&_0x10111c['push']('ck-ai-assistant-ui_theme'),_0x48a4b2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x10111c,'priority':0xc}}),_0x48a4b2['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x55b2f9,{writer:_0x5798e5})=>{if(!_0x55b2f9['markerRange']['isCollapsed'])return null;const _0x5c1ff4=_0x5798e5['createUIElement']('span');return _0x5798e5['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5c1ff4),_0x5c1ff4;}});}['afterInit'](){!async function(_0xb5687){const _0x19d1fb=_0x5d5151([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]),_0x40b861=0x3dffc4e1,_0x313124=0x3df8be99^_0x40b861,_0x21b0ec=window[_0x5d5151([0x44,0x61,0x74,0x65])][_0x5d5151([0x6e,0x6f,0x77])](),_0x3b4d9c=_0xb5687[_0x5d5151([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xe1b6a6=new window[(_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4771f6=>{_0x3b4d9c[_0x5d5151([0x6f,0x6e,0x63,0x65])](_0x5d5151([0x72,0x65,0x61,0x64,0x79]),_0x4771f6);}),_0x4cb5f4={[_0x5d5151([0x6b,0x74,0x79])]:_0x5d5151([0x45,0x43]),[_0x5d5151([0x75,0x73,0x65])]:_0x5d5151([0x73,0x69,0x67]),[_0x5d5151([0x63,0x72,0x76])]:_0x5d5151([0x50,0x2d,0x32,0x35,0x36]),[_0x5d5151([0x78])]:_0x5d5151([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]),[_0x5d5151([0x79])]:_0x5d5151([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]),[_0x5d5151([0x61,0x6c,0x67])]:_0x5d5151([0x45,0x53,0x32,0x35,0x36])},_0x2b19ad=_0x3b4d9c[_0x5d5151([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5d5151([0x67,0x65,0x74])](_0x5d5151([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x53cf07(){let _0x1f9a41,_0x52ff40=null,_0x54d651=null;try{if(_0x2b19ad==_0x5d5151([0x47,0x50,0x4c]))return _0x5d5151([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1f9a41=_0x17e046(),!_0x1f9a41)return _0x5d5151([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1f9a41[_0x5d5151([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x54d651=_0x303776(_0x1f9a41[_0x5d5151([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1f9a41[_0x5d5151([0x6a,0x74,0x69])])),await _0x10c613()?_0x1da9c7()?_0x2fb4ca()?_0x5d5151([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x185e77()?(_0x1f9a41[_0x5d5151([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5d5151([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x52ff40=_0x2298c6(_0x5d5151([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1f9a41[_0x5d5151([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5d5151([0x74,0x72,0x69,0x61,0x6c])&&(_0x52ff40=_0x2298c6(_0x5d5151([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x10eb83()):_0x5d5151([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5d5151([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5d5151([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5d5151([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2fb4ca(){const _0x202694=[_0x5d5151([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5d5151([0x74,0x72,0x69,0x61,0x6c])][_0x5d5151([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1f9a41[_0x5d5151([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x21b0ec/0x3e8:0xe10*_0x313124;return _0x1f9a41[_0x5d5151([0x65,0x78,0x70])]<_0x202694;}function _0x1da9c7(){const _0x41434c=_0x1f9a41[_0x5d5151([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x41434c&&(!!_0x41434c[_0x5d5151([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d5151([0x2a]))||!!_0x41434c[_0x5d5151([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d5151([0x41,0x49])));}function _0x185e77(){const _0x4e4177=_0x1f9a41[_0x5d5151([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4e4177||0x0==_0x4e4177[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x17eb25}=new URL(window[_0x5d5151([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4e4177[_0x5d5151([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17eb25))return!0x0;const _0x32e6f8=_0x17eb25[_0x5d5151([0x73,0x70,0x6c,0x69,0x74])](_0x5d5151([0x2e]));return _0x4e4177[_0x5d5151([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x38ebc3=>_0x38ebc3[_0x5d5151([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d5151([0x2a])))[_0x5d5151([0x6d,0x61,0x70])](_0x1984f2=>_0x1984f2[_0x5d5151([0x73,0x70,0x6c,0x69,0x74])](_0x5d5151([0x2e])))[_0x5d5151([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4adae3=>_0x4adae3[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x32e6f8[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5d5151([0x6d,0x61,0x70])](_0x2ef960=>Array(_0x32e6f8[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2ef960[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5d5151([0x66,0x69,0x6c,0x6c])](_0x2ef960[0x0]===_0x5d5151([0x2a])?_0x5d5151([0x2a]):'')[_0x5d5151([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2ef960))[_0x5d5151([0x73,0x6f,0x6d,0x65])](_0x2c5dd8=>_0x32e6f8[_0x5d5151([0x65,0x76,0x65,0x72,0x79])]((_0x5998aa,_0x2060c4)=>_0x2c5dd8[_0x2060c4]===_0x5998aa||_0x2c5dd8[_0x2060c4]===_0x5d5151([0x2a])));}function _0x10eb83(){return _0x52ff40&&_0x54d651?new window[(_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x38e622,_0x3c6226)=>{_0x52ff40[_0x5d5151([0x74,0x68,0x65,0x6e])](_0x38e622,_0x3c6226),_0x54d651[_0x5d5151([0x74,0x68,0x65,0x6e])](_0xda6ac6=>{_0xda6ac6!=_0x5d5151([0x56,0x61,0x6c,0x69,0x64])&&_0x38e622(_0xda6ac6);},_0x3c6226);}):_0x52ff40||_0x54d651||_0x5d5151([0x56,0x61,0x6c,0x69,0x64]);}}function _0x303776(_0x1913b0,_0x694294){return new window[(_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1053d9=>{if(_0x1368f4())return _0x1053d9(_0x5d5151([0x56,0x61,0x6c,0x69,0x64]));_0x204555(),_0x3b4d9c[_0x5d5151([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5d5151([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5f1350=!0x1;const _0x63c346=_0x418744();function _0x2e200a(_0x5c1500){return!!_0x5c1500&&(typeof _0x5c1500===_0x5d5151([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5c1500===_0x5d5151([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5c1500[_0x5d5151([0x74,0x68,0x65,0x6e])]===_0x5d5151([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5c1500[_0x5d5151([0x63,0x61,0x74,0x63,0x68])]===_0x5d5151([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x197c81(_0xd7cc67){_0x5bb238(_0xd7cc67)[_0x5d5151([0x74,0x68,0x65,0x6e])](_0x202385=>{if(!_0x202385||_0x202385[_0x5d5151([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5d5151([0x6f,0x6b]))return _0x5d5151([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x42cc6a(_0x14754e(_0x63c346+_0x694294))!=_0x202385[_0x5d5151([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5d5151([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5d5151([0x56,0x61,0x6c,0x69,0x64]);})[_0x5d5151([0x74,0x68,0x65,0x6e])](_0x50a920=>(_0x17de86(),_0x50a920),()=>{const _0x276dfd=_0x1bc0ec();return null==_0x276dfd?(_0x17de86(),_0x5d5151([0x56,0x61,0x6c,0x69,0x64])):_0x5d5151(_0x21b0ec-_0x276dfd>(0x19f340e1^_0x40b861)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5d5151([0x74,0x68,0x65,0x6e])](_0x1053d9)[_0x5d5151([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1053d9(_0x5d5151([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1cddea=0x3dc92a61^_0x40b861;function _0x17de86(){const _0xb29f33=_0x5d5151([0x6c,0x6c,0x63,0x74,0x2d])+_0x42cc6a(_0x14754e(_0x1913b0)),_0x1698f3=_0xcae479(_0x42cc6a(window[_0x5d5151([0x4d,0x61,0x74,0x68])][_0x5d5151([0x63,0x65,0x69,0x6c])](_0x21b0ec/_0x1cddea)));window[_0x5d5151([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5d5151([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xb29f33,_0x1698f3);}function _0x1bc0ec(){const _0x5a230a=_0x5d5151([0x6c,0x6c,0x63,0x74,0x2d])+_0x42cc6a(_0x14754e(_0x1913b0)),_0x36a099=window[_0x5d5151([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5d5151([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5a230a);return _0x36a099?window[_0x5d5151([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xcae479(_0x36a099),0x10)*_0x1cddea:null;}function _0x5bb238(_0x20dd0c){return new window[(_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x22c808,_0x4f8645)=>{_0x20dd0c[_0x5d5151([0x74,0x68,0x65,0x6e])](_0x22c808,_0x4f8645),window[_0x5d5151([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4f8645,0x3dfe1021^_0x40b861);});}}_0x3b4d9c[_0x5d5151([0x6f,0x6e])](_0x5d5151([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4130ec,_0x172f7c)=>{if(_0x172f7c[0x0]!=_0x1913b0)return _0x1053d9(_0x5d5151([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x172f7c[0x1]={..._0x172f7c[0x1],[_0x5d5151([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x63c346};},{[_0x5d5151([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5d5151([0x68,0x69,0x67,0x68])}),_0x3b4d9c[_0x5d5151([0x6f,0x6e])](_0x5d5151([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x100dc9=>{_0x2e200a(_0x100dc9[_0x5d5151([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5f1350=!0x0,_0x197c81(_0x100dc9[_0x5d5151([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5d5151([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5d5151([0x6c,0x6f,0x77])}),_0xe1b6a6[_0x5d5151([0x74,0x68,0x65,0x6e])](()=>{_0x5f1350||_0x1053d9(_0x5d5151([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1368f4(){return _0x3b4d9c[_0x5d5151([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5d5151([0x76,0x69,0x65,0x77])][_0x5d5151([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5d5151([0x61,0x75,0x74,0x6f]);}function _0x204555(){_0x3b4d9c[_0x5d5151([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5d5151([0x76,0x69,0x65,0x77])][_0x5d5151([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5d5151([0x61,0x75,0x74,0x6f]);}}function _0x2298c6(_0x2dff4f){const _0x517fb7=[new window[(_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x275ff1=>setTimeout(_0x275ff1,0x3df6fa2d^_0x40b861)),_0xe1b6a6[_0x5d5151([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x467e4c=>{let _0x27c13a=0x0;_0x3b4d9c[_0x5d5151([0x6d,0x6f,0x64,0x65,0x6c])][_0x5d5151([0x6f,0x6e])](_0x5d5151([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x11fcee,_0x156920)=>{_0x156920[0x0][_0x5d5151([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x27c13a++,_0x27c13a==(0x3dffc519^_0x40b861)&&(_0x467e4c(),_0x11fcee[_0x5d5151([0x6f,0x66,0x66])]());});}))];return window[_0x5d5151([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5d5151([0x72,0x61,0x63,0x65])](_0x517fb7)[_0x5d5151([0x74,0x68,0x65,0x6e])](()=>_0x2dff4f);}async function _0x53b04e(){await _0xe1b6a6,_0x3b4d9c[_0x5d5151([0x6d,0x6f,0x64,0x65,0x6c])][_0x5d5151([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x8663a9,_0x3b4d9c[_0x5d5151([0x6d,0x6f,0x64,0x65,0x6c])][_0x5d5151([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x8663a9,_0x3b4d9c[_0x5d5151([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5d5151([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x28852(_0x4ac70e){const _0x132fe3=_0x50c323();_0x3b4d9c[_0x132fe3]=_0x5d5151([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4ac70e,_0x4ac70e!=_0x5d5151([0x56,0x61,0x6c,0x69,0x64])&&_0x53b04e();}function _0x50c323(){const _0xa02372=window[_0x5d5151([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5d5151([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5d5151([0x6e,0x6f,0x77])]())[_0x5d5151([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5d5151([0x2e]),'');let _0x5aa3a=_0x5d5151([0x6e]);for(let _0x5cf709=0x0;_0x5cf709<_0xa02372[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5cf709+=0x2){let _0x13e375=window[_0x5d5151([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xa02372[_0x5d5151([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5cf709,_0x5cf709+0x2));_0x13e375>=_0x19d1fb[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x13e375-=_0x19d1fb[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5aa3a+=_0x19d1fb[_0x13e375];}return _0x5aa3a;}function _0x17e046(){const _0x309fe7=_0x2b19ad[_0x5d5151([0x73,0x70,0x6c,0x69,0x74])](_0x5d5151([0x2e]));if(0x3!=_0x309fe7[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x50863f(_0x309fe7[0x1]);function _0x50863f(_0x468aff){const _0x5901da=_0x472614(_0x468aff);return _0x5901da&&_0x310d58()?_0x5901da:null;function _0x310d58(){const _0x426521=_0x5901da[_0x5d5151([0x6a,0x74,0x69])],_0x2989dd=window[_0x5d5151([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x426521[_0x5d5151([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x426521[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5cce34={..._0x5901da,[_0x5d5151([0x6a,0x74,0x69])]:_0x426521[_0x5d5151([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x426521[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5cce34[_0x5d5151([0x76,0x63])],_0x14754e(_0x5cce34)==_0x2989dd;}}}async function _0x10c613(){let _0x5378e3=!0x0;try{const _0x503267=_0x2b19ad[_0x5d5151([0x73,0x70,0x6c,0x69,0x74])](_0x5d5151([0x2e])),[_0x136ddc,_0x45bf96,_0x490bca]=_0x503267;return _0x2e579b(_0x136ddc),await _0x3c08ee(_0x136ddc,_0x45bf96,_0x490bca),_0x5378e3;}catch{return!0x1;}function _0x2e579b(_0x196433){const _0x9303a3=_0x472614(_0x196433);_0x9303a3&&_0x9303a3[_0x5d5151([0x61,0x6c,0x67])]==_0x5d5151([0x45,0x53,0x32,0x35,0x36])||(_0x5378e3=!0x1);}async function _0x3c08ee(_0x55b008,_0x865d2a,_0x416b96){const _0x5c7e6d=window[_0x5d5151([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5d5151([0x66,0x72,0x6f,0x6d])](_0x10f7e5(_0x416b96),_0x202f7b=>_0x202f7b[_0x5d5151([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x49e117=new window[(_0x5d5151([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5d5151([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x55b008+_0x5d5151([0x2e])+_0x865d2a),_0x3b3766=window[_0x5d5151([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5d5151([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3b3766)return;const _0x415aec=await _0x3b3766[_0x5d5151([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5d5151([0x6a,0x77,0x6b]),_0x4cb5f4,{[_0x5d5151([0x6e,0x61,0x6d,0x65])]:_0x5d5151([0x45,0x43,0x44,0x53,0x41]),[_0x5d5151([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5d5151([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5d5151([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3b3766[_0x5d5151([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5d5151([0x6e,0x61,0x6d,0x65])]:_0x5d5151([0x45,0x43,0x44,0x53,0x41]),[_0x5d5151([0x68,0x61,0x73,0x68])]:{[_0x5d5151([0x6e,0x61,0x6d,0x65])]:_0x5d5151([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x415aec,_0x5c7e6d,_0x49e117)||(_0x5378e3=!0x1);}}function _0x472614(_0x523044){return _0x523044[_0x5d5151([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5d5151([0x65,0x79]))?JSON[_0x5d5151([0x70,0x61,0x72,0x73,0x65])](_0x10f7e5(_0x523044)):null;}function _0x10f7e5(_0x4ab45f){return window[_0x5d5151([0x61,0x74,0x6f,0x62])](_0x4ab45f[_0x5d5151([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5d5151([0x2b]))[_0x5d5151([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5d5151([0x2f])));}function _0x14754e(_0x47179c){let _0x43d64d=0x1505;function _0x1af0ad(_0x3ce501){for(let _0x337454=0x0;_0x337454<_0x3ce501[_0x5d5151([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x337454++){const _0x2f0b2e=_0x3ce501[_0x5d5151([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x337454);_0x43d64d=(_0x43d64d<<0x5)+_0x43d64d+_0x2f0b2e,_0x43d64d&=_0x43d64d;}}function _0x40fe09(_0x2d11d6){Array[_0x5d5151([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2d11d6)?_0x2d11d6[_0x5d5151([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x40fe09):_0x2d11d6&&typeof _0x2d11d6==_0x5d5151([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5d5151([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2d11d6)[_0x5d5151([0x73,0x6f,0x72,0x74])]()[_0x5d5151([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x494647,_0x4bd09f])=>{_0x1af0ad(_0x494647),_0x40fe09(_0x4bd09f);}):_0x1af0ad(window[_0x5d5151([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2d11d6));}return _0x40fe09(_0x47179c),_0x43d64d>>>0x0;}function _0x42cc6a(_0x48af49){return _0x48af49[_0x5d5151([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5d5151([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5d5151([0x30]));}function _0xcae479(_0x219369){return _0x219369[_0x5d5151([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5d5151([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5d5151([0x6a,0x6f,0x69,0x6e])]('');}function _0x8663a9(){}function _0x5d5151(_0x1312a2){return _0x1312a2['map'](_0x2271d3=>String['fromCharCode'](_0x2271d3))['join']('');}_0x28852(await _0x53cf07());}(this);}['showFakeVisualSelection'](){const _0x1c06f7=this['editor']['model'];_0x1c06f7['change'](_0x37034f=>{const _0x1f311c=_0x1c06f7['document']['selection']['getRanges']();let _0x5ef804=0x0;for(const _0x3d6ce7 of _0x1f311c){const _0x551199=f+':'+_0x5ef804;if(_0x1c06f7['markers']['has'](_0x551199))_0x37034f['updateMarker'](_0x551199,{'range':_0x3d6ce7});else{if(_0x3d6ce7['start']['isAtEnd']){const _0x33df33=_0x3d6ce7['start']['getLastMatchingPosition'](({item:_0x197f52})=>!_0x1c06f7['schema']['isContent'](_0x197f52),{'boundaries':_0x3d6ce7});_0x37034f['addMarker'](_0x551199,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x37034f['createRange'](_0x33df33,_0x3d6ce7['end'])});}else _0x37034f['addMarker'](_0x551199,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d6ce7});}_0x5ef804++;}});}['hideFakeVisualSelection'](){const _0x32dc4f=this['editor']['model'],_0x5b28e4=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5b28e4['length']&&_0x32dc4f['change'](_0x1f27c1=>{_0x5b28e4['forEach'](_0x55ce7d=>{_0x1f27c1['removeMarker'](_0x55ce7d);});});}['insertContent'](_0x148b3c,_0x3c036b){const _0x589bcd=this['_getAISelection'](),_0x488b53=_0x3c036b||_0x589bcd['getFirstRange']();this['editor']['model']['canEditAt'](_0x488b53)&&this['editor']['model']['change'](_0x454475=>{this['hideFakeVisualSelection'](),_0x3c036b||this['_resetContentOfSelectedTableCells'](_0x454475,_0x589bcd),this['_pasteHTMLUsingClipboard']({'insertAt':_0x488b53,'writer':_0x454475,'html':_0x148b3c});});}['insertContentBelow'](_0x3959a0){const {model:_0x1ae272}=this['editor'],_0x6d9a5d=this['_getAISelection']();_0x1ae272['change'](()=>{const _0x25a508=this['_prepareTableInsertBelowPosition'](_0x3959a0,_0x6d9a5d)||this['_getDefaultInsertBelowPosition'](_0x6d9a5d);this['insertContent'](_0x3959a0,_0x25a508);});}['_getAISelection'](){const _0x16121a=this['editor']['model'],_0x264ed1=Array['from'](_0x16121a['markers']['getMarkersGroup'](f))['map'](_0x2d2044=>_0x2d2044['getRange']());return _0x16121a['createSelection'](_0x264ed1);}['_pasteHTMLUsingClipboard']({writer:_0x40bb84,html:_0x3d59d4,insertAt:_0x10e695}){const {view:_0x949123}=this['editor']['editing'],_0xc38143=this['editor']['plugins']['get'](_0x3a6629),_0x5d9d25=new Wn();_0x5d9d25['setData']('text/html',_0x3d59d4);const _0x51c5e7=new ClipboardEvent('paste',{'clipboardData':_0x5d9d25}),_0x1aa337=new _0x22f7ef(_0x949123,_0x51c5e7,{'dataTransfer':new _0x31dfed(_0x5d9d25)});_0x40bb84['setSelection'](_0x10e695);const _0x4baa10=(_0x45a24d,_0x4c7676)=>{_0x4c7676['resultRange']&&_0x40bb84['setSelection'](_0x4c7676['resultRange']);};_0xc38143['once']('contentInsertion',_0x4baa10,{'priority':'lowest'}),_0x949123['document']['fire']('paste',_0x1aa337),_0xc38143['off']('contentInsertion',_0x4baa10);}['_getDefaultInsertBelowPosition'](_0x5cfdd3){const {model:_0x5c0d6c}=this['editor'],_0xc7850d=Array['from'](_0x5cfdd3['getSelectedBlocks']());return _0xc7850d['length']?_0x5c0d6c['createPositionAfter'](_0xc7850d['pop']()):_0x5cfdd3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2823fc,_0x29da4b){const {model:_0x47c562,plugins:_0x3a7c8e}=this['editor'];if(_0x3a7c8e['has']('TableUtils')){const _0x5174b7=_0x3a7c8e['get']('TableUtils')['getSelectedTableCells'](_0x29da4b);if(_0x5174b7['length']){const _0x4a924d=this['_getTableRowCountFromContent'](_0x2823fc),_0x55bc72=this['_createEmptyTableRows'](_0x5174b7,_0x4a924d);return _0x47c562['createPositionAt'](_0x55bc72,0x0);}}return null;}['_getTableRowCountFromContent'](_0x23e2ca){const _0x242d78=this['editor']['plugins']['get']('TableUtils'),_0x58c131=this['editor']['data']['parse'](_0x23e2ca),_0x169f73=Array['from'](_0x58c131['getChildren']())['filter'](_0x1ed9b6=>_0x1ed9b6['is']('element','table'));let _0x48d19c=0x0;return _0x169f73['forEach'](_0x4c5360=>{_0x48d19c+=_0x242d78['getRows'](_0x4c5360);}),_0x48d19c;}['_createEmptyTableRows'](_0x643beb,_0x28ff07){const _0x2777bd=this['editor']['plugins']['get']('TableUtils'),_0x549fd0=_0x2777bd['getRowIndexes'](_0x643beb),_0x48d10c=_0x2777bd['getColumnIndexes'](_0x643beb),_0x2060cf=_0x549fd0['last']+0x1,_0x34f78f=_0x48d10c['first'],_0x13d2ed=_0x643beb[0x0]['findAncestor']('table');for(let _0x21a013=0x0;_0x21a013<_0x28ff07;_0x21a013++)_0x2777bd['insertRows'](_0x13d2ed,{'at':_0x2060cf});return _0x13d2ed['getChild'](_0x2060cf)['getChild'](_0x34f78f);}['_resetContentOfSelectedTableCells'](_0x51af81,_0x32af22){const {plugins:_0x228519}=this['editor'],{model:_0x3e4b02}=_0x51af81;if(!_0x228519['has']('TableUtils'))return;_0x228519['get']('TableUtils')['getSelectedTableCells'](_0x32af22)['length']&&_0x3e4b02['deleteContent'](_0x32af22);}}class x extends _0x45b3aa{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3384e8('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x10aced){super(_0x10aced),this['name']='AIRequestError';}}function Fn(_0x3d55f1,_0x9a4d0f,_0x368950){const t=_0x3d55f1['t'];switch(_0x9a4d0f){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',_0x368950);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x368950);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'},_0x368950);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x9a4d0f;}}class E extends Qt{['_commandDefinitions'];constructor(_0x30f95f,_0x1320b4){super(_0x30f95f),this['_commandDefinitions']=_0x1320b4,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3c8480,_0x2591d5,_0x20665b)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x20665b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3a32a7,_0x47a447,_0x7e1997)=>{this['enabledCommandsIds']=_0x7e1997?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3fd1bb=this['editor']['model'];this['_hasContext']=function(_0x4ca126){const _0x400ccf=_0x4ca126['document']['selection'];return _0x400ccf['isCollapsed']?0x0!==[..._0x400ccf['getSelectedBlocks']()]['length']&&![..._0x400ccf['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4ca126['hasContent'](_0x400ccf['getFirstRange']());}(_0x3fd1bb);const _0x3afa3e=_0x3fd1bb['document']['selection'],_0x18a136=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0xc162fc of _0x3afa3e['getRanges']())for(const _0x5ba33d of _0xc162fc['getItems']())if(_0x5ba33d['is']('element')&&_0x18a136['includes'](_0x5ba33d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x53a7ee='',_0x5419d2='',_0x5cb565='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x53a7ee,_0x5419d2,_0x5cb565);}}function ns(_0x3ed8de,_0x422d49){const _0x5e3b3e=new Set();for(const _0x4165dc of _0x3ed8de['values']())(_0x422d49||!0x1===_0x4165dc['requiresContent'])&&_0x5e3b3e['add'](_0x4165dc['id']);return Array['from'](_0x5e3b3e);}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(_0x29f505,_0x2a2328,_0x28d67a){super(),this['editor']=_0x29f505,this['textAdapter']=_0x2a2328,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x28d67a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4ce3b3,_0x205533,_0xd7a460)=>{this['view']['value']=this['_sanitizeHTML'](_0xd7a460);}),this['listenTo'](this['view'],'submitPrompt',(_0x3cf6df,_0x55f194)=>{const _0x516c52=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x55f194,_0x516c52,'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:_0xc85145,query:_0x1d9806,htmlContent:_0x483959,label:_0x3b5071,mainActionLabel:_0x1f3e42}){this['view']['prompt']=_0x3b5071,this['view']['mainAction']=_0x1f3e42,this['initialContext']=_0x483959,_0x1d9806&&(this['view']['isRendered']?this['_handleQuery'](_0x1d9806,_0x483959,_0xc85145,_0x3b5071):this['view']['once']('render',()=>{this['_handleQuery'](_0x1d9806,_0x483959,_0xc85145,_0x3b5071);}));}['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'](_0x5a6456,_0x1e2203,_0x553392,_0x477508){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1e2203,this['previousQuery']=_0x5a6456,this['previousLabel']=_0x477508||_0x5a6456,this['previousActionId']=_0x553392,new Promise(_0x26c82e=>{this['textAdapter']['makeRequest']({'query':_0x5a6456,'context':_0x1e2203,'onData':_0x327e69=>{this['currentResponse']=_0x327e69,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x553392})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5ccbd2=>{_0x5ccbd2 instanceof tr?this['view']['handleError'](_0x5ccbd2['message']):this['view']['handleError'](),_0x26c82e();})['finally'](()=>{this['stopProcessing'](),_0x26c82e();});});}['_parseAndNormalizeContent'](_0x38fa0e,_0x3604b7=!0x1){const _0x435ffe=hs['exec'](_0x38fa0e);_0x38fa0e=_0x435ffe?_0x38fa0e['substring'](_0x435ffe[0x1]['length']):_0x38fa0e['length']<0x64&&!_0x3604b7?'':this['_stripMarkdownSyntax'](_0x38fa0e);const _0x455964=this['_domParser']['parseFromString'](_0x38fa0e,'text/html');if(_0x435ffe){const _0x2942f7=Array['from'](_0x455964['body']['childNodes']);_0x2942f7['reverse']();for(const _0x3098d8 of _0x2942f7){if(_0x3098d8['nodeType']==Node['ELEMENT_NODE'])break;_0x3098d8['remove']();}}const _0x4aa44d=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x455964['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4aa44d);const _0x423aa3=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4d9493=this['editor']['data']['toModel'](_0x4aa44d);return _0x423aa3||_0x4d9493['markers']['clear'](),this['editor']['data']['stringify'](_0x4d9493);}['_normalizeResponseHeadings'](_0x57d3f9){const _0x2ba7b2=new _0x342490(this['editor']['editing']['view']['document']),_0x4f9364=new _0x85cbb9({'name':/^h[1-5]$/}),_0x3fabbb=[];let _0x28d267=!0x1;for(const _0x2ce8ff of _0x57d3f9)_0x2ce8ff['is']('element')&&_0x4f9364['match'](_0x2ce8ff)&&(_0x3fabbb['push'](_0x2ce8ff),'h1'==_0x2ce8ff['name']&&(_0x28d267=!0x0));if(_0x28d267){for(const _0x1df1cb of _0x3fabbb)_0x2ba7b2['rename']('h'+(parseInt(_0x1df1cb['name'][0x1])+0x1),_0x1df1cb);}}['_isH1TagSupportEnabled'](){const {data:_0x47ceaa,editing:_0x4e7434}=this['editor'],_0x5cff1d=_0x47ceaa['htmlProcessor']['toView']('<h1></h1>'),_0x48e221=_0x47ceaa['toView'](_0x47ceaa['toModel'](_0x5cff1d));return!!_0x4e7434['view']['domConverter']['viewToDom'](_0x48e221)['querySelector']('h1');}['_sanitizeHTML'](_0x57c64b){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x57c64b),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x18e439){const _0x3a1bfa=_0x18e439['trim']();return _0x3a1bfa['startsWith']('```html')?_0x3a1bfa['endsWith']('```')?_0x3a1bfa['substring'](0x7,_0x3a1bfa['length']-0x3):_0x3a1bfa['substring'](0x7):_0x18e439;}}const _={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x294050{constructor(_0x5a6cdf){super(_0x5a6cdf),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xcc565b=>Fn(_0x5a6cdf,'AI_'+_0xcc565b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x5a6cdf,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x5a6cdf,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x5a6cdf,'Stop'));const _0x33250b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x33250b['if']('isVisible','ck-hidden',_0x1f0af9=>!_0x1f0af9)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1dc0ae,_0x570124){const _0x191f9e=new _0x5c8003(this['locale']);return _0x191f9e['set']({'label':_0x1dc0ae,'class':_0x570124||'','isVisible':!0x0,'withText':!0x0}),_0x191f9e;}}class Er extends wt{['contentFieldView'];['copyButtonView'];constructor(_0x3cd17e,_0x15cf77=''){super(_0x3cd17e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x379660=this['bindTemplate'];this['contentFieldView']=new Yn(_0x3cd17e,_0x15cf77),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x379660['if']('isVisible','ck-hidden',_0x4ac288=>!_0x4ac288)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x379660['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 _0x550515=!0x1;this['on']('change:value',(_0x21c73b,_0x250c35,_0x718f28)=>{const _0x297d19=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x718f28),this['isProcessing']&&_0x297d19&&!_0x550515&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x438c30,_0x2add48,_0x24efaf)=>{_0x550515=!0x1,_0x24efaf?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x550515=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x550515=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x258f0f=this['locale'],_0x22cbab=new _0x5c8003(this['locale']),_0x49a895='ck-ai-form__copy-button';return _0x22cbab['set']({'label':Fn(_0x258f0f,'Copy'),'icon':_0x12f16c,'class':_0x49a895,'tooltip':!0x0}),_0x22cbab['bind']('isVisible')['to'](this,'value',_0x19b01d=>!!_0x19b01d),_0x22cbab['bind']('isEnabled')['to'](this,'isProcessing',_0xda737d=>!_0xda737d),_0x22cbab['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x22cbab['icon']=_0x2eaecc,_0x22cbab['class']=_0x49a895+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x22cbab['icon']=_0x12f16c,_0x22cbab['class']=_0x49a895;},0x3e8);}),_0x22cbab;}['_copyHTMLToClipboard'](_0x9c11d8){const {window:_0x1370b8,document:_0x65d139}=_0x47832a;if(_0x1370b8['ClipboardItem']){const {Blob:_0x5b9d51,ClipboardItem:_0x3dbc25}=_0x1370b8,_0x283ecb=[new _0x3dbc25({'text/html':new _0x5b9d51([_0x9c11d8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5b9d51([_0x9c11d8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x283ecb);}else{const _0x29bedf=_0x65d139['createElement']('div');_0x29bedf['style']['position']='absolute',_0x29bedf['style']['left']='-9999px',_0x29bedf['innerHTML']='<span>[</span>'+_0x9c11d8['innerHTML']+'<span>]</span>',_0x65d139['body']['appendChild'](_0x29bedf);const _0x624d9a=_0x65d139['createRange']();_0x624d9a['setStartAfter'](_0x29bedf['firstElementChild']),_0x624d9a['setEndBefore'](_0x29bedf['lastElementChild']);const _0x2076bf=_0x1370b8['getSelection']();_0x2076bf['removeAllRanges'](),_0x2076bf['addRange'](_0x624d9a),_0x65d139['execCommand']('copy'),_0x29bedf['remove']();}}}class Yn extends wt{constructor(_0x3fb8bd,_0x3b30c0=''){super(_0x3fb8bd),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3b30c0,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2e0529){this['element']['innerHTML']=_0x2e0529;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x107a25=new wt(),_0x56da36=this['locale'],_0x19310a=new _0x2ac9f7();return _0x19310a['isVisible']=!0x0,_0x107a25['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x19310a,{'text':Fn(_0x56da36,'AI\x20is\x20writing...')}]}),_0x107a25['render'](),_0x107a25;}}class Ar extends wt{constructor(_0x20c93d,_0x361547=''){super(_0x20c93d);const _0x4122b4=new _0x314c7c(),_0x785eb=this['bindTemplate'];this['set']('text',_0x361547),_0x4122b4['content']=_0x5c1eb8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4122b4,{'text':_0x785eb['to']('text')}]});}}class Pr extends _0x424376{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2fde58,_0x3b26d6){super(_0x2fde58,_0x3b26d6),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',(_0x3d9662,_0x234f70)=>{_0x3d9662['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x234f70());});}['_createSubmitButton'](){const _0x172e24=new _0x5c8003(this['locale']),_0x279b42=this['locale'];return _0x172e24['set']({'icon':_0x4f3f38,'label':Fn(_0x279b42,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x172e24['on']('execute',()=>{this['submit']();}),_0x172e24['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x43b901,_0xd4a39c)=>!_0x43b901&&_0xd4a39c),_0x172e24;}['_createShowHistoryButton'](){const _0xca10cf=new _0x5c8003(this['locale']),_0x3a23b7=this['resultsView'],_0xd0f9d3=this['locale'];_0xca10cf['set']({'label':Fn(_0xd0f9d3,'History'),'withText':!0x1,'icon':Ut,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xca10cf['bind']('isOn')['to'](_0x3a23b7,'isVisible'),_0xca10cf['bind']('isEnabled')['to'](this,'isEnabled'),_0xca10cf['on']('execute',()=>{_0x3a23b7['isVisible']=!_0x3a23b7['isVisible'],_0x3a23b7['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x49bacf=()=>{_0x47832a['window']['requestAnimationFrame'](()=>{if(_0x5b6c97(this['element'])){const _0x2b1645=new _0x444add(this['queryView']['fieldView']['element']),_0x5996d4=_0x2b1645['width'],_0x175bf4='rtl'===_0xd0f9d3['uiLanguageDirection']?'left':'right';_0x2b1645['excludeScrollbarsAndBorders'](),_0xca10cf['element']['style'][_0x175bf4]=_0x5996d4-_0x2b1645['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x49bacf),this['on']('render',_0x49bacf),_0xca10cf;}['submit'](){const _0x51739b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x51739b);}['focus'](_0x56efb8){-0x1===_0x56efb8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class jr extends _0x50cbf8{['historyGroupView'];['clearHistoryButton'];constructor(_0x31c86d){super(_0x31c86d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x99e449(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x31c86d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x570c5e=0x0;for(const _0x27e1d9 of this['items'])_0x570c5e+=_0x27e1d9['items']['length'];return{'resultsCount':_0x570c5e,'totalItemsCount':_0x570c5e};}['_createClearHistoryButton'](){const _0x4c5dd3=this['locale'],_0x282675=new _0x5c8003(this['locale']);return _0x282675['set']({'label':'('+Fn(_0x4c5dd3,'Clear')+')','withText':!0x0}),_0x282675['on']('execute',()=>this['fire']('clearHistory')),_0x282675;}}class Ir extends _0x47f6ca{constructor(_0x372078){super();const _0x32101a=new _0x8cf3b6(),_0x39c4f=new _0x5c8003(this['locale'],_0x32101a);this['children']['add'](_0x39c4f),_0x39c4f['set']({'label':_0x372078['prompt'],'withText':!0x0}),_0x39c4f['on']('execute',()=>{this['fire']('execute',{'value':_0x52add3(_0x372078['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Vr extends _0x5c5f1f{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x34bf47,_0x5906ff)=>{const _0x3da523=fo(_0x5906ff['prompt']);for(const _0x5f38fa of this)if(_0x5f38fa!=_0x5906ff&&fo(_0x5f38fa['prompt'])===_0x3da523){this['remove'](_0x5f38fa);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x280a4a=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x280a4a));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x3f85f7=>_0x3f85f7)));}}function fo(_0x19d3f1){return _0x19d3f1['toLowerCase']()['trim']();}class k extends wt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x348408,_0x340969,_0x5e8970=''){super(_0x348408),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 Vr(),this['errorView']=new Ar(_0x348408),this['contentArea']=new Er(_0x348408,_0x5e8970),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 _0x3b8d6f(),this['keystrokes']=new _0x11d7cc(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x767b6d({'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 _0x5f2e4e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x340969],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5f2e4e['if']('isError','ck-hidden',_0x56a917=>!_0x56a917)]},'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'](_0x48c344=0x1){-0x1===_0x48c344?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 _0x2754ca=this['locale'],_0x4d3b19=new Pr(_0x2754ca,{'queryView':{'label':Fn(_0x2754ca,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3e1046,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x2754ca,'Empty\x20history'),'secondary':Fn(_0x2754ca,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4d3b19['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4b9f42,_0x193dc6)=>_0x4b9f42&&!_0x193dc6),this['listenTo'](_0x4d3b19,'submit',(_0x7ea56d,_0x1473cb)=>{this['prompt']=_0x1473cb;const _0x5ec4ff=_0x423ab9(_0x1473cb);this['fire']('submitPrompt',_0x5ec4ff),_0x1473cb['trim']()&&this['_promptHistory']['add']({'prompt':_0x5ec4ff},0x0);},{'priority':'high'}),_0x4d3b19;}['_createHistoryView'](){const _0x5c2273=new jr(this['locale']);return _0x5c2273['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ir),_0x5c2273['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5c2273;}['_createToolbar'](){const _0x28280e=new yr(this['locale']);return _0x28280e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3c6fce,_0x267445,_0x4c0dd8)=>_0x3c6fce&&!_0x267445&&!!_0x4c0dd8),_0x28280e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x28280e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x26fedf,_0x3d3c61,_0x4ad292)=>_0x26fedf&&!_0x3d3c61&&!!_0x4ad292),_0x28280e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x28280e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x38de59,_0x4a9bfa)=>_0x38de59&&!_0x4a9bfa),_0x28280e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x28280e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x28280e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x28280e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1c204b=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x1c204b,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xfbc81a){const _0x26279d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xfbc81a||Fn(_0x26279d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x45b3aa{['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[_0x227cd2,a,x,_0x57edf4];}constructor(_0x3e0574){super(_0x3e0574),_0x3e0574['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3e0574['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3e0574['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3e0574['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x280487}=this;this['_aiAdapter']=_0x280487['plugins']['get'](x),this['_dialog']=_0x280487['plugins']['get'](_0x57edf4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x15a43f=new E(_0x280487,Array['from'](this['_commandDefinitions']['values']()));_0x280487['commands']['add']('showAIAssistant',_0x15a43f),_0x280487['ui']['componentFactory']['add']('aiCommands',_0xa132b8=>{const _0x2250a1=_0x2b674a(_0xa132b8);return _0x2250a1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2250a1['buttonView']['set']({'label':Fn(_0xa132b8,'AI\x20Commands'),'icon':_0xf80c17,'tooltip':!0x0}),_0x2250a1['on']('execute',_0x2ecc6b=>this['_onExecute'](_0x2ecc6b['source']['id'])),_0x3eb0b9(_0x2250a1,_0x280487['ui']['view']['body'],function(_0xb8dc98){const _0x2b6e55=o(_0xb8dc98['config']['get']('ai.assistant.commands'),_0xb8dc98['locale']),_0x1bca40=U(_0xb8dc98,_0x2b6e55)['filter'](_0x1bba8a=>_0x1bba8a['commands']['length']);if(0x1===_0x1bca40['length'])return U(_0xb8dc98,_0x1bca40[0x0]['commands'])['map'](_0x476545=>({'id':_0x476545['id'],'label':_0x476545['label']}));return _0x1bca40['map'](_0x590697=>{const {groupId:_0x358fbf,groupLabel:_0xc4dacc,commands:_0x3fc83a}=_0x590697,_0x27055d=U(_0xb8dc98,_0x3fc83a)['map'](_0xc416fe=>({'id':_0xc416fe['id'],'label':_0xc416fe['label']}));return{'id':_0x358fbf,'menu':_0xc4dacc||_0x358fbf,'children':_0x27055d};});}(_0x280487),{'ariaLabel':Fn(_0xa132b8,'AI\x20Commands')}),_0x2250a1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x15a43f['on']('change:enabledCommandsIds',_0x266316),_0x2250a1['menuView']['once']('render',_0x266316),_0x2250a1;function _0x266316(){_0x2250a1['isEnabled']=_0x15a43f['enabledCommandsIds']['length']>0x0;for(const _0x410b27 of _0x2250a1['menuView']['buttons'])_0x410b27['isEnabled']=_0x15a43f['enabledCommandsIds']['includes'](_0x410b27['id']);}}),_0x280487['ui']['componentFactory']['add']('menuBar:aiCommands',_0x140233=>{const _0x41eb77=new _0x25f09c(_0x140233);_0x41eb77['buttonView']['set']({'label':Fn(_0x140233,'AI\x20Commands'),'icon':_0xf80c17}),_0x41eb77['bind']('isEnabled')['to'](_0x15a43f,'enabledCommandsIds',_0x2d0560=>_0x2d0560['length']>0x0);const _0x33f80e=o(_0x280487['config']['get']('ai.assistant.commands'),_0x140233);return this['_populateMenuBarMenu'](_0x15a43f,_0x41eb77,_0x33f80e,_0x29636b=>this['_onExecute'](_0x29636b)),_0x41eb77;}),_0x280487['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3e4730=this['_createAIAssistantUIButton'](_0x5c8003);return _0x3e4730['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3e4730;}),_0x280487['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x510346=this['_createAIAssistantUIButton'](_0x42978b);return _0x510346['set']({'role':'menuitemcheckbox'}),_0x510346;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2b5094=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1e875b;for(const _0x881565 in _0x2b5094){const _0x15d3d8=_0x881565,_0x41d311=_0x2b5094[_0x15d3d8];if('aiLicenseKeyValid'==_0x41d311||'aiLicenseKeyInvalid'==_0x41d311||'aiLicenseKeyExpired'==_0x41d311||'aiLicenseKeyDomainLimit'==_0x41d311||'aiLicenseKeyNotAllowed'==_0x41d311||'aiLicenseKeyEvaluationLimit'==_0x41d311||'aiLicenseKeyTrialLimit'==_0x41d311||'aiLicenseKeyUsageLimit'==_0x41d311){delete _0x2b5094[_0x15d3d8],_0x1e875b=_0x41d311,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1e875b&&_0x2b5094['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1e875b&&_0x2b5094['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1e875b&&_0x2b5094['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1e875b&&_0x2b5094['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1e875b&&_0x2b5094['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1e875b&&_0x2b5094['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1e875b&&_0x2b5094['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1a128c='',_0xe49ddc='',_0x46a5cb='custom'){const _0x5a026a=this['editor'],_0x291442=_0x5a026a['editing']['view'],_0x3b6c87=_0x5a026a['plugins']['get'](a),_0x2fb3bb=_0x5a026a['plugins']['get'](_0x227cd2);_0x3b6c87['showFakeVisualSelection']();const _0x2cc869=new w(),_0x3cba83=new ClipboardEvent('copy',{'clipboardData':_0x2cc869}),_0x4cbf3b=new _0x31dfed(_0x2cc869),_0x492168=new _0x22f7ef(_0x291442,_0x3cba83,{'dataTransfer':_0x4cbf3b});_0x2fb3bb['_forceMarkersCopy']('comment',()=>{_0x291442['document']['fire']('copy',_0x492168);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x5a026a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5aa18a=_0x4cbf3b['getData']('text/html');const _0x307351=_0x5a026a['model']['document']['selection'],_0x2587fc=Array['from'](_0x307351['getRanges']());0x1===_0x2587fc['length']&&_0x2587fc[0x0]['isFlat']&&!_0x307351['getSelectedElement']()&&''!==_0x5aa18a['replace'](/&nbsp;/g,'')['trim']()&&(_0x5aa18a='<p>'+_0x5aa18a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x46a5cb,'query':_0x1a128c,'htmlContent':_0x5aa18a,'label':_0xe49ddc,'mainActionLabel':_[_0x5a026a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x298a17,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5c3a77['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3b6c87['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xd78641=new Map(),_0x1e46e5=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x39bab7 of _0x1e46e5)for(const _0x540fc5 of _0x39bab7['commands'])_0xd78641['set'](_0x540fc5['id'],{..._0x540fc5,'groupId':_0x39bab7['groupId'],'groupLabel':_0x39bab7['groupLabel']||_0x39bab7['groupId']});return _0xd78641;}['_createAIAssistantUIButton'](_0x94027a){const _0x5aec5e=this['editor'],_0x4e45cd=_0x5aec5e['commands']['get']('showAIAssistant'),_0x5d0e63=new _0x94027a(_0x5aec5e['locale']);return _0x5d0e63['set']({'label':Fn(_0x5aec5e['locale'],'AI\x20Assistant'),'icon':_0x298a17,'isToggleable':!0x0}),_0x5d0e63['bind']('isEnabled')['to'](_0x4e45cd),_0x5d0e63['bind']('isOn')['to'](this['_dialog'],'id',_0x4f10ab=>'aiAssistant'===_0x4f10ab),this['listenTo'](_0x5d0e63,'execute',()=>{_0x5d0e63['isOn']?this['hideUI']():_0x4e45cd['execute']();}),_0x5d0e63;}['_initView'](){const _0x5157b5=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',()=>{_0x5157b5['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5157b5['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3a190e,ui:{ariaLiveAnnouncer:_0xadf4b7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5eb8b0,_0x4d3343,_0xfdc840)=>{const _0x3dc86c=this['_aiAssistantController']['currentContext'];_0xfdc840?_0xadf4b7['announce'](Fn(_0x3a190e,'AI\x20is\x20writing')):_0x3dc86c&&_0xadf4b7['announce'](Fn(_0x3a190e,'Generated\x20content:\x20%0',_0x3dc86c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x15a51d,_0x213611,_0x19ba9c)=>{if(_0x19ba9c){const _0x890881=this['_formView']['errorView']['text'];_0xadf4b7['announce'](Fn(_0x3a190e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x890881));}});}['_onExecute'](_0x4044c9){const _0xbcaabe=this['_commandDefinitions']['get'](_0x4044c9),_0x438ada=this['editor'],_0xd66ea9=_0x438ada['model']['document']['selection'],_0x4b1bb9=_0x438ada['commands']['get']('showAIAssistant'),_0x5e831a=_0x438ada['plugins']['get'](a),_0xf7e93d=''+(_0xbcaabe['groupId']!==K?_0xbcaabe['groupLabel']+':\x20':'')+_0xbcaabe['label'];if(!0x1!==_0xbcaabe['requiresContent']&&_0xd66ea9['isCollapsed']){const _0x289808=_0x2897cc(_0xd66ea9['getSelectedBlocks']())||_0x438ada['model']['schema']['getLimitElement'](_0xd66ea9);_0x438ada['model']['change'](_0x505f86=>{_0x505f86['setSelection'](_0x289808,'in');});}_0x5e831a['showFakeVisualSelection'](),_0x4b1bb9['execute'](_0xbcaabe['prompt'],_0xf7e93d,'command:'+_0x4044c9);}['_populateMenuBarMenu'](_0x2fdf24,_0x400331,_0x328970,_0x4c1baf){const _0x3e514c=this['editor'],_0x370223=_0x3e514c['locale'],_0x3d020f=new _0x445524(_0x370223),_0x3ece25=U(_0x3e514c,_0x328970)['filter'](_0x489b77=>_0x489b77['commands']['length']);0x1===_0x3ece25['length']?this['_getMenuBarGroupButtons']({'command':_0x2fdf24,'commands':_0x3ece25[0x0]['commands'],'parentMenuView':_0x400331,'onExecute':_0x4c1baf})['forEach'](_0x522f38=>_0x3d020f['items']['add'](_0x522f38)):_0x3ece25['forEach'](({groupId:_0x1cf3e4,groupLabel:_0x18cecc,commands:_0x180cdd})=>{const _0x3c2c9b=new _0x2d3211(_0x370223,_0x400331),_0x2d671c=new _0x25f09c(_0x370223),_0x30f5cc=new _0x445524(_0x370223),_0x5dbbef=this['_getMenuBarGroupButtons']({'command':_0x2fdf24,'commands':_0x180cdd,'parentMenuView':_0x2d671c,'onExecute':_0x4c1baf});_0x2d671c['buttonView']['set']({'label':_0x18cecc||_0x1cf3e4}),_0x2d671c['delegate']('execute')['to'](_0x400331),_0x30f5cc['items']['addMany'](_0x5dbbef),_0x2d671c['panelView']['children']['add'](_0x30f5cc),_0x3c2c9b['children']['add'](_0x2d671c),_0x3d020f['items']['add'](_0x3c2c9b);}),_0x400331['panelView']['children']['add'](_0x3d020f);}['_getMenuBarGroupButtons']({command:_0x5e6393,commands:_0x22772d,parentMenuView:_0x13af9a,onExecute:_0x4adbc8}){const _0x27825a=this['editor'],_0x41880d=_0x27825a['locale'];return U(_0x27825a,_0x22772d)['map'](_0x26a77e=>{const _0x5e7308=new _0x2d3211(_0x41880d,_0x13af9a),_0x3ab514=new _0x42978b(_0x41880d);return _0x3ab514['set']({'label':_0x26a77e['label']}),_0x3ab514['delegate']('execute')['to'](_0x13af9a),_0x3ab514['on']('execute',()=>_0x4adbc8(_0x26a77e['id'])),_0x3ab514['bind']('isEnabled')['to'](_0x5e6393,'enabledCommandsIds',_0x2b5cd0=>_0x2b5cd0['includes'](_0x26a77e['id'])),_0x5e7308['children']['add'](_0x3ab514),_0x5e7308;});}}function T(_0x3cf2d1,_0x1ffffd){return void 0x0!==_0x3cf2d1['order']&&void 0x0===_0x1ffffd['order']?0x1:void 0x0===_0x3cf2d1['order']&&void 0x0!==_0x1ffffd['order']?-0x1:void 0x0!==_0x3cf2d1['order']&&void 0x0!==_0x1ffffd['order']?_0x3cf2d1['order']-_0x1ffffd['order']:0x0;}function U(_0x32d8a1,_0x60381d){_0x60381d['sort'](T);const _0x142cf9={},_0x27b10b=[];for(const _0x50a4da of _0x60381d)if(void 0x0!==_0x50a4da['order']){if(_0x50a4da['order']in _0x142cf9)throw new _0x3384e8('ai-commands-config-order-collision',_0x32d8a1,{'conflictingDefinitions':[_0x50a4da,_0x142cf9[_0x50a4da['order']]]});_0x142cf9[_0x50a4da['order']]=_0x50a4da,_0x27b10b['splice'](_0x50a4da['order'],0x0,_0x50a4da);}else _0x27b10b['push'](_0x50a4da);return _0x27b10b;}class $n extends _0x45b3aa{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x525e39){super(_0x525e39);const _0x57f46f=_0x525e39['config'],_0xde59f0=_0x525e39['locale'];_0x57f46f['define']('ai.assistant.preserveComments',!0x0),_0x57f46f['define']('ai.assistant.commands',qn(_0xde59f0)),_0x57f46f['define']('ai.assistant.extraCommandGroups',[]),_0x57f46f['define']('ai.assistant.removeCommands',[]);let _0x1e26b6=o(_0x57f46f['get']('ai.assistant.commands'),_0xde59f0);const _0x3fac11=_0x57f46f['get']('ai.assistant.extraCommandGroups'),_0x3d8c42=_0x57f46f['get']('ai.assistant.removeCommands');_0x3fac11['forEach'](_0x1dcc4c=>{const _0x5745b4=_0x1e26b6['find'](_0x266541=>_0x266541['groupId']===_0x1dcc4c['groupId']);_0x5745b4?_0x5745b4['commands']=_0x5745b4['commands']['concat'](_0x1dcc4c['commands']):_0x1e26b6['push'](_0x1dcc4c);}),_0x1e26b6=_0x1e26b6['filter'](_0x53c2db=>!_0x3d8c42['includes'](_0x53c2db['groupId'])),_0x1e26b6['forEach'](_0x4d022d=>{_0x4d022d['commands']=_0x4d022d['commands']['filter'](_0x110994=>!_0x3d8c42['includes'](_0x110994['id']));}),_0x57f46f['set']('ai.assistant.commands',_0x1e26b6);}}function qn(_0x114e21){return[{'groupId':'editOrReview','groupLabel':Fn(_0x114e21,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x114e21,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x114e21,'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(_0x114e21,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x114e21,'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(_0x114e21,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x114e21,'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(_0x114e21,'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(_0x114e21,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x114e21,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x114e21,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x114e21,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x114e21,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x114e21,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x114e21,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x114e21,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x114e21,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x114e21,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x114e21,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x114e21,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x114e21,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x114e21,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x114e21,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x114e21,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x114e21,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x114e21,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x114e21,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x114e21,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x45b3aa{['abortController'];static get['requires'](){return[x];}constructor(_0x13ac1e){super(_0x13ac1e),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x49662a){return this['sendRequest'](_0x49662a)['catch'](_0x5a309a=>{if(_0x5a309a instanceof tr)return Promise['reject'](_0x5a309a);if('AbortError'==_0x5a309a['name'])return Promise['resolve']();throw console['error'](_0x5a309a),new _0x3384e8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5446ea,_0x53db73){const _0x19a7ca=this['editor']['locale'],_0x23bd33={'Content-Type':'application/json'};if('object'==typeof _0x5446ea)Object['assign'](_0x23bd33,_0x5446ea);else{if(_0x5446ea)try{const _0x2e1907=await _0x5446ea(_0x53db73);Object['assign'](_0x23bd33,_0x2e1907);}catch{return Promise['reject'](new tr(Fn(_0x19a7ca,'AI_ERROR_GET_HEADERS')));}}return _0x23bd33;}async['_prepareRequestParameters'](_0x117810,_0x2dbd8a){const _0x4af19a=this['editor']['locale'];if('object'==typeof _0x117810)return _0x117810;try{return await _0x117810(_0x2dbd8a);}catch{return Promise['reject'](new tr(Fn(_0x4af19a,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3aab7a){super(_0x3aab7a),_0x3aab7a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3aab7a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3aab7a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3aab7a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3aab7a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3aab7a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x1e71e8,context:_0x5729cf,onData:_0xcc3122,actionId:_0x3f81f4}){const _0x12e207=this['editor']['locale'],_0x51d54e=await this['prepareMessages'](_0x1e71e8,_0x5729cf,_0x3f81f4),_0x337398=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3f81f4),_0x396262=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3f81f4),_0x56d814={'messages':_0x51d54e,..._0x396262},_0x3f5f20={'method':'POST','headers':_0x337398,'body':JSON['stringify'](_0x56d814),'signal':this['abortController']['signal']},_0x5540bd=await fetch(this['_apiUrl'],_0x3f5f20);if(_0x5540bd['ok'])return _0x396262['stream']?await this['_readStreamableResponse'](_0x5540bd,_0xcc3122):await this['_readStaticResponse'](_0x5540bd,_0xcc3122),Promise['resolve']();{const _0x218fcc=await _0x5540bd['text']();return _0x218fcc['includes']('context_length_exceeded')?Promise['reject'](new tr(Fn(_0x12e207,'AI_ERROR_CONTEXT_LENGTH'))):_0x218fcc['includes']('Moderation')?Promise['reject'](new tr(Fn(_0x12e207,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x218fcc));}}async['prepareMessages'](_0x583d88,_0x4b630d,_0x435631){let _0x19780a,_0x59f201;return _0x4b630d?(_0x19780a='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.',_0x59f201='Instruction:\x0a'+_0x583d88+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4b630d):(_0x19780a='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.',_0x59f201=_0x583d88),[{'role':'system','content':_0x19780a},{'role':'user','content':_0x59f201}];}async['_readStreamableResponse'](_0x2f43d1,_0x29ad96){const _0x411967=_0x2f43d1['body']['getReader'](),_0x53b740=new TextDecoder();let _0x2973b7='',_0x2a71f6='',_0x2dfa1f='',_0x137994=!0x1;for(;!_0x137994;){const {done:_0x55cf6c,value:_0xc4f52f}=await _0x411967['read'](),_0x102df0=_0x2973b7+_0x53b740['decode'](_0xc4f52f);let _0x2f595b='';_0x137994=_0x55cf6c;try{_0x2f595b=this['_cleanUpData'](_0x102df0),_0x2973b7='';}catch{_0x2973b7=_0x102df0;continue;}_0x2a71f6+=_0x2f595b,!_0x137994&&this['_isBufferIncomplete'](_0x2a71f6)||_0x2a71f6&&(_0x2dfa1f+=_0x2a71f6,_0x2a71f6='',_0x29ad96(_0x2dfa1f));}return Promise['resolve']();}async['_readStaticResponse'](_0x229c6a,_0x5a39bc){return _0x5a39bc((await _0x229c6a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4efb13){const _0x1e2096=_0x4efb13['split']('<')['length']!==_0x4efb13['split']('>')['length'],_0x4e1986=_0x4efb13['length']<0x1e;return _0x1e2096&&_0x4e1986;}['_cleanUpData'](_0x410303){return _0x410303['split'](/\n(?![^{]*\})/g)['map'](_0x36bb2e=>_0x36bb2e['replace']('data:\x20',''))['filter'](_0x48dfd1=>_0x48dfd1&&_0x48dfd1['length']>0x0&&'[DONE]'!==_0x48dfd1)['map'](_0x5a3e94=>{const {choices:_0x552a39}=JSON['parse'](_0x5a3e94);if(_0x552a39[0x0]?.['delta']?.['content'])return _0x552a39[0x0]['delta']['content'];})['filter'](_0x2bb480=>_0x2bb480)['join']('');}}class Xn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x401c62){super(_0x401c62),_0x401c62['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x401c62['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x401c62['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x401c62['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x401c62['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x401c62['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x12d530,context:_0x11d97e,onData:_0x475a71,actionId:_0x1afd6d}){const {model:_0x37c149,stream:_0xb37a6c,..._0x5bf20e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1afd6d),_0x4f0fbf={'prompt':await this['preparePrompt'](_0x12d530,_0x11d97e,_0x37c149,_0x1afd6d),..._0x5bf20e};this['_apiUrl']?await this['_processProxyRequest'](_0x4f0fbf,_0x37c149,_0xb37a6c,_0x475a71,_0x1afd6d):await this['_processAWSRequest'](_0x4f0fbf,_0x37c149,_0xb37a6c,_0x475a71);}async['preparePrompt'](_0x5d048c,_0x781795,_0x35df12,_0x25e046){let _0x366dfd,_0xb7f797;return _0x781795?(_0x366dfd='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.',_0xb7f797='Instruction:\x0a'+_0x5d048c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x781795):(_0x366dfd='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.',_0xb7f797=_0x5d048c),'meta.llama'==this['getModelFamily'](_0x35df12)?'<<SYS>>\x0a'+_0x366dfd+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xb7f797+'\x0a[/INST]':'Human:\x0a'+_0x366dfd+'\x0a'+_0xb7f797+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2360cc){if(/^anthropic\.claude/['test'](_0x2360cc))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2360cc))return'ai21.j2';if(/^cohere\.command/['test'](_0x2360cc))return'cohere.command';if(/^meta\.llama/['test'](_0x2360cc))return'meta.llama';throw new tr(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2360cc));}async['_processProxyRequest'](_0x55eee4,_0x319810,_0x148015,_0x239c64,_0x319738){const _0x2ce138={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x319738),'body':JSON['stringify']({..._0x55eee4,'model':_0x319810,'stream':_0x148015}),'signal':this['abortController']['signal']},_0x148c3d=await fetch(this['_apiUrl'],_0x2ce138);_0x148015?await this['_readStreamableResponse'](_0x148c3d,_0x319810,_0x239c64):await this['_readStaticResponse'](_0x148c3d,_0x319810,_0x239c64);}async['_processAWSRequest'](_0x4df30c,_0x18b800,_0x440aaf,_0x9a625b){const _0x253368=new _0x9aa991(this['_bedrockClientConfig']),_0xdfd724={'body':JSON['stringify'](_0x4df30c),'contentType':'application/json','accept':'application/json','modelId':_0x18b800};let _0x2ec7ec;if(_0x440aaf){const _0x234c8a=new _0x54f3b5(_0xdfd724);_0x2ec7ec=await _0x253368['send'](_0x234c8a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2ec7ec,_0x18b800,_0x9a625b);}else{const _0x50a62f=new _0x2f31bb(_0xdfd724);_0x2ec7ec=await _0x253368['send'](_0x50a62f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2ec7ec,_0x18b800,_0x9a625b);}}async['_readAsyncIterableResponse'](_0x18df67,_0x4e706f,_0xba63b){const _0x31cdb2=_0x18df67['body'],_0x81089f=new TextDecoder('utf-8');let _0xc8d039='';for await(const _0x8a83c2 of _0x31cdb2)if(_0x8a83c2['chunk']){const _0x12b443=_0x81089f['decode'](_0x8a83c2['chunk']['bytes']),_0x58dc98=JSON['parse'](_0x12b443);_0xc8d039+=this['_getGeneratedText'](_0x58dc98,_0x4e706f),_0xba63b(_0xc8d039);}return Promise['resolve']();}async['_readStreamableResponse'](_0x31df88,_0x576af2,_0x4db042){const _0x51a2fa=_0x31df88['body'],_0xabb184=new TextDecoder('utf-8'),_0x46f8a6=_0x51a2fa['getReader']();let _0x215f20='',_0xaa9375='',_0x240f14=!0x1;for(;!_0x240f14;){const {done:_0x57dd9d,value:_0x1f4c83}=await _0x46f8a6['read']();if(_0x240f14=_0x57dd9d,_0x240f14)break;const _0x598dc0=(_0x215f20+_0xabb184['decode'](_0x1f4c83))['split']('\x0a')['map'](_0x51ff45=>{try{return _0x215f20='',JSON['parse'](_0x51ff45);}catch{return _0x215f20=_0x51ff45,null;}})['filter'](_0x259e61=>null!==_0x259e61);_0x598dc0['length']&&(_0xaa9375+=_0x598dc0['map'](_0x521f7c=>this['_getGeneratedText'](_0x521f7c,_0x576af2))['join'](''),_0x4db042(_0xaa9375));}return Promise['resolve']();}async['_readStaticResponse'](_0x4f81aa,_0x2c71f1,_0x107da5){let _0x55fd87;return _0x55fd87=_0x4f81aa instanceof Response?await _0x4f81aa['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x4f81aa['body'])),(_0x107da5(this['_getGeneratedText'](_0x55fd87,_0x2c71f1)),Promise['resolve']());}['_getGeneratedText'](_0x3b80dc,_0x396606){switch(this['getModelFamily'](_0x396606)){case'anthropic.claude':return _0x3b80dc['completion'];case'ai21.j2':return _0x3b80dc['completions'][0x0]['data']['text'];case'cohere.command':return _0x3b80dc['generations'][0x0]['text'];case'meta.llama':return _0x3b80dc['generation'];}}}class ia extends _0x5c8003{constructor(_0x52a3a5,_0x42a08e={}){super(_0x52a3a5),this['isToggleable']=!0x0,this['set']('side',_0x42a08e['side']||'top');const _0x4da2cd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x4efba8(_0x42a08e['class']||[]),_0x4da2cd['to']('side',_0x2ceab9=>'ck-tab-button_'+_0x2ceab9),_0x4da2cd['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends wt{['children'];constructor(_0xcf1f73,_0x433f81={}){super(_0xcf1f73);const _0x3467a2=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x4efba8(_0x433f81['class']||[]),_0x3467a2['to']('class'),_0x3467a2['if']('isVisible','ck-hidden',_0x1290fd=>!_0x1290fd)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends wt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3d02ee,_0x53cf2d={}){super(_0x3d02ee),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x53cf2d['side']||'top'),this['set']('isMaximized',!0x1);const _0x5d3bfc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x4efba8(_0x53cf2d['class']||[]),_0x5d3bfc['to']('side',_0x281565=>'ck-tabs_'+_0x281565),_0x5d3bfc['to']('class'),_0x5d3bfc['to']('isMaximized',_0x15d16a=>_0x15d16a?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5d3bfc['to']('side',_0xf647ef=>'ck-tabs__buttons-container_'+_0xf647ef)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5d3bfc['to']('side',_0x219aea=>'ck-tabs__panels-container_'+_0x219aea)]},'children':this['panelViews']},..._0x4efba8(_0x53cf2d['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x586dbd){const _0x58882b=this['_tabs']['get'](_0x586dbd);return _0x58882b||null;}['addTab'](_0x59f51d){const _0x5bf5a9=this['_setupButton']({'id':_0x59f51d['id'],'label':_0x59f51d['buttonLabel'],'icon':_0x59f51d['buttonIcon'],'order':_0x59f51d['order']}),_0xc760be=new ea(this['locale']);return _0xc760be['render'](),_0x59f51d['content']&&_0xc760be['children']['add'](_0x59f51d['content']),this['panelViews']['add'](_0xc760be),this['_tabs']['set'](_0x59f51d['id'],{'button':_0x5bf5a9,'panel':_0xc760be,'order':void 0x0!==_0x59f51d['order']?_0x59f51d['order']:null}),this['fire']('addTab:'+_0x59f51d['id'],{'id':_0x59f51d['id'],'button':_0x5bf5a9,'panel':_0xc760be}),null===this['activeTab']?this['activateTab'](_0x59f51d['id']):this['_hidePanel'](_0x59f51d['id']),{'button':_0x5bf5a9,'panel':_0xc760be};}['activateTab'](_0x549e42){if(null!==_0x549e42&&!this['getTab'](_0x549e42))throw new _0x3384e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x549e42});this['activeTab']!==_0x549e42&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x549e42,_0x549e42&&this['_showPanel'](_0x549e42),this['fire']('activateTab:'+_0x549e42,_0x549e42));}['showTab'](_0x30deaf){if(!this['getTab'](_0x30deaf))throw new _0x3384e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x30deaf});this['_showPanel'](_0x30deaf),this['_showButton'](_0x30deaf),this['fire']('show:'+_0x30deaf,_0x30deaf);}['hideTab'](_0x5b3f87){if(!this['getTab'](_0x5b3f87))throw new _0x3384e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5b3f87});const _0x54abae=this['activeTab'];this['_hidePanel'](_0x5b3f87),this['_hideButton'](_0x5b3f87);const _0x4926e0=this['getTabIds']();_0x54abae===_0x5b3f87&&_0x4926e0['length']>0x1&&this['activateTab'](_0x4926e0['find'](_0x29e0b3=>_0x29e0b3!==_0x5b3f87)),this['fire']('hide:'+_0x5b3f87,_0x5b3f87);}['_getPanel'](_0x141d8e){const _0x25fd52=this['_tabs']['get'](_0x141d8e);return _0x25fd52?_0x25fd52['panel']:null;}['_showPanel'](_0x4edff7){null!==this['activeTab']&&this['activeTab']!==_0x4edff7||this['_getPanel'](_0x4edff7)['show']();}['_hidePanel'](_0x3a5b90){const _0x51b240=this['_getPanel'](_0x3a5b90);_0x51b240['isVisible']&&(this['activeTab']===_0x3a5b90&&(this['activeTab']=null),_0x51b240['hide']());}['_getButton'](_0x3874f1){const _0x3ae2d0=this['_tabs']['get'](_0x3874f1);return _0x3ae2d0?_0x3ae2d0['button']:null;}['_showButton'](_0x28f3a9){this['_getButton'](_0x28f3a9)['show']();}['_hideButton'](_0x2cb761){this['_getButton'](_0x2cb761)['hide']();}['_setupButton'](_0xd0cdb1){const _0x3102b3=new ia(this['locale'],{'side':this['side']}),_0x287277=this['buttonViews'];if(_0x3102b3['set']({'label':_0xd0cdb1['label'],'icon':_0xd0cdb1['icon'],'tooltip':!0x0,'withText':!0x0}),_0x3102b3['bind']('isOn')['to'](this,'activeTab',_0x397edd=>_0x397edd===_0xd0cdb1['id']),_0x3102b3['bind']('side')['to'](this,'side'),_0xd0cdb1['order']){const _0x2ad3e8=[...this['_tabs']]['reduce']((_0x18ddeb,_0x40bf41)=>{const _0x4826cb=_0x40bf41[0x0],{order:_0x3f76d2}=_0x40bf41[0x1];return!_0x3f76d2||_0x3f76d2>_0xd0cdb1['order']?_0x18ddeb:_0x3f76d2>=_0x18ddeb['order']?{'id':_0x4826cb,'order':_0x3f76d2}:_0x18ddeb;},{'id':'','order':0x0}),_0x13f465=_0x287277['getIndex'](this['_getButton'](_0x2ad3e8['id']));_0x287277['add'](_0x3102b3,_0x13f465+0x1);}else _0x287277['add'](_0x3102b3);return _0x3102b3['on']('execute',()=>{this['activateTab'](_0xd0cdb1['id']);}),_0x3102b3;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ss{constructor(_0x4c7ec5,_0x246a7a={}){super(_0x4c7ec5,_0x246a7a),this['set']('type',_0x246a7a['type']||'sidebar'),this['set']('side',_0x246a7a['side']||'right'),this['set']('isVisible',_0x246a7a['visibleByDefault']??!0x0);const _0x1d8b35=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1d8b35['if']('type','ck-ai-tabs__overlay',_0x185f4c=>'overlay'===_0x185f4c),_0x1d8b35['if']('type','ck-ai-tabs__sidebar',_0x5885ab=>'sidebar'===_0x5885ab),_0x1d8b35['if']('isVisible','ck-hidden',_0x45d705=>!_0x45d705)]}}),this['buttonViews']['on']('add',(_0x34c2cf,_0x36df8c)=>{_0x36df8c['set']('withText',!0x1);});}}class Y extends _0x36f460{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x47ac82){super(_0x47ac82);const _0x5c923b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5c923b)throw new _0x3384e8('ai-tabs-configuration-not-found');if(void 0x0!==_0x5c923b['showResizeButton']&&(this['showResizeButton']=_0x5c923b['showResizeButton']),'sidebar'!==_0x5c923b['type']&&'overlay'!==_0x5c923b['type']||_0x5c923b['side']&&(this['side']=_0x5c923b['side']),'sidebar'===_0x5c923b['type']){if(this['container']=_0x5c923b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x3384e8('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5c923b['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x5c923b['visibleByDefault']||_0x5c923b['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 _0x4999b5&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2db3d9){if(_0x2db3d9&&this['type']!==_0x2db3d9){if(!di['includes'](_0x2db3d9))throw new _0x3384e8('ai-tabs-unsupported-ui-type');this['type']=_0x2db3d9;}}['switchSide'](_0x198eb9){if(_0x198eb9&&this['side']!==_0x198eb9){if(!ui['includes'](_0x198eb9))throw new _0x3384e8('ai-tabs-unsupported-ui-side');this['side']=_0x198eb9;}}['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 R extends _0x36f460{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x124b57){super(_0x124b57),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 _0x12b4d6=this['context']['plugins']['get']('CloudServices');if(!_0x12b4d6['token'])throw new _0x3384e8('ai-missing-token',this);this['_token']=_0x12b4d6['token'];}['startConversation'](_0x594110,_0xee9ef1){const _0x439223=this['_sendApiRequest']('/conversations','POST',{'id':_0x594110,'group':_0xee9ef1});return{'getConversation':async()=>(await _0x439223['request'])['json'](),'abortController':_0x439223['abortController']};}['queryAssistant']({message:_0x345b9a,conversationId:_0x2880dd,parts:_0x3429d2,capabilities:_0x56e9fd,model:_0x1273ad,quickActionData:_0x29b09f}){const _0x539ba2={..._0x29b09f&&{'quickActionData':_0x29b09f}},_0x223c58={'prompt':_0x345b9a,'content':_0x3429d2,'model':_0x1273ad,..._0x56e9fd&&{'capabilities':_0x56e9fd},...Object['keys'](_0x539ba2)['length']>0x0&&{'attributes':_0x539ba2}},_0x22d801=this['_sendApiRequest']('/conversations/'+_0x2880dd+'/messages','POST',_0x223c58);return{'getStream':async()=>{const _0x581a40=(await _0x22d801['request'])['body'];return this['_getStreamReader'](_0x581a40);},'abortController':_0x22d801['abortController']};}['executeCustomAction']({content:_0x1dab1a,message:_0x3499fd,model:_0x2639dc,outputFormat:_0x36526b}){const _0xcc504e={'content':[{'type':'text','content':_0x1dab1a}],'prompt':_0x3499fd,'model':_0x2639dc,'outputFormat':_0x36526b},_0xf4438f=this['_sendApiRequest']('/actions/custom/calls','POST',_0xcc504e);return{'getStream':async()=>{const _0x5a5d04=(await _0xf4438f['request'])['body'];return this['_getStreamReader'](_0x5a5d04);},'abortController':_0xf4438f['abortController']};}['executeAction']({actionName:_0x34c3f0,content:_0x5844a9,args:_0x14147b}){const _0x92590d={'content':[{'type':'text','content':_0x5844a9}],'args':_0x14147b},_0x8d53d9=this['_sendApiRequest']('/actions/system/'+_0x34c3f0+'/calls','POST',_0x92590d);return{'getStream':async()=>{const _0x7b7422=(await _0x8d53d9['request'])['body'];return this['_getStreamReader'](_0x7b7422);},'abortController':_0x8d53d9['abortController']};}['uploadFile'](_0x253b97,_0x5f1e5e,_0x241ad7){const _0x3dcab4=new FormData();_0x3dcab4['append']('file',_0x5f1e5e,_0x5f1e5e['name']),_0x241ad7&&_0x3dcab4['append']('attributes',JSON['stringify'](_0x241ad7));const _0xee7c41=this['_sendApiRequest']('/conversations/'+_0x253b97+'/files','POST',_0x3dcab4);return{'getId':async()=>(await _0xee7c41['request'])['json'](),'abortController':_0xee7c41['abortController']};}['fetchDocument'](_0x5b5220,_0x45015d){const _0x30f215=this['_sendApiRequest']('/conversations/'+_0x5b5220+'/documents/'+_0x45015d,'GET');return{'getDocument':async()=>(await _0x30f215['request'])['json'](),'abortController':_0x30f215['abortController']};}['uploadDocument'](_0x210a67,_0x522b5c,_0x53b10a){const _0x1a650d={'content':_0x522b5c};_0x53b10a&&(_0x1a650d['attributes']=_0x53b10a);const _0x69fbaf=this['_sendApiRequest']('/conversations/'+_0x210a67+'/documents','POST',_0x1a650d);return{'getId':async()=>(await _0x69fbaf['request'])['json'](),'abortController':_0x69fbaf['abortController']};}['fetchConversations'](_0x41cc4f,_0x1bcc7a){const _0x47bf5a=new URLSearchParams();_0x47bf5a['append']('excludeEmpty','true'),_0x47bf5a['append']('limit','100'),_0x47bf5a['append']('group',_0x41cc4f),_0x1bcc7a&&_0x47bf5a['append']('search',_0x1bcc7a);const _0x2a62e1=this['_sendApiRequest']('/conversations?'+_0x47bf5a['toString'](),'GET');return{'getConversations':async()=>{const _0x270f99=await _0x2a62e1['request'];return(await _0x270f99['json']())['items'];},'abortController':_0x2a62e1['abortController']};}['deleteConversation'](_0x45a6d3){const _0x4a5b8c=this['_sendApiRequest']('/conversations/'+_0x45a6d3,'DELETE');return{'execute':async()=>{await _0x4a5b8c['request'];},'abortController':_0x4a5b8c['abortController']};}['updateConversation'](_0x28bf67,_0x1ced6b){const _0x286f7b=this['_sendApiRequest']('/conversations/'+_0x28bf67,'PATCH',_0x1ced6b);return{'getResult':async()=>(await _0x286f7b['request'],_0x1ced6b),'abortController':_0x286f7b['abortController']};}['fetchConversation'](_0x5f366d){const _0x5ad26a=this['_sendApiRequest']('/conversations/'+_0x5f366d,'GET');return{'getConversation':async()=>(await _0x5ad26a['request'])['json'](),'abortController':_0x5ad26a['abortController']};}['fetchConversationMessages'](_0x4a3798){const _0x308ab6=this['_sendApiRequest']('/conversations/'+_0x4a3798+'/messages','GET');return{'getMessages':async()=>{const _0x145adf=await _0x308ab6['request'];return(await _0x145adf['json']())['items'];},'abortController':_0x308ab6['abortController']};}['uploadUrl'](_0x16c22d,_0x277104,_0x100765){const _0x33567a=this['_sendApiRequest']('/conversations/'+_0x16c22d+'/web-resources','POST',{'url':_0x277104,'attributes':_0x100765});return{'getId':async()=>(await _0x33567a['request'])['json'](),'abortController':_0x33567a['abortController']};}['getModels'](){const _0x491100=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x491100['request'])['json'](),'abortController':_0x491100['abortController']};}['deleteFile'](_0x4fc2c3,_0x5b9403){const _0x34b1d3=this['_sendApiRequest']('/conversations/'+_0x4fc2c3+'/files/'+_0x5b9403,'DELETE');return{'execute':async()=>{await _0x34b1d3['request'];},'abortController':_0x34b1d3['abortController']};}['deleteDocument'](_0x4e527f,_0x7c927d){const _0x3b6b54=this['_sendApiRequest']('/conversations/'+_0x4e527f+'/documents/'+_0x7c927d,'DELETE');return{'execute':async()=>{await _0x3b6b54['request'];},'abortController':_0x3b6b54['abortController']};}['deleteWebResource'](_0x51203d,_0x224aa7){const _0x2dc1e7=this['_sendApiRequest']('/conversations/'+_0x51203d+'/web-resources/'+_0x224aa7,'DELETE');return{'execute':async()=>{await _0x2dc1e7['request'];},'abortController':_0x2dc1e7['abortController']};}['callSystemReview']({reviewName:_0x5da6b4,content:_0x1325ae,args:_0x38d71c}){const _0x355dac=this['_sendApiRequest']('/reviews/system/'+_0x5da6b4+'/calls','POST',{'content':[{'type':'text','content':_0x1325ae}],'args':_0x38d71c});return{'getStream':async()=>{const _0x5dd52d=(await _0x355dac['request'])['body'];return this['_getStreamReader'](_0x5dd52d);},'abortController':_0x355dac['abortController']};}['callCustomReview']({content:_0x31cc67,prompt:_0x154cbb,model:_0x308225}){const _0x482c94=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x31cc67}],'prompt':_0x154cbb,'model':_0x308225});return{'getStream':async()=>{const _0x28d512=(await _0x482c94['request'])['body'];return this['_getStreamReader'](_0x28d512);},'abortController':_0x482c94['abortController']};}['upsertAIChatRating'](_0x111bd4,_0x105c52,_0x6074d9){const _0x596bc8=this['_sendApiRequest']('/conversations/'+_0x111bd4+'/messages/'+_0x105c52+'/ratings','PUT',{'positiveCount':_0x6074d9['positiveCount'],'totalCount':_0x6074d9['totalCount'],'modificationId':_0x6074d9['modificationId']});return{'execute':async()=>{await _0x596bc8['request'];},'abortController':_0x596bc8['abortController']};}['upsertAIActionRating'](_0x5a737f,_0x2d8a00,_0x589362){const _0x1f6ecf=this['_sendApiRequest']('/actions/system/'+_0x5a737f+'/calls/'+_0x2d8a00+'/ratings','PUT',{'positiveCount':_0x589362['positiveCount'],'totalCount':_0x589362['totalCount']});return{'execute':async()=>{await _0x1f6ecf['request'];},'abortController':_0x1f6ecf['abortController']};}['upsertCustomAIActionRating'](_0x5ef862,_0x4d8cd8){const _0x5cae77=this['_sendApiRequest']('/actions/custom/calls/'+_0x5ef862+'/ratings','PUT',{'positiveCount':_0x4d8cd8['positiveCount'],'totalCount':_0x4d8cd8['totalCount']});return{'execute':async()=>{await _0x5cae77['request'];},'abortController':_0x5cae77['abortController']};}['upsertAIReviewRating'](_0x4207bd,_0x2bbb0d,_0x9a983,_0x3e736e){const _0x239176=this['_sendApiRequest']('/reviews/system/'+_0x4207bd+'/calls/'+_0x2bbb0d+'/ratings','PUT',{'positiveCount':_0x9a983['positiveCount'],'totalCount':_0x9a983['totalCount'],'dataId':_0x3e736e});return{'execute':async()=>{await _0x239176['request'];},'abortController':_0x239176['abortController']};}['upsertCustomAIReviewRating'](_0x885883,_0x1e5f51,_0x3b5412){const _0x3ff12c=this['_sendApiRequest']('/reviews/custom/calls/'+_0x885883+'/ratings','PUT',{'positiveCount':_0x1e5f51['positiveCount'],'totalCount':_0x1e5f51['totalCount'],'dataId':_0x3b5412});return{'execute':async()=>{await _0x3ff12c['request'];},'abortController':_0x3ff12c['abortController']};}['_sendApiRequest'](_0x1f011c,_0x2a176c,_0x49d4f6){const _0x1bc832=new AbortController(),_0x522fb8=_0x49d4f6 instanceof FormData,_0x32b2fa={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x49d4f6&&!_0x522fb8&&(_0x32b2fa['Content-Type']='application/json');const _0x3d9a7c={'method':_0x2a176c,'headers':_0x32b2fa,'signal':_0x1bc832['signal']};return _0x49d4f6&&(_0x3d9a7c['body']=_0x522fb8?_0x49d4f6:JSON['stringify'](_0x49d4f6)),{'request':fetch(''+this['_apiUrl']+_0x1f011c,_0x3d9a7c)['catch'](_0x338796=>{this['_handleError'](_0x338796);})['then'](_0x96018c=>_0x96018c['ok']?_0x96018c:_0x96018c['json']()['then'](_0x136bde=>{throw{'url':this['_apiUrl'],'path':_0x1f011c,'method':_0x2a176c,'body':_0x49d4f6,'status':(_0x96018c||{})['status'],'statusText':(_0x96018c||{})['statusText'],'code':_0x136bde['code'],'message':_0x136bde['message'],'traceId':_0x136bde['traceId']};})),'abortController':_0x1bc832};}async*['_getStreamReader'](_0x187888){const _0x15d4fc=[],_0x40ec86=_0x187888['getReader'](),_0x4dedfc=$t({'onError':_0x5db97f=>{this['_handleError'](_0x5db97f);},'onEvent':_0x8944b9=>{_0x8944b9['data']=JSON['parse'](_0x8944b9['data']),_0x15d4fc['push'](_0x8944b9);}});try{let _0x12ce86=!0x1;for(;!_0x12ce86;){const {done:_0x4a1a4f,value:_0x325e05}=await _0x40ec86['read']();_0x4a1a4f&&(_0x12ce86=!0x0),_0x4dedfc['feed'](this['_decoder']['decode'](_0x325e05,{'stream':!0x0})),yield*_0x15d4fc,_0x15d4fc['length']=0x0;}}catch(_0x5b60ad){this['_handleError'](_0x5b60ad);}finally{_0x40ec86['releaseLock'](),_0x4dedfc['reset']();}}['_handleError'](_0x226af6){if(_0x226af6 instanceof _0x3384e8)throw _0x226af6;if(_0x226af6 instanceof Error&&'AbortError'===_0x226af6['name'])throw new _0x3384e8('ai-request-aborted',this,{'originalError':_0x226af6});throw new _0x3384e8('ai-request-failed',this,{'originalError':_0x226af6});}}function i(_0x574b9b,_0x4fd7de,_0x1a40f2){const t=_0x574b9b['t'];switch(_0x4fd7de){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'},_0x1a40f2);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x1a40f2);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.'},_0x1a40f2);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x1a40f2);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x1a40f2);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x1a40f2);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x1a40f2);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x1a40f2);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x1a40f2);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x1a40f2);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x1a40f2);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.'},_0x1a40f2);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.'},_0x1a40f2);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.'},_0x1a40f2);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.'},_0x1a40f2);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'},_0x1a40f2);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_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.'},_0x1a40f2);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x4fd7de;}}function ks(_0x549e0f,_0x3f06ec){const _0xb8ee90=new _0x5c8003(_0x549e0f),_0x5b5135=i(_0x549e0f,'AI_TABS_LABEL_MINIMIZE'),_0x40220b=i(_0x549e0f,'AI_TABS_LABEL_MAXIMIZE');return _0xb8ee90['set']({'withText':!0x1,'icon':_0x2475ae,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0xb8ee90['bind']('label')['to'](_0x3f06ec,'isMaximized',_0x2ef731=>_0x2ef731?_0x5b5135:_0x40220b),_0xb8ee90['bind']('icon')['to'](_0x3f06ec,'isMaximized',_0x519a7c=>_0x519a7c?to:_0x2475ae),_0xb8ee90['bind']('isOn')['to'](_0x3f06ec,'isMaximized'),_0xb8ee90['on']('execute',()=>{_0x3f06ec['fire']('resizeTabs');}),_0xb8ee90;}function Be(_0x2c9fce){return _0x994a28(_0x2c9fce);}function lt(_0x42a366){return _0x4c489b(_0x42a366);}function pt(_0x6eb003,_0x4c82cb,_0x4db1b3){const _0x275674=null!==_0x4c82cb?_0x185efd=>_0x185efd['attribs'][_0x6eb003]===_0x4c82cb:_0x557850=>Boolean(_0x557850['attribs'][_0x6eb003]);return ct(_0x24b718=>_0x53fb25(_0x24b718)&&_0x275674(_0x24b718),_0x4db1b3);}function Xe(_0x4b8291,_0x1bb5db,_0xe13feb){const _0x10bd7c=null!==_0x1bb5db?_0x17a4cb=>_0x17a4cb['attribs'][_0x4b8291]===_0x1bb5db:_0x7cb083=>Boolean(_0x7cb083['attribs'][_0x4b8291]);return _0x175b52(_0x33f39d=>_0x53fb25(_0x33f39d)&&_0x10bd7c(_0x33f39d),_0xe13feb);}function dt(_0x2ffe2c,_0x40c1ec){return _0x2ffe2c&&_0x53fb25(_0x2ffe2c)?_0x2ffe2c['attribs'][_0x40c1ec]:null;}function Ki(_0xa9f37b,_0x1639ee,_0x238d78){_0x53fb25(_0xa9f37b)&&(null===_0x238d78?delete _0xa9f37b['attribs'][_0x1639ee]:_0xa9f37b['attribs'][_0x1639ee]=_0x238d78);}function Bi(_0x3192f8,_0x5175d8,_0x4d2f50){const _0x2fc7f0=_0x5175d8['cloneNode'](!0x0);'beforebegin'===_0x4d2f50?_0x2f9325(_0x3192f8,_0x2fc7f0):'afterbegin'===_0x4d2f50?_0x74c0d7(_0x3192f8,_0x2fc7f0):'beforeend'===_0x4d2f50?_0x41f937(_0x3192f8,_0x2fc7f0):'afterend'===_0x4d2f50&&_0x5e4293(_0x3192f8,_0x2fc7f0);}function qe(_0x5e9c95){const _0xc42ab3=[];let _0x35670e=_0x5e9c95;for(;_0x35670e;)_0x35670e=_0x1eaa78(_0x35670e),_0x35670e&&_0xc42ab3['push'](_0x35670e);return _0xc42ab3;}function zn(_0x5647d1){return _0x5647d1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Zi(_0x6b6486){let _0x17ed83=0x0;for(;_0x6b6486['parentNode'];)_0x6b6486=_0x6b6486['parentNode'],_0x17ed83++;return _0x17ed83;}function fs(_0x13ad30){const _0x3dbe20=[];let _0x347314=_0x13ad30['nextSibling'];for(;_0x347314;)_0x3dbe20['push'](_0x347314),_0x347314=_0x347314['nextSibling'];_0x3dbe20['forEach'](_0x39bebb=>{_0x3dc7bd(_0x39bebb);});}class Je extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x500a7f();}['convertMarkdownToHTML'](_0x293c40){const _0x33dc94=this['_m2html']['parse'](_0x293c40);return this['parseAndNormalizeHTML'](_0x33dc94);}['parseAndNormalizeHTML'](_0x2fcd0c){return this['_parseHTML'](_0x2fcd0c);}['_parseHTML'](_0x54ffa5){const _0x5e036d=Be('<dummy>'+_0x54ffa5['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x5e036d['children']=_0x5e036d['children'][0x0]['children'],_0x5e036d;}}class Ke extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x565bd2){super(),this['_generateUid']=_0x565bd2||_0x418744;}['merge'](_0x2f09a4,_0x33260b,_0x497923){const _0x12c8e3=_0x2f09a4['cloneNode'](!0x0);if(0x0===_0x33260b['childNodes']['length']){const _0x12fb04=[];return Xe('data-id','new-element',_0x12c8e3)['forEach'](_0x361f09=>{const _0x4a22d2=this['_generateUid']();Ki(_0x361f09,'data-id',_0x4a22d2),_0x12fb04['push'](_0x4a22d2);}),this['_removeSpecialComments'](_0x12c8e3),{'parsedContent':_0x12c8e3,'newNodeIds':_0x12fb04,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x497923&&_0x497923['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x12c8e3),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Xe('data-id',null,_0x33260b)['map'](_0x1b9e41=>dt(_0x1b9e41,'data-id'))['filter'](_0x161da1=>!!_0x161da1));let _0x329bb8=-0x1,_0x2a250a=!0x1;const _0x4ece3d=_0x12c8e3['childNodes'],_0x1a573e=Array['from'](_0x4ece3d)['filter'](_0x4d65a9=>!(0x3===_0x4d65a9['nodeType']&&''===lt(_0x4d65a9)['trim']())),_0x43cd24=_0x1a573e['length'];for(let _0x2059a1=0x0;_0x2059a1<_0x43cd24;_0x2059a1++){const _0x1dc154=_0x1a573e[_0x2059a1],_0x288f1c=_0x1a573e[_0x2059a1+0x1];if(this['_isNewNode'](_0x1dc154)){if(-0x1===_0x329bb8&&(_0x329bb8=_0x2059a1),this['_markWrappedElements'](_0x1dc154),!this['_isNewNode'](_0x288f1c)){const [_0x39fa94,_0xf9f4fc]=this['_findReferenceNode'](_0x1dc154,_0x2a250a,_0x33260b);if(_0x39fa94){const _0xfe275e=Array['from'](_0x1a573e)['slice'](_0x329bb8,_0x2059a1+0x1);this['_insertNodes'](_0x39fa94,_0xfe275e,_0xf9f4fc),_0x329bb8=-0x1;}}}else{if(this['_isExistingContentComment'](_0x1dc154))_0x2a250a=!0x0;else{if(this['_isExistingNode'](_0x1dc154)){const _0x1ef523=dt(_0x1dc154,'data-id');if(_0x1ef523&&this['_existingDataIds']['has'](_0x1ef523)){const _0x58c075=pt('data-id',_0x1ef523,_0x33260b);this['_replaceNode'](_0x58c075,_0x1dc154);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1ef523)){const _0x4787b4=this['_touchedNodesState']['removedIds']['indexOf'](_0x1ef523);this['_touchedNodesState']['removedIds']['splice'](_0x4787b4,0x1);}}else{if(this['_isDelNode'](_0x1dc154)){const _0x27fa06=dt(_0x1dc154,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x27fa06)||this['_storeDeletedElementIds'](_0x1dc154);}}}}}for(const _0x8ed330 of this['_touchedNodesState']['removedIds']){const _0x239e1f=pt('data-id',_0x8ed330,_0x33260b);if(_0x239e1f){if(_0x497923&&_0x497923['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x8ed330;const _0x54d1dd=_0x497923['replaceRemovedWith']['cloneNode'](!0x0);Ki(_0x54d1dd,'data-id',_0x8ed330),Ki(_0x54d1dd,'data-removed','true'),_0x86eb75(_0x239e1f,_0x54d1dd);}else _0x3dc7bd(_0x239e1f);}}if(Xe('data-wrapped-id',null,_0x33260b)['forEach'](_0x23b9f7=>{const _0x57edb1=pt('data-id',dt(_0x23b9f7,'data-wrapped-id'),_0x33260b);var _0x4aedcd,_0x2e0d6a;_0x57edb1&&(_0x2e0d6a=_0x23b9f7,_0x3dc7bd(_0x4aedcd=_0x57edb1),_0x86eb75(_0x2e0d6a,_0x4aedcd));}),Xe('data-id','new-element',_0x33260b)['forEach'](_0x89e543=>{const _0xec503f=this['_getUid'](_0x89e543);Ki(_0x89e543,'data-id',_0xec503f),this['_touchedNodesState']['newIds']['push'](_0xec503f);}),this['_removeSpecialComments'](_0x33260b),_0x497923&&_0x497923['markUnstableElements']&&this['_markUnstableElements'](_0x33260b,_0x497923['markUnstableElementsDepth']||0x0),_0x497923&&_0x497923['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x41fb8f=pt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x33260b);for(;_0x41fb8f;)fs(_0x41fb8f),_0x41fb8f=_0x41fb8f['parentNode'];}return{'parsedContent':_0x33260b,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0xbfd0d1,_0x2e8785,_0x451090){for(const _0x4803b7 of _0x2e8785){const _0xa10f69=this['_getUid'](_0x4803b7);Ki(_0x4803b7,'data-id',_0xa10f69),this['_touchedNodesState']['newIds']['push'](_0xa10f69),this['_touchedNodesState']['lastTouchedId']=_0xa10f69;}const _0x230e1c='afterbegin'===_0x451090||'afterend'===_0x451090?_0x2e8785['reverse']():_0x2e8785;for(const _0x9258f9 of _0x230e1c)Bi(_0xbfd0d1,_0x9258f9,_0x451090);}['_replaceNode'](_0x2937c3,_0x4de6a6){if(!_0x2937c3)return;if(_0x4b1f86=_0x4de6a6,zn(lt(_0x2937c3))===zn(lt(_0x4b1f86)))return;var _0x4b1f86;const _0x52579d=this['_getUid'](_0x2937c3);Ki(_0x4de6a6,'data-id',_0x52579d),this['_touchedNodesState']['modifiedIds']['push'](_0x52579d),this['_touchedNodesState']['lastTouchedId']=_0x52579d,_0x86eb75(_0x2937c3,_0x4de6a6['cloneNode'](!0x0));}['_findReferenceNode'](_0x4fd945,_0x5e05d1,_0x534aa5){const _0x1b32af=this['_findPrevElementWithDataId'](_0x4fd945,!0x1);if(_0x1b32af){const _0x2ecb6e=this['_getNodeDataId'](_0x1b32af),_0x2f8e4d=pt('data-id',_0x2ecb6e,_0x534aa5);if(_0x2f8e4d)return[_0x2f8e4d,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x2ecb6e);}const _0x423481=this['_findNextElementWithDataId'](_0x4fd945,!0x1);if(_0x423481){const _0x523370=this['_getNodeDataId'](_0x423481),_0x3baf4d=pt('data-id',_0x523370,_0x534aa5);if(_0x3baf4d)return[_0x3baf4d,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x523370);}return _0x5e05d1?_0x4fd945['nextSibling']?this['_findFallbackReferenceNode'](_0x4fd945,_0x534aa5):[_0x534aa5['childNodes'][_0x534aa5['childNodes']['length']-0x1],'afterend']:[_0x534aa5['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2cc17e,_0x2f3103){const _0x2cb66b=[],_0x161e94=this['_findPrevElementWithDataId'](_0x2cc17e,!0x0);if(_0x161e94){const _0x2965fd=pt('data-id',this['_getNodeDataId'](_0x161e94),_0x2f3103);_0x2965fd&&_0x2cb66b['push']([_0x2965fd,'afterend']);}const _0x1474da=this['_findNextElementWithDataId'](_0x2cc17e,!0x0);if(_0x1474da){const _0x2ed1ef=pt('data-id',this['_getNodeDataId'](_0x1474da),_0x2f3103);_0x2ed1ef&&_0x2cb66b['push']([_0x2ed1ef,'beforebegin']);}if(_0x2cb66b['length']>0x1)return Zi(_0x2cb66b[0x0][0x0])<=Zi(_0x2cb66b[0x1][0x0])?_0x2cb66b[0x0]:_0x2cb66b[0x1];return 0x1===_0x2cb66b['length']?_0x2cb66b[0x0]:[_0x2f3103['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x3ff4e2,_0x1675d4){let _0x264a3c=_0x3ff4e2['nextSibling'],_0x37d4a2=null,_0x13da70=!0x1;for(;_0x264a3c;){if(_0x1bc1ce(_0x264a3c)){if(this['_isDelNode'](_0x264a3c)&&(_0x37d4a2=_0x264a3c),this['_isExistingContentComment'](_0x264a3c)&&_0x1675d4&&!_0x13da70){_0x13da70=!0x0,_0x264a3c=_0x264a3c['nextSibling'];continue;}break;}const _0x165879=dt(_0x264a3c,'data-id');if(_0x165879&&'new-element'!==_0x165879&&this['_existingDataIds']['has'](_0x165879)){_0x37d4a2=_0x264a3c;break;}_0x264a3c=_0x264a3c['nextSibling'];}return _0x37d4a2;}['_findPrevElementWithDataId'](_0x7e9dd2,_0x4f18e8){let _0x5544fb=_0x7e9dd2['previousSibling'],_0x4e838b=null,_0x40d7e8=!0x1;for(;_0x5544fb;){if(_0x1bc1ce(_0x5544fb)){if(this['_isDelNode'](_0x5544fb)&&(_0x4e838b=_0x5544fb),this['_isExistingContentComment'](_0x5544fb)&&_0x4f18e8&&!_0x40d7e8){_0x40d7e8=!0x0,_0x5544fb=_0x5544fb['previousSibling'];continue;}break;}const _0x2ddcb5=dt(_0x5544fb,'data-id');if(_0x2ddcb5&&'new-element'!==_0x2ddcb5&&this['_existingDataIds']['has'](_0x2ddcb5)){_0x4e838b=_0x5544fb;break;}_0x5544fb=_0x5544fb['previousSibling'];}return _0x4e838b;}['_markWrappedElements'](_0xca098a){_0x53fb25(_0xca098a)&&Xe('data-id',null,_0xca098a)['forEach'](_0x1fa42c=>{this['_isExistingNode'](_0x1fa42c)&&!this['_hasWrappedParent'](_0x1fa42c)&&(Ki(_0x1fa42c,'data-wrapped-id',dt(_0x1fa42c,'data-id')),Ki(_0x1fa42c,'data-id',null));});}['_getNodeDataId'](_0x34e0e6){if(!_0x34e0e6)return null;if(_0x53fb25(_0x34e0e6))return dt(_0x34e0e6,'data-id');if(_0x1bc1ce(_0x34e0e6)){const _0x5387dd=lt(_0x34e0e6)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5387dd&&_0x5387dd[0x1])return _0x5387dd[0x1];}return null;}['_storeDeletedElementIds'](_0x2d839f){if(_0x1bc1ce(_0x2d839f)){const _0x44a5f3=lt(_0x2d839f)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x44a5f3&&_0x44a5f3[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x44a5f3[0x1]);}}['_getUid'](_0x10fc37){return this['_isExistingNode'](_0x10fc37)?dt(_0x10fc37,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x145871){(function(_0x5792b3){return _0x18de35(_0x1bd179=>_0x1bc1ce(_0x1bd179),_0x5792b3,!0x0,0x1/0x0);}(_0x145871)['filter'](_0x4914ac=>this['_isDelNode'](_0x4914ac)||this['_isExistingContentComment'](_0x4914ac))['forEach'](_0x2cc6d3=>{_0x3dc7bd(_0x2cc6d3);}));}['_markLastTagElementUnstable'](_0x55b303){const _0x2349e1=_0x55b303['childNodes'],_0x361dbf=_0x2349e1[_0x2349e1['length']-0x1];_0x361dbf&&_0x53fb25(_0x361dbf)&&Ki(_0x361dbf,'data-unstable','true');}['_markUnstableElements'](_0x58d97e,_0x45d547){const _0x5d5bf9=pt('data-unstable','true',_0x58d97e);if(!_0x5d5bf9)return;const _0x3a9144=qe(_0x5d5bf9)['slice'](0x0,-0x1),_0x18ad4e=_0x3a9144['length'];let _0xd387b0=_0x5d5bf9;if(_0x18ad4e>_0x45d547){let _0x2bffcd=_0x18ad4e,_0x468c86=null;for(;_0x2bffcd>_0x45d547&&_0x2bffcd>=0x0;)_0x2bffcd--,_0x468c86=_0x3a9144[_0x2bffcd];_0x468c86&&(_0xd387b0=_0x468c86,Ki(_0x5d5bf9,'data-unstable',null),Ki(_0x468c86,'data-unstable','true'));}else{if(_0x18ad4e<_0x45d547){let _0x4db8ad=_0x18ad4e,_0x173906=_0x5d5bf9;for(;_0x4db8ad<_0x45d547;){const _0x20e3da=_0x173906['childNodes']['filter'](_0x489318=>_0x53fb25(_0x489318));if(0x0===_0x20e3da['length'])break;_0x4db8ad++,_0x173906=_0x20e3da[_0x20e3da['length']-0x1];}_0x173906&&(_0xd387b0=_0x173906,Ki(_0x5d5bf9,'data-unstable',null),Ki(_0x173906,'data-unstable','true'));}}let _0x177ccb=_0xd387b0;for(;_0x177ccb;){for(;_0x177ccb['nextSibling'];)_0x177ccb=_0x177ccb['nextSibling'],_0x53fb25(_0x177ccb)&&Ki(_0x177ccb,'data-unstable','true');_0x177ccb=_0x177ccb['parentNode'];}}['_isNewNode'](_0x27d0e0){return Boolean('new-element'===dt(_0x27d0e0,'data-id'));}['_isExistingNode'](_0xdeef17){return Boolean((dt(_0xdeef17,'data-id')||'')['length']>0x0&&'new-element'!==dt(_0xdeef17,'data-id'));}['_isDelNode'](_0x5618db){return!!_0x5618db&&Boolean(_0x1bc1ce(_0x5618db)&&lt(_0x5618db)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x26eb9b){let _0x494c6f=_0x26eb9b['parentNode'];for(;_0x494c6f;){if(dt(_0x494c6f,'data-wrapped-id'))return!0x0;_0x494c6f=_0x494c6f['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x10e496){return Boolean(_0x1bc1ce(_0x10e496)&&lt(_0x10e496)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function xt({editor:_0x4c188b,changeGroups:_0x10bb42,documentContextContent:_0x3a44e1,showDiff:_0x38b8ec,trimUnchanged:_0x2a0d64=!0x0}){return _0x10bb42['map'](_0x2a0fe8=>{const _0x183b36=new gt([]),_0x5a5ebe=new gt([]);for(const _0x25864f of _0x2a0fe8['changes'])if(_0x38b8ec&&'removed'==_0x25864f['type']||_0x5a5ebe['children']['push'](_0x25864f['node']['cloneNode'](!0x0)),'new'!=_0x25864f['type']&&(_0x38b8ec||'removed'!=_0x25864f['type'])){const _0x9e9902=ct(_0x3e5466=>dt(_0x3e5466,'data-id')==_0x25864f['id'],_0x3a44e1,!0x0);_0x9e9902&&_0x183b36['children']['push'](_0x9e9902['cloneNode'](!0x0));}const {content:_0x4f5eaf,hasChanges:_0x1c8253}=function(_0x2cb0eb,_0x130086,_0x48a4d6,_0x307f7c,_0x224451=!0x0){const _0x58b25e=_0x2cb0eb['plugins']['get']('DocumentCompare'),_0x285542=lt(_0x130086),_0x5b8d4e=lt(_0x48a4d6),_0xce948f=_0x2cb0eb['data']['parse'](_0x285542,'$root'),_0x4d0035=_0x2cb0eb['model']['createPositionAt'](_0xce948f,0x0),_0x2b403e=_0x58b25e['getDiff'](_0x285542,_0x5b8d4e,{'anchor':_0x4d0035,'markDeletions':_0x307f7c}),_0x5a4b27=_0x2b403e['getOperations']();if(0x0==_0x5a4b27['length'])return{'content':_0x130086['cloneNode'](!0x0),'hasChanges':!0x1};_0x307f7c?function(_0x44cd54,_0x2c1fd1,_0x2e3c62){if(0x0==_0x44cd54['length'])return;const _0x3c6f7a=_0x2e3c62['plugins']['get']('DocumentCompare'),_0xe18a8e=_0x2e3c62['plugins']['get']('SuggestionsConversion');_0x2e3c62['model']['change'](_0x5013d2=>{const _0x5aa923=new Set();for(let _0x48962e=0x0;_0x48962e<_0x44cd54['length'];_0x48962e++){const _0x260a92=_0x44cd54[_0x48962e];if(_0x260a92['baseVersion']=null,_0x260a92['isDocumentOperation']=!0x1,_0x3c6f7a['isMarkedRemoveOperation'](_0x260a92)){const _0x9333ed=_0x461c8f(_0x260a92['newRange'],_0x2e3c62['model']),_0x57967d='suggestion:deletion:'+_0x418744()+':$aiSuggestion';_0x2c1fd1['markers']['set'](_0x57967d,_0x9333ed);}else switch(_0x260a92['type']){case'rename':{if(_0x260a92['oldName']==_0x260a92['newName'])break;_0x5013d2['batch']['addOperation'](_0x260a92),_0x2e3c62['model']['applyOperation'](_0x260a92);const _0x15a7bb='$elementName',_0x3844b5=_0x260a92['position'],_0x47b503=_0x2e3c62['model']['createRange'](_0x3844b5,_0x2e3c62['model']['createPositionAt'](_0x3844b5['nodeAfter'],'end')),_0x1cea50='suggestion:attribute:'+_0x15a7bb+':'+_0x418744()+':$aiSuggestion';_0x2c1fd1['markers']['set'](_0x1cea50,_0x47b503);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x260a92['oldValue']==_0x260a92['newValue'])break;_0x5013d2['batch']['addOperation'](_0x260a92),_0x2e3c62['model']['applyOperation'](_0x260a92);const _0x93cf81=_0x260a92['key'];if(!_0xe18a8e['isRegisteredAttribute'](_0x93cf81))break;const _0x4abda0=_0x461c8f(_0x260a92['range'],_0x2e3c62['model']),_0x5b1c18='suggestion:attribute:'+_0x93cf81+':'+_0x418744()+':$aiSuggestion';_0x2c1fd1['markers']['set'](_0x5b1c18,_0x4abda0);break;}case'insert':{_0x5013d2['batch']['addOperation'](_0x260a92),_0x2e3c62['model']['applyOperation'](_0x260a92);if(_0x44cd54[_0x48962e+0x1]&&'move'==_0x44cd54[_0x48962e+0x1]['type']){ro(_0x2c1fd1,_0x260a92);break;}const _0x87871f=_0x260a92['position'],_0x138147=_0x260a92['howMany'],_0x59f447=_0x461c8f(_0x2e3c62['model']['createRange'](_0x87871f,_0x87871f['getShiftedBy'](_0x138147)),_0x2e3c62['model']),_0x7bc9fc='suggestion:insertion:'+_0x418744()+':$aiSuggestion';_0x2c1fd1['markers']['set'](_0x7bc9fc,_0x59f447);break;}case'split':{_0x5013d2['batch']['addOperation'](_0x260a92),_0x2e3c62['model']['applyOperation'](_0x260a92);const _0x40ce95=_0x260a92['splitPosition'],_0x36bf87=_0x260a92['moveTargetPosition'],_0xd9f95b=_0x2e3c62['model']['createRange'](_0x40ce95,_0x36bf87),_0x3151e2='suggestion:insertion:'+_0x418744()+':$aiSuggestion';_0x2c1fd1['markers']['set'](_0x3151e2,_0xd9f95b);break;}case'move':{_0x5013d2['batch']['addOperation'](_0x260a92),_0x2e3c62['model']['applyOperation'](_0x260a92),_0x44cd54[_0x48962e-0x1]&&'insert'==_0x44cd54[_0x48962e-0x1]['type']&&ro(_0x2c1fd1,_0x260a92);const _0x32aed1=_0x260a92['getMovedRangeStart'](),_0x3c7577=_0x260a92['howMany'];for(let _0x25e79b=0x0;_0x25e79b<_0x3c7577;_0x25e79b++){const _0x46a0b4=_0x32aed1['getShiftedBy'](_0x25e79b)['nodeAfter'];_0x5aa923['add'](_0x46a0b4);}break;}case'remove':{const _0xd46b9f=_0x260a92['sourcePosition'],_0x19be60=_0x260a92['howMany'],_0x2c4a23=new ht(_0xd46b9f,_0x19be60);_0x5013d2['batch']['addOperation'](_0x2c4a23),_0x2e3c62['model']['applyOperation'](_0x2c4a23);break;}}}for(const _0x4393b9 of _0x5aa923){const _0x57426d=_0x2e3c62['model']['createRangeOn'](_0x4393b9),_0x2bf6c7='suggestion:formatBlock:$fakeWrap:'+_0x418744()+':$aiSuggestion';_0x2c1fd1['markers']['set'](_0x2bf6c7,_0x461c8f(_0x57426d,_0x2e3c62['model']));}});}(_0x5a4b27,_0xce948f,_0x2cb0eb):_0x2cb0eb['model']['change'](_0x40bc44=>{for(const _0x1b2acb of _0x5a4b27)if('remove'==_0x1b2acb['type']){const _0x19186e=_0x1b2acb['sourcePosition'],_0x3d0997=_0x1b2acb['howMany'],_0x5aae85=new ht(_0x19186e,_0x3d0997);_0x40bc44['batch']['addOperation'](_0x5aae85),_0x2cb0eb['model']['applyOperation'](_0x5aae85);}else{if('marker'==_0x1b2acb['type']){const _0x2e3ebb=_0x1b2acb['name'],_0x32c732=_0x1b2acb['newRange'];_0xce948f['markers']['set'](_0x2e3ebb,_0x32c732);}else _0x1b2acb['baseVersion']=null,_0x1b2acb['isDocumentOperation']=!0x1,_0x40bc44['batch']['addOperation'](_0x1b2acb),_0x2cb0eb['model']['applyOperation'](_0x1b2acb);}});if(_0x224451){const _0x2fd98b=rt(_0x2cb0eb,_0x5a4b27,_0xce948f);at(_0x2cb0eb['model'],_0x2fd98b),function(_0x46dfef,_0x47e8ed){const _0x55265f=_0x47e8ed['getFirstRange']()['start'];let _0x20dd78=_0x47e8ed['getFirstRange']()['end'];const _0x46acfd=_0x55265f['root'];(_0x20dd78['textNode']||_0x20dd78['nodeAfter']&&_0x20dd78['nodeAfter']['is']('$text'))&&(_0x4b0d66(_0x20dd78,'...'),_0x20dd78=_0x20dd78['getShiftedBy'](0x3)),(_0x55265f['textNode']||_0x55265f['nodeBefore']&&_0x55265f['nodeBefore']['is']('$text'))&&(_0x4b0d66(_0x55265f,'...'),function(_0x408f6b,_0xa3102b,_0x891876){for(let [_0x14a5c7,_0xb29957]of _0x408f6b['markers']){const _0x46cdfb=_0xb29957['_getTransformedByInsertion'](_0xa3102b,_0x891876,!0x1);_0xb29957=_0x46cdfb[0x0],_0x408f6b['markers']['set'](_0x14a5c7,_0xb29957);}}(_0x46acfd,_0x55265f,0x3),_0x55265f['parent']==_0x20dd78['parent']&&(_0x20dd78=_0x20dd78['getShiftedBy'](0x3)));const _0x417b11=_0x46dfef['createRange'](_0x46dfef['createPositionAt'](_0x46acfd,0x0),_0x55265f),_0x3f16d4=_0x46dfef['createRange'](_0x20dd78,_0x46dfef['createPositionAt'](_0x46acfd,'end')),_0x12b12f=[..._0x417b11['getMinimalFlatRanges'](),..._0x3f16d4['getMinimalFlatRanges']()];_0x12b12f['reverse']();for(const _0x3b1018 of _0x12b12f)_0x70394c(_0x3b1018),Jn(_0x46acfd,_0x3b1018);}(_0x2cb0eb['model'],_0x2fd98b);}const _0x51306b=_0x2cb0eb['data']['stringify'](_0xce948f,{'showSuggestionHighlights':!0x0});return{'content':Be(_0x51306b),'hasChanges':!0x0};}(_0x4c188b,_0x183b36,_0x5a5ebe,_0x38b8ec,_0x2a0d64);return{'type':_0x2a0fe8['changes'][0x0]['type'],'index':_0x2a0fe8['index'],'content':_0x4f5eaf,'hasChanges':_0x1c8253};});}function ro(_0x3af4a4,_0x5ae6b1){for(const [_0x3f5c2b,_0x13613d]of _0x3af4a4['markers']){const _0x1a9e5f=nt['_createFromRanges'](_0x13613d['getTransformedByOperation'](_0x5ae6b1));_0x3af4a4['markers']['set'](_0x3f5c2b,_0x1a9e5f);}}function rt(_0x54af70,_0x58850d,_0x38fa70){const _0xe512c5=_0x54af70['plugins']['get']('DocumentCompare');let _0x562ca9=_0x54af70['model']['createPositionAt'](_0x38fa70,Number['POSITIVE_INFINITY']),_0x13ae6d=_0x54af70['model']['createPositionAt'](_0x38fa70,0x0);for(const _0x193e9f of _0x58850d){let _0x262596,_0x4d6f68;if(_0xe512c5['isMarkedRemoveOperation'](_0x193e9f))_0x262596=_0x193e9f['newRange']['start'],_0x4d6f68=_0x193e9f['newRange']['end'];else switch(_0x562ca9=_0x562ca9['getTransformedByOperation'](_0x193e9f),_0x13ae6d=_0x13ae6d['getTransformedByOperation'](_0x193e9f),_0x193e9f['type']){case'rename':_0x262596=_0x193e9f['position'],_0x4d6f68=_0x262596['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x262596=_0x193e9f['range']['start'],_0x4d6f68=_0x193e9f['range']['end'];break;case'insert':_0x262596=_0x193e9f['position'],_0x4d6f68=_0x262596['getShiftedBy'](_0x193e9f['howMany']);break;case'split':_0x262596=_0x193e9f['splitPosition'],_0x4d6f68=_0x193e9f['moveTargetPosition'];break;case'merge':{const _0x2d44db=_0x193e9f['targetPosition']['path']['slice'](0x0,-0x1);_0x262596=_0x54af70['model']['createPositionFromPath'](_0x38fa70,_0x2d44db),_0x4d6f68=_0x262596['getShiftedBy'](0x1);break;}case'remove':{const _0x418a16=_0x193e9f['howMany'],_0x145d72=_0x193e9f['sourcePosition']['_getTransformedByInsertion'](_0x193e9f['targetPosition'],_0x418a16),_0x1478ce=_0x193e9f['getMovedRangeStart']();'remove'==_0x193e9f['type']?(_0x262596=_0x145d72,_0x4d6f68=_0x145d72):(_0x262596=_0x1478ce,_0x4d6f68=_0x1478ce['getShiftedBy'](_0x418a16));break;}}_0x262596&&_0x262596['isBefore'](_0x562ca9)&&(_0x562ca9=_0x262596['clone'](),_0x562ca9['stickiness']='toNone'),_0x4d6f68&&_0x4d6f68['isAfter'](_0x13ae6d)&&(_0x13ae6d=_0x4d6f68['clone'](),_0x13ae6d['stickiness']='toNone');}return _0x54af70['model']['createSelection'](_0x54af70['model']['createRange'](_0x562ca9,_0x13ae6d));}function at(_0x44cea0,_0x3e90f0){so(_0x44cea0,_0x3e90f0,'forward');const _0x3c9201=_0x3e90f0['getFirstRange']();_0x3e90f0['setTo']([]),_0x3e90f0['setTo'](_0x3c9201,{'backward':!0x0}),so(_0x44cea0,_0x3e90f0,'backward');}function so(_0x31fbd0,_0x29343d,_0x2aa182){let _0x17f000=0x14;for(;_0x17f000;){_0x31fbd0['modifySelection'](_0x29343d,{'unit':'word','direction':_0x2aa182}),_0x17f000--;const _0x4c516a=_0x29343d['focus']['forward'==_0x2aa182?'nodeBefore':'nodeAfter'];if(_0x4c516a&&_0x4c516a['is']('element')&&_0x31fbd0['schema']['isBlock'](_0x4c516a)&&_0x31fbd0['schema']['isObject'](_0x4c516a))break;}}function Jn(_0x575dbe,_0xfbb298){for(const [_0xd7dee6,_0xded28b]of _0x575dbe['markers']){const _0x1d4e61=_0xded28b['_getTransformedByDeletion'](_0xfbb298['start'],_0xfbb298['end']['offset']-_0xfbb298['start']['offset']);null!=_0x1d4e61?_0x575dbe['markers']['set'](_0xd7dee6,_0x1d4e61):_0x575dbe['markers']['delete'](_0xd7dee6);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new gt([]);['parsedMergedContent']=new gt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3848be,content:_0x149dcb='',isDone:_0x59569f=!0x1,interactionId:_0x229dbb,areActionsDisabled:_0x3182a7,documentContextContent:_0x192b69,editor:_0x238349,id:_0x1e43c4}){super(),this['id']=_0x1e43c4||_0x418744(),this['interactionId']=_0x229dbb,this['type']=_0x3848be,this['areActionsDisabled']=!!_0x3182a7,this['editor']=_0x238349,this['aiResponseParser']=new Je(),this['aiResponseApplier']=new Ke(),this['documentContextContent']=Be(_0x192b69||''),this['set']('isDone',_0x59569f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x149dcb);}['appendContent'](_0x53de2d){this['set']('content',this['content']+_0x53de2d);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x465d5,_0xe56aa){this['changeGroups'][_0x465d5]['state']=_0xe56aa,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x465d5,'state':_0xe56aa});}['getContentParts']({showDiff:_0xb8f0f3,groupIndex:_0xaaa35f}){if(!this['editor'])throw new _0x3384e8('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x2e2275=this['_getCachedContentParts'](_0xb8f0f3,_0xaaa35f);if(_0x2e2275)return _0x2e2275;let _0x3316ca=[];if(void 0x0===_0xaaa35f)_0x3316ca=this['changeGroups'];else{const _0x28f2d1=this['changeGroups']['find'](({index:_0x2a12fa})=>_0x2a12fa===_0xaaa35f);if(!_0x28f2d1)throw new _0x3384e8('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xaaa35f});_0x3316ca=[_0x28f2d1];}const _0x30f4d9=xt({'editor':this['editor'],'showDiff':_0xb8f0f3,'changeGroups':_0x3316ca,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xb8f0f3,_0x30f4d9),_0x30f4d9;}['_getCachedContentParts'](_0x4bc797,_0x242748){const _0x241e19=_0x4bc797?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x241e19]['length'])return null;const _0x103b3b=this['cachedSuggestionContentParts'][_0x241e19];if(void 0x0===_0x242748)return _0x30ef56(_0x103b3b);{const _0x4f26f2=_0x103b3b['find'](({index:_0x2ffd89})=>_0x2ffd89===_0x242748);if(_0x4f26f2)return[_0x30ef56(_0x4f26f2)];}return null;}['_setCachedContentParts'](_0x4ca1ba,_0x2e1f4b){const _0x401ae8=_0x4ca1ba?'withDiff':'withoutDiff';_0x2e1f4b['forEach'](_0x1ae4ed=>{const _0x2d13d7=this['cachedSuggestionContentParts'][_0x401ae8],_0x41cb53=_0x2d13d7['find'](({index:_0x6f7615})=>_0x6f7615===_0x1ae4ed['index']);if(_0x41cb53){const _0x56e646=_0x2d13d7['indexOf'](_0x41cb53);_0x2d13d7['splice'](_0x56e646,0x1,_0x1ae4ed);}else _0x2d13d7['push'](_0x1ae4ed);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x1e1306=this['changeGroups'];this['updateChangeGroups']();const _0x362502=this['_getDifferentChangeGroups'](_0x1e1306,this['changeGroups']);(_0x362502['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x362502),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x3be949,_0x33df9c){const _0x13b069=[];for(const _0x42e661 of _0x33df9c){const _0x4c77e7=_0x3be949[_0x42e661['index']];_0x4c77e7?_0x4c77e7['changes']['length']!==_0x42e661['changes']['length']?_0x13b069['push'](_0x42e661):_0x4c77e7['changes']['forEach']((_0x4236bf,_0x58c0ca)=>{const _0x414dde=_0x42e661['changes'][_0x58c0ca];_0x4236bf['id']!==_0x414dde['id']&&_0x13b069['push'](_0x42e661);}):_0x13b069['push'](_0x42e661);}return _0x13b069;}['updateChangeGroups'](){const _0x3799ba=new _0xfaa538('p',{},[new _0xfaa538('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x1b6656(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x12fe31=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x3799ba,'cutAfterLastChange':!this['isDone']});if(!_0x12fe31['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x12fe31['parsedContent'];let _0x412e20=[];if(_0x175b52(_0x13b808=>{const _0x1d43a9=dt(_0x13b808,'data-id');if(!_0x1d43a9||!_0x5455bd(_0x1d43a9))return!0x1;const _0x53bd68=[_0x13b808,...qe(_0x13b808)]['at'](-0x2);if(_0x13b808!=_0x53bd68){const _0x5d9a46=dt(_0x53bd68,'data-id');_0x5455bd(_0x5d9a46)||(_0x412e20['push']({'node':_0x53bd68,'id':_0x5d9a46,'type':'modified'}),_0x12fe31['modifiedNodeIds']['push'](_0x5d9a46));}else _0x12fe31['modifiedNodeIds']['includes'](_0x1d43a9)?_0x412e20['push']({'node':_0x13b808,'type':'modified','id':_0x1d43a9}):_0x12fe31['newNodeIds']['includes'](_0x1d43a9)?_0x412e20['push']({'node':_0x13b808,'type':'new','id':_0x1d43a9,'anchorId':dt(_0x13b808['previousSibling'],'data-id')}):_0x412e20['push']({'node':_0x13b808,'type':'removed','id':_0x1d43a9});return!0x0;},this['parsedMergedContent']),_0x412e20=_0x412e20['filter'](({node:_0x153b13})=>[...qe(_0x153b13),_0x153b13]['every'](_0x199fd4=>!dt(_0x199fd4,'data-unstable'))),0x0==_0x412e20['length'])return;const _0x1a6601=[[_0x412e20[0x0]]];for(let _0x5ef209=0x1;_0x5ef209<_0x412e20['length'];_0x5ef209++){const _0x463e4f=_0x1a6601[_0x1a6601['length']-0x1],_0x9cca4e=_0x463e4f[_0x463e4f['length']-0x1];_0x412e20[_0x5ef209]['node']['previousSibling']==_0x9cca4e['node']&&'modified'!=_0x412e20[_0x5ef209]['type']&&'modified'!=_0x9cca4e['type']?_0x463e4f['push'](_0x412e20[_0x5ef209]):_0x1a6601['push']([_0x412e20[_0x5ef209]]);}for(const _0x42e1e0 of _0x1a6601){const _0x28a66d=_0x42e1e0[0x0],_0x570f0c=_0x42e1e0[_0x42e1e0['length']-0x1],_0x46ed2d=_0x389f30(_0x28a66d['node']['previousSibling']);_0x46ed2d&&_0x42e1e0['unshift'](_0x46ed2d);const _0x2546fa=_0x389f30(_0x570f0c['node']['nextSibling']);_0x2546fa&&_0x42e1e0['push'](_0x2546fa);}function _0x5455bd(_0x1ec8e3){return _0x12fe31['modifiedNodeIds']['includes'](_0x1ec8e3)||_0x12fe31['newNodeIds']['includes'](_0x1ec8e3)||_0x12fe31['removedNodeIds']['includes'](_0x1ec8e3);}function _0x389f30(_0xeafcee){if(_0xeafcee&&dt(_0xeafcee,'data-id')&&!dt(_0xeafcee,'data-unstable')){const _0x29dfb9=dt(_0xeafcee,'data-id');if(!_0x5455bd(_0x29dfb9))return{'node':_0xeafcee,'type':'context','id':_0x29dfb9};}return null;}this['changeGroups']=_0x1a6601['map']((_0x5649b4,_0x241ced)=>({'changes':_0x5649b4,'state':'pending','index':_0x241ced}));}}function Ui(_0x4b7249){return Object['values'](Zn)['includes'](_0x4b7249);}function Fi(_0xff11){return Wr['includes'](_0xff11);}function qi(_0x43965f){return'conversation-title'===_0x43965f;}function Gi(_0x2db608){return'source'===_0x2db608;}const wi=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class pi extends _0xe5b3f8(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4fea25,editor:_0x1033be}){super(),this['id']=_0x418744(),this['connector']=_0x4fea25,this['isStopped']=!0x0,this['editor']=_0x1033be;}async['start'](){let _0x18dffb;const _0x2e4c49=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x485041=await this['currentRequest']['getStream']();for await(const _0x4c031d of _0x485041){if(this['isStopped'])return;if('error'===_0x4c031d['event'])return void this['fire']('error',{'error':new _0x3384e8('ai-chat-interaction-error',this)});if('message-metadata'!==_0x4c031d['event']){if('action-metadata'!==_0x4c031d['event']){if(qi(_0x4c031d['event'])&&this['setConversationTitle'](_0x4c031d['data']['conversationTitle'],!0x0),Gi(_0x4c031d['event']))_0x2e4c49['push'](_0x4c031d['data']['source']);else{if(Ui(_0x4c031d['event'])){if(_0x4c031d['event']!==_0x18dffb){if(_0x18dffb=_0x4c031d['event'],'web-search'===_0x4c031d['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x4c031d['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x4c031d['event'],'interactionId':this['id'],'id':_0x4c031d['data']?.['id']}),_0x2e4c49['length']>0x0&&'modification-delta'===_0x4c031d['event']&&(this['currentReply']['sources']=_0x2e4c49['splice'](0x0));}_0x4c031d['data']['textDelta']&&this['currentReply']['appendContent'](_0x4c031d['data']['textDelta']);}else Fi(_0x4c031d['event']);}}else this['actionCallId']=_0x4c031d['data']['callId'];}else this['messageId']=_0x4c031d['data']['messageId'];}}finally{this['isStopped']||(_0x2e4c49['length']>0x0&&(this['currentReply']['sources']=_0x2e4c49['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4477d8){return this['replies']['find'](_0x161862=>_0x161862['id']===_0x4477d8);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5c5991=>_0x5c5991['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x982f76){const _0x41cc05=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x982f76});return this['replies']['push'](_0x41cc05),_0x41cc05['delegate'](...wi)['to'](this),this['fire']('replyCreated',_0x41cc05),_0x41cc05;}['setConversationTitle'](_0x485dfa,_0xc2988=!0x1){this['fire']('setConversationTitle',_0x485dfa,_0xc2988);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x3ebea1){return _0x3ebea1['FILE']='file',_0x3ebea1['DOCUMENT']='document',_0x3ebea1['URL']='web-resource',_0x3ebea1['TEXT']='text',_0x3ebea1['SELECTION']='selection',_0x3ebea1;}({}),Ce=function(_0x7785b8){return _0x7785b8['TEXT']='text',_0x7785b8['MARKDOWN']='markdown',_0x7785b8['HTML']='html',_0x7785b8;}({});const Fe=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ii=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class vi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x936b96,config:_0x3a4af2,ownerId:_0x24c09e}){super(),this['_connector']=_0x936b96,this['_config']=_0x3a4af2,this['_ownerId']=_0x24c09e;}['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'](_0x1458bf){const _0x1155f6=await this['_createContextItemFromContent'](_0x1458bf);return this['_addToConversationContextItem'](_0x1155f6),'current-document'===_0x1155f6['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1155f6;}async['_createContextItemFromContent'](_0x34752d){if(_0x34752d['type']===xe['DOCUMENT']){const _0x3faa72=await this['_connector']['fetchDocument'](this['_ownerId'],_0x34752d['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x34752d['type'],'content':_0x3faa72['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x3faa72['attributes']?.['version'],'sessionId':_0x3faa72['attributes']?.['sessionId']};}return{'id':_0x34752d['id'],'uiId':_0x34752d['id'],'label':_0x34752d['attributes']?.['label']||_0x34752d['name']||_0x34752d['url']||_0x34752d['id'],'type':_0x34752d['type'],..._0x34752d?.['attributes']?.['resourceId']?{'resourceId':_0x34752d['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x458d97){const _0xe9794f=this['_pendingContextItems']['get'](_0x458d97);_0xe9794f?.['isReadOnly']||this['_removeContextItem'](_0x458d97);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x327abd of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x327abd['uiId']);const _0x2775ff=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2775ff&&this['_addContextItem']({..._0x2775ff,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3065b1){for(const _0xc777f1 of _0x3065b1['values']())this['_addToConversationContextItem'](_0xc777f1);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'](_0x42d7e0){return Array['from'](_0x42d7e0['values']())['map'](_0x9679af=>this['_mapContextItemToRequestData'](_0x9679af))['filter'](_0x3c94af=>null!==_0x3c94af);}async['addFilesToContext'](_0x31c3fe,_0x389fbc,_0x17cf6d=xe['FILE']){const _0x1ac156='files-'+_0x418744();this['_startUploadOperation'](_0x1ac156);try{await Promise['all'](_0x31c3fe['map'](async _0xcf27c7=>{const _0x39ee83='file-'+_0x418744(),_0x59d461=_0x423ab9(_0xcf27c7['name']);try{this['_addContextItem']({'type':_0x17cf6d,'label':_0x389fbc?.['label']||_0x59d461,'uiId':_0x39ee83,'resourceId':_0x389fbc?.['resourceId']},!0x0);const _0x57adc6=this['_connector']['uploadFile'](this['_ownerId'],_0xcf27c7,_0x389fbc);this['_ongoingUploads']['set'](_0x39ee83,_0x57adc6['abortController']);const {id:_0x1e59f4}=await _0x57adc6['getId']();this['_ongoingUploads']['delete'](_0x39ee83),this['_finishContextItemLoading']({'type':_0x17cf6d,'id':_0x1e59f4,'label':_0x389fbc?.['label']||_0x59d461,'uiId':_0x39ee83,'resourceId':_0x389fbc?.['resourceId']},!0x1);}catch(_0x415d4c){this['_ongoingUploads']['delete'](_0x39ee83);if(!(_0x415d4c instanceof _0x3384e8&&_0x415d4c['message']['startsWith']('ai-request-aborted'))){const _0x42e997=Fe['get'](_0x415d4c['code'])||'ai-chat-file-upload-failed',_0x5842b1=new _0x3384e8(_0x42e997,null,{'fileName':_0x59d461,..._0x415d4c});_0x5842b1['stack']=_0x415d4c['stack'],this['fire']('error',{'error':_0x5842b1});}this['_removeContextItem'](_0x39ee83);}}));}finally{this['_finishUploadOperation'](_0x1ac156);}}['addCurrentDocumentToContext'](_0x49fb1f){if(this['isCurrentDocumentInContext']())return;const _0x207cd2={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x49fb1f,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x207cd2);}async['updateCurrentDocument'](_0x25a323,_0x219faf,_0x3bc1d8,_0x50cafa){const _0x5e4d49=this['_pendingContextItems']['get']('current-document');if(_0x5e4d49&&_0x25a323){_0x5e4d49['selection']=_0x50cafa?_0x50cafa['map'](_0x3ddb42=>({'start':_0x3ddb42['start'],'end':_0x3ddb42['end']})):[];try{if(_0x5e4d49['version']===_0x219faf)return;const {id:_0x3b6f42}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x25a323,{'version':_0x219faf,'sessionId':_0x3bc1d8})['getId']();_0x5e4d49['id']=_0x3b6f42,_0x5e4d49['content']=_0x25a323,_0x5e4d49['version']=_0x219faf,_0x5e4d49['sessionId']=_0x3bc1d8;}catch(_0x2880da){const _0x5a1376=new _0x3384e8('ai-chat-document-upload-failed',null);_0x5a1376['stack']=_0x2880da['stack'],this['fire']('error',{'error':_0x5a1376});}}}['addSelectionToContext'](_0x536948){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x536948,'uiId':'selection','content':_0x536948});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4cdb4f,_0x3df33f){const _0x34685b='url-'+_0x418744();this['_startUploadOperation'](_0x34685b);const _0x57f59d='url-'+_0x418744();try{this['_addContextItem']({'type':xe['URL'],'label':_0x3df33f?.['label']||_0x4cdb4f,'uiId':_0x57f59d,'resourceId':_0x3df33f?.['resourceId']},!0x0);const _0x3274ce=this['_connector']['uploadUrl'](this['_ownerId'],_0x4cdb4f,_0x3df33f);this['_ongoingUploads']['set'](_0x57f59d,_0x3274ce['abortController']);const {id:_0x20053d}=await _0x3274ce['getId']();this['_ongoingUploads']['delete'](_0x57f59d),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x20053d,'label':_0x3df33f?.['label']||_0x4cdb4f,'uiId':_0x57f59d,'resourceId':_0x3df33f?.['resourceId']},!0x1);}catch(_0x3e5bac){this['_ongoingUploads']['delete'](_0x57f59d),(_0x3e5bac['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x3384e8('ai-chat-url-upload-failed',this,{'url':_0x4cdb4f,'originalError':_0x3e5bac}),'url':_0x4cdb4f}),this['_removeContextItem'](_0x57f59d));}finally{this['_finishUploadOperation'](_0x34685b);}}async['loadSourceResources'](_0x897560,_0x354f64,_0xaf7167){const _0xbb4835=this['_addContextOptionsState']['sources']['find'](_0x137578=>_0x137578['id']===_0x897560);if(!_0xbb4835)return this['fire']('error',{'error':new _0x3384e8('ai-chat-source-not-found',this,{'sourceId':_0x897560}),'sourceId':_0x897560}),[];try{const _0x5c3ec1=(await _0xbb4835['getResources'](_0x354f64))['map'](_0x1f70f8=>{const _0x258dee=this['_isResourceInContext'](_0x1f70f8['id']);return{..._0x1f70f8,'isInContext':_0x258dee};});return _0xbb4835['resources']=_0x5c3ec1,this['fire']('sourceResourcesLoaded',{'sourceId':_0x897560,'source':_0xbb4835,'resources':_0x5c3ec1,'uid':_0xaf7167}),_0x5c3ec1;}catch(_0x526cd0){return this['fire']('error',{'error':new _0x3384e8('ai-chat-source-resources-load-failed',this,{'sourceId':_0x897560,'originalError':_0x526cd0}),'sourceId':_0x897560,'sourceLabel':_0xbb4835['label']}),[];}}async['addResourceToContext'](_0x5e2a93,_0x2bf8b4){if(this['_isResourceInContext'](_0x2bf8b4['id']))return;let _0x434c65=_0x2bf8b4['data'];if(!_0x434c65&&_0x5e2a93['getData'])try{_0x434c65=await _0x5e2a93['getData'](_0x2bf8b4['id']);}catch(_0x3a976a){return void this['fire']('error',{'error':new _0x3384e8('ai-chat-resource-load-failed',this,{'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id'],'originalError':_0x3a976a}),'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']});}if(_0x434c65)switch(_0x2bf8b4['type']){case xe['URL']:if('string'!=typeof _0x434c65)return void this['fire']('error',{'error':new _0x3384e8('ai-chat-context-invalid-data',this,{'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id'],'expectedType':'string','actualType':typeof _0x434c65}),'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']});await this['addUrlToContext'](_0x434c65,{'label':_0x2bf8b4['label'],'resourceId':_0x2bf8b4['id']});break;case xe['FILE']:if(!(_0x434c65 instanceof File))return void this['fire']('error',{'error':new _0x3384e8('ai-chat-context-invalid-data',this,{'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id'],'expectedType':'File','actualType':typeof _0x434c65}),'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']});await this['addFilesToContext']([_0x434c65],{'label':_0x2bf8b4['label'],'resourceId':_0x2bf8b4['id']});break;case xe['TEXT']:if('object'!=typeof _0x434c65||!('content'in _0x434c65)||!('type'in _0x434c65))return void this['fire']('error',{'error':new _0x3384e8('ai-chat-context-invalid-data',this,{'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x434c65}),'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']});_0x434c65=vi['_convertTextResourceToFile'](_0x434c65,_0x2bf8b4['label']),await this['addFilesToContext']([_0x434c65],{'label':_0x2bf8b4['label'],'resourceId':_0x2bf8b4['id']},xe['TEXT']);break;default:this['fire']('error',{'error':new _0x3384e8('ai-chat-context-unsupported-type',this,{'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id'],'resourceType':_0x2bf8b4['type']}),'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']});}else this['fire']('error',{'error':new _0x3384e8('ai-chat-resource-no-data',this,{'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']}),'resourceId':_0x2bf8b4['id'],'sourceId':_0x5e2a93['id']});}static['_convertTextResourceToFile'](_0x3f09bd,_0x36692a){switch(_0x3f09bd['type']){case Ce['MARKDOWN']:return new File([_0x3f09bd['content']],_0x36692a,{'type':'text/markdown'});case Ce['HTML']:return new File([_0x3f09bd['content']],_0x36692a,{'type':'text/html'});default:return new File([_0x3f09bd['content']],_0x36692a,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x30236d){switch(_0x30236d['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x30236d['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x30236d['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x30236d['id'],..._0x30236d['selection']?.['length']&&{'selection':_0x30236d['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x30236d['id']};default:return null;}}['_addContextItem'](_0x40bf23,_0x17d701=!0x1){if(this['_pendingContextItems']['set'](_0x40bf23['uiId'],_0x40bf23),_0x40bf23['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x40bf23,'isLoading':_0x17d701}),'current-document'===_0x40bf23['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x40bf23['resourceId']){const _0x1b5e01=this['_findSourceIdsByResourceId'](_0x40bf23['resourceId']);_0x1b5e01&&_0x1b5e01['forEach'](_0x43aaed=>{this['_updateResourceInContextState'](_0x43aaed,_0x40bf23['resourceId'],!0x0);});}}['_removeContextItem'](_0x2414fe){const _0xb045a2=this['_pendingContextItems']['get'](_0x2414fe),_0x129f65=this['_ongoingUploads']['get'](_0x2414fe);if(_0x129f65&&(_0x129f65['abort'](),this['_ongoingUploads']['delete'](_0x2414fe)),_0xb045a2?.['resourceId']){const _0xcef006=this['_findSourceIdsByResourceId'](_0xb045a2['resourceId']);_0xcef006&&_0xcef006['forEach'](_0x2e3cda=>{this['_updateResourceInContextState'](_0x2e3cda,_0xb045a2['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2414fe),this['fire']('contextItemRemoved',{'uiId':_0x2414fe,'type':_0xb045a2?.['type']}),'current-document'===_0x2414fe&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x5049ae,_0x5474a5){if(this['_pendingContextItems']['has'](_0x5049ae['uiId'])&&(this['_pendingContextItems']['set'](_0x5049ae['uiId'],_0x5049ae),this['fire']('contextItemLoadingEnded',{'contextItem':_0x5049ae,'isLoading':_0x5474a5}),_0x5049ae['resourceId'])){const _0x52540a=this['_findSourceIdsByResourceId'](_0x5049ae['resourceId']);_0x52540a&&_0x52540a['forEach'](_0x2d8bd9=>{this['_updateResourceInContextState'](_0x2d8bd9,_0x5049ae['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2a4cd2){this['_conversationContextItems']['set'](_0x2a4cd2['uiId'],_0x2a4cd2);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3820f6=>({..._0x3820f6,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3102ab=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3102ab,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x21edad){for(const _0x31b092 of this['_pendingContextItems']['values']())if(_0x31b092['resourceId']===_0x21edad)return!0x0;for(const _0x187fac of this['_conversationContextItems']['values']())if(_0x187fac['resourceId']===_0x21edad)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x49045f){const _0x5c291b=[];for(const _0xe222b4 of this['_addContextOptionsState']['sources']){_0xe222b4['resources']['find'](_0x57b675=>_0x57b675['id']===_0x49045f)&&_0x5c291b['push'](_0xe222b4['id']);}return 0x0===_0x5c291b['length']?null:_0x5c291b;}['_updateResourceInContextState'](_0x25c794,_0x377ca9,_0x33bd90){const _0x43c2fe=this['_addContextOptionsState']['sources']['find'](_0x496fae=>_0x496fae['id']===_0x25c794);if(!_0x43c2fe)return;const _0xfa0616=_0x43c2fe['resources']['find'](_0x1e0ca9=>_0x1e0ca9['id']===_0x377ca9);_0xfa0616&&(_0xfa0616['isInContext']=_0x33bd90,this['fire']('resourceStateChanged',{'sourceId':_0x25c794,'resourceId':_0x377ca9,'isInContext':_0x33bd90}));}['_startUploadOperation'](_0x5d1d89){this['_ongoingUploadOperations']['set'](_0x5d1d89,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x534462){this['_ongoingUploadOperations']['delete'](_0x534462),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ci=['capabilitiesUpdated'];class fi extends _0xe5b3f8(){['_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'](_0x4995c1){const _0x228446={};return _0x4995c1&&_0x4995c1['isWebSearchEnabled']&&(_0x228446['webSearch']={}),_0x4995c1&&_0x4995c1['isReasoningEnabled']&&(_0x228446['reasoning']={}),_0x228446;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x190bc){_0x190bc!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x190bc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x23d934){_0x23d934!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x23d934,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class xi extends pi{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x2890fe){super(_0x2890fe),this['conversationId']=_0x2890fe['conversationId'],this['contextItems']=_0x2890fe['contextItems'],this['capabilities']=_0x2890fe['capabilities'],this['userMessage']=_0x2890fe['userMessage'],this['model']=_0x2890fe['model'],this['quickActionData']=_0x2890fe['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':vi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':fi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Q extends _0xe5b3f8(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x3e6484){super(),this['options']=_0x3e6484,this['connector']=_0x3e6484['connector'],this['chatModels']=_0x3e6484['chatModels'],this['id']=_0x3e6484['conversationId'];}async['init'](_0x2b1241){try{this['chatContext']=new vi({'connector':this['connector'],'config':_0x2b1241,'ownerId':this['id']}),this['chatContext']['delegate'](...Ii)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new fi(),this['chatCapabilities']['delegate'](...Ci)['to'](this),this['chatCapabilities']['init']();const _0x10ea2b=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x10ea2b});const _0x32901a=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x32901a&&await this['setModel'](_0x32901a);}catch(_0x5486d4){const _0x284b48=new _0x3384e8('ai-chat-conversation-init-failed',null,{'message':_0x5486d4['message']||_0x5486d4});_0x284b48['stack']=_0x5486d4['stack'],this['fire']('error',{'error':_0x284b48});}}async['start'](){if(this['isStarted'])throw new _0x3384e8('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x3384e8('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x222ca1}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x222ca1,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x303096){const _0x9326c=new _0x3384e8('ai-chat-conversation-start-failed',null,{'message':_0x303096['message'],'conversationId':this['id']});throw _0x9326c['stack']=_0x303096['stack'],this['fire']('error',{'error':_0x9326c}),_0x9326c;}}async['load'](_0xcc2416,_0x4fbc3a){try{const _0x18be3d=await this['connector']['fetchConversation'](_0xcc2416)['getConversation'](),_0x516058=await this['connector']['fetchConversationMessages'](_0xcc2416)['getMessages'](),_0x526407=_0x516058[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x18be3d['id'],'title'in _0x18be3d?this['fire']('setConversationTitle',_0x18be3d['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x30b7ff=(await this['chatModels']['getAll']())['find'](_0xf6b612=>_0xf6b612['id']['toLowerCase']()===_0x526407['toLowerCase']());return this['selectedModel']=_0x30b7ff,this['fire']('modelSelected',{'selectedModel':_0x30b7ff,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x516058,_0x4fbc3a,_0x526407),this['currentInteraction']=void 0x0,this;}catch(_0xddd5c6){const _0x4ee4ff=new _0x3384e8('ai-chat-conversation-init-from-id-failed',null,{'message':_0xddd5c6['message'],'conversationId':_0xcc2416});throw _0x4ee4ff['stack']=_0xddd5c6['stack'],this['fire']('error',{'error':_0x4ee4ff}),_0x4ee4ff;}}async['_processMessagesToInteractions'](_0x1c6785,_0x3723b5,_0x3af335){let _0x262549;for(const _0x58194c of _0x1c6785)if('user'===_0x58194c['role']){const _0x431d80=await this['_extractContextItems'](_0x58194c),_0x10e7f9={'isReasoningEnabled':Object['hasOwn'](_0x58194c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x58194c['capabilities'],'webSearch')};_0x262549=this['createInteraction']({'userMessage':_0x58194c['prompt'],'contextItems':_0x431d80,'capabilities':_0x10e7f9,'modelId':_0x3af335,'quickActionData':_0x58194c['attributes']?.['quickActionData']}),this['currentInteraction']=_0x262549,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x58194c['role']&&_0x262549)for(const _0x578e84 of _0x58194c['content']){const _0x397626='text'===_0x578e84['type']?'text-delta':'modification-delta',_0x166249=_0x262549['getDocumentContext']()?.['sessionId']!==_0x3723b5;_0x262549['currentReply']=_0x262549['createReply']({'type':_0x397626,'isDone':!0x0,'interactionId':_0x262549['id'],'areActionsDisabled':_0x166249}),_0x262549['currentReply']['appendContent'](_0x578e84['content']);}}}async['_extractContextItems'](_0x2f9134){const _0x3d895c=new Map();if(!_0x2f9134['content'])return _0x3d895c;for(const _0xc646c8 of _0x2f9134['content']){const _0x24e66f=await this['chatContext']['populateFromMessage'](_0xc646c8);_0x24e66f&&_0x3d895c['set'](_0x24e66f['id'],_0x24e66f);}return _0x3d895c;}async['handleUserInteraction']({userMessage:_0x162363,quickActionData:_0x3690da}){if(!this['isStarted'])throw new _0x3384e8('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x3384e8('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5e17be=this['chatContext']['getPendingContextItems'](),_0x372e73=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3b8807=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x162363,'contextItems':_0x5e17be,'capabilities':_0x372e73,'modelId':_0x3b8807,'quickActionData':_0x3690da}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x36b0c8){if(_0x36b0c8 instanceof _0x3384e8)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x36b0c8});else{const _0x3a4c39=Fe['get'](_0x36b0c8['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x3384e8(_0x3a4c39,null,{'error':_0x36b0c8})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x211cb3,contextItems:_0x333e1a,capabilities:_0x169f9a,modelId:_0x1fff79,quickActionData:_0x218db7}){const _0xfdc3f8=new xi({'userMessage':_0x211cb3,'contextItems':_0x333e1a,'capabilities':_0x169f9a,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x1fff79,'quickActionData':_0x218db7});return _0xfdc3f8['delegate'](...wi)['to'](this),this['interactions']['push'](_0xfdc3f8),this['fire']('interactionCreated',_0xfdc3f8),_0xfdc3f8;}['getInteraction'](_0x13bed6){return this['interactions']['find'](_0x4aa8f2=>_0x4aa8f2['id']===_0x13bed6);}['removeInteraction'](_0xf26bf0){const _0x75ed51=this['getInteraction'](_0xf26bf0);_0x75ed51&&(_0x75ed51['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x75ed51),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2c17a7){this['chatContext']['addCurrentDocumentToContext'](_0x2c17a7);}async['updateCurrentDocumentInContext']({content:_0x586a34,version:_0x13af97,sessionId:_0x50de16,selections:_0x141a3b}){await this['chatContext']['updateCurrentDocument'](_0x586a34,_0x13af97,_0x50de16,_0x141a3b);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x40581b){this['chatContext']['addSelectionToContext'](_0x40581b);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x659896){this['chatContext']['addFilesToContext'](_0x659896);}['addUrlToContext'](_0xd2b695){this['chatContext']['addUrlToContext'](_0xd2b695);}['addResourceToContext'](_0x4945ed,_0x5bc793){this['chatContext']['addResourceToContext'](_0x4945ed,_0x5bc793);}['loadSourceResources'](_0x1c3dda,_0x4a3ee2,_0x5e2ba6){return this['chatContext']['loadSourceResources'](_0x1c3dda,_0x4a3ee2,_0x5e2ba6);}['removeFromContext'](_0x28fbd2){this['chatContext']['removeFromContext'](_0x28fbd2);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x152073){_0x152073?!0x1===await this['chatModels']['isAvailable'](_0x152073)&&(_0x586800('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x152073}),_0x152073=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x586800('ai-chat-conversation-set-model-null',{'conversation':this}),_0x152073=(await this['chatModels']['getAvailableModels']())[0x0]),_0x152073['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x152073,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x152073}));}}function q(_0x250266){if(_0x250266 instanceof _0x4999b5)return _0x250266;if(_0x250266?.['editors']&&_0x250266['editors']['get'](0x0))return _0x250266['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.'),_0x250266['editors']['get'](0x0);throw new _0x3384e8('ai-get-editor-from-context-no-editor');}const Z='ai-selection';class S extends _0x36f460{['_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 _0x179238=q(this['context']),_0x3ab861=_0x179238['plugins']['has']('RealTimeCollaborationClient')&&_0x179238['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x3ab861||_0x418744();}return this['_sessionId'];}['getDocumentData'](){const _0x545887=q(this['context']),_0x202f45=_0x545887['model'],_0xbf5d5f=_0x545887['data']['toView'](_0x202f45['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x20f4b7=new Mt(_0x545887['editing']['view']['document']);this['_setDataIdsOnChildren'](_0xbf5d5f,_0x20f4b7);let _0x88f654=_0x545887['data']['processor']['toData'](_0xbf5d5f);const _0x1d20ab=this['_getMarkersInDocumentOrder'](),_0xbc5d2a=[];for(const _0xdcb998 of _0x1d20ab){const _0x513f41='<'+_0xdcb998['name']+':start></'+_0xdcb998['name']+':start>',_0x47212f=_0x88f654['indexOf'](_0x513f41);_0x88f654=_0x88f654['substring'](0x0,_0x47212f)+_0x88f654['substring'](_0x47212f+_0x513f41['length']);const _0x435c55='<'+_0xdcb998['name']+':end></'+_0xdcb998['name']+':end>',_0xa8cf22=_0x88f654['indexOf'](_0x435c55);_0x88f654=_0x88f654['substring'](0x0,_0xa8cf22)+_0x88f654['substring'](_0xa8cf22+_0x435c55['length']),_0xbc5d2a['push']({'markerName':_0xdcb998['name'],'start':_0x47212f,'end':_0xa8cf22,'htmlFragment':_0x88f654['substring'](_0x47212f,_0xa8cf22)});}return{'content':_0x88f654,'version':_0x545887['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0xbc5d2a};}async['afterInit'](){this['context']instanceof _0x4999b5?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1864c0,_0x38731b)=>{_0x38731b['on']('ready',()=>{this['_integrateEditor'](_0x38731b);});});}['_integrateEditor'](_0x221ef5){_0x221ef5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Z,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x221ef5['conversion']['for']('dataDowncast')['markerToElement']({'model':Z,'view':(_0x19d419,{writer:_0x4e142c,options:_0x2b4e22})=>_0x2b4e22['convertAiChatSelectionMarker']?_0x4e142c['createUIElement'](_0x19d419['markerName']+':'+(_0x19d419['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4acfbd,_0x2b0b99,_0x235962=!0x1,_0x38639c=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x38639c)return!0x1;const _0x196622=q(this['context'])['model'];return _0x196622['change'](_0x275966=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x2b0b99,this['_displayedFakeSelectionLocked']=_0x235962;let _0x2ea127=0x0;for(let _0x55edeb of _0x4acfbd){const _0x246c24=Z+':'+_0x2ea127;if(_0x55edeb['start']['isAtEnd']){const _0x11812b=_0x55edeb['start']['getLastMatchingPosition'](({item:_0x606f86})=>!_0x196622['schema']['isContent'](_0x606f86),{'boundaries':_0x55edeb});_0x55edeb=_0x275966['createRange'](_0x11812b,_0x55edeb['end']);}_0x275966['addMarker'](_0x246c24,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x55edeb}),_0x2ea127++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x56ffc8){if(this['_displayedFakeSelectionId']!=_0x56ffc8)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4fafaf=q(this['context']),_0xdb440=_0x4fafaf['model']['markers']['getMarkersGroup'](Z);return _0x4fafaf['model']['change'](_0x930ac4=>{for(const _0x3a3e27 of _0xdb440)_0x930ac4['removeMarker'](_0x3a3e27);}),!0x0;}['modelToViewWithIds'](_0x545780){const _0x5c7dd2=q(this['context']),_0xee6e2=_0x5c7dd2['data']['toView'](_0x545780),_0x37e90a=new Mt(_0x5c7dd2['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xee6e2,_0x37e90a),_0xee6e2;}['_setDataIdsOnChildren'](_0x4003d1,_0x3130a6){let _0xbedece=!0x1;const _0x300048=new Set();for(const _0x21937b of _0x4003d1['getChildren']()){const _0xcbcfc2=_0x21937b['is']('emptyElement')||_0x21937b['is']('containerElement');if(!_0x21937b['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x21937b,_0x3130a6)||_0xcbcfc2)&&(_0x3130a6['setAttribute']('data-id',this['_nextDataId'](_0x300048),_0x21937b),_0xbedece=!0x0);}return _0xbedece;}['_nextDataId'](_0x5ad278){let _0x43060b;do{_0x43060b='';for(let _0x2f6c6b=0x0;_0x2f6c6b<0x4;_0x2f6c6b++)_0x43060b+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x5ad278['has'](_0x43060b));return _0x5ad278['add'](_0x43060b),_0x43060b;}['getSelectionText'](){const {model:_0x408da5}=q(this['context']),_0x33d901=_0x408da5['document']['selection'],_0x22622b=_0x408da5['getSelectedContent'](_0x33d901),_0x7cca05=[],_0x3b8ed2=_0x408da5['createRangeIn'](_0x22622b)['getWalker']();for(const {item:_0x520f2a}of _0x3b8ed2)_0x520f2a['is']('$textProxy')?_0x7cca05['push'](_0x520f2a['data']):_0x520f2a['is']('element')&&_0x7cca05['length']>0x0&&'\x20'!==_0x7cca05[_0x7cca05['length']-0x1]&&_0x7cca05['push']('\x20');return'\x22'+_0x7cca05['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x59a07d=q(this['context'])['model'];return Array['from'](_0x59a07d['markers']['getMarkersGroup'](Z))['sort']((_0x5c581c,_0x2e3bfa)=>_0x5c581c['getStart']()['isBefore'](_0x2e3bfa['getStart']())?-0x1:_0x5c581c['getStart']()['isAfter'](_0x2e3bfa['getStart']())?0x1:0x0);}}const H=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends wt{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x54f099,_0x227f7d){super(_0x54f099),this['_dropdownOriginalConfig']=_0x227f7d||[...H],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x3ee063=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x9d6116({'label':Pn('applySuggestion',_0x54f099,this['_partsCount']),'icon':_0x2eaecc,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x9d6116({'label':Pn('showChangeInText',_0x54f099,this['_partsCount']),'icon':_0x3a7531,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x9d6116({'label':Pn('insertSuggestion',_0x54f099,this['_partsCount']),'icon':_0x18dc33,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x54f099),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x3ee063['if']('isVisible','ck-hidden',_0x4f84d5=>!_0x4f84d5)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x55ad66=>'applySuggestion'!==_0x55ad66):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x54f099);});}['_updateDropdownActions'](_0x259a46){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x259a46),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x3c2452){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x9f5374=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x3c2452):this['_createActionsDropdown'](_0x3c2452),_0x57ac0a=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x9f5374['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x3c2452,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x3c2452,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x57ac0a});for(const _0x36aaf6 of this['_dropdownCurrentConfig'])_0x9f5374['on'](_0x36aaf6,()=>{this['fire'](_0x36aaf6);});return this['_firstRender']=!0x1,_0x9f5374;}['_createActionsButton'](_0x1924cc){const _0x5d5a28=new _0x5c8003(_0x1924cc);return _0x5d5a28['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x5d5a28['on']('execute',()=>{_0x5d5a28['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x5d5a28;}['_createActionsDropdown'](_0x114517){const _0x3d37fe=new Nn(_0x114517,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x29cbf3=>{switch(_0x29cbf3){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x3d37fe['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x114517,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x114517,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x3d37fe['bind']('isEnabled')['to'](this),_0x3d37fe;}['updateLabels'](_0x554803){const _0x555506=this['locale'];this['_partsCount']=_0x554803||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x555506,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x555506,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x555506,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x555506,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x555506,this['_partsCount']);}}class Nn extends _0x35fd09{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x53b49b,_0x2dba06){super(_0x53b49b),this['balloonPanelView']=new _0x43f8f9(this['locale']),this['bodyCollection']=new _0x2c3837(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x2dba06['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x5ebdfc=_0x2dba06['listItemModels'][0x0]['actionName'];this['fire'](_0x5ebdfc),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),_0x5478fb({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x48ebcf){const _0x3d07dc=this['locale'],_0x103fb7=new _0x50cbf8(_0x3d07dc);for(const _0x45ba42 of _0x48ebcf){const _0x3eac83=new _0x47f6ca(_0x3d07dc),_0x181329=new _0xc13ac5(_0x3d07dc);_0x181329['bind'](...Object['keys'](_0x45ba42))['to'](_0x45ba42),_0x181329['delegate']('execute')['to'](_0x103fb7),_0x3eac83['children']['add'](_0x181329),_0x103fb7['items']['add'](_0x3eac83);}return _0x103fb7['items']['delegate']('execute')['to'](this),_0x103fb7['on']('execute',_0x5273e6=>{const _0x19c2d3=_0x5273e6['source'];this['fire'](_0x19c2d3['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x103fb7;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x11d7cc(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x2ca93b,_0x1f7a91)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x1f7a91();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0x2fff67){return{'top':_0x2fff67['bottom'],'left':_0x2fff67['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x18575b,_0x53ebf7){return{'top':_0x18575b['bottom'],'left':_0x18575b['left']-(_0x53ebf7['width']-_0x18575b['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x47b3c0,_0x29c3e4,_0x10de3f){switch(_0x47b3c0){case'applySuggestion':return i(_0x29c3e4,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x10de3f);case'showChangeInText':return i(_0x29c3e4,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x10de3f);case'insertSuggestion':return i(_0x29c3e4,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x10de3f);}}function Hn(_0x44b3a3,_0x48fe7f,_0x2a639f){switch(_0x44b3a3){case'applySuggestion':return i(_0x48fe7f,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x2a639f);case'showChangeInText':return i(_0x48fe7f,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x2a639f);case'insertSuggestion':return i(_0x48fe7f,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x2a639f);}}class oe extends _0xe5b3f8(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x57b64f,availableModels:_0x49878e,defaultModelId:_0x4c697a}){super(),this['_connector']=_0x57b64f,this['_availableModels']=_0x49878e,this['_defaultModelId']=_0x4c697a;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x1ced30=this['_connector']['getModels'](),_0xb886b0=await _0x1ced30['list']();this['_modelList']=_0xb886b0['items'];}catch(_0x1cc349){throw _0x49f6d0('ai-models-unable-to-retrieve',{'error':_0x1cc349}),_0x1cc349;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x34dc52=await this['getAll']();return this['_filterModels'](_0x34dc52,this['_availableModels']);}async['getModel'](_0x471886){const _0x4e5642=await this['getAll']();if(!_0x4e5642['length'])return null;if(_0x471886){const _0x42cf3b=this['_getModelById'](_0x4e5642,_0x471886);if(_0x42cf3b)return _0x42cf3b;_0x586800('ai-chat-model-id-unrecognized',{'modelId':_0x471886,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x4110b3=await this['getAvailableModels']();if(!_0x4110b3['length'])return null;if(this['_defaultModelId']){const _0x3a5041=this['_getModelById'](_0x4110b3,this['_defaultModelId']);if(_0x3a5041)return _0x3a5041;_0x586800('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x4110b3[0x0]['id']});}return _0x4110b3[0x0];}async['isAvailable'](_0x29ef03){return(await this['getAvailableModels']())['some'](_0x12f6d3=>_0x12f6d3['name']===_0x29ef03['name']&&_0x12f6d3['provider']===_0x29ef03['provider']);}['_filterModels'](_0x1b29da,_0x4441bf){let _0x5e8dea;if(_0x4441bf){_0x5e8dea=[];const _0x53a8f8='string'==typeof _0x4441bf?[_0x4441bf['toLocaleLowerCase']()]:_0x4441bf['map'](_0x43b749=>_0x43b749['toLocaleLowerCase']());for(const _0x36a0aa of _0x53a8f8)for(const _0x4c0961 of _0x1b29da)(_0x4c0961['id']['toLocaleLowerCase']()===_0x36a0aa||_0x4c0961['name']['toLocaleLowerCase']()===_0x36a0aa||ze(_0x4c0961)&&'auto'===_0x36a0aa||_0x4c0961['provider']['toLocaleLowerCase']()===_0x36a0aa||_0x4c0961['id']['toLocaleLowerCase']()['startsWith'](_0x36a0aa))&&_0x5e8dea['push'](_0x4c0961);}else _0x5e8dea=_0x1b29da;return _0x5e8dea;}['_getModelById'](_0x51ad27,_0x209849){return _0x51ad27['find'](_0x40d304=>ze(_0x40d304)&&'auto'===_0x209849?_0x40d304:_0x40d304['id']===_0x209849)||null;}static['getLocalized'](_0x1b96b7,_0x19a2ce){return _0x19a2ce['map'](_0x402469=>{if(ze(_0x402469))_0x402469['name']=i(_0x1b96b7,'AI_MODEL_NAME_AUTO'),_0x402469['description']=i(_0x1b96b7,'AI_MODEL_DESCRIPTION_AUTO');else i(_0x1b96b7,'AI_MODEL_DESCRIPTION_'+_0x402469['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x402469['description']=i(_0x1b96b7,'AI_MODEL_DESCRIPTION_'+_0x402469['id']['toUpperCase']()));return _0x402469;});}}function ze(_0x4cd74e){return _0x4cd74e['id']['startsWith']('agent');}class tt extends oe{async['getAll'](){return(await super['getAll']())['sort']((_0x3d4e36,_0x19d283)=>{const _0x16b374=Object['values'](_0x3d4e36['capabilities'])['filter'](_0x633ade=>_0x633ade['enabled'])['length'];return Object['values'](_0x19d283['capabilities'])['filter'](_0x491e5b=>_0x491e5b['enabled'])['length']-_0x16b374;});}}function ot({editor:_0x1a66b8,interaction:_0x224782,reply:_0x28f4c8,groups:_0x55acc9,transform:_0x34373e,documentCompare:_0x4418ce,documentCompareOptions:_0x2bb002}){const _0x277a23=_0x224782['getDocumentContext']();if(!_0x277a23)return[];const _0xa99153=_0x277a23['content'],_0x197c6f=_0x277a23['version'],_0x49d196=_0x28f4c8['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4258be}of _0x55acc9){const _0x50f771=_0x4258be['filter'](_0x9f0569=>'new'!=_0x9f0569['type'])['map'](_0x1a27cf=>pt('data-id',_0x1a27cf['id'],_0x49d196)),_0x42fbf=_0x4258be['filter'](_0x50121c=>'removed'!=_0x50121c['type'])['map'](_0x37d451=>_0x37d451['node']['cloneNode'](!0x0));let _0x4a001e=null;if(_0x50f771['length']){_0x4a001e=_0x50f771[0x0]['previousSibling'];for(let _0x54b547=0x0;_0x54b547<_0x50f771['length'];_0x54b547++)_0x3dc7bd(_0x50f771[_0x54b547]);}if(_0x42fbf['length']){_0x4a001e||(_0x4258be[0x0]['anchorId']?_0x4a001e=pt('data-id',_0x4258be[0x0]['anchorId'],_0x49d196):(_0x4a001e=_0x42fbf['shift'](),_0x74c0d7(_0x49d196,_0x4a001e)));for(let _0x502ae6=0x0;_0x502ae6<_0x42fbf['length'];_0x502ae6++)_0x5e4293(_0x4a001e,_0x42fbf[_0x502ae6]),_0x4a001e=_0x42fbf[_0x502ae6];}}const _0x49b180=lt(_0x49d196),_0x503078=_0x4418ce['getDiff'](_0xa99153,_0x49b180,_0x2bb002)['getOperations']();if(_0x34373e){const _0xa7a8f=_0x1a66b8['model']['document']['history']['getOperations'](_0x197c6f),_0x19349a={'document':_0x1a66b8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return Ot(_0x503078,_0xa7a8f,_0x19349a)['operationsA'];}return _0x503078;}function et(_0x26e6e6,_0x406073){if('marker'!=_0x406073['type'])return;const _0x5439b9=_0x26e6e6['model']['markers']['get'](_0x406073['name']);_0x5439b9&&(_0x406073['oldRange']=_0x5439b9['getRange']());}class Lr extends _0x294050{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x40c3ab,_0x575770={},_0x554791){super(_0x40c3ab),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x575770};const _0x6fb296=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x6fb296?'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'](_0x554791),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x5c8003(this['locale']),this['likeButton']['set']({'icon':_0x38a6d0,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xabafc6=>!_0xabafc6),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5c8003(this['locale']),this['dislikeButton']['set']({'icon':_0x4e9e7c,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x2e8771=>!_0x2e8771),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5c8003(this['locale']),this['copyButton']['set']({'icon':_0x247399,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x54b9ed=>!_0x54b9ed);const _0x27ba42=new _0x314c7c();_0x27ba42['set']({'content':_0x382d3e}),_0x27ba42['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'](_0x27ba42);}['_setupShowChangesButton'](_0x2dab1f){this['showChangesButton']=new _0x5c8003(this['locale']),this['showChangesButton']['set']({'icon':kt,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x2dab1f}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x2ff8fc=>!_0x2ff8fc),this['showChangesButton']['on']('execute',()=>{const _0x5e4dff=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x5e4dff,'icon':_0x5e4dff?_0x24ed8d:kt}),this['fire']('toggleShowChanges',_0x5e4dff);});}}class Dr extends wt{['showChangesToggleView'];constructor(_0x338df8,_0x358c47){super(_0x338df8),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x338df8),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x338df8,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x358c47['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x12fa4a=>_0x12fa4a?_0x8a4b4a:_0x5e9380),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xf69c27=new _0x314c7c();_0xf69c27['content']=_0x39221a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x358c47['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xf69c27,{'tag':'span','children':[i(_0x338df8,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x5c8003{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x12844f){this['options']={'delay':_0x12844f['delay']??0x14,'textNodeStyle':_0x12844f['textNodeStyle'],'onStreamUpdate':_0x12844f['onStreamUpdate']||(()=>{})};}async['stream']({document:_0xc97ef4,targetElement:_0x15f4de,abortSignal:_0x2ed142}){this['isStreaming']&&this['stop'](),_0x2ed142?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x475ed4(_0xc97ef4,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x586800('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x138bc3=0x0;_0x138bc3<this['currentIndex'];_0x138bc3++)this['nodesList'][_0x138bc3]['shouldBeStreamed']=!0x0;let _0x2e0f68=0x0;for(let _0xef9386=this['currentIndex'];_0xef9386<this['nodesList']['length'];_0xef9386++){const _0x1f2530=Date['now'](),_0x354908=this['nodesList'][_0xef9386],_0x536844=_0x1f2530-_0x2e0f68;_0x354908['shouldBeStreamed']=!0x0;let _0x1e9def=_0x354908['parent'];for(;_0x1e9def;)_0x1e9def['shouldBeStreamed']=!0x0,_0x1e9def=_0x1e9def['parent'];if(_0x536844<this['options']['delay'])try{const {promise:_0x2eafed,abortController:_0x4794d7}=pr(this['options']['delay']-_0x536844);this['timeoutAbortController']=_0x4794d7,await _0x2eafed;}catch(_0x2ef3a0){return;}_0x236918(_0x15f4de,'<'+_0x15f4de['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x15f4de['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0xef9386,_0x2e0f68=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x4b3556}){Array['from'](_0x4b3556['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3fc81f=>{_0x3fc81f['replaceWith'](_0x3fc81f['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x12d8f5){let _0x1ad2bb='';if(function(_0x3ec058){return _0x55b786(_0x3ec058);}(_0x12d8f5)){for(const _0xc55945 of _0x12d8f5['children'])_0x1ad2bb+=this['renderNode'](_0xc55945);}else{if(dr(_0x12d8f5)){if(!_0x12d8f5['shouldBeStreamed'])return'';const _0x6e9ec7=_0x12d8f5,_0x1f9a5c=Object['entries'](_0x6e9ec7['attribs'])['map'](([_0x528aee,_0x133a9b])=>_0x528aee+'=\x22'+_0x133a9b+'\x22')['join']('\x20');_0x1ad2bb+='<'+_0x6e9ec7['tagName']+(_0x1f9a5c?'\x20'+_0x1f9a5c:'')+'>';for(const _0x2d851d of _0x5531ba(_0x6e9ec7))_0x1ad2bb+=this['renderNode'](_0x2d851d);_0x1ad2bb+='</'+_0x6e9ec7['tagName']+'>';}else{if(!ar(_0x12d8f5))return'';if(!_0x12d8f5['shouldBeStreamed'])return'';!function(_0x16b73d){if(!_0x16b73d['parent']||!dr(_0x16b73d['parent']))return!0x1;if(!cr['includes'](_0x16b73d['parent']['tagName']))return!0x1;return!_0x59f1f7(_0x16b73d)['match'](/^\s*[<>]\s*$/);}(_0x12d8f5)?_0x1ad2bb+=_0x4c489b(_0x12d8f5):_0x1ad2bb+=_0x4c489b(new _0xfaa538('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x12d8f5]));}}return _0x1ad2bb;}['getParsedDocumentNodeList'](){const _0x1f83be=[];return function(_0x3bf0ef,_0x3e4d3f){const _0x415e22=_0x4a8576=>{if(_0x3e4d3f(_0x4a8576),_0x4a8576 instanceof _0x5c713e)for(let _0x3152ef=0x0;_0x3152ef<_0x4a8576['children']['length'];_0x3152ef++){const _0x40c504=_0x4a8576['children'][_0x3152ef];_0x415e22(_0x40c504);}};for(let _0x501c22=0x0;_0x501c22<_0x3bf0ef['children']['length'];_0x501c22++)_0x415e22(_0x3bf0ef['children'][_0x501c22]);}(this['document'],_0x50b5ae=>{if(ar(_0x50b5ae)){const _0x26d1ed=this['splitTextNodeIntoWordNodes'](_0x50b5ae);_0x26d1ed['length']&&_0x1f83be['push'](..._0x26d1ed);}_0x50b5ae['isWordSplitSource']||_0x50b5ae['isWordSplitResult']||_0x1f83be['push'](_0x50b5ae);}),_0x1f83be;}['splitTextNodeIntoWordNodes'](_0x38e2a0){if(_0x38e2a0['isWordSplitSource']||_0x38e2a0['isWordSplitResult'])return[];const _0x2b7b00=_0x59f1f7(_0x38e2a0)['match'](/(?:\s*\S+\s*)/g),_0x2f2fe2=[];if(_0x2b7b00&&_0x2b7b00['length']>0x1){for(const _0x4fce93 of _0x2b7b00){const _0x25c594=new _0x1b6656(_0x4fce93);_0x25c594['isWordSplitResult']=!0x0,_0x2f9325(_0x38e2a0,_0x25c594),_0x2f2fe2['push'](_0x25c594);}_0x38e2a0['isWordSplitSource']=!0x0,_0x3dc7bd(_0x38e2a0);}return _0x2f2fe2;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x38d058){return _0x3f891f(_0x38d058);}function dr(_0x43c3b4){return _0x53fb25(_0x43c3b4);}function pr(_0x46f511){const _0x34b75f=new AbortController();return{'promise':new Promise((_0x15eda8,_0xbaebc8)=>{const _0xe5c047=setTimeout(_0x15eda8,_0x46f511);_0x34b75f['signal']['addEventListener']('abort',()=>{clearTimeout(_0xe5c047),_0xbaebc8();});}),'abortController':_0x34b75f};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends wt{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x4fa81a,{part:_0x3fab4d,uiIndex:_0x19b21e,areActionsDisabled:_0x3c74fa,availableActions:_0x1f3737}){super(_0x4fa81a),this['set']('partDefinition',_0x3fab4d),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x6bd5b5=>'pending'==_0x6bd5b5&&!_0x3c74fa),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x4fa81a,{'part':_0x3fab4d,'uiIndex':_0x19b21e,'availableActions':_0x1f3737}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x3ed99a=this['bindTemplate'];this['contentView']=new wt(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3ed99a['to']('state',_0x1e64b9=>'ck-ai-suggestion__body__content-part_'+_0x1e64b9),_0x3ed99a['to']('isEnabled',_0x3276a1=>_0x3276a1?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x3ed99a['if']('isVisible','ck-hidden',_0x351ba7=>!_0x351ba7)]},'children':this['children'],'on':{'mouseenter':_0x3ed99a['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3fab4d['index']});}),'mouseleave':_0x3ed99a['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3fab4d['index']});})}});}async['updateContent']({part:_0x5b40c1,renderingStrategy:_0x581080,showUnchangedParts:_0x11a735=!0x1,abortSignal:_0x2b14f3}){this['partDefinition']=_0x5b40c1,this['isVisible']=this['partDefinition']['hasChanges']||_0x11a735,this['isVisible']&&('streaming'===_0x581080?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x2b14f3}):this['contentView']['element']['innerHTML']=lt(this['partDefinition']['content']));}['toggleHeader'](_0x142e4c){_0x142e4c?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends wt{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x32141c,{part:_0x45d656,uiIndex:_0x92c3ed,availableActions:_0x2452a0}){super(_0x32141c),this['set']('partDefinition',_0x45d656),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0xcdf72a=new _0x314c7c();_0xcdf72a['content']=_0x23bdb1,_0xcdf72a['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x33f846=[];if(_0x2452a0['includes']('showChangeInText')){const _0x30a926=new _0x5c8003(_0x32141c);_0x30a926['set']({'label':i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3a7531}),_0x30a926['bind']('isEnabled')['to'](this),_0x30a926['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x45d656['index']});}),_0x33f846['push'](_0x30a926);}if(_0x2452a0['includes']('insertSuggestion')){const _0x930ad1=new _0x5c8003(_0x32141c);_0x930ad1['set']({'label':i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x18dc33}),_0x930ad1['bind']('isEnabled')['to'](this),_0x930ad1['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x45d656['index']});}),_0x33f846['push'](_0x930ad1);}const _0x563155=new _0x5c8003(_0x32141c);_0x563155['set']({'label':i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x94a10e}),_0x563155['bind']('isEnabled')['to'](this),_0x563155['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x45d656['index']});}),_0x33f846['push'](_0x563155),this['_toolbarView']=new _0x294050(_0x32141c),this['_toolbarView']['items']['addMany'](_0x33f846),this['_iconStateAccepted']=new _0x314c7c(),this['_iconStateAccepted']['content']=_0x3ccf4d,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x314c7c(),this['_iconStateRejected']['content']=_0x69b87c,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x314c7c(),this['_iconStateOutdated']['content']=_0x69b87c,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x33cbf6=new wt(_0x32141c);_0x33cbf6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x32141c,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x92c3ed['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0xcdf72a,_0x33cbf6,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',(_0x5e0d95,_0x2b333e,_0x4d64ff,_0x3c0cfc)=>{switch(_0x3c0cfc){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x4d64ff){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class St extends _0xe5b3f8(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x4a0775){const _0x2c38fa=this['createTask'](_0x4a0775);return this['queue']['push'](_0x2c38fa),this['_processQueue'](),_0x2c38fa['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(_0x13e3b2=>{this['once']('_queueEmpty',()=>{_0x13e3b2();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x10c2b0=this['queue']['shift']();try{await _0x10c2b0['callback'](this['_abortController']['signal']),_0x10c2b0['resolve']();}catch(_0x48f582){_0x10c2b0['reject'](_0x48f582);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x27544b){let _0x5cf557,_0x2f4a12;const _0x101043=new Promise((_0x2ca9dd,_0x318a46)=>{_0x5cf557=_0x2ca9dd,_0x2f4a12=_0x318a46;});return{'callback':_0x27544b,'resolve':_0x5cf557,'reject':_0x2f4a12,'completePromise':_0x101043};}}class Fr extends wt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x278323){super();const _0x2d3582=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']=_0x278323,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2d3582['if']('isDone','ck-ai-chat__feed__item_done'),_0x2d3582['if']('isVisible','ck-hidden',_0x5899cf=>!_0x5899cf),'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'](_0x22ed50=>{_0x22ed50['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x596d52,_0x2bd96c,_0x26c2df){await this['htmlStreamer']['stream']({'document':_0x596d52,'targetElement':_0x2bd96c,'abortSignal':_0x26c2df});}}class Me extends Fr{constructor(_0x1d6cbf){super(_0x1d6cbf),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x1d6cbf['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x5bef4a){this['element']['innerHTML']=_0x5bef4a;}}class Tr extends wt{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x255ee8,_0x368bb5){super(_0x255ee8);const {areActionsDisabled:_0x590584,showUnchangedParts:_0xa87d80,availableActions:_0x3a0f65}=_0x368bb5;this['_areActionsDisabled']=_0x590584,this['_showUnchangedParts']=_0xa87d80,this['_availableActions']=_0x3a0f65,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Me({'id':'empty-parts-warning','initialContent':i(_0x255ee8,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x260844,renderingStrategy:_0xff98c5,abortSignal:_0x591268}){this['_children']['length']?_0x260844['forEach'](_0x4e90b0=>{const _0x11fc72=this['_cachedContentParts']['findIndex'](_0x5748db=>_0x5748db['index']==_0x4e90b0['index']);-0x1===_0x11fc72?this['_cachedContentParts']['push'](_0x4e90b0):this['_cachedContentParts'][_0x11fc72]=_0x4e90b0;}):this['_cachedContentParts']=_0x260844;for(const _0x476176 of _0x260844['filter'](_0x228c11=>_0x228c11['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1abf44=>{let _0x5bffe3=this['getPartView'](_0x476176['index']);_0x5bffe3||(_0x5bffe3=new na(this['locale'],{'part':_0x476176,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x5bffe3['delegate'](...Ee)['to'](this),this['_children']['add'](_0x5bffe3),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x5bffe3['toggleHeader'](this['_children']['length']>0x1),await _0x5bffe3['updateContent']({'part':_0x476176,'renderingStrategy':_0xff98c5,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1abf44});});return _0x591268?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x94dd2f,_0x266549){const _0x16063b=this['getPartView'](_0x94dd2f);_0x16063b&&(_0x16063b['state']=_0x266549),this['hasPendingParts']='pending'==_0x266549||Array['from'](this['_children'])['some'](_0x39ebf7=>'pending'==_0x39ebf7['state']);}['getPartView'](_0x347b77){return this['_children']['find'](_0x49129b=>_0x49129b['partDefinition']['index']==_0x347b77)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x412f2b=!this['_cachedContentParts']['find'](({hasChanges:_0x538bea})=>_0x538bea),_0x1bcb9a=!!this['_cachedContentParts']['find'](({hasChanges:_0x58e56a})=>!_0x58e56a);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1bcb9a,_0x412f2b?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x43bce2=>_0x43bce2['partDefinition']['hasChanges']);}}class Pe extends _0x2ac9f7{constructor(_0xdc2399=void 0x0){super();const _0x4f4b2b=_0xdc2399?'ck-ai-spinner_'+_0xdc2399:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4f4b2b]}});}}class _t extends wt{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x1e0c70,_0x41d329){super(_0x1e0c70);const {showDiff:_0x3ecbc5,areActionsDisabled:_0x3f96e6,miniToolbarConfig:_0x392d4f,hideHeader:_0x5d223d,showLoader:_0x15796a,showUnchangedParts:_0x3c5f84,availableActions:_0x264850}=_0x41d329;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x15796a),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x5d223d||(this['headerView']=new Dr(_0x1e0c70,{'showDiff':_0x3ecbc5}),this['headerView']['on']('toggleShowChanges',(_0x5cfeb0,_0x5c8e58)=>{this['areChangesVisible']=_0x5c8e58['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5c8e58['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Tr(_0x1e0c70,{'areActionsDisabled':_0x3f96e6,'showUnchangedParts':!!_0x3c5f84,'availableActions':_0x264850}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0x1e0c70,_0x392d4f,_0x3ecbc5),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x283248,_0x276234)=>{this['areChangesVisible']=_0x276234,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x276234});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x15796a&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4519dc){await this['bodyView']['updateContentParts'](_0x4519dc);}['updateSources'](_0x17d872){this['sourcesView']['children']['addMany'](_0x17d872['map'](_0x114e7d=>new qr(this['locale'],_0x114e7d))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x14a293){if(this['errorView']){const _0x332cbe=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x332cbe&&(_0x332cbe['textContent']=_0x14a293),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x163106){this['miniToolbarView']['items']['add'](_0x163106);}['removeNavigationItem'](_0xc3253c){this['miniToolbarView']['items']['remove'](_0xc3253c);}['_createLoaderView'](){const _0x596142=new wt(this['locale']),_0x3e261c=new Pe('small');_0x3e261c['isVisible']=!0x0;const _0x33c6d9=new wt(this['locale']);return _0x33c6d9['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x596142['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x4867d7=>!_0x4867d7)]},'children':[_0x3e261c,_0x33c6d9]}),_0x596142;}['_createErrorView'](){const _0x4bbde6=new wt(this['locale']),_0x52fde1=new wt(this['locale']);return _0x52fde1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x4bbde6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x577332=>!_0x577332)]},'children':[_0x52fde1]}),_0x4bbde6;}}class Sr extends wt{['children'];constructor(_0x145648){super(_0x145648),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',_0x4d1546=>!_0x4d1546)]},'children':this['children']});const _0x53604a=new wt(this['locale']),_0x21e400=new _0x314c7c();_0x21e400['content']=_0x36dfa2,_0x53604a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x21e400,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x53604a);}}class qr extends _0x5c8003{constructor(_0x1946fb,_0x17beaa){super(_0x1946fb),this['set']({'label':_0x17beaa['title'],'tooltip':_0x17beaa['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x50da45=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x50da45['to'](()=>{window['open'](_0x17beaa['url'],'_blank');})}}),_0x17beaa['favicon']){const _0x1a9a12=new wt(_0x1946fb);_0x1a9a12['setTemplate']({'tag':'img','attributes':{'src':_0x17beaa['favicon']||_0x36dfa2,'alt':_0x17beaa['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1a9a12);}else this['set']('icon',_0x36dfa2);}}class cs extends _0x294050{constructor(_0x2273cd,_0x1627be=!0x0,_0x6b4ea4=!0x0){super(_0x2273cd),this['set']('isLoading',!0x1),_0x1627be&&(this['applyButton']=this['_createButton'](i(_0x2273cd,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5d3c2d=>!_0x5d3c2d),this['items']['add'](this['applyButton'])),_0x6b4ea4&&(this['suggestButton']=this['_createButton'](i(_0x2273cd,'AI_BALLOON_SUGGEST_BUTTON'),_0x1627be?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5cceac=>!_0x5cceac),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x3bb55b,_0x112bc8){const _0x7beac9=new _0x5c8003(this['locale']);return _0x7beac9['set']({'label':_0x3bb55b,'class':_0x112bc8||'','isVisible':!0x0,'withText':!0x0}),_0x7beac9;}}class ls extends wt{constructor(_0x57258b){super(_0x57258b),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(_0x57258b,'AI_DISCLAIMER_TEXT')}]}]});}}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class us{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x42d70b){this['element']=_0x42d70b,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x19a873 of Fs){const _0x2c36a0='keydown'!==_0x19a873;this['element']['addEventListener'](_0x19a873,this['_onUserEvent']['bind'](this),{'passive':_0x2c36a0,'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'](_0x120f1d){if(this['isRunning']){if('keydown'===_0x120f1d['type']){const _0xabf232=_0x120f1d['key'];if(!Us['includes'](_0xabf232))return;}_0x120f1d instanceof WheelEvent?_0x120f1d['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x29c479,scrollHeight:_0x2e8963,clientHeight:_0xe7ece5}=this['element'];return _0x2e8963-_0x29c479-_0xe7ece5<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const N=['applySuggestion','insertSuggestion','showNext','showPrevious'];class B extends wt{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0xaf99c1,_0x46f5d9,_0x20e188,_0x4fc87e){super(_0xaf99c1),this['_availableActions']=_0x20e188,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x4fc87e),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x3b8d6f(),this['keystrokes']=new _0x11d7cc(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x767b6d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new ft(),this['_addContentView'](_0x46f5d9['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x46f5d9['showApplyButton'],_0x46f5d9['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x46f5d9['showApplyButton'],_0x46f5d9['showSuggestButton']);});}['render'](){super['render']();for(const _0x5d78cf of this['_focusables'])this['focusTracker']['add'](_0x5d78cf['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0xf0e39c){-0x1===_0xf0e39c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x35b230){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x35b230,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x48948a){this['showError'](_0x48948a);}['showBlockingError'](_0x3059ea){this['showError'](_0x3059ea),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x241897){const _0x311c51=this['_createNextButtonView'](),_0xa59b79=this['_createPreviousButtonView']();_0x241897['view']['headerView']['children']['add'](_0x311c51,0x2),_0x241897['view']['headerView']['children']['add'](_0xa59b79,0x0),this['_focusables']['addMany']([_0x311c51,_0xa59b79]),this['focusTracker']['add'](_0x311c51['element']),this['focusTracker']['add'](_0xa59b79['element']);}['_addContentView'](_0x3e6a00){this['_mainView']=_0x3e6a00,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x5d8d93){const _0x22f6cb=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x5d8d93,this['_dialogContent']['add'](this['_mainView'],_0x22f6cb),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x3dd15f=!0x0,_0x590bd3=!0x0){_0x3dd15f=_0x3dd15f&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x590bd3=_0x590bd3&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x3dd15f,_0x590bd3),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x388d4e=new _0x5c8003(this['locale']);return _0x388d4e['set']({'icon':Tt,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x388d4e['on']('execute',()=>{this['fire']('showNext');}),_0x388d4e;}['_createPreviousButtonView'](){const _0x33d51a=new _0x5c8003(this['locale']);return _0x33d51a['set']({'icon':Nt,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x33d51a['on']('execute',()=>{this['fire']('showPrevious');}),_0x33d51a;}['_createErrorView'](){const _0x2b0252=new wt(this['locale']),_0xb6e492=new wt(this['locale']);return _0xb6e492['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x2b0252['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x3cb52d=>!_0x3cb52d)]},'children':[_0xb6e492]}),_0x2b0252;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x2ebf19=this['_getScrollableElement']();_0x2ebf19&&!this['scrollManager']&&(this['scrollManager']=new us(_0x2ebf19));}['_getScrollableElement'](){return this['_mainView']instanceof _t&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const z=0xa;class mt extends _0x36f460{static get['requires'](){return[R,S];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x2a615d){const _0x1502f9=q(this['context']);if(this['_config']=_0x2a615d,this['isOpen'])return void this['_updateBalloon'](_0x2a615d);const _0x7b527b=this['context']['config']['get']('ai.availableReplyActions')||[...H],_0x306775=_0x1502f9?.['commands']['get']('trackChanges'),_0x2a14d3=_0x306775?.['value'];this['balloonView']=new B(_0x1502f9['locale'],_0x2a615d,_0x7b527b,!!_0x2a14d3),this['balloonView']['delegate'](...N)['to'](this),_0x306775&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x306775,'value'),this['_showDialog'](_0x2a615d);}['close'](){q(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x49127f){const _0x92882d=q(this['context']),_0x2c7e35=_0x92882d['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x92882d['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x2c7e35['view']?.['headerView']&&(_0x2c7e35['view']['headerView']['label']=_0x49127f['title'],_0x2c7e35['view']['headerView']['iconView']&&_0x49127f['icon']&&(_0x2c7e35['view']['headerView']['iconView']['content']=_0x49127f['icon'])),this['balloonView']['updateContent'](_0x49127f['mainView']),this['_setupVisualSelection'](_0x49127f['ranges'],_0x49127f['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x2c7e35['view']&&_0x2c7e35['view']['updatePosition']();},_0x92882d['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x50376a,_0x423303){this['context']['plugins']['get'](S)['showFakeVisualSelection'](_0x50376a,'ai-balloon-'+_0x423303,!0x0,!0x0);}['_showDialog'](_0x1cd1c6){const _0x11a3af=q(this['context']);this['_setupVisualSelection'](_0x1cd1c6['ranges'],_0x1cd1c6['index']);const _0x233a88=this['_getSelectionElements']();_0x233a88&&_0x233a88[0x0]&&_0x2618c2({'target':_0x233a88[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x11a3af['plugins']['get']('Dialog')['show']({'title':_0x1cd1c6['title'],'icon':_0x1cd1c6['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x1cd1c6['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x573447=>{_0x1cd1c6['showRotator']&&this['balloonView']['setupRotator'](_0x573447),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x4ecfd0,_0x2068f3){if(!_0x2068f3)return null;const _0x1f02be=this['_getSelectionElements']();if(!_0x1f02be||0x0===_0x1f02be['length'])return{'left':Math['round'](_0x2068f3['left']+_0x2068f3['width']/0x2-_0x4ecfd0['width']/0x2),'top':Math['round'](_0x2068f3['top']+_0x2068f3['height']/0x2-_0x4ecfd0['height']/0x2)};const _0x45735f=Math['round'](_0x2068f3['left']+_0x2068f3['width']/0x2-_0x4ecfd0['width']/0x2),_0x491443=new _0x444add(_0x1f02be[0x0]),_0x17f6dd=new _0x444add(_0x1f02be[_0x1f02be['length']-0x1]),_0x5584f0=_0x4ecfd0['height'],_0x3233c3=this['_config']['showRotator']?0x8:0x0;return{'left':_0x45735f,'top':this['_calculateOptimalTopPosition'](_0x491443,_0x17f6dd,_0x5584f0,_0x3233c3,_0x2068f3)};}['_calculateOptimalTopPosition'](_0x1ff34d,_0x4bc6aa,_0x166782,_0x38cf6f=0x0,_0x1cdd7b){const _0x5e1963=_0x166782+_0x38cf6f,_0x339819=new _0x444add(_0x47832a['window']),_0x1ad5cd=[_0x1ff34d['getVisible'](),_0x4bc6aa['getVisible']()]['filter'](_0x30c218=>_0x30c218),_0x24777d=_0x444add['getBoundingRect'](_0x1ad5cd);if(!_0x24777d)return Math['round'](_0x1cdd7b['top']+_0x1cdd7b['height']/0x2);const _0x18b4ce=_0x339819['getIntersection'](_0x24777d);if(!_0x18b4ce)return Math['round'](_0x1cdd7b['top']+_0x1cdd7b['height']/0x2);const _0x61f908=_0x1cdd7b['getVisible'](),_0x6ce6a=_0x61f908&&_0x24777d['height']>_0x61f908['height'],_0x4c043b=_0x18b4ce['top'],_0x86842e=_0x18b4ce['bottom'];if(_0x6ce6a){const _0x434fa9=(_0x61f908||_0x339819)['height']/0x2-_0x5e1963/0x2,_0x290a51=_0x4c043b-z-_0x1cdd7b['top'],_0x7e289=_0x1cdd7b['bottom']-_0x86842e-z;return _0x290a51>=_0x5e1963?Math['max'](z,_0x4c043b-_0x5e1963-z):_0x7e289>=_0x5e1963?_0x86842e+z:Math['max'](z,_0x434fa9);}const _0x413b6f=_0x4c043b-_0x5e1963,_0xedc45a=_0x1cdd7b['bottom']-_0x86842e-z,_0x32f3ab=_0x4c043b-z-_0x1cdd7b['top'];let _0x30e07e;if(_0xedc45a>=_0x5e1963)_0x30e07e=_0x86842e+z;else{if(_0x32f3ab>=_0x5e1963)_0x30e07e=_0x413b6f-z;else _0x30e07e=_0x4c043b+_0x24777d['height']/0x2-_0x5e1963/0x2;}return _0x30e07e;}['_setupMarkerRemovalListener'](){const _0x5df6b9=q(this['context']);this['listenTo'](_0x5df6b9['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x51285e,data:{newRange:_0x4b42ed}}of _0x5df6b9['model']['document']['differ']['getChangedMarkers']())if(_0x51285e['startsWith']('ai-selection:')&&(_0x4b42ed&&(_0x4b42ed['start']['isEqual'](_0x4b42ed['end'])||'$graveyard'==_0x4b42ed['root']['rootName'])||null==_0x4b42ed)){const _0x1ee894=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x1ee894),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x11eab0=q(this['context']);this['stopListening'](_0x11eab0['model']['document']);}['_getSelectionElements'](){const _0x5dbe41=q(this['context']);return _0x5ca2d3(_0x5dbe41['editing'],[..._0x5dbe41['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5dbe41['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class F extends _0x36f460{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[R,mt,it];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new tt({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x6a3755=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xb3fd7c,_0x4e5103)=>{this['_handleUIUserMessage']({'userMessage':_0x4e5103});}),this['listenTo'](_0x6a3755,'resizedTabs',(_0x2abd41,_0x506683)=>{this['_setIsMaximized'](_0x506683);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x6a3755['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x248b28,_0x5e4cd3)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x5e4cd3));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3e1d7f,_0x388e04)=>{this['activeConversation']?.['addUrlToContext'](_0x388e04);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x1aa18b,_0x30810d)=>{this['activeConversation']?.['addResourceToContext'](_0x30810d['source'],_0x30810d['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x19f26a,_0x2346d4)=>{this['_removeFromContext'](_0x2346d4);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x32301b,_0x1053ef)=>{this['activeConversation']?.['loadSourceResources'](_0x1053ef['sourceId'],_0x1053ef['query'],_0x1053ef['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3e7eee,_0x36325f)=>{this['activeConversation']?.['setModel'](_0x36325f);}),this['listenTo'](this['_aiChatUi'],'like',(_0x25ff69,{replyId:_0x224356})=>{console['log']('Liked\x20response',_0x224356);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x33860a,{replyId:_0x449014})=>{console['log']('Disliked\x20response',_0x449014);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x383490,_0x1bb672)=>{this['context']['plugins']['get'](mt)['close'](),this['_insertSuggestion'](_0x1bb672);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x13ae59,{replyId:_0x3ee50d,partIndex:_0x2f9c18})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3ee50d,_0x2f9c18);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2a8763,{replyId:_0x5b4e6d,partIndex:_0x338f15})=>{const _0x189716=this['_getDocumentRangeForReplyChanges'](_0x5b4e6d,_0x338f15);_0x189716&&'$graveyard'!=_0x189716['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x189716['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x197a94,_0x1626c8)=>{this['context']['plugins']['get'](mt)['close'](),this['_applySuggestion'](_0x1626c8);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xedf0b,{replyId:_0x45063a,showDiff:_0x203186})=>{const {reply:_0x56684b}=this['getInteractionAndReplyById'](_0x45063a),_0x392e57=_0x56684b['getContentParts']({'showDiff':_0x203186});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x56684b['id'],'parts':_0x392e57,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x22e872,{replyId:_0x59f50b,partIndex:_0x4eee71})=>{this['_previewedChangeGroup']?.['replyId']==_0x59f50b&&this['_previewedChangeGroup']?.['partIndex']==_0x4eee71&&this['context']['plugins']['get'](mt)['close']();const {reply:_0x5c0a82}=this['getInteractionAndReplyById'](_0x59f50b);_0x5c0a82['setChangeGroupState'](_0x4eee71,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _0x4999b5?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x42f0cc,_0x37227b)=>{_0x37227b['on']('ready',()=>{this['_integrateEditor'](_0x37227b);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x1d594c){const _0x361ee5=q(this['context']);if(!_0x361ee5['plugins']['has']('TrackChanges'))throw new _0x3384e8('ai-no-track-changes',null);const _0x2ff07f=this['context']['plugins']['get']('DocumentCompare'),{reply:_0xef6bc4,interaction:_0x15968c}=this['getInteractionAndReplyById'](_0x1d594c['replyId']),_0x35a597=this['_getDocumentRangeForReplyChanges'](_0x1d594c['replyId'],_0x1d594c['partIndex']),_0x4211c7=void 0x0!==_0x1d594c['partIndex']?[_0xef6bc4['changeGroups'][_0x1d594c['partIndex']]]:_0xef6bc4['changeGroups']['filter'](_0x5e3f8f=>'pending'==_0x5e3f8f['state']),_0x418927=_0x4211c7['map'](_0x573e2d=>_0xef6bc4['changeGroups']['indexOf'](_0x573e2d));if(!_0x35a597||'$graveyard'==_0x35a597['range']['root']['rootName'])return void _0x418927['forEach'](_0x5cc369=>_0xef6bc4['setChangeGroupState'](_0x5cc369,'outdated'));_0x418927['forEach'](_0x4a7b09=>_0xef6bc4['setChangeGroupState'](_0x4a7b09,'accepted'));const _0x4944ac=ot({'editor':_0x361ee5,'reply':_0xef6bc4,'interaction':_0x15968c,'groups':_0x4211c7,'transform':!0x0,'documentCompare':_0x2ff07f,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x3daaa2;_0x35a597&&this['_scrollToSuggestionRange'](_0x35a597['range']),_0x361ee5['model']['change'](_0x26cbaf=>{_0x3daaa2=_0x26cbaf['batch'],_0x361ee5['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4944ac),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x3daaa2,{'interactionId':_0x15968c['id'],'replyId':_0xef6bc4['id'],'indexes':_0x418927['slice']()}),this['_updateRatings'](_0xef6bc4);}['_applySuggestion'](_0x5b95b8){const _0x587f68=q(this['context']),_0x12bc0a=this['context']['plugins']['get'](it),{reply:_0x2dfbbc,interaction:_0x571416}=this['getInteractionAndReplyById'](_0x5b95b8['replyId']),_0x4d0484=this['_getDocumentRangeForReplyChanges'](_0x5b95b8['replyId'],_0x5b95b8['partIndex']),_0x47e0b5=void 0x0!==_0x5b95b8['partIndex']?[_0x2dfbbc['changeGroups'][_0x5b95b8['partIndex']]]:_0x2dfbbc['changeGroups']['filter'](_0x509aaa=>'pending'==_0x509aaa['state']),_0xa95673=_0x47e0b5['map'](_0x2a081a=>_0x2dfbbc['changeGroups']['indexOf'](_0x2a081a));if(!_0x4d0484||'$graveyard'==_0x4d0484['range']['root']['rootName'])return void _0xa95673['forEach'](_0x36c9d3=>_0x2dfbbc['setChangeGroupState'](_0x36c9d3,'outdated'));_0xa95673['forEach'](_0x3d9ee5=>_0x2dfbbc['setChangeGroupState'](_0x3d9ee5,'accepted'));const _0xfb0ed1=ot({'editor':_0x587f68,'reply':_0x2dfbbc,'interaction':_0x571416,'groups':_0x47e0b5,'transform':!0x0,'documentCompare':_0x12bc0a,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x3dc654;_0x4d0484&&this['_scrollToSuggestionRange'](_0x4d0484['range']),_0x587f68['model']['change'](_0x2a6c65=>{_0x3dc654=_0x2a6c65['batch'];for(const _0x4804bf of _0xfb0ed1)_0x4804bf['baseVersion']=_0x587f68['model']['document']['version'],et(_0x587f68,_0x4804bf),_0x2a6c65['batch']['addOperation'](_0x4804bf),_0x587f68['model']['applyOperation'](_0x4804bf);}),this['_batchToChanges']['set'](_0x3dc654,{'interactionId':_0x571416['id'],'replyId':_0x2dfbbc['id'],'indexes':_0xa95673['slice']()}),this['_updateRatings'](_0x2dfbbc);}['_openBalloonFor'](_0x12bc6d,_0x582dd8){const _0x5af51a=q(this['context']),_0x190bd1=this['_getDocumentRangeForReplyChanges'](_0x12bc6d,_0x582dd8),_0x591119=this['context']['plugins']['get'](mt);if(!_0x190bd1)return void _0x591119['close']();const {range:_0x22b5c4,currentIndex:_0x303abc}=_0x190bd1;if('$graveyard'==_0x22b5c4['root']['rootName']){const {reply:_0x31facb}=this['getInteractionAndReplyById'](_0x12bc6d);return _0x31facb['setChangeGroupState'](_0x303abc,'outdated'),void _0x591119['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x12bc6d&&this['_previewedChangeGroup']?.['partIndex']==_0x303abc)return;this['stopListening'](_0x591119),this['_previewedChangeGroup']={'replyId':_0x12bc6d,'partIndex':_0x303abc};let _0x1a99e6=_0x5af51a['config']['get']('ai.availableReplyActions')||[...H];_0x5af51a['plugins']['has']('TrackChanges')||(_0x1a99e6=_0x1a99e6['filter'](_0x29c08e=>'insertSuggestion'!=_0x29c08e));const _0x17488c=new _t(_0x5af51a['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x1a99e6});this['stopListening'](_0x17488c);const {reply:_0x2dc7f2}=this['getInteractionAndReplyById'](_0x12bc6d),_0x2066f8=_0x2dc7f2['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x3109e8=>_0x3109e8['hasChanges']),_0x53d351=_0x2066f8['findIndex'](_0x56d406=>_0x56d406['index']==_0x303abc);if(-0x1==_0x53d351)return;const _0x283f6b=_0x2066f8[_0x53d351],_0x26eb7e=_0x2066f8['at']((_0x53d351-0x1)%_0x2066f8['length'])?.['index'],_0x185e4c=_0x2066f8['at']((_0x53d351+0x1)%_0x2066f8['length'])?.['index'];_0x17488c['updateContent']({'parts':[_0x283f6b],'renderingStrategy':'static'});const _0x28a2df=_0x303abc!==_0x26eb7e;this['_scrollToSuggestionRange'](_0x22b5c4,!0x0),_0x591119['open']({'index':_0x303abc,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x53d351+0x1)['toString']()),'icon':ut,'mainView':_0x17488c,'showRotator':_0x28a2df,'showApplyButton':!0x0,'showSuggestButton':_0x5af51a['plugins']['has']('TrackChanges'),'ranges':[_0x22b5c4]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x12bc6d,_0x303abc),this['listenTo'](_0x17488c,'toggleSuggestionDisplayMode',(_0x3270e4,{showDiff:_0x25aca1})=>{this['_balloonShowDiff']=_0x25aca1;const {reply:_0x4c48b7}=this['getInteractionAndReplyById'](_0x12bc6d),_0x33653f=_0x4c48b7['getContentParts']({'showDiff':_0x25aca1,'groupIndex':_0x303abc});_0x17488c['updateContent']({'parts':_0x33653f,'renderingStrategy':'static'});}),this['listenTo'](_0x591119,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x12bc6d,'partIndex':_0x303abc}),_0x28a2df?this['_openBalloonFor'](_0x12bc6d,_0x185e4c):_0x591119['close']();}),this['listenTo'](_0x591119,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x12bc6d,'partIndex':_0x303abc}),_0x28a2df?this['_openBalloonFor'](_0x12bc6d,_0x185e4c):_0x591119['close']();}),_0x28a2df&&(this['listenTo'](_0x591119,'showNext',()=>{this['_openBalloonFor'](_0x12bc6d,_0x185e4c);}),this['listenTo'](_0x591119,'showPrevious',()=>{this['_openBalloonFor'](_0x12bc6d,_0x26eb7e);})),this['listenTo'](_0x591119,'dialogClosed',()=>{this['stopListening'](_0x591119),this['stopListening'](_0x17488c),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x5019f1,_0x3682c8){const _0xdef65e=q(this['context']),{reply:_0x5401f2,interaction:_0x4f1f36}=this['getInteractionAndReplyById'](_0x5019f1),_0x4f6305=_0x5401f2['changeGroups']['filter'](_0x5f3943=>'pending'==_0x5f3943['state']),_0x5297b2=_0x4f6305['map'](_0x41a683=>_0x5401f2['changeGroups']['indexOf'](_0x41a683));void 0x0===_0x3682c8&&(_0x3682c8=_0x5297b2[0x0]);const _0x45704d=_0x5297b2['indexOf'](_0x3682c8);if(-0x1==_0x45704d)return null;const _0x3066f1=_0x4f6305[_0x45704d],_0x160514=new gt([]),_0x166acd=new gt([]);for(const _0x3486ea of _0x3066f1['changes'])if('removed'!=_0x3486ea['type']&&_0x166acd['children']['push'](_0x3486ea['node']['cloneNode'](!0x0)),'new'!=_0x3486ea['type']){const _0x370d3f=ct(_0x42e79e=>dt(_0x42e79e,'data-id')==_0x3486ea['id'],_0x5401f2['documentContextContent'],!0x0);_0x160514['children']['push'](_0x370d3f['cloneNode'](!0x0));}if(0x0==_0x160514['children']['length']){if(_0x3066f1['changes'][0x0]['anchorId']){const _0x5797bd=pt('data-id',_0x3066f1['changes'][0x0]['anchorId'],_0x5401f2['documentContextContent']);_0x160514['children']['unshift'](_0x5797bd['cloneNode'](!0x0)),_0x166acd['children']['unshift'](_0x5797bd['cloneNode'](!0x0)),_0x5797bd['nextSibling']&&(_0x160514['children']['push'](_0x5797bd['nextSibling']['cloneNode'](!0x0)),_0x166acd['children']['push'](_0x5797bd['nextSibling']['cloneNode'](!0x0)));}else{const _0x1011b4=_0x5401f2['documentContextContent']['children'][0x0];if(!_0x1011b4)return null;_0x160514['children']['push'](_0x1011b4['cloneNode'](!0x0)),_0x166acd['children']['push'](_0x1011b4['cloneNode'](!0x0));}}const _0x5ba24f=_0x4f1f36['getDocumentContext'](),_0x54f547=_0xdef65e['data']['parse'](_0x5ba24f['content']),_0x2df3f9=lt(_0x160514),_0x492522=_0xdef65e['data']['parse'](_0x2df3f9),_0x105abb=_0xdef65e['data']['parse'](_0x2df3f9),_0x2f3720=_0xdef65e['model']['createPositionAt'](_0x492522,0x0),_0x115645=lt(_0x166acd),_0x3ff870={'anchor':_0x2f3720,'markDeletions':!0x1},_0x2e86ee=_0xdef65e['plugins']['get'](it)['getDiff'](_0x2df3f9,_0x115645,_0x3ff870)['getOperations']();if(!_0x2e86ee['length'])return null;_0xdef65e['model']['change'](_0x52c751=>{for(const _0x317e47 of _0x2e86ee)if('remove'==_0x317e47['type']){const _0x406c41=_0x317e47['sourcePosition'],_0x3ef912=_0x317e47['howMany'],_0x4d13b1=new ht(_0x406c41,_0x3ef912);_0x52c751['batch']['addOperation'](_0x4d13b1),_0xdef65e['model']['applyOperation'](_0x4d13b1);}else'marker'!==_0x317e47['type']&&(_0x317e47['baseVersion']=null,_0x317e47['isDocumentOperation']=!0x1,_0x52c751['batch']['addOperation'](_0x317e47),_0xdef65e['model']['applyOperation'](_0x317e47));});const _0x2d8266=rt(_0xdef65e,_0x2e86ee,_0x492522);at(_0xdef65e['model'],_0x2d8266);const _0x498a99=_0x2d8266['getFirstRange']()['start']['path']['slice'](),_0x632e2a=_0x2d8266['getFirstRange']()['end']['path']['slice'](),_0x10dfce=[];let _0x5b8f0e=_0x492522,_0x36de2e=_0x105abb;for(let _0x3d0feb=0x0;_0x3d0feb<_0x632e2a['length'];_0x3d0feb++){const _0x3e5933=_0x5b8f0e['maxOffset']-_0x632e2a[_0x3d0feb];_0x10dfce[_0x3d0feb]=_0x36de2e['maxOffset']-_0x3e5933,_0x5b8f0e=_0x5b8f0e['getChildAtOffset'](_0x632e2a[_0x3d0feb]),_0x36de2e=_0x36de2e['getChildAtOffset'](_0x10dfce[_0x3d0feb]);}const _0x371566=_0xdef65e['model']['createRange'](_0xdef65e['model']['createPositionFromPath'](_0x105abb,_0x498a99),_0xdef65e['model']['createPositionFromPath'](_0x105abb,_0x10dfce)),_0x2e323c=_0x105abb['getChild'](0x0)['getAttribute'](st),_0x8d956=Array['from'](_0x54f547['getChildren']())['find'](_0x18ef10=>_0x18ef10['getAttribute'](st)==_0x2e323c)['getPath'](),_0x18515c=_0x371566['start']['path']['slice'](),_0x240b34=_0x371566['end']['path']['slice']();_0x18515c[0x0]=_0x8d956[0x0]+_0x18515c[0x0],_0x240b34[0x0]=_0x8d956[0x0]+_0x240b34[0x0];let _0x5db948=_0xdef65e['model']['createRange'](_0xdef65e['model']['createPositionFromPath'](_0xdef65e['model']['document']['getRoot'](),_0x18515c),_0xdef65e['model']['createPositionFromPath'](_0xdef65e['model']['document']['getRoot'](),_0x240b34));const _0xd676cb=_0xdef65e['model']['document']['history']['getOperations'](_0x5ba24f['version']);for(const _0x4db267 of _0xd676cb)_0x5db948=nt['_createFromRanges'](_0x5db948['getTransformedByOperation'](_0x4db267));return{'range':_0x5db948,'currentIndex':_0x3682c8};}['_integrateEditor'](_0x3d9d3d){if(!_0x3d9d3d['plugins']['has']('Undo'))return;const _0x5d07b7=_0x3d9d3d['commands']['get']('undo'),_0x122e23=_0x3d9d3d['commands']['get']('redo');this['listenTo'](_0x5d07b7,'revert',(_0x3bd657,_0x973e2f,_0x377b85)=>{const _0x475c49=this['_batchToChanges']['get'](_0x973e2f);if(!_0x475c49)return;const _0x91b003=this['activeConversation']['getInteraction'](_0x475c49['interactionId'])['getReply'](_0x475c49['replyId']);_0x475c49['indexes']['forEach'](_0x45fac7=>_0x91b003['setChangeGroupState'](_0x45fac7,'pending')),this['_batchToChanges']['delete'](_0x973e2f),this['_batchToChanges']['set'](_0x377b85,_0x475c49);}),this['listenTo'](_0x122e23,'revert',(_0x42a71f,_0x5dfc1d,_0x445664)=>{const _0x445be2=this['_batchToChanges']['get'](_0x5dfc1d);if(!_0x445be2)return;const _0xcd8eba=this['activeConversation']['getInteraction'](_0x445be2['interactionId'])['getReply'](_0x445be2['replyId']);_0x445be2['indexes']['forEach'](_0x31f6dc=>_0xcd8eba['setChangeGroupState'](_0x31f6dc,'accepted')),this['_batchToChanges']['delete'](_0x5dfc1d),this['_batchToChanges']['set'](_0x445664,_0x445be2);});}async['loadConversation'](_0x23c77f){this['context']['plugins']['get'](mt)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0x23c77f)['getConversation'](),await this['_startConversationSafely'](_0x23c77f),this['updateConversationTitle']('\x20');const {sessionId:_0x102cf4}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x23c77f,_0x102cf4),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x594e42){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x23c77f}),this['_logError'](new _0x3384e8('ai-chat-conversation-not-found',this,{'error':_0x594e42}));}finally{this['context']['plugins']['get'](Y)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x3e63fa){this['activeConversation']['id']===_0x3e63fa&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x28bfb8=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x28bfb8),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x266c25,quickActionData:_0x7a3f14}){await this['_handleUIUserMessage']({'userMessage':_0x266c25,'quickActionData':_0x7a3f14});}['getGroupId'](){const _0x90bd61=this['context']['config']['get']('collaboration.channelId');if(!_0x90bd61)throw new _0x3384e8('ai-chat-missing-channel-id',this);return _0x90bd61;}async['_startConversationSafely'](_0x264263){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x264263);}catch(_0x4db8ac){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x264263||_0x418744()}),console['error'](_0x4db8ac),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x50031c){const _0x38ba70=this['context']['plugins']['get'](mt);let _0x597bfd;_0x38ba70['isOpen']&&_0x38ba70['close'](),_0x50031c||!this['activeConversation']?_0x597bfd=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x597bfd=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x53b9df=this['getGroupId'](),_0x52c3ea=_0x50031c||_0x418744();this['activeConversation']=new Q({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x597bfd,'conversationId':_0x52c3ea,'group':_0x53b9df,'getEditor':()=>q(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x249d94,_0x48864e)=>{this['_aiChatUi']['createConversation'](_0x48864e),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x50031c||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x35a674,_0x5cff88)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5cff88['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x22f9b1,_0x19e9bc)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x19e9bc);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x557a4c,_0x27664f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x27664f,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x17ebd3,_0x1273b9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1273b9,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3a2e47,_0x4c77b1)=>{this['_aiChatUi']['removeFeedInteraction'](_0x4c77b1['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x308e02,_0x28d4e8,_0x54c5fe)=>{this['updateConversationTitle'](_0x28d4e8,_0x54c5fe);}),this['activeConversation']['on']('replyCreated',(_0x5e1a07,_0x28d9f7)=>{'text-delta'===_0x28d9f7['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x28d9f7):this['_aiChatUi']['addFeedItemAISuggestion'](_0x28d9f7);}),this['activeConversation']['on']('replyContentUpdated',async(_0x27e4b4,_0x1700fb)=>{await this['_updateReplyContent']({'reply':_0x1700fb});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x1faa5c,{reply:_0x16863f,index:_0x56fa99,state:_0x3be3d4})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x16863f['id'],'index':_0x56fa99,'state':_0x3be3d4});}),this['activeConversation']['on']('contextItemAdded',(_0x305e01,_0x516f1f)=>{if(this['_aiChatUi']['addContextItem'](_0x516f1f['contextItem'],_0x516f1f['isLoading']),'selection'===_0x516f1f['contextItem']['type']){const _0x2e0107=[...q(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x2e0107,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x44700b,_0x1b5c11)=>{this['_aiChatUi']['removeContextItem'](_0x1b5c11['uiId']),'current-document'==_0x1b5c11['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1b5c11['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x4f9181,_0x4bc9ec)=>{this['_aiChatUi']['setContextItemLoading'](_0x4bc9ec['contextItem']['uiId'],_0x4bc9ec['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x165a6e,_0x3db4d3)=>{this['_aiChatUi']['setConversationContext'](_0x3db4d3['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x22985c,_0x5c2dfd)=>{this['_aiChatUi']['setAddContextOptions'](_0x5c2dfd['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2fd863,_0x5d9b99)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5d9b99['sourceId'],_0x5d9b99['source'],_0x5d9b99['resources'],_0x5d9b99['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x55df17,_0x2d882d)=>{this['_aiChatUi']['updateResourceState'](_0x2d882d['sourceId'],_0x2d882d['resourceId'],_0x2d882d['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xf40034,_0x5dbe53)=>{this['_aiChatUi']['updateCapabilities'](_0x5dbe53);}),this['activeConversation']['on']('modelSelected',(_0x3ef530,_0x24cb04)=>{this['_aiChatUi']['setSelectedModel'](_0x24cb04['selectedModel'],_0x24cb04['isDisabled']);}),this['activeConversation']['on']('error',(_0x4e4ff7,{error:_0x4c42f4,interactionId:_0x1a0e45,fileName:_0x337e6a,url:_0xb72053,sourceId:_0x3febe1,sourceLabel:_0x395bd0})=>{const _0x3e2b04=_0x1a0e45?_0x1a0e45+':'+_0x418744():_0x418744();_0x4c42f4['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3e2b04}):_0x4c42f4['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4c42f4['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x337e6a),'id':_0x3e2b04}):_0x4c42f4['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0xb72053),'id':_0x3e2b04}):_0x4c42f4['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3e2b04}):_0x4c42f4['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3e2b04}):_0x4c42f4['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3febe1&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3febe1),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x395bd0||'source'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['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':_0x3e2b04}),this['_logError'](_0x4c42f4)):_0x4c42f4['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':_0x3e2b04}),this['_logError'](_0x4c42f4)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3e2b04}),this['_logError'](_0x4c42f4));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x50031c||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x3463a4,quickActionData:_0x1f9315}){if(!this['activeConversation'])throw new _0x3384e8('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x3463a4,'quickActionData':_0x1f9315}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x477a6a=q(this['context'])['model'],_0x3e5dc5=Array['from'](_0x477a6a['markers']['getMarkersGroup'](Z));_0x477a6a['change'](_0x84a51c=>{_0x3e5dc5['forEach'](_0x5968c4=>_0x84a51c['removeMarker'](_0x5968c4));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x551c5b){this['_aiChatUi']['setIsMaximized'](_0x551c5b);}['_logError'](_0x90f46e){_0x49f6d0(_0x90f46e['message']);}['_removeFromContext'](_0x5efc67){this['activeConversation']?.['removeFromContext'](_0x5efc67);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x31cc73){const [_0x570a88,_0x4a83c4]=_0x31cc73['split'](':'),_0x4d6050=this['activeConversation']['getInteraction'](_0x570a88),_0x47b70f=_0x4d6050['getReply'](_0x4a83c4);return{'interaction':_0x4d6050,'reply':_0x47b70f};}['_scrollToSuggestionRange'](_0x445a7a,_0xe7154a=!0x1){const _0x463204=q(this['context']),_0x2dfaa9={'target':_0x463204['editing']['view']['domConverter']['viewRangeToDom'](_0x463204['editing']['mapper']['toViewRange'](_0x445a7a)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0xe7154a};_0xe7154a&&(_0x2dfaa9['alignToTop']=!0x0),_0x2618c2(_0x2dfaa9);}['updateConversationTitle'](_0x1e34eb,_0x110ee3=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1e34eb||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x110ee3);}async['_updateReplyContent']({reply:_0x3a4059,renderingStrategy:_0x256761}){const {id:_0x2ae432,isDone:_0x4e6ce,type:_0x2aa7bb,parsedContent:_0x429eb0}=_0x3a4059;if('modification-delta'===_0x2aa7bb){const _0x393d84=_0x3a4059['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2ae432,'parts':_0x393d84,'renderingStrategy':_0x256761,'isDone':_0x4e6ce});}else'text-delta'===_0x2aa7bb&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x2ae432,'parsedContent':_0x429eb0,'renderingStrategy':_0x256761,'isDone':_0x4e6ce});_0x4e6ce&&_0x3a4059['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x2ae432,_0x3a4059['sources']);}async['_stopLastInteraction'](){const _0x25f43f=this['activeConversation']?.['lastInteraction'];_0x25f43f&&(_0x25f43f['stop'](),this['_aiChatUi']['stopInteraction'](_0x25f43f));}async['_flushLastInteractionUI'](){const _0x40e01a=this['activeConversation']?.['lastInteraction'];if(_0x40e01a){for await(const _0x5bc7d2 of _0x40e01a['replies'])await this['_updateReplyContent']({'reply':_0x5bc7d2,'renderingStrategy':'static'});}}['_updateRatings'](_0xa195ab){const _0x2ba4fb={'positiveCount':_0xa195ab['changeGroups']['filter'](_0x2cf76c=>'accepted'===_0x2cf76c['state'])['length'],'totalCount':_0xa195ab['changeGroups']['length'],'modificationId':_0xa195ab['id']},_0x227248=this['activeConversation']['getInteraction'](_0xa195ab['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x227248,_0x2ba4fb);}}const Rt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class je extends Fr{['containerView'];['actionsView'];constructor(_0x41dd4f,_0x1c5dfd){super(_0x1c5dfd),this['set']('isTrackChangesOn',!0x1),this['containerView']=new _t(_0x41dd4f,{'showDiff':_0x1c5dfd['showDiff'],'areActionsDisabled':_0x1c5dfd['areActionsDisabled'],'availableActions':_0x1c5dfd['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3c741b,_0x51c4f9)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x51c4f9['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x17ab77,{index:_0x4e0615})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x4e0615});}),this['containerView']['on']('insertSuggestion',(_0x25df1f,{index:_0x2e5f7b})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2e5f7b});}),this['containerView']['on']('rejectSuggestion',(_0x59509d,{index:_0x96a9d8})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x96a9d8});}),this['containerView']['on']('mouseOverSuggestion',(_0x50dd93,{index:_0x3a57b4})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3a57b4});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x411569,{index:_0x9dab3})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x9dab3});}),this['actionsView']=new ah(_0x41dd4f,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x1c5dfd['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x28495b){await this['containerView']['updateContent'](_0x28495b),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x4b63b0,_0xc4f4){this['containerView']['bodyView']['updatePartState'](_0x4b63b0,_0xc4f4);}['updateSources'](_0x3776a8){this['containerView']['updateSources'](_0x3776a8);}['getPartView'](_0x5675d8){return this['containerView']['bodyView']['getPartView'](_0x5675d8);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Le extends Fr{['replyContainer'];constructor(_0xffd926,_0x1a4813){super(_0x1a4813),this['locale']=_0xffd926,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new wt(),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':Be(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x26e706,renderingStrategy:_0x4b09f0,abortSignal:_0x5a9b81}){'streaming'===_0x4b09f0?await this['streamIntoElement'](_0x26e706,this['replyContainer']['element'],_0x5a9b81):this['replyContainer']['element']['innerHTML']=_0x4c489b(_0x26e706);}['updateSources'](_0x40b378){const _0x438a7a=new Sr(this['locale']);_0x438a7a['children']['addMany'](_0x40b378['map'](_0x45515a=>new qr(this['locale'],_0x45515a))),_0x438a7a['isVisible']=!0x0,this['children']['add'](_0x438a7a);}}const xn={'file':_0x15b10c,'document':_0x314ba7,'web-resource':_0x228b90,'text':_0x15b10c,'selection':_0x85bd51},$r='ck-ai-chat-context-chip',Zr='ck-ai-chat-context-chip_wide',ra='ck-ai-chat-context-chip_document',oa='ck-ai-chat-context-chip__label',ca='ck-ai-chat-context-chip__type-icon',la='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Bo extends _0x5c8003{constructor(_0x300350,_0x2ef584,_0xafd6cc,_0x458411,_0x499eeb=!0x1){super(_0x300350),this['_isAnimationOnEnterEnabled']=_0x458411,this['_initializeProperties'](_0x2ef584,_0xafd6cc,_0x499eeb),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'](_0x564e77,_0xd83008,_0x3eb713){this['set']('label',_0x564e77['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x564e77['type']),this['set']('id',_0x564e77['uiId']),this['set']('readonly',_0xd83008),this['set']('isLoading',_0x3eb713);}['_setupTemplate'](){const _0xf8495e=this['_createIconView'](),_0x6ce1cc=this['_createRemoveButton'](),_0x39f09b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x39f09b),'children':this['_createTemplateChildren'](_0xf8495e,_0x6ce1cc,_0x39f09b)});}['_createTemplateAttributes'](_0xfac173){return{'class':[$r,_0xfac173['if']('itemType',ra,_0x4b95ed=>'document'==_0x4b95ed),_0xfac173['if']('itemType',Zr,_0x129846=>'selection'==_0x129846)],'data-cke-tooltip-text':_0xfac173['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':la};}['_createTemplateChildren'](_0x1b40a2,_0x5cc30e,_0x5c038a){const _0xe82d46=this['_createLabelElement'](_0x5c038a),_0x5ab1a4=this['_createLoaderIcon']();return this['readonly']?[_0x1b40a2,_0xe82d46]:[_0x1b40a2,_0x5ab1a4,_0xe82d46,_0x5cc30e];}['_createLabelElement'](_0x4615de){return{'tag':'span','attributes':{'class':oa},'children':[{'text':_0x4615de['to']('label')}]};}['_createRemoveButton'](){const _0x326988=new _0x5c8003(this['locale']);return _0x326988['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xaaa2ee}),this['_setupRemoveButtonEvent'](_0x326988),_0x326988;}['_setupRemoveButtonEvent'](_0xb2cd6a){_0xb2cd6a['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x6ad08c=this['bindTemplate'],_0x115bec=new _0x314c7c();return _0x115bec['content']=xn[this['itemType']],_0x115bec['extendTemplate']({'attributes':{'class':[ca,_0x6ad08c['if']('isLoading','ck-hidden',_0x266cb6=>_0x266cb6)]}}),_0x115bec;}['_handleAnimationEndOnce'](_0x26a421,_0x5c8a5e){if(!_0x26a421)return;const _0x3b7d1a=()=>{_0x5c8a5e(),_0x26a421['removeEventListener']('animationend',_0x3b7d1a),_0x26a421['removeEventListener']('webkitAnimationEnd',_0x3b7d1a);};_0x26a421['addEventListener']('animationend',_0x3b7d1a),_0x26a421['addEventListener']('webkitAnimationEnd',_0x3b7d1a);}['_createLoaderIcon'](){const _0x1acb04=new Pe('small');return _0x1acb04['bind']('isVisible')['to'](this,'isLoading',_0x132232=>_0x132232),_0x1acb04;}}function In(_0x56e748){if(!_0x56e748)return _0x56e748;if(_0x56e748['length']<=0x78)return _0x56e748;const _0x4e2f3e=_0x56e748['slice'](0x0,0x78),_0x2ab80f=_0x4e2f3e['lastIndexOf']('\x20');return(_0x2ab80f>0x0?_0x4e2f3e['slice'](0x0,_0x2ab80f):_0x4e2f3e)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class To{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x57d229,_0x271bce,_0x20a2af,_0xdc20a,_0x100e93){this['_locale']=_0x57d229,this['_visibleChips']=_0x271bce,this['_config']={...hn,..._0x20a2af,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x20a2af['cssClasses']}},this['_overflowChips']=new _0x5c5f1f(),this['_bodyCollection']=_0xdc20a,this['_parentView']=_0x100e93||null;}['setContainerElement'](_0x492398){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x492398,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 _0x5e025c=[...this['_visibleChips'],...this['_overflowChips']],_0x496145=this['_createCalculationContainer'](),_0x4959ac=this['_calculateOverflowInContainer'](_0x496145,_0x5e025c),_0x252542=_0x496145['_ancestorsToRestore'];_0x252542&&this['_restoreAncestorVisibility'](_0x252542),_0x496145['remove'](),this['_applyOverflowResults'](_0x5e025c,_0x4959ac);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x5478fb({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2b6121=new _0x5c8003(this['_locale']);_0x2b6121['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x195470=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x195470['push'](this['_config']['cssClasses']['controlsButton']),_0x2b6121['extendTemplate']({'attributes':{'class':_0x195470}}),_0x2b6121;}['_createShowMoreBalloonPanelView'](){const _0x5d9778=new _0x43f8f9(this['_locale']);return _0x5d9778['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x5d9778),_0x5d9778;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x1b6d4d=>{_0x1b6d4d['disableAnimationOnEnter']();});const _0x44cf7b=new wt(this['_locale']);_0x44cf7b['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x44cf7b);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x5e9c28=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x5e9c28?'':'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'](_0x11118f){const _0x25d645=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x56753a=this['_containerElement']?.['classList'];if(_0x56753a){const _0x23149e=_0x56753a[0x0]||'',_0x152660=_0x11118f['querySelector']('.'+_0x23149e),_0x40e7c9=_0x11118f['querySelector'](_0x25d645);return _0x152660||_0x40e7c9||_0x11118f;}return _0x11118f['querySelector'](_0x25d645)||_0x11118f;}['_calculateContainerWidth'](){const _0x368d90=this['_parentView']?.['element']||this['_containerElement'];if(!_0x368d90)return an;const _0x4891bc=window['getComputedStyle'](_0x368d90)['width'];if('auto'===_0x4891bc||'0px'===_0x4891bc||!_0x4891bc){const _0x7b6d6b=_0x368d90['parentElement'];if(_0x7b6d6b){const _0x3b1c61=window['getComputedStyle'](_0x7b6d6b);return'auto'!==_0x3b1c61['width']?_0x3b1c61['width']:an;}return an;}return _0x4891bc;}['_applyCalculationStyles'](_0x2741d9,_0x406d0c){this['_config']['cssClasses']['calculationContainer']&&_0x2741d9['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x2741d9['style']['width']=_0x406d0c,_0x2741d9['style']['position']='absolute',_0x2741d9['style']['top']='-9999px',_0x2741d9['style']['left']='-9999px',_0x2741d9['style']['opacity']='0',_0x2741d9['style']['pointerEvents']='none',_0x2741d9['style']['zIndex']='-1',_0x2741d9['style']['visibility']='visible\x20!important',_0x2741d9['style']['display']='block\x20!important',_0x2741d9['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4d51a4){_0x4d51a4['forEach'](({element:_0x14e95a,originalDisplay:_0x33a1be,originalVisibility:_0x5a2876})=>{_0x14e95a['style']['display']=_0x33a1be,_0x14e95a['style']['visibility']=_0x5a2876;});}['_makeAncestorsVisible'](_0x57ea08){const _0xa3961a=[];let _0x2420c4=_0x57ea08;for(;_0x2420c4&&_0x2420c4!==document['body'];){const _0x4d426d=window['getComputedStyle'](_0x2420c4);'none'!==_0x4d426d['display']&&'hidden'!==_0x4d426d['visibility']||(_0xa3961a['push']({'element':_0x2420c4,'originalDisplay':_0x2420c4['style']['display'],'originalVisibility':_0x2420c4['style']['visibility']}),_0x2420c4['style']['display']='block',_0x2420c4['style']['visibility']='visible'),_0x2420c4=_0x2420c4['parentElement'];}return _0xa3961a;}['_createContainerElements'](){let _0x3bc849,_0x3d0ea5;return this['_parentView']?.['element']?(_0x3bc849=this['_parentView']['element']['cloneNode'](!0x0),_0x3d0ea5=this['_findTargetContainer'](_0x3bc849)):(_0x3bc849=document['createElement']('div'),_0x3d0ea5=_0x3bc849),{'calculationContainer':_0x3bc849,'targetContainer':_0x3d0ea5};}['_createCalculationContainer'](){const {calculationContainer:_0x31df07,targetContainer:_0x544c8e}=this['_createContainerElements'](),_0x4753a3=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x31df07,_0x4753a3);const _0xf28547=this['_parentView']?.['element']||this['_containerElement'],_0x54dcce=_0xf28547?.['parentElement'];_0x54dcce?_0x54dcce['appendChild'](_0x31df07):document['body']['appendChild'](_0x31df07),_0x31df07['_targetContainer']=_0x544c8e;const _0xaaf5cf=this['_makeAncestorsVisible'](_0x54dcce||null);return _0x31df07['offsetWidth'],_0x31df07['_ancestorsToRestore']=_0xaaf5cf,_0x31df07;}['_calculateOverflowInContainer'](_0x332aec,_0x4ee477){const _0x567e36=_0x332aec['_targetContainer']||_0x332aec,_0x12a877=[],{rowCount:_0x295c48}=this['_renderChipsAndCountRows'](_0x567e36,_0x4ee477);if(_0x295c48<=this['_config']['maxVisibleRows'])return _0x12a877;const _0x33c72e=_0x4ee477['slice']();for(;_0x33c72e['length']>0x0;){if(this['_testButtonFit'](_0x332aec,_0x567e36,_0x33c72e)){const _0x5c4948=_0x4ee477['filter'](_0x4cca89=>!_0x33c72e['includes'](_0x4cca89));_0x12a877['push'](..._0x5c4948);break;}if(!_0x33c72e['pop']())break;}return _0x12a877;}['_renderChipsAndCountRows'](_0x1b9a9c,_0x1f1292){_0x1b9a9c['innerHTML']='',_0x1f1292['forEach'](_0x15a825=>{if(_0x15a825['element']){const _0x524640=_0x15a825['element']['cloneNode'](!0x0);_0x1b9a9c['appendChild'](_0x524640);}}),_0x1b9a9c['offsetWidth'];const _0x5375a6=_0x1b9a9c['children'],_0x5a6508=[];return Array['from'](_0x5375a6)['forEach'](_0x21598a=>{const _0x2eab72=_0x21598a['getBoundingClientRect']()['top'];_0x5a6508['some'](_0x56f63f=>Math['abs'](_0x56f63f-_0x2eab72)<this['_config']['rowDetectionTolerance'])||_0x5a6508['push'](_0x2eab72);}),{'rowCount':_0x5a6508['length']};}['_createMockButton'](){const _0x56caa2=document['createElement']('button');return _0x56caa2['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x56caa2['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x56caa2['textContent']='+\x201',_0x56caa2;}['_testButtonFit'](_0x1e39e8,_0x33844b,_0x2f6e6f){this['_renderChipsAndCountRows'](_0x33844b,_0x2f6e6f);const _0x5c3bc4=this['_createMockButton']();_0x1e39e8['appendChild'](_0x5c3bc4),_0x1e39e8['offsetWidth'];const _0xea151=[..._0x33844b['children'],_0x5c3bc4],_0x360be3=[];_0xea151['forEach'](_0x58b1ad=>{const _0x5133a3=_0x58b1ad['getBoundingClientRect']()['top'];_0x360be3['some'](_0x1afab7=>Math['abs'](_0x1afab7-_0x5133a3)<this['_config']['rowDetectionTolerance'])||_0x360be3['push'](_0x5133a3);});const _0x13e0cf=_0x360be3['length'];return _0x5c3bc4['remove'](),_0x13e0cf<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x34ccca,_0xba5c4){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x34ccca['forEach'](_0x1d6c38=>{_0xba5c4['includes'](_0x1d6c38)?this['_overflowChips']['add'](_0x1d6c38):this['_visibleChips']['add'](_0x1d6c38);});}['_updateOverflowUI'](_0x10da6d){if(_0x10da6d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x10da6d>0x0&&this['_showMoreButtonView']){const _0x1d6bc3=''+this['_config']['showMoreLabelPrefix']+(_0x10da6d<0x63?_0x10da6d:'99');this['_showMoreButtonView']['label']=_0x1d6bc3;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x53600d,_0xd19c2){this['_distributeChips'](_0x53600d,_0xd19c2),this['_updateOverflowUI'](_0xd19c2['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x26fc65=>{_0x26fc65[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 _0xdb6df9=this['_containerElement']['getBoundingClientRect']();if(0x0===_0xdb6df9['width']||0x0===_0xdb6df9['height'])return!0x1;const _0x543266=window['innerHeight']||document['documentElement']['clientHeight'],_0x13d5d4=window['innerWidth']||document['documentElement']['clientWidth'],_0x185657=0xc8;return _0xdb6df9['bottom']>=-0xc8&&_0xdb6df9['top']<=_0x543266+_0x185657&&_0xdb6df9['right']>=-0xc8&&_0xdb6df9['left']<=_0x13d5d4+_0x185657;}}const da='ck-ai-chat__feed__context-chips',ua='ck-ai-chat-context-chips-wrapper',_a='ck-ai-chat-context-chips-wrapper-balloon',Ia='ck-ai-chat-controls-button',Aa='ck-ai-chat-controls_context_show-more-button',ga='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends wt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x410b5c,_0x25cc86,_0x284959){super(_0x410b5c),this['_bodyCollection']=_0x284959,this['_createContextChips'](_0x25cc86);const _0x25ece6={'cssClasses':{'showMoreButton':Aa,'showMoreBalloon':ga,'overflowContainer':_a,'controlsButton':Ia}};this['_overflowManager']=new To(_0x410b5c,this['_contextChips'],_0x25ece6,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[da,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':ua},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x18115d=this['element']['querySelector']('.'+ua);_0x18115d&&(this['_overflowManager']['setContainerElement'](_0x18115d),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x3b9afe){for(const _0x3f7b78 of _0x3b9afe){const _0x1e8d3e=new Bo(this['locale'],_0x3f7b78,!0x0,!0x1);this['_contextChips']['add'](_0x1e8d3e);}}}class Ve extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x70db52,_0x342b05,_0x391f12){super(_0x342b05),this['_locale']=_0x70db52,this['_bodyCollection']=_0x391f12,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'](_0x1bf4e4=>!_0x1bf4e4['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new wt(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(_0x1c47b8,_0x6fdc5){super(_0x6fdc5);const {isWebSearchEnabled:_0x2d7e5d,isReasoningEnabled:_0x26b6f3}=_0x6fdc5['capabilities'],_0x5c58ec=[];let _0x1193da='';_0x2d7e5d&&_0x26b6f3?(_0x1193da=i(_0x1c47b8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x5c58ec['push'](aa(_0x36dfa2)),_0x5c58ec['push'](aa(_0x11be31))):_0x2d7e5d?(_0x1193da=i(_0x1c47b8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x5c58ec['push'](aa(_0x36dfa2))):_0x26b6f3&&(_0x1193da=i(_0x1c47b8,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x5c58ec['push'](aa(_0x11be31))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x1193da?'':'ck-hidden']}});const _0x52d621=new wt();_0x52d621['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x5c58ec,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x1193da]}]}),this['children']['add'](_0x52d621),this['capabilities']=_0x6fdc5['capabilities'];}}function aa(_0x4ea13f){const _0x2a1e4e=new _0x314c7c();return _0x2a1e4e['content']=_0x4ea13f,_0x2a1e4e;}class Ae extends wt{constructor(_0x17bc48,_0x53d509){super(_0x17bc48),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x53d509)});}['_createSkeletonItems'](_0x1bc36a){const _0x578081=['ck','ck-ai-skeleton__item'];return _0x1bc36a['map'](_0x1cf825=>{let _0x28b0a7='';switch(_0x1cf825['attributes']['align']){case'right':_0x28b0a7='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x28b0a7='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x28b0a7='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1cf825['tag'],'attributes':{'class':[..._0x578081,_0x1cf825['attributes']['class']?_0x1cf825['attributes']['class']:''],'style':'width:\x20'+_0x1cf825['attributes']['width']+';\x20height:\x20'+_0x1cf825['attributes']['height']+';'+_0x28b0a7}};});}}const Oe={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':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(_0x4ef681,_0x14bc7e,_0x1abc16,_0x566483){return new Array(_0x4ef681)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x14bc7e,'height':_0x1abc16,'align':_0x566483}}));}class ji extends wt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x5504cf,_0x171663){super(_0x5504cf),this['_bodyCollection']=_0x171663,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 us(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x32e116,_0x268772){let _0xbd521e;'ai-reply'===_0x32e116?_0xbd521e=new Le(this['locale'],_0x268772):'ai-suggestion-reply'===_0x32e116?(_0xbd521e=new je(this['locale'],_0x268772),_0xbd521e['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0xbd521e='user-message'===_0x32e116?new Ve(this['locale'],_0x268772,this['_bodyCollection']):'interaction-header'===_0x32e116?new Ct(this['locale'],_0x268772):new Me(_0x268772),this['children']['add'](_0xbd521e);}async['updateReplyItem']({id:_0x508e3e,parsedContent:_0x2f4081,renderingStrategy:_0x4ce16c,abortSignal:_0x888bc}){const _0xebed4c=this['getItemById'](_0x508e3e);if(!(_0xebed4c instanceof Le))throw new _0x3384e8('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0xebed4c,'id':_0x508e3e,'parsedContent':_0x2f4081});await _0xebed4c['updateContent']({'parsedContent':_0x2f4081,'renderingStrategy':_0x4ce16c,'abortSignal':_0x888bc});}async['updateWebSources'](_0x53648a,_0x2c88ec){const _0x4e0fae=this['getItemById'](_0x53648a);if(_0x4e0fae instanceof je)_0x4e0fae['updateSources'](_0x2c88ec);else{if(!(_0x4e0fae instanceof Le))throw new _0x3384e8('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4e0fae,'id':_0x53648a,'sources':_0x2c88ec});_0x4e0fae['updateSources'](_0x2c88ec);}}async['updateSuggestionItem']({id:_0x2cb5fb,parts:_0x48fddd,renderingStrategy:_0x5e76a2,abortSignal:_0x89416a}){const _0x2d8db4=this['getItemById'](_0x2cb5fb);if(!(_0x2d8db4 instanceof je))throw new _0x3384e8('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x2d8db4,'id':_0x2cb5fb,'parts':_0x48fddd});await _0x2d8db4['updateContent']({'parts':_0x48fddd,'renderingStrategy':_0x5e76a2,'abortSignal':_0x89416a});}['updateSuggestionPartState']({id:_0x3efa5a,index:_0x4a8324,state:_0x177708}){const _0x29d922=this['getItemById'](_0x3efa5a);if(!(_0x29d922 instanceof je))throw new _0x3384e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3efa5a});_0x29d922['updatePartState'](_0x4a8324,_0x177708);}['markItemAsDone'](_0x196dec){this['getItemById'](_0x196dec)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x15fc22=>_0x15fc22['options']['id']);}['removeItem'](_0x21db11){this['children']['remove'](this['getItemById'](_0x21db11));}['scrollToSuggestion'](_0x576ac5,_0x5e51c7){const _0x19098b=this['getItemById'](_0x576ac5);if(!(_0x19098b instanceof je))return void _0x586800('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x576ac5,'partIndex':_0x5e51c7});const _0x512304=_0x19098b['getPartView'](_0x5e51c7);_0x512304?_0x2618c2({'target':_0x512304['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x586800('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x576ac5,'partIndex':_0x5e51c7});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x303b7b=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x303b7b,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x31bd4c=new Ae(this['locale'],Oe['aiFeed']);return _0x31bd4c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2a853f=>!_0x2a853f)]}}),_0x31bd4c;}['_createFeedItems'](){const _0x1dbbba=new wt(this['locale']);return _0x1dbbba['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1dbbba;}['_createFeedLoader'](){const _0x578d24=new wt(this['locale']);return _0x578d24['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x11ebf8=>!_0x11ebf8)]},'children':this['_createLoaderChildren']()}),_0x578d24;}['_createLoaderChildren'](){const _0x3c008a=new Pe();return _0x3c008a['isVisible']=!0x0,[_0x3c008a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4279bc){const _0x128fcb=this['children']['find'](_0x19128c=>_0x19128c['options']['id']['includes'](_0x4279bc));if(!_0x128fcb)throw new _0x3384e8('ai-chat-feed-view-item-not-found',this,{'id':_0x4279bc});return _0x128fcb;}['setLoadingMessage'](_0x58967b){this['set']('loadingMessage',_0x58967b);}['toggleLoadingSkeleton'](_0x41da6d){this['set']('isLoadingSkeletonVisible',_0x41da6d);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Rr extends _0x50cbf8{['filter'](){let _0x2abbf3=0x0;for(const _0x58e30b of this['items'])_0x2abbf3+=_0x58e30b['items']['length'];return{'resultsCount':_0x2abbf3,'totalItemsCount':_0x2abbf3};}}class ps extends _0x424376{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x10c1c0,_0x3e502b){super(_0x10c1c0,{'queryView':{'label':'','creator':_0x3e1046,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Rr(_0x10c1c0),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3e502b,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x106403,_0x1c889a)=>!_0x106403&&!_0x1c889a),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5b2ab5,_0xcbcc1)=>{this['isUploadInProgress']||this['isEmpty']||_0x5b2ab5['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xcbcc1());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x22b46f=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x22b46f)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2c6e7d=_0x423ab9(_0x22b46f);this['fire']('sendUserMessage',_0x2c6e7d),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xf20109){this['queryView']['fieldView']['set']('placeholder',_0xf20109);}['_createSubmitButton'](){const _0x2c7230=new _0x5c8003(this['locale']);return _0x2c7230['set']({'icon':_0x4f3f38,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x2c7230['on']('execute',()=>{this['submit']();}),_0x2c7230;}['setIsUploadInProgress'](_0x4b54ee){this['isUploadInProgress']=_0x4b54ee;}['_setUpAddContextButtonPositioning'](){const _0x2806b0=this['locale'],_0x1c39c5=()=>{_0x47832a['window']['requestAnimationFrame'](()=>{if(_0x5b6c97(this['element'])){const _0x3bd84c=new _0x444add(this['queryView']['fieldView']['element']),_0x281bf2=new _0x444add(this['_addContextButtonView']['element']),_0x1a99bc=_0x3bd84c['width'],_0x277d8b='rtl'===_0x2806b0['uiLanguageDirection']?'right':'left';_0x3bd84c['excludeScrollbarsAndBorders']();const _0x5c99c4=_0x1a99bc-_0x3bd84c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x277d8b]='calc('+(_0x1a99bc-_0x281bf2['width']-_0x5c99c4)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x1c39c5),this['on']('render',()=>{_0x1c39c5(),this['_queryViewResizeObserver']=new _0x4accb7(this['queryView']['fieldView']['element'],()=>{_0x1c39c5();});});}}const Ea='ck-ai-chat__prompt-capabilities',ma='ck-ai-chat-controls-button',pa='ck-ai-chat-controls-button--commands',Ta='ck-ai-chat-controls__model-selection',Ca='ck-ai-chat-controls__model-selection__item-name',wa='ck-ai-chat-controls__model-selection__item-description',fa='ck-ai-chat-controls__model-selection__item-capabilities',Sa='n';class ms extends wt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x19d412){super(_0x19d412),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x11f3f7=>_0x11f3f7),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x252273=>_0x252273?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x286c89=>_0x286c89),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x418f4a=>_0x418f4a),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x2647fe=>!_0x2647fe),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0xa12d15=>i(this['locale'],_0xa12d15?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x60adeb=>_0x60adeb),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x14afff=>!_0x14afff),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x7d7c17=>i(this['locale'],_0x7d7c17?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ea]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x5c5f1f(),_0x562328(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3b9264,_0x1dce6c){if(this['set']('modelSelectorVisible',!(_0x1dce6c&&_0x3b9264['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x3b9264?.['length']){const _0x4f1f9b=oe['getLocalized'](this['locale'],_0x3b9264);for(const _0x22fa21 of _0x4f1f9b){const _0x5aa4de=new _0x9d6116({'label':_0x22fa21['name'],'withText':!0x0,'role':'menuitemradio','id':_0x22fa21['id'],'model':_0x22fa21});_0x5aa4de['bind']('isOn')['to'](this,'activeModelId',_0x401d8e=>_0x401d8e===_0x22fa21['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x5aa4de,'labelView':new Oa(this['locale'],_0x22fa21)});}}}['setWebSearch'](_0x27ba6a){this['set']('webSearchActive',_0x27ba6a);}['setReasoning'](_0x50fcac){this['set']('reasoningActive',_0x50fcac);}['setModel'](_0x3022a7){if(!_0x3022a7)return;this['activeModelId']=_0x3022a7['id'],this['activeModelName']=_0x3022a7['name']||_0x3022a7['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3022a7['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3022a7['name']);const _0x424ccb=_0x3022a7['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x424ccb),this['_webSearchButton']['set']('isVisible',_0x424ccb);const _0x28b677=_0x3022a7['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x28b677),this['_reasoningButton']['set']('isVisible',_0x28b677);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x52721f){this['set']('modelSelectorEnabled',!0x1),_0x52721f&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x5de493=new _0x5c8003();return _0x5de493['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x36dfa2,'class':ma,'isToggleable':!0x0,'tooltipPosition':Sa}),_0x5de493['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x5de493;}['_createReasoningButton'](){const _0x352402=new _0x5c8003();return _0x352402['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x11be31,'class':ma,'isToggleable':!0x0,'tooltipPosition':Sa}),_0x352402['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x352402;}['_createCommandsButton'](){const _0x15fe4b=new _0x5c8003();return _0x15fe4b['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':ut,'withText':!0x0,'class':ma,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Sa}),_0x15fe4b['extendTemplate']({'attributes':{'class':[pa]}}),_0x15fe4b['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x15fe4b;}['_createModelSelectionDropdown'](){const _0x1339e4=_0x2b674a(this['locale']);return _0x1339e4['set']({'panelPosition':'ne','class':[Ta]}),_0x1339e4['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Sa}),this['listenTo'](_0x1339e4,'execute',_0x4bd995=>{this['fire']('selectModel',_0x4bd995['source']['model']);}),_0x1339e4;}['_createModelNameView'](){const _0xcc302d=new Jo(this['locale']);return _0xcc302d['bind']('text')['to'](this,'activeModelName',_0x5900bf=>_0x5900bf??''),_0xcc302d['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x392b56,_0x4306d5)=>!_0x392b56&&!_0x4306d5?.['toLowerCase']()['startsWith']('agent')),_0xcc302d;}}let Oa=class extends _0x8cf3b6{constructor(_0x1c9e9a,_0x2f06ae){super();const _0x5d8c3e=this['bindTemplate'],_0x166c07=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5d8c3e['to']('style'),'id':_0x5d8c3e['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ca]},'children':[{'text':_0x5d8c3e['to']('text')}]},{'tag':'div','attributes':{'class':[wa]},'children':[{'tag':'span','children':[{'text':_0x2f06ae['description']}]}]},{'tag':'div','attributes':{'class':[fa]},'children':_0x166c07}]}),_0x166c07['addMany'](this['_getCapabilityParts'](_0x1c9e9a,_0x36dfa2,'AI_CHAT_SEARCH_WEB',_0x2f06ae['capabilities']['webSearch']?.['enabled']??!0x1)),_0x166c07['addMany'](this['_getCapabilityParts'](_0x1c9e9a,_0x11be31,'AI_CHAT_REASONING',_0x2f06ae['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x380661,_0x108fa3,_0x426ddd,_0x3c0453){const _0x27207f=new _0x314c7c();_0x27207f['content']=_0x108fa3;const _0x38d711=new wt(_0x380661);_0x38d711['setTemplate']({'tag':'span','children':[{'text':i(_0x380661,_0x426ddd)+':\x20'}]});const _0x3b2c56=new wt(_0x380661);return _0x3b2c56['setTemplate']({'tag':'span','children':[{'text':i(_0x380661,_0x3c0453?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x27207f,_0x38d711,_0x3b2c56];}};class Jo extends wt{constructor(_0xca8e94){super(_0xca8e94),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x507bdc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x507bdc['if']('isVisible','ck-hidden',_0x4330f2=>!_0x4330f2)]},'children':[{'text':_0x507bdc['to']('text')}]});}}const ba='ck-ai-chat-context-controls__url-form',Ra='ck-ai-chat-context-controls__url-input-section';class bo extends wt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x40d3d2){super(_0x40d3d2),this['focusTracker']=new _0x3b8d6f(),this['keystrokes']=new _0x11d7cc(),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 _0x767b6d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x57378b=>{this['focusTracker']['add'](_0x57378b['element']),this['keystrokes']['listenTo'](_0x57378b['element']);}),_0x2837a1({'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'](_0x12be05){this['urlInputField']['errorText']=_0x12be05,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x69855d=new _0x5c8003(this['locale']);return _0x69855d['set']({'icon':Nt,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x69855d;}['_createUrlInputField'](){const _0xba5eff=new _0x114356(this['locale'],_0x17f05b);return _0xba5eff['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0xba5eff['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0xba5eff;}['_createConfirmButton'](){const _0x32a980=new _0x5c8003(this['locale']);return _0x32a980['set']({'icon':_0x382d3e,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x32a980;}['_setupTemplate'](){const _0x206815=new _0x24123a(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'});_0x206815['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ba,'tabindex':'-1'},'children':[_0x206815,{'tag':'div','attributes':{'class':Ra},'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',_0x3f2524=>{_0x3f2524['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x543e53,_0x50c3e4)=>{this['clear'](),this['fire']('cancel'),_0x50c3e4();});}['_handleSubmit'](){const _0x332f96=this['getValue']()['trim']();_0x332f96?this['_isValidUrl'](_0x332f96)?(this['clearError'](),this['fire']('submitUrl',_0x332f96)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x11b49a=this['getValue']()['trim'](),_0xb0143b=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x11b49a['length']>0x0&&!_0xb0143b;}['_isValidUrl'](_0x55f493){try{return!!new URL(_0x55f493);}catch{return!0x1;}}}const Na='ck-ai-chat-resources__item',ka='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',va='ck-ai-chat-resources__item__icon';class sc extends _0x47f6ca{['resource'];['_titleView'];['_iconView'];constructor(_0x565741,_0x35e961){super(_0x565741),this['resource']=_0x35e961,this['set']('isInContext',!!_0x35e961['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x271184){if(_0x271184['isInContext'])return _0x382d3e;switch(_0x271184['type']){case xe['DOCUMENT']:return _0x314ba7;case xe['URL']:return _0x228b90;case xe['FILE']:case xe['TEXT']:return _0x15b10c;default:return _0xf0382d;}}['highlightText'](_0x5026b){if(!_0x5026b||''===_0x5026b['trim']())return void this['_titleView']['highlightText'](null);const _0x22ca74=new RegExp(_0x4da077(_0x5026b),'gi');this['_titleView']['highlightText'](_0x22ca74);}['updateResourceState'](_0x191f9c){this['resource']['isInContext']=_0x191f9c,this['isInContext']=_0x191f9c,this['_updateIcon']();}['_createTitleView'](){const _0x4cf4b7=new _0x10267b();return _0x4cf4b7['text']=this['resource']['label'],_0x4cf4b7['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0x4cf4b7;}['_createIconView'](){const _0x1aa6e0=new _0x314c7c();return _0x1aa6e0['content']=this['getResourceIcon'](this['resource']),_0x1aa6e0;}['_setupTemplate'](){const _0x5a0419=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Na,_0x5a0419['if']('isVisible','ck-hidden',_0x25b505=>!_0x25b505),_0x5a0419['if']('isInContext',ka)]},'children':[{'tag':'div','attributes':{'class':[va]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5a0419['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Ur extends _0x50cbf8{['_source'];constructor(_0x249417,_0x1a0881){super(_0x249417),this['_source']=_0x1a0881,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x13b5f8,_0x224f93){this['items']['clear']();let _0x12cc14=_0x13b5f8;if(this['_source']['useDefaultFiltering']&&_0x224f93&&''!==_0x224f93['trim']()){const _0x4db01c=new RegExp(_0x224f93['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x12cc14=_0x13b5f8['filter'](_0x2669c8=>_0x4db01c['test'](_0x2669c8['label']));}for(const _0x5b686a of _0x12cc14){const _0x4ac36b=new sc(this['locale'],_0x5b686a);_0x4ac36b['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5b686a);}),this['items']['add'](_0x4ac36b);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x224f93);}['highlightText'](_0x3838ef){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x183cea=>{_0x183cea['highlightText'](_0x3838ef);});}['updateResourceState'](_0x285552,_0x51f93f){for(const _0x5e967c of this['items']){const _0x52afe6=_0x5e967c;_0x52afe6['resource']['id']===_0x285552&&_0x52afe6['updateResourceState'](_0x51f93f);}}['_handleResourceSelection'](_0x2be748,_0x23a8f0){this['fire']('addResourceToContext',{'source':_0x2be748,'resource':_0x23a8f0});}}class zr extends _0x114356{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x11c78a){const t=_0x11c78a['t'],_0x30d2dc={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x17f05b,'label':i(_0x11c78a,'AI_CHAT_SEARCH_RESOURCES')};super(_0x11c78a,_0x30d2dc['creator']),this['label']=_0x30d2dc['label'],this['_viewConfig']=_0x30d2dc,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x11c78a,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x24beb5){this['fire']('search',_0x24beb5);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x314c7c(),this['iconView']['content']=_0x2963a8,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x4140c6,t){this['resetButtonView']=new _0x5c8003(_0x4140c6),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x4f3ae4,'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',_0x421be4=>!_0x421be4),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends wt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x6fc778,_0x16c65c){super(_0x6fc778),this['_source']=_0x16c65c['source'],this['_searchInputVisibleFrom']=_0x16c65c['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 ft([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x5378f0=new wt(this['locale']);return _0x5378f0['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x69a89c,_0x57470f)=>{this['loadResources'](_0x57470f),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x57470f);}),_0x5378f0;}['_createResourcesListView'](){const _0x59170a=new Ur(this['locale'],this['_source']);return _0x59170a['delegate']('addResourceToContext')['to'](this),_0x59170a['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x59170a;}['_createSkeletonView'](){const _0x5eb77c=new Ae(this['locale'],Oe['aiChatResources']);return _0x5eb77c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4b3ee2=>!_0x4b3ee2)]}}),_0x5eb77c;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x119cf3){const _0x6f90c4=_0x418744();this['_latestLoadResourcesUid']=_0x6f90c4,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x119cf3,'uid':_0x6f90c4}),this['isLoading']=!0x0;}['setResources'](_0x2d2269,_0x4945a9){if(_0x4945a9&&_0x4945a9!==this['_latestLoadResourcesUid'])return;const _0xea37a4=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2d2269,_0xea37a4),_0x2d2269['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x7b8df4,_0x25eba2){this['_resourcesListView']['updateResourceState'](_0x7b8df4,_0x25eba2);}}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 Ao{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x5408c8,_0xf4c17f,_0x16a99d){this['_locale']=_0x5408c8,this['_bodyCollection']=_0xf4c17f,this['_config']=_0x16a99d;}['showSourceResourcesBalloon'](_0x40c21d){let _0x10f2a4=this['_sourceResourceBalloons']['get'](_0x40c21d['id']);_0x10f2a4||(_0x10f2a4=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x40c21d['id'],_0x10f2a4),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x10f2a4)),this['_addSourceResourceContent'](_0x10f2a4,_0x40c21d),_0x10f2a4['show']();const _0x593884=this['_config']['getTargetElement']();_0x593884&&_0x10f2a4['pin']({'target':_0x593884,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x54840d,_0x24597d,_0x52c322){const _0x4a35fd=this['_sourceResourceBalloons']['get'](_0x54840d);if(!_0x4a35fd)return;const _0x5daf9d=this['_getResourcesViewFromBalloon'](_0x4a35fd);_0x5daf9d&&(_0x5daf9d['setResources'](_0x24597d,_0x52c322),_0x5daf9d['once']('change:isLoading',()=>{_0x4a35fd['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0xdff91e){const _0x20774c=this['_sourceResourceBalloons']['get'](_0xdff91e);_0x20774c&&requestAnimationFrame(()=>{_0x20774c['hide'](),this['_sourceResourceBalloons']['delete'](_0xdff91e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x379c53 of this['_sourceResourceBalloons']['values']())if(_0x379c53['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4b41ea,_0x1b6e90,_0x7fc8d9){const _0x5223f5=this['_sourceResourceBalloons']['get'](_0x4b41ea);if(!_0x5223f5||!_0x5223f5['isVisible'])return;const _0x5e2fb5=this['_config']['getTargetElement']();if(!_0x5e2fb5)return;_0x5223f5['pin']({'target':_0x5e2fb5,'limiter':this['_config']['getLimiterElement']()});const _0x71c114=this['_getResourcesViewFromBalloon'](_0x5223f5);_0x71c114&&_0x71c114['updateResourceState'](_0x1b6e90,_0x7fc8d9);}['destroy'](){for(const _0x214c92 of this['_sourceResourceBalloons']['values']())_0x214c92['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2bd910=new _0x43f8f9(this['_locale']);return _0x2bd910['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x2bd910),_0x2bd910;}['_addSourceResourceContent'](_0x1be9bd,_0x3a2c62){_0x1be9bd['content']['clear']();const _0x51da37=this['_createBalloonHeader'](_0x1be9bd,_0x3a2c62);_0x1be9bd['content']['add'](_0x51da37);const _0x415320=this['_createBalloonResourcesView'](_0x3a2c62);_0x1be9bd['content']['add'](_0x415320);}['_createBalloonHeader'](_0x2e4707,_0x452051){const _0xc62e98=this['_createBackButton'](_0x2e4707),_0x452721=new _0x24123a(this['_locale'],{'label':_0x452051['label'],'class':Pa});return _0x452721['children']['add'](_0xc62e98,0x0),_0x452721;}['_createBackButton'](_0x2bc8fb){const _0x211dac=new _0x5c8003(this['_locale']);return _0x211dac['set']({'icon':Nt,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x211dac['on']('execute',()=>{_0x2bc8fb['hide'](),this['_config']['onBackToContext']();}),_0x211dac;}['_createBalloonResourcesView'](_0x2afe92){const _0x3c927c=new Or(this['_locale'],{'source':_0x2afe92,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x3c927c['on']('loadSourceResources',(_0x1af50f,_0x3d7652)=>{this['_config']['onLoadSourceResources'](_0x3d7652);}),_0x3c927c['on']('addResourceToContext',(_0x41732f,_0x5682e6)=>{this['_config']['onResourceSelected'](_0x5682e6['source'],_0x5682e6['resource']),this['closeSourceResourceBalloon'](_0x2afe92['id']);}),_0x3c927c;}['_getResourcesViewFromBalloon'](_0x566096){const _0x7c25f5=_0x566096['content']['get'](0x1);return _0x7c25f5 instanceof Or?_0x7c25f5:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x26712b){_0x5478fb({'emitter':_0x26712b,'contextElements':[_0x26712b['element']],'callback':()=>{_0x26712b['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x26712b['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],ko='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',vo='ck-ai-chat-context-controls__add-context-balloon-panel',Vo='ck-ai-chat-context-controls__add-context-button',Io='ck-ai-chat-context-controls__url-balloon-panel',Po='ck-ai-chat-context-controls__balloon-button',Ro='ck-ai-chat-context-controls__balloon-button-source',Uo='ck-ai-chat-controls-button',Lo='ck-ai-chat-context-chips-wrapper-balloon',No='ck-ai-chat-controls_context_show-more-button',Oo='ck-ai-chat-context-controls__show-more-balloon-panel',Mo='ck-ai-chat',Ho=[_0x43f8f9['defaultPositions']['northArrowSouthWest'],_0x43f8f9['defaultPositions']['northArrowSouth'],_0x43f8f9['defaultPositions']['northArrowSouthEast'],_0x43f8f9['defaultPositions']['southArrowNorthWest'],_0x43f8f9['defaultPositions']['southArrowNorth'],_0x43f8f9['defaultPositions']['southArrowNorthEast']];class bs extends wt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x425a6c,_0x5349e5){super(_0x425a6c),this['bodyCollection']=_0x5349e5['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x425a6c),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x425a6c),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x425a6c),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x425a6c,_0x5349e5);const _0x4891c8={'cssClasses':{'showMoreButton':No,'showMoreBalloon':Oo,'overflowContainer':Lo,'controlsButton':Uo}};this['_overflowManager']=new To(_0x425a6c,this['_currentContextsChips'],_0x4891c8,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'](_0x3bd5f8,_0x3fe72f){const _0x409794=this['_createContextButton'](_0x3bd5f8,'current',!0x0,_0x3fe72f);this['_addContextToCollection'](_0x409794,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x286c4e){this['_removeContextFromCollection'](_0x286c4e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x286c4e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x196e9c,_0xe5c359){let _0x5b6884=this['_currentContextsChips']['find'](_0x1866bd=>_0x1866bd['id']===_0x196e9c);_0x5b6884||(_0x5b6884=this['_overflowManager']['overflowChips']['find'](_0x5aafed=>_0x5aafed['id']===_0x196e9c)),_0x5b6884&&(_0x5b6884['isLoading']=_0xe5c359);}['setConversationContext'](_0x16f7f4){this['_conversationContextsChips']['clear']();for(const _0x6c9ed5 of _0x16f7f4){const _0x3212a2=this['_createContextButton'](_0x6c9ed5,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3212a2,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2342ef,_0x264367,_0x1d60a0){this['_resourcesBalloonView']['updateResourceState'](_0x2342ef,_0x264367,_0x1d60a0);}['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'](_0x334321){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x334321),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x4c9a29,_0x32fbd5,_0x26cb76,_0x165ba0){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x4c9a29,_0x26cb76,_0x165ba0);}['closeSourceResourceBalloon'](_0x43ac42){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x43ac42),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5eed1f){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5eed1f),this['_setAddContextButtonEnabled'](_0x5eed1f);}['_setAddContextButtonEnabled'](_0x1363f6){const _0x1fca8b=!_0x1363f6['document']['isHidden']&&_0x1363f6['document']['enabled'],_0x100184=_0x1363f6['urls']['enabled'],_0x30322f=_0x1363f6['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x1fca8b||_0x100184||_0x30322f;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[ko,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x47eaaf){const _0xf04ed3=new _0x5c8003(_0x47eaaf);return _0xf04ed3['set']({'label':i(_0x47eaaf,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Uo+'\x20'+Vo,'icon':_0x198d62,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xf04ed3;}['_createAddContextBalloonPanelView'](_0x533481){return this['_createBaseBalloonPanel'](_0x533481,vo);}['_createUrlBalloonPanelView'](_0x47e7c7){const _0x1ff7c1=this['_createBaseBalloonPanel'](_0x47e7c7,Io);return this['_addUrlContent'](_0x1ff7c1,_0x47e7c7),_0x1ff7c1;}['_createResourcesBalloonView'](_0x253cd8,_0x297300){const _0x44304a={'searchInputVisibleFrom':_0x297300['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});},'onResourceSelected':(_0x42bfff,_0x5ad480)=>{this['fire']('addResourceToContext',{'source':_0x42bfff,'resource':_0x5ad480});},'onLoadSourceResources':_0x3c3255=>{this['fire']('loadSourceResources',_0x3c3255);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ao(_0x253cd8,_0x297300['bodyCollection'],_0x44304a);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Mo)||document['body'];}['_createBaseBalloonPanel'](_0x3bd6f9,_0x35a65d){const _0xad958a=new _0x43f8f9(_0x3bd6f9);return _0xad958a['extendTemplate']({'attributes':{'class':_0x35a65d}}),this['bodyCollection']['add'](_0xad958a),_0xad958a;}['_setBalloonPanelContent'](_0x55c4f1,_0x450f8c,_0xe15091){if(_0x55c4f1['content']['clear'](),!_0xe15091['document']['isHidden']&&_0xe15091['document']['enabled']){const _0x5e3b8a=this['_createBalloonButton'](_0x450f8c,{'label':i(_0x450f8c,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x314ba7});_0x5e3b8a['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x55c4f1['content']['add'](_0x5e3b8a);}if(_0xe15091['urls']['enabled']){const _0x401338=this['_createBalloonButton'](_0x450f8c,{'label':i(_0x450f8c,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x228b90});_0x401338['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}),this['_urlInputView']['focus']();}),_0x55c4f1['content']['add'](_0x401338);}if(_0xe15091['files']['enabled']){const _0x5f1514=new _0x4385b1(_0x450f8c);_0x5f1514['set']({'label':i(_0x450f8c,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x20ccd8,'withText':!0x0,'tooltip':!0x0,'class':Po,'allowMultipleFiles':!0x0}),_0x5f1514['on']('done',(_0x406bb8,_0x4ef38a)=>{this['fire']('addFileToContext',_0x4ef38a),this['hideAddContextBalloonPanel']();}),_0x5f1514['tooltip']=!0x0,_0x55c4f1['content']['add'](_0x5f1514);}for(const _0x271ffc of _0xe15091['sources']){const _0x17e09a=this['_createBalloonButton'](_0x450f8c,{'label':_0x271ffc['label'],'icon':_0x271ffc['icon']||_0xf0382d,'type':'source'});_0x55c4f1['content']['add'](_0x17e09a),_0x17e09a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x271ffc);});}}['_addUrlContent'](_0x1c35e5,_0x18e62d){this['_urlInputView']=new bo(_0x18e62d),this['_urlInputView']['on']('submitUrl',(_0x4a7704,_0x527efc)=>{this['_handleUrlSubmit'](_0x527efc);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),_0x1c35e5['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x598e7a,_0x39c7ba){const _0x27b7c8='source'===_0x39c7ba['type']?new Ha(_0x598e7a):new _0x5c8003(_0x598e7a);return _0x27b7c8['set']({'label':_0x39c7ba['label'],'icon':_0x39c7ba['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Po}),_0x27b7c8;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x5478fb({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x374f4c){const _0x16808f=this['_addContextBalloonConfig'];_0x16808f['buttonView']['isOn']=_0x374f4c,_0x374f4c?_0x16808f['balloonView']['show']():_0x16808f['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x15c541,buttonView:_0x6e885a,hideMethod:_0x4ce86f}=this['_addContextBalloonConfig'];_0x5478fb({'emitter':_0x15c541,'contextElements':[_0x15c541['element'],_0x6e885a['element']],'callback':()=>{_0x4ce86f();},'activator':()=>_0x6e885a['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1a9f88,_0x37176a,_0x279f0b=!0x1,_0x11f5a4=!0x1){const _0x34206d='conversation'===_0x37176a||!0x0===_0x1a9f88['isReadOnly'],_0x3f8659=new Bo(this['locale'],_0x1a9f88,_0x34206d,_0x279f0b,_0x11f5a4);return _0x34206d||_0x3f8659['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3f8659['id']);}),_0x3f8659;}['_addContextToCollection'](_0x5edef8,_0x5595dd){_0x5595dd['add'](_0x5edef8,0x0);}['_removeContextFromCollection'](_0x1550cf,_0x30e531){const _0x54c13b=_0x30e531['find'](_0x55fe10=>_0x55fe10['id']===_0x1550cf);_0x54c13b&&_0x30e531['remove'](_0x54c13b);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}));}['_handleUrlSubmit'](_0x294d95){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x294d95);}}class Ha extends _0x5c8003{['arrowView'];constructor(_0x197dfc){super(_0x197dfc),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ro]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x38156f=new _0x314c7c();return _0x38156f['content']=_0x3a7f1c,_0x38156f['extendTemplate']({'attributes':{'class':Ro+'__arrow'}}),_0x38156f;}}class _s extends wt{['_cancelButtonView'];['_loaderView'];constructor(_0x1dd09f){super(_0x1dd09f),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 _0x2167e0=new _0x5c8003(this['locale']);return _0x2167e0['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x1fefe2}),_0x2167e0['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x2167e0;}['_createLoaderView'](){const _0x4f3ab9=new wt(this['locale']);return _0x4f3ab9['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')}]}),_0x4f3ab9;}}class ki extends wt{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x2b7321,_0x3abbdb){super(_0x2b7321),this['_contextPanelView']=this['_createContextPanelView'](_0x2b7321,{'bodyCollection':_0x3abbdb['bodyCollection'],'searchInputVisibleFrom':_0x3abbdb['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x2b7321),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x2b7321),this['_loaderView']=this['_createLoaderView'](_0x2b7321),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x2b7321),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x1b4bff=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1b4bff['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1b4bff['if']('isLoading','ck-hidden',_0x31655d=>_0x31655d||!this['isModelAvailable']),_0x1b4bff['if']('isModelAvailable','ck-hidden',_0x2874d7=>!_0x2874d7||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1b4bff['if']('isLoading','ck-hidden',_0xa57b3=>!_0xa57b3)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1b4bff['if']('isModelAvailable','ck-hidden',_0x3b78fa=>_0x3b78fa)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x5478fb({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x24cc81,_0x421d4f){return new bs(_0x24cc81,_0x421d4f);}['_createPromptInputView'](_0x7aefd0){return new ps(_0x7aefd0,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0xb53621){return new ms(_0xb53621);}['_createLoaderView'](_0x13bee8){return new _s(_0x13bee8);}['_createModelUnavailableMessageView'](_0x16f95f){const _0x4e829f=new ws(_0x16f95f);return _0x4e829f['delegate']('startConversation')['to'](this),_0x4e829f;}['_handlePromptInputFocus'](_0xb7e728,_0x3ff707,_0x4530e8){_0x4530e8?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3cafba,_0x1658c5){this['_contextPanelView']['addContextItem'](_0x3cafba,_0x1658c5);}['removeContextItem'](_0x5e1356){this['_contextPanelView']['removeContextItem'](_0x5e1356);}['setContextItemLoading'](_0x8c9db8,_0x4d0f0b){this['_contextPanelView']['setContextItemLoading'](_0x8c9db8,_0x4d0f0b);}['setIsUploadInProgress'](_0x1db403){this['_promptInputView']['setIsUploadInProgress'](_0x1db403);}['setConversationContext'](_0x12b07b){this['_contextPanelView']['setConversationContext'](_0x12b07b);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5e93bb,_0x208cf8,_0xf60a91){this['_contextPanelView']['updateResourceState'](_0x5e93bb,_0x208cf8,_0xf60a91);}['setWebSearch'](_0x2b1f69){this['_promptCapabilitiesView']['setWebSearch'](_0x2b1f69);}['setReasoning'](_0x3b9f69){this['_promptCapabilitiesView']['setReasoning'](_0x3b9f69);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x24a10d){this['_contextPanelView']['setAddContextOptions'](_0x24a10d);}['setInputPlaceholder'](_0x1362fb){this['_promptInputView']['setPlaceholderText'](_0x1362fb);}['setModelList'](_0x1ac66f,_0x2aa898){this['_displayedModels']=_0x1ac66f,this['_promptCapabilitiesView']['setModelList'](_0x1ac66f,_0x2aa898);}['setModel'](_0x10ef4b){(_0x10ef4b?this['_displayedModels']['find'](_0x138b6e=>_0x138b6e['id']===_0x10ef4b['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x10ef4b)):_0x10ef4b?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x17e954){this['_promptCapabilitiesView']['disableModelSelector'](_0x17e954);}['populateSourceResourceBalloon'](_0x44097d,_0xe5d39d,_0xe27c09,_0x5d0c10){this['_contextPanelView']['populateSourceResourceBalloon'](_0x44097d,_0xe5d39d,_0xe27c09,_0x5d0c10);}['closeSourceResourceBalloon'](_0x5cd289){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5cd289);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ws extends wt{constructor(_0x5094bd){super(_0x5094bd);const _0x47766c=new _0x5c8003(_0x5094bd);_0x47766c['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x47766c['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'},_0x47766c]}]});}}class bi extends _0x24123a{['conversationStartButton'];['resizeButton'];constructor(_0x217dab,_0x45e0bb){super(_0x217dab,{'label':i(_0x217dab,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x217dab),this['children']['add'](this['conversationStartButton']),_0x45e0bb&&(this['resizeButton']=ks(_0x217dab,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x3fc9b1){const _0x4efea6=new _0x5c8003(_0x3fc9b1);return _0x4efea6['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x220078,'class':'ck-ai-chat__start-conversation'}),_0x4efea6['on']('execute',()=>{this['fire']('startConversation');}),_0x4efea6;}}class yi extends wt{constructor(_0x4ff734){super(_0x4ff734),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x4ff734,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends wt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0xcbe41e,_0x557d29){super(_0xcbe41e),this['_bodyCollection']=new _0x2c3837(_0xcbe41e),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new bi(_0xcbe41e,_0x557d29['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new ji(_0xcbe41e,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new ki(_0xcbe41e,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x557d29['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new yi(_0xcbe41e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0xcbe41e['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x35f844,_0x473f47,_0x3c13cb,_0x7db8b8){this['chatControls']['populateSourceResourceBalloon'](_0x35f844,_0x473f47,_0x3c13cb,_0x7db8b8);}['closeSourceResourceBalloon'](_0x204abc){this['chatControls']['closeSourceResourceBalloon'](_0x204abc);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class G extends _0x36f460{static get['requires'](){return[Y];}['_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(_0x4aa583){super(_0x4aa583);const _0x48304c=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x48304c['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xce7129,{showDiff:_0x35a71e})=>{this['showDiff']=_0x35a71e;}),_0x48304c['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',_0x3d5ad3=>_0x3d5ad3),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x2bb88a=>_0x2bb88a),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x129d36){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x129d36['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x2595eb,staticMessage:_0x259859}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2595eb,'initialContent':'<p>'+_0x259859+'</p>'});}['addFeedItemUserMessage'](_0x404e75){const _0x5215fb=_0x404e75['quickActionData']?.['displayedPrompt']||_0x404e75['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x404e75['contextItems']['values']()),'initialContent':'<p>'+_0x5215fb+'</p>','id':_0x404e75['id']});}['addFeedItemError']({errorMessage:_0x2505ba,id:_0x482cd0}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2505ba+'</p>','id':_0x482cd0});}['addFeedItemAIReply'](_0x1ebe94){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1ebe94['interactionId']+':'+_0x1ebe94['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x4a1752){const _0xe7d7a8=q(this['context']);let _0x16029a=_0xe7d7a8['config']['get']('ai.availableReplyActions')||[...H];if(_0xe7d7a8['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x134def=_0xe7d7a8['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x134def,'value');}}else _0x16029a=_0x16029a['filter'](_0x5798d6=>'insertSuggestion'!=_0x5798d6);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4a1752['interactionId']+':'+_0x4a1752['id'],'areActionsDisabled':_0x4a1752['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x16029a}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x2cfac4,_0x3ade7c){const _0x357829=this['_view']['chatFeed']['children']['last'];if(_0x357829 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x357829),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2cfac4['id'],'capabilities':{'isWebSearchEnabled':_0x357829['capabilities']['isWebSearchEnabled']||_0x3ade7c['isWebSearchEnabled'],'isReasoningEnabled':_0x357829['capabilities']['isReasoningEnabled']||_0x3ade7c['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2cfac4['id'],'capabilities':_0x3ade7c});}['updateFeedInteractionHeader'](_0x243317){const _0x4d2c96=this['_view']['chatFeed']['children']['find'](_0x497695=>_0x497695['options']['id']==_0x243317['id']&&_0x497695 instanceof Ct);_0x4d2c96&&_0x4d2c96['set']('isVisible',_0x243317['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2dc75b){const _0x584863=_0x2dc75b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2b002b=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2dc75b,'abortSignal':_0x2b002b,'renderingStrategy':_0x584863}),_0x2dc75b['isDone']&&this['markFeedItemAsDone'](_0x2dc75b['id']);});}['updateFeedItemAIReplySources'](_0x53c882,_0x25a945){this['_view']['chatFeed']['updateWebSources'](_0x53c882,_0x25a945);}async['updateFeedItemAIReplySuggestionContent'](_0x4f5eb4){const _0x2bc7d3=_0x4f5eb4['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5dab1a=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4f5eb4,'abortSignal':_0x5dab1a,'renderingStrategy':_0x2bc7d3}),_0x4f5eb4['isDone']&&this['markFeedItemAsDone'](_0x4f5eb4['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1134e8){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1134e8);}['markFeedItemAsDone'](_0x1d533a){this['_view']['chatFeed']['markItemAsDone'](_0x1d533a);}['removeFeedInteraction'](_0x50d345){this['_view']['chatFeed']['getItemIds']()['filter'](_0xcac242=>_0xcac242['startsWith'](_0x50d345))['forEach'](_0x704d07=>this['_view']['chatFeed']['removeItem'](_0x704d07));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1f1904){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x137b90=>_0x137b90['startsWith'](_0x1f1904['id']))['forEach'](_0x41cc46=>this['markFeedItemAsDone'](_0x41cc46)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x24898f,_0x303e49){this['_view']['chatControls']['addContextItem'](_0x24898f,_0x303e49);}['removeContextItem'](_0x516233){this['_view']['chatControls']['removeContextItem'](_0x516233);}['setContextItemLoading'](_0x12a305,_0x46d0b4){this['_view']['chatControls']['setContextItemLoading'](_0x12a305,_0x46d0b4);}['setIsUploadInProgress'](_0x5ccdf3){this['_view']['chatControls']['setIsUploadInProgress'](_0x5ccdf3);}['setConversationContext'](_0x531eae){this['_view']['chatControls']['setConversationContext'](_0x531eae);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1ac199,_0x2c1149,_0x5fbf00){this['_view']['chatControls']['updateResourceState'](_0x1ac199,_0x2c1149,_0x5fbf00);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x34499d){this['_view']['chatControls']['setAddContextOptions'](_0x34499d);}['updateCapabilities'](_0x58db6c){this['_view']['chatControls']['setWebSearch'](_0x58db6c['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x58db6c['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x58db6c));}['setSelectedModel'](_0x3e36ac,_0x26bfb3){this['_view']['chatControls']['setModel'](_0x3e36ac),_0x26bfb3&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xb31865){this['feedItemRenderingStrategy']=_0xb31865;}['toggleLoadingSkeleton'](_0x2c1834){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2c1834);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x530550,_0x2d9aa0=!0x1){if(_0x2d9aa0&&!It()&&_0x530550['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x530550);this['_view']['chatHeader']['label']=_0x530550;}['setLoadingMessage'](_0x4c6fcf){const _0x524511=this['_getLoadingMessage'](_0x4c6fcf);this['_view']['chatFeed']['setLoadingMessage'](_0x524511);}['_animateConversationTitle'](_0x276e5a){let _0x9d4a3b=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x276e5a[_0x9d4a3b],_0x9d4a3b++,_0x9d4a3b===_0x276e5a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x7714cb){this['_view']['chatHeader']['isMaximized']=_0x7714cb;}['_getLoadingMessage'](_0x5e34a1){return _0x5e34a1?_0x5e34a1['isWebSearchEnabled']&&_0x5e34a1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5e34a1['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5e34a1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x5694d3){return _0x5694d3?_0x5694d3['isWebSearchEnabled']&&_0x5694d3['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x5694d3['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x5694d3['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'](_0x43cb59,_0x5ea200,_0x5944d0,_0x3be97a){this['_view']['populateSourceResourceBalloon'](_0x43cb59,_0x5ea200,_0x5944d0,_0x3be97a);}['closeSourceResourceBalloon'](_0x25e6b4){this['_view']['closeSourceResourceBalloon'](_0x25e6b4);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x14e4e0,_0x688cae){this['_view']['chatFeed']['scrollToSuggestion'](_0x14e4e0,_0x688cae);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Li extends _0x50cbf8{['sections'];constructor(_0x80609d,_0x19851e){super(_0x80609d),this['sections']=_0x19851e,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5d3ebc){let _0x22f494=0x0,_0x243bb0=0x0;for(const _0x5d7ab9 of this['sections']){const {resultsCount:_0x4e20f2,totalItemsCount:_0x2f4fec}=_0x5d7ab9['filter'](_0x5d3ebc);_0x22f494+=_0x4e20f2,_0x243bb0+=_0x2f4fec;}return{'resultsCount':_0x22f494,'totalItemsCount':_0x243bb0};}}class Yi extends _0x47f6ca{['title'];['itemsViews'];['_itemsListView'];constructor(_0xcd9075,{title:_0x3903fd,items:_0xd4efa0}){super(_0xcd9075);const _0x46b5a8=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3903fd,this['itemsViews']=_0xd4efa0;const _0x912e1c=new wt(_0xcd9075);_0x912e1c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x50cbf8(_0xcd9075),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x46b5a8['if']('isVisible','ck-hidden',_0x11d18f=>!_0x11d18f)]},'children':[_0x912e1c,this['_itemsListView']]});}['filter'](_0x966640){const _0x2c8ae4=this['itemsViews']['length'];let _0x429b4d=0x0;for(const _0x23d3f4 of this['itemsViews']){if(_0x966640){const _0x4c5e17=_0x23d3f4['isMatching'](_0x966640);_0x23d3f4['isVisible']=!!_0x4c5e17,_0x23d3f4['highlightText'](_0x966640);}else _0x23d3f4['isVisible']=!0x0,_0x23d3f4['highlightText'](null);_0x23d3f4['isVisible']&&_0x429b4d++;}return this['isVisible']=_0x429b4d>0x0,{'resultsCount':_0x429b4d,'totalItemsCount':_0x2c8ae4};}['getItem'](_0x333752){return this['itemsViews']['find'](_0x1481b6=>_0x1481b6['id']===_0x333752);}['removeItem'](_0x372803){const _0x1fa357=this['itemsViews']['indexOf'](_0x372803);-0x1!==_0x1fa357&&(this['itemsViews']['splice'](_0x1fa357,0x1),this['_itemsListView']['items']['remove'](_0x372803));}}class Di extends/* #__PURE__ -- @preserve */
27
+ _0x20c2d4(_0x47f6ca){['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(_0x17ef0f,_0x14e299){super(_0x17ef0f);const _0x2ca7a6=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x14e299['pinned']),this['set']('loadingState',null),this['id']=_0x14e299['id'];const {title:_0x2be669,createdAt:_0x5d12ae,active:_0x53d262=!0x1}=_0x14e299;this['_titleView']=new _0x10267b(),this['_titleView']['text']=_0x2be669,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x9823a5=this['_createCheckView'](),_0x1c5c08=this['_createPinButtonView'](_0x17ef0f),_0x28f468=this['_createMenuDropdownView'](),_0x375274=this['_createEditInputView'](_0x17ef0f,_0x2be669),_0x163bd4=this['_createAcceptEditButtonView'](_0x17ef0f,_0x375274),_0x1427cb=this['_createCancelEditButtonView'](_0x17ef0f,_0x375274);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x1c5c08),this['actions']['add'](_0x28f468),this['on']('change:isEdit',(_0x464bb2,_0x45d0f3,_0x4a35ff)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4a35ff?(this['actions']['add'](_0x163bd4),this['actions']['add'](_0x1427cb),this['mainContent']['add'](_0x375274),_0x375274['element']['focus']()):(this['actions']['add'](_0x1c5c08),this['actions']['add'](_0x28f468),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x53d262?'ck-ai-chat-history__item--active':'',_0x2ca7a6['if']('isVisible','ck-hidden',_0xeb852d=>!_0xeb852d),_0x2ca7a6['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',_0x2ca7a6['if']('loadingState','ck-hidden',_0x17b547=>!!_0x17b547)]},'children':_0x53d262?[_0x9823a5]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2ca7a6['if']('loadingState','ck-hidden',_0x1507c6=>!_0x1507c6)]},'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',_0x2ca7a6['if']('loadingState','ck-hidden',_0x1b423a=>!!_0x1b423a)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2ca7a6['if']('loadingState','ck-hidden',_0x496038=>!_0x496038)]},'children':[{'text':_0x2ca7a6['to']('loadingState',_0x30f0ef=>_0x30f0ef?i(this['locale'],Di['LOADING_LABELS'][_0x30f0ef]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x5d12ae]}]},{'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'](_0x5363a9){this['_titleView']['text']=_0x423ab9(_0x5363a9);}['updateLoadingState'](_0x20ded6,_0x36e424){this['set']('loadingState',_0x36e424?_0x20ded6:null);}['_createCheckView'](){const _0x1f2919=new _0x314c7c();return _0x1f2919['set']({'content':_0x2eaecc}),_0x1f2919;}['_createPinButtonView'](_0x5cddd8){const _0x34ffb1=new _0x5c8003(_0x5cddd8);return _0x34ffb1['set']({'label':i(_0x5cddd8,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5a39a8,'withText':!0x1,'tooltip':!0x0}),_0x34ffb1['bind']('isOn')['to'](this,'pinned'),_0x34ffb1['on']('execute',()=>{const _0xd94e5a=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xd94e5a});}),_0x34ffb1;}['_createMenuDropdownView'](){const _0x66c14e=_0x2b674a(this['locale'],_0x5c9840),_0x25cedf=_0x66c14e['panelView']['children'];_0x66c14e['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xa05572}),_0x66c14e['panelPosition']='sw';const _0x3e43b6=new _0x5c8003(this['locale']);_0x3e43b6['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3e43b6['withText']=!0x0,_0x3e43b6['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1e87a3=new _0x5c8003(this['locale']);_0x1e87a3['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1e87a3['withText']=!0x0,_0x1e87a3['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x113fcc=new _0x50cbf8(this['locale']),_0x1e7f42=new _0x47f6ca(this['locale']);_0x1e7f42['children']['add'](_0x3e43b6);const _0x4bdc4b=new _0x47f6ca(this['locale']);return _0x4bdc4b['children']['add'](_0x1e87a3),_0x113fcc['items']['addMany']([_0x1e7f42,_0x4bdc4b]),_0x25cedf['add'](_0x113fcc),_0x66c14e;}['_createEditInputView'](_0x3415a2,_0x3caf18){const _0x57cd95=new _0x374ad0(_0x3415a2),_0x28bbdd=_0x57cd95['bindTemplate'];return _0x57cd95['value']=_0x3caf18,_0x57cd95['extendTemplate']({'on':{'keydown':_0x28bbdd['to'](_0x4186aa=>{'Enter'==_0x4186aa['key']&&this['_commitEditInputValue'](_0x57cd95);})}}),_0x57cd95;}['_createAcceptEditButtonView'](_0x18789b,_0x1a8f40){const _0x1d0d0b=new _0x5c8003(_0x18789b);return _0x1d0d0b['set']({'icon':_0x2eaecc,'withText':!0x1,'tooltip':i(_0x18789b,'AI_CHAT_HISTORY_ACCEPT')}),_0x1d0d0b['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x1d0d0b['on']('execute',()=>{this['_commitEditInputValue'](_0x1a8f40);}),_0x1d0d0b;}['_commitEditInputValue'](_0x267b11){const _0x4097b0=_0x267b11['element']['value']||'';this['_titleView']['text']=_0x4097b0,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x4097b0});}['_createCancelEditButtonView'](_0x4c61f1,_0x238ebf){const _0x521fc7=new _0x5c8003(_0x4c61f1);return _0x521fc7['set']({'icon':_0x4f3ae4,'withText':!0x1,'tooltip':i(_0x4c61f1,'AI_CHAT_HISTORY_CANCEL')}),_0x521fc7['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x521fc7['on']('execute',()=>{this['isEdit']=!0x1,_0x238ebf['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x521fc7;}['_createSpinnerView'](){const _0x3d828c=new Pe('tiny');return _0x3d828c['isVisible']=!0x0,_0x3d828c;}['isMatching'](_0x2457c1){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2457c1)?{'title':!0x0}:null;}['highlightText'](_0x1c5726){this['_titleView']['highlightText'](_0x1c5726);}}class Lt extends wt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x57bfb7,_0x3b36a3){super(_0x57bfb7),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 _0x272a85=new _0x24123a(_0x57bfb7,{'label':i(_0x57bfb7,'AI_CHAT_HISTORY_HEADING'),'icon':Ut,'class':'ck-ai-header\x20ck-ai-header_history'});_0x3b36a3&&(this['resizeButton']=ks(_0x57bfb7,this),_0x272a85['children']['add'](this['resizeButton'])),this['sectionsView']=new Li(_0x57bfb7,[]),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',_0x2a5383=>!_0x2a5383)]}}),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':[_0x272a85,{'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 _0xbd2015=new _0x57285a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1495a5=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1495a5),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3a5f29=this['_createErrorView']();return _0x3a5f29['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3ff604=>!_0x3ff604)]}}),_0xbd2015['on']('render',()=>{_0xbd2015['children']['add'](_0x3a5f29,0x1);}),_0xbd2015['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x2c59e6=>!_0x2c59e6)]}}),_0xbd2015;}['_createSkeletonView'](){const _0xa4f217=new Ae(this['locale'],Oe['aiHistory']);return _0xa4f217['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2777da=>!_0x2777da)]}}),_0xa4f217;}['_createErrorView'](){const _0x365b56=new wt(this['locale']),_0x5a67bc=new _0x5c8003(this['locale']);_0x5a67bc['set']({'withText':!0x1,'icon':_0x4f3ae4,'class':'ck-ai-notification_error__dismiss-button'}),_0x5a67bc['bind']('isVisible')['to'](this,'hasItems',_0x44d201=>!!_0x44d201),_0x5a67bc['on']('execute',()=>{this['errorMessage']='';});const _0x8f84bb=this['bindTemplate'];return _0x365b56['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x8f84bb['to']('errorMessage')}]},_0x5a67bc]}),_0x365b56;}['_createEmptyStateView'](){const _0x46bf83=new _0x5c8003(this['locale']);_0x46bf83['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x220078,'class':'ck-ai-chat__start-conversation'}),_0x46bf83['on']('execute',()=>{this['fire']('openChat');});const _0x2f6040=new wt(this['locale']);return _0x2f6040['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x13e4d7=>!_0x13e4d7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x46bf83]}),_0x2f6040;}['_createListItemViews'](_0x2b15b4,_0x3f1743){const _0x458526=[];for(const _0xa2843a of _0x2b15b4){const _0x59be4f=new Di(_0x3f1743,_0xa2843a);_0x59be4f['delegate'](...zi)['to'](this),_0x458526['push'](_0x59be4f);}return _0x458526;}['updateHistoryItemsWithCategories'](_0xb7d784){const _0x4fe131=this['locale']||'en',_0x1ad2f0=[];for(const _0x735891 of _0xb7d784){const _0x1b518d=this['_createListItemViews'](_0x735891['items'],_0x4fe131);_0x1ad2f0['push'](new Yi(_0x4fe131,{'title':_0x735891['title'],'items':_0x1b518d}));}this['sectionsView']['sections']=_0x1ad2f0,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1ad2f0),this['hasItems']=_0xb7d784['some'](_0x3ec07e=>_0x3ec07e['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x1a4acf){for(const _0x447e4e of this['sectionsView']['sections']){const _0x526b58=_0x447e4e['getItem'](_0x1a4acf);if(_0x526b58){if(_0x447e4e['removeItem'](_0x526b58),0x0===_0x447e4e['itemsViews']['length']){const _0x3369ea=this['sectionsView']['sections']['indexOf'](_0x447e4e);-0x1!==_0x3369ea&&(this['sectionsView']['sections']['splice'](_0x3369ea,0x1),this['sectionsView']['items']['remove'](_0x447e4e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x204563,_0x1a650e){for(const _0x4ea82b of this['sectionsView']['sections']){const _0xedf819=_0x4ea82b['getItem'](_0x204563);if(_0xedf819){_0xedf819['updateTitle'](_0x1a650e);break;}}}['updateItemLoadingState'](_0x4e5808,_0x3a0a61,_0x1487f1){for(const _0x879a63 of this['sectionsView']['sections']){const _0x33762e=_0x879a63['getItem'](_0x4e5808);if(_0x33762e){_0x33762e['updateLoadingState'](_0x3a0a61,_0x1487f1);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x4cfa42=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x4cfa42);}}}const zi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class Pt extends _0x36f460{static get['requires'](){return[Y];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x562cdf){super(_0x562cdf);const _0x33f4e8=this['context']['plugins']['get']('AITabs');this['_historyView']=new Lt(this['context']['locale'],_0x33f4e8['showResizeButton']),this['_historyView']['delegate'](...zi)['to'](this),_0x33f4e8['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ut,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x20dafb){this['_historyView']['removeHistoryItem'](_0x20dafb);}['updateItems'](_0x12133b){this['_historyView']['updateHistoryItemsWithCategories'](_0x12133b);}['updateItemTitle'](_0x54089c,_0x55135a){this['_historyView']['updateItemTitle'](_0x54089c,_0x55135a);}['updateItemLoadingState'](_0x4df876,_0x16aae1,_0x5799c7){this['_historyView']['updateItemLoadingState'](_0x4df876,_0x16aae1,_0x5799c7);}['setLoadingSkeleton'](_0x380e9b){this['_historyView']['isLoading']=_0x380e9b;}['showError'](_0x2989cd){this['_historyView']['errorMessage']=_0x2989cd;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x4d0e3a){this['_historyView']['isMaximized']=_0x4d0e3a;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x15b4f9,title:_0x34edbc,createdAt:_0x5289ae,updatedAt:_0x595bac,pinned:_0xae19dd}){super(),this['id']=_0x15b4f9,this['createdAt']=new Date(_0x5289ae),this['set']('title',_0x34edbc),this['set']('updatedAt',_0x595bac?new Date(_0x595bac):null),this['set']('pinned',_0xae19dd||!0x1);}['updateTitle'](_0x502cb1){this['set']('title',_0x423ab9(_0x502cb1)),this['updatedAt']=new Date();}['updatePinned'](_0x7906ca){this['set']('pinned',_0x7906ca),this['updatedAt']=new Date();}}class Yt extends _0xe5b3f8(){['items']=[];['connector'];['group'];constructor({connector:_0x28bbb4,group:_0x247924}){super(),this['connector']=_0x28bbb4,this['group']=_0x247924;}async['init'](){try{const _0x14c708=this['connector']['fetchConversations'](this['group']),_0x4d63d6=await _0x14c708['getConversations']();this['loadItems'](_0x4d63d6);}catch(_0x1a929e){this['fire']('error',{'error':_0x1a929e,'operation':'init'});}}['addItem'](_0x31ed44){this['items']['push'](_0x31ed44);}async['removeItem'](_0x2174d3){const _0x4baddc=this['items']['findIndex'](_0x20c97f=>_0x20c97f['id']===_0x2174d3);if(-0x1===_0x4baddc)return!0x1;try{return await this['connector']['deleteConversation'](_0x2174d3)['execute'](),this['items']['splice'](_0x4baddc,0x1),this['fire']('itemRemoved',{'itemId':_0x2174d3}),!0x0;}catch(_0x1ea1fd){return this['fire']('error',{'error':_0x1ea1fd,'operation':'removeItem','itemId':_0x2174d3}),!0x1;}}['getItem'](_0x47f4d7){return this['items']['find'](_0x314bbd=>_0x314bbd['id']===_0x47f4d7);}async['updateItemTitle'](_0xc4fe7e,_0x3fa691){const _0xb3e955=this['getItem'](_0xc4fe7e);if(!_0xb3e955)return!0x1;try{return await this['connector']['updateConversation'](_0xc4fe7e,{'title':_0x3fa691})['getResult'](),_0xb3e955['updateTitle'](_0x3fa691),this['fire']('itemUpdated',{'itemId':_0xc4fe7e,'updates':{'title':_0x3fa691}}),!0x0;}catch(_0x4d7e65){return this['fire']('error',{'error':_0x4d7e65,'operation':'updateItemTitle','itemId':_0xc4fe7e}),!0x1;}}async['updateItemPinned'](_0x243b4d,_0x4c05ee){const _0x1de4e3=this['getItem'](_0x243b4d);if(!_0x1de4e3)return!0x1;try{return await this['connector']['updateConversation'](_0x243b4d,{'pinned':_0x4c05ee})['getResult'](),_0x1de4e3['updatePinned'](_0x4c05ee),this['fire']('itemUpdated',{'itemId':_0x243b4d,'updates':{'pinned':_0x4c05ee}}),!0x0;}catch(_0x231f66){return this['fire']('error',{'error':_0x231f66,'operation':'updateItemPinned','itemId':_0x243b4d}),!0x1;}}['loadItems'](_0x211b77){try{this['items']=[],_0x211b77['map'](_0x52f872=>{this['addItem'](new Ue(_0x52f872));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x56d86f){this['fire']('error',{'error':_0x56d86f,'operation':'loadItems'});}}['getItems'](_0x2d0d40={}){const _0x3c15ff=void 0x0!==_0x2d0d40['pinned']&&_0x2d0d40['pinned'],_0x1c2b20=_0x2d0d40['from']?new Date(_0x2d0d40['from']['getFullYear'](),_0x2d0d40['from']['getMonth'](),_0x2d0d40['from']['getDate']()):null,_0x5e3154=_0x2d0d40['to']?new Date(_0x2d0d40['to']['getFullYear'](),_0x2d0d40['to']['getMonth'](),_0x2d0d40['to']['getDate']()):null;return this['items']['filter'](_0x39b89f=>{if(_0x39b89f['pinned']!==_0x3c15ff)return!0x1;if(_0x5e3154){const _0x474fdb=new Date(_0x39b89f['createdAt']['getFullYear'](),_0x39b89f['createdAt']['getMonth'](),_0x39b89f['createdAt']['getDate']());return _0x1c2b20?_0x1c2b20['getTime']()===_0x5e3154['getTime']()?_0x474fdb['getTime']()===_0x1c2b20['getTime']():_0x474fdb<_0x5e3154&&_0x474fdb>=_0x1c2b20:_0x474fdb<_0x5e3154;}return!0x0;});}}class Ht extends _0x36f460{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[R,F,Pt,Y];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](R),this['_aiChatHistoryUi']=this['context']['plugins']['get'](Pt),this['_aiChatController']=this['context']['plugins']['get'](F);const _0x4e4f95=this['context']['plugins']['get'](Y);try{const _0x436177=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x436177}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x193b0f,_0x4f8655)=>{this['_setItemLoading'](_0x4f8655['id'],'remove'),this['_handleRemove'](_0x4f8655['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x525145,_0x213b9e)=>{this['_setItemLoading'](_0x213b9e['id'],'rename'),this['_handleEditTitle'](_0x213b9e['id'],_0x213b9e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x40510a,_0x40349a)=>{void 0x0!==_0x40349a['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x40349a['itemId'],_0x40349a['updates']['title']),void 0x0!==_0x40349a['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x40349a['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4ddb71,_0x397290)=>{this['_aiChatController']['handleRemovedConversation'](_0x397290['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x397290['itemId']),this['_clearItemLoading'](_0x397290['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x193af4,_0x4353f9)=>{this['_handleHistoryErrorUI'](_0x4353f9['error'],_0x4353f9['operation'],_0x4353f9['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x28b178,_0x31ecc2)=>{this['_handleSelectConversation'](_0x31ecc2['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x873f2c,_0x258b67)=>{const _0x19b778=_0x258b67['pinned']?'pin':'unpin';this['_setItemLoading'](_0x258b67['id'],_0x19b778),this['_handleTogglePin'](_0x258b67['id'],_0x258b67['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x4e4f95['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4e4f95['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x4e4f95,'resizedTabs',(_0x916cea,_0x154d00)=>{this['_setIsMaximized'](_0x154d00);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x4e4f95['resize']();});}catch(_0x173671){this['_handleHistoryErrorUI'](_0x173671,'init');}}async['_handleEditTitle'](_0x445cb6,_0x23f13b){await this['history']['updateItemTitle'](_0x445cb6,_0x23f13b);}async['_handleTogglePin'](_0x15eb8c,_0x22e8fc){await this['history']['updateItemPinned'](_0x15eb8c,_0x22e8fc);}async['_handleRemove'](_0x3c7c20){await this['history']['removeItem'](_0x3c7c20);}async['_handleSelectConversation'](_0x10f63d){await this['_aiChatController']['loadConversation'](_0x10f63d);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x136127=this['_aiChatController']['activeConversation']?.['id'],_0x591963=this['_getCategorizedItems']()['map'](_0x4a0ecd=>({'title':_0x4a0ecd['title'],'items':_0x4a0ecd['items']['map'](_0x278669=>({'id':_0x278669['id'],'title':_0x278669['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x278669['createdAt'])['toLocaleDateString'](),'active':_0x278669['id']===_0x136127,'pinned':_0x278669['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x591963);}['_setItemLoading'](_0x101792,_0x476fcc){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x101792,_0x476fcc,!0x0);}['_clearItemLoading'](_0x97b982){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x97b982,null,!0x1);}['_handleHistoryErrorUI'](_0x174848,_0x20f017,_0x829c3f){const _0x50769d=this['_generateErrorMessage'](_0x20f017,_0x829c3f);this['_aiChatHistoryUi']['showError'](_0x50769d),_0x829c3f&&this['_clearItemLoading'](_0x829c3f),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x22be37,_0x3bb232){const _0x1763b8=_0x3bb232?this['history']['getItem'](_0x3bb232):null,_0x1f994d=_0x1763b8?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x22be37){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1f994d);case'updateItemPinned':{const _0x172b9b=i(this['context']['locale'],_0x1763b8?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x172b9b,_0x1f994d]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1f994d);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 _0x4186f9=new Date(),_0x15da9c=new Date(_0x4186f9['getFullYear'](),_0x4186f9['getMonth'](),_0x4186f9['getDate']()),_0x2f191f=new Date(_0x15da9c);_0x2f191f['setDate'](_0x2f191f['getDate']()-0x1);const _0x27ed9c=new Date(_0x15da9c);_0x27ed9c['setDate'](_0x27ed9c['getDate']()-0xe);const _0x1b1ec0=this['history']['getItems']({'pinned':!0x0}),_0x31e3e4=this['history']['getItems']({'from':_0x15da9c,'to':_0x15da9c}),_0x25eda1=this['history']['getItems']({'from':_0x2f191f,'to':_0x2f191f}),_0x63e887=this['history']['getItems']({'from':_0x27ed9c,'to':_0x2f191f}),_0x7b5965=this['history']['getItems']({'to':_0x27ed9c}),_0x2bf1c3=[];return _0x1b1ec0['length']>0x0&&_0x2bf1c3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1b1ec0}),_0x31e3e4['length']>0x0&&_0x2bf1c3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x31e3e4}),_0x25eda1['length']>0x0&&_0x2bf1c3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x25eda1}),_0x63e887['length']>0x0&&_0x2bf1c3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x63e887}),_0x7b5965['length']>0x0&&_0x2bf1c3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x7b5965}),_0x2bf1c3;}['_setIsMaximized'](_0x3874b2){this['_aiChatHistoryUi']['setIsMaximized'](_0x3874b2);}}class J extends _0x36f460{static get['requires'](){return[Ht,Pt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x36f460{static get['requires'](){return[F,S,G,J];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3227fb){super(_0x3227fb),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](F)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](F)['startConversation']();}async['sendMessage']({message:_0x36d7c6,quickActionData:_0x507a49}){await this['context']['plugins']['get'](F)['sendMessage']({'message':_0x36d7c6,'quickActionData':_0x507a49});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](F)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](F)['focusPromptInput']();}}class co extends Qt{constructor(_0x30728e){super(_0x30728e);const _0x17b70e=_0x30728e['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x17b70e,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x4eab68=this['editor']['plugins']['get']('AITabs')['view'];_0x4eab68['isVisible']=!_0x4eab68['isVisible'];}}class qt extends _0x45b3aa{static get['requires'](){return[Y];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x25a6c7=this['editor'];_0x25a6c7['commands']['add']('toggleAi',new co(_0x25a6c7)),_0x25a6c7['ui']['componentFactory']['add']('toggleAi',()=>{const _0x4905ca=this['_createAIUIButton'](_0x5c8003);return _0x4905ca['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x4905ca;}),_0x25a6c7['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x13f6c6=this['_createAIUIButton'](_0x42978b);return _0x13f6c6['set']({'role':'menuitemcheckbox'}),_0x13f6c6;});}['_createAIUIButton'](_0x3843ed){const _0x54eed8=this['editor'],_0x2e8312=_0x54eed8['commands']['get']('toggleAi'),_0x173a83=new _0x3843ed(_0x54eed8['locale']);return _0x173a83['set']({'label':i(_0x54eed8['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2b574a,'isToggleable':!0x0}),_0x173a83['bind']('isEnabled')['to'](_0x2e8312),_0x173a83['bind']('isOn')['to'](_0x2e8312,'value',_0x5b23bc=>!!_0x5b23bc),this['listenTo'](_0x173a83,'execute',()=>{_0x2e8312['execute']();}),_0x173a83;}}class Ua extends _0x45b3aa{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ee(_0x208a9e){const {editor:_0x3e3a28,action:_0x52b55b,withText:_0x1c574c=!0x1,withIcon:_0x60f966=!0x0,isInDropdown:_0x59381d=!0x0,shouldPreventFocus:_0x1866cf=!0x1}=_0x208a9e;return()=>{const _0x3ee0c2=_0x3e3a28['locale'],_0x20a376=new _0x5c8003(_0x3ee0c2),_0x1f69c1=_0x20a376['bindTemplate'];_0x59381d&&_0x20a376['extendTemplate']({'on':{'mouseenter':_0x1f69c1['to'](()=>{_0x1866cf&&_0x1866cf()||_0x20a376['focus']();})}});const _0x14fb20=_0x52b55b['icon']??_0x52b55b['parent']?.['icon'];return _0x20a376['set']({'label':_0x52b55b['displayedPrompt'],'withText':_0x1c574c,'role':'menuitem','icon':_0x60f966?_0x14fb20??bt:void 0x0,'tooltip':!_0x1c574c,'class':'ck-ai-quick-actions-button','isEnabled':_0x52b55b['isEnabled']}),_0x20a376['on']('execute',()=>{_0x3e3a28['editing']['view']['focus'](),_0x3e3a28['commands']['execute']('aiQuickAction',_0x52b55b);}),_0x20a376;};}class vs extends _0xc13ac5{['arrowView'];constructor(_0xbe860d,_0x39c465){super(_0xbe860d,_0x39c465);const _0x5ab23f=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',_0x15a5bc=>String(_0x15a5bc)),'data-cke-tooltip-disabled':_0x5ab23f['to']('isOn')},'on':{'mouseenter':_0x5ab23f['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2ac3f9=new _0x314c7c();return _0x2ac3f9['content']=_0x3a7f1c,_0x2ac3f9['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x2ac3f9;}}class Ss extends _0x50cbf8{['_allListItems'];['_allSearchableItems'];constructor(_0x25e02b,_0x43df66,_0x26ccbe){super(_0x25e02b),this['_allListItems']=_0x43df66,this['_allSearchableItems']=_0x26ccbe;}['filter'](_0x5745ce){if(!_0x5745ce)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x424daf=_0x5745ce['source']['toLowerCase']()['trim'](),_0x17fe9b=this['_allSearchableItems']['filter'](_0x4b755b=>(_0x4b755b['groupLabel']?_0x4b755b['label']+'\x20('+_0x4b755b['groupLabel']+')':_0x4b755b['label'])['toLowerCase']()['includes'](_0x424daf));return this['items']['clear'](),this['items']['addMany'](_0x17fe9b['sort']((_0x2a3102,_0x5a3d0e)=>{const _0x54da02=_0x2a3102['groupLabel'],_0x380935=_0x5a3d0e['groupLabel'];return _0x54da02||_0x380935?_0x54da02?0x1:-0x1:0x0;})['map'](_0x33e278=>_0x33e278['item'])),this['_highlightQuery'](_0x424daf,_0x17fe9b),{'resultsCount':_0x17fe9b['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x41bbc3,_0x599f17){if(!_0x41bbc3)return;const _0x1924f1=new RegExp(_0x4da077(_0x41bbc3),'gi');_0x599f17['forEach'](_0xb6c7a7=>{_0xb6c7a7['highlightViews']&&_0xb6c7a7['highlightViews']['forEach'](_0x2a4f25=>{'function'==typeof _0x2a4f25['highlightText']&&_0x2a4f25['highlightText'](_0x1924f1);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x388309=>{_0x388309['highlightViews']&&_0x388309['highlightViews']['forEach'](_0xaf8537=>{'function'==typeof _0xaf8537['highlightText']&&_0xaf8537['highlightText'](null);});});}}const ys='menu',Ts='menuitem';class ao extends wt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x307944,_0x5c520a,_0x11f760,_0x2914de,_0x3bff7d=!0x1){const _0x33328d=_0x307944['locale'];super(_0x33328d),this['_bodyCollection']=_0x2914de,this['_hasSearch']=_0x3bff7d;const _0x2199ae=this['_createListItems'](_0x307944,_0x5c520a,_0x11f760);this['optionsListView']=new Ss(_0x33328d,_0x2199ae,this['_allSearchableItems']),this['optionsListView']['role']=ys,this['optionsListView']['items']['addMany'](_0x2199ae),this['focusTracker']=new _0x3b8d6f(),this['keystrokes']=new _0x11d7cc(),_0x3bff7d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2199ae,this['focusCycler']=new _0x767b6d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x3bff7d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x3ab109=_0x3bff7d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new ft(_0x3ab109),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x33328d['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x57285a(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 _0x494d22=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x494d22);}['_createListItems'](_0x5c00ef,_0x27a807,_0x5db5ec){const _0x218a76=new ft();return _0x27a807['forEach'](_0x13c79d=>{if('actions'in _0x13c79d){const {listItem:_0x51aabd}=this['_createActionGroupButton'](_0x5c00ef,_0x13c79d,_0x5db5ec);_0x218a76['add'](_0x51aabd),_0x13c79d['actions']['forEach'](_0x4acd0e=>{this['_createActionButton'](_0x5c00ef,_0x4acd0e,_0x13c79d['label'],_0x13c79d['icon']);const {listItem:_0x29644c,highlightViews:_0x48b924}=this['_createSearchResultActionButton'](_0x5c00ef,_0x4acd0e,_0x13c79d['label'],_0x13c79d['icon']);this['_allSearchableItems']['push']({'item':_0x29644c,'label':_0x4acd0e['displayedPrompt'],'groupLabel':_0x13c79d['label'],'highlightViews':_0x48b924});});}else{const {listItem:_0x5e054c}=this['_createActionButton'](_0x5c00ef,_0x13c79d);_0x218a76['add'](_0x5e054c);const _0x155eb2=_0x5e054c['children']['first'];if(_0x155eb2){const {listItem:_0x3f1f6c,highlightViews:_0x2b2f51}=this['_createSearchResultActionButton'](_0x5c00ef,_0x13c79d);this['_allSearchableItems']['push']({'item':_0x3f1f6c,'label':_0x155eb2['label']||'','highlightViews':_0x2b2f51});}}}),_0x218a76;}['_createActionButton'](_0x20231c,_0x5d1e05,_0x75c49c,_0x4bb713){const _0x300974=new _0x47f6ca(this['locale']);if(_0x75c49c&&_0x4bb713){const _0x36c090=new _0x5c8003(this['locale']),_0x568910=_0x36c090['bindTemplate'],_0x4fe9c2=new _0x10267b();_0x4fe9c2['text']=_0x5d1e05['displayedPrompt'];const _0xe9889=new _0x10267b();_0xe9889['text']=_0x75c49c;const _0x4b4986=new _0x314c7c();_0x4b4986['content']=_0x4bb713,_0x4b4986['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4d7c6b=new wt(this['locale']);_0x4d7c6b['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x15bf1c=new wt(this['locale']);return _0x15bf1c['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x36c090['set']({'label':_0x5d1e05['displayedPrompt']+'\x20('+_0x75c49c+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x36c090['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':[_0x4fe9c2,_0x4d7c6b,_0x4b4986,_0xe9889,_0x15bf1c],'on':{'mouseenter':_0x568910['to'](()=>{this['_isSearchFocused']()||_0x36c090['focus']();}),'click':_0x568910['to'](()=>{_0x36c090['fire']('execute');})}}),_0x36c090['on']('execute',()=>{_0x20231c['editing']['view']['focus'](),_0x20231c['commands']['execute']('aiQuickAction',_0x5d1e05);}),_0x300974['children']['add'](_0x36c090),{'listItem':_0x300974,'highlightViews':[_0x4fe9c2,_0xe9889]};}{const _0x116154=new _0x25926c(),_0x35946c=new _0x5c8003(this['locale'],_0x116154),_0x40f21=_0x35946c['bindTemplate'],_0x8d3199=_0x5d1e05['icon']??_0x5d1e05['parent']?.['icon'],_0x47197e=void 0x0!==_0x5d1e05['icon'];return _0x35946c['set']({'label':_0x5d1e05['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x47197e?_0x8d3199??bt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x35946c['extendTemplate']({'on':{'mouseenter':_0x40f21['to'](()=>{this['_isSearchFocused']()||_0x35946c['focus']();})}}),_0x35946c['on']('execute',()=>{_0x20231c['editing']['view']['focus'](),_0x20231c['commands']['execute']('aiQuickAction',_0x5d1e05);}),_0x300974['children']['add'](_0x35946c),{'listItem':_0x300974,'highlightViews':[_0x116154]};}}['_createSearchResultActionButton'](_0x3deb03,_0xabc4e,_0x9bb15a,_0x116127){return _0x9bb15a&&_0x116127?this['_createSearchResultGroupedActionButton'](_0x3deb03,_0xabc4e,_0x9bb15a,_0x116127):this['_createSearchResultIndividualActionButton'](_0x3deb03,_0xabc4e);}['_createSearchResultGroupedActionButton'](_0x236e60,_0x173ce9,_0x38b7d8,_0x191540){const _0x260ce6=new _0x47f6ca(this['locale']),_0x41c2f3=new _0x5c8003(this['locale']),_0x15718c=_0x41c2f3['bindTemplate'],{view:_0x2322cf,highlightView:_0x422bf9}=this['_createSearchResultGroupRow'](_0x38b7d8,_0x191540),{view:_0x4eca86,highlightView:_0x5ebdb5}=this['_createSearchResultActionRow'](_0x173ce9['displayedPrompt']),_0x1e6479=this['_createSearchResultContentView'](_0x2322cf,_0x4eca86);return _0x41c2f3['set']({'label':_0x173ce9['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}),_0x41c2f3['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':[_0x1e6479],'on':{'mouseenter':_0x15718c['to'](()=>{this['_isSearchFocused']()||_0x41c2f3['focus']();}),'click':_0x15718c['to'](()=>{this['_handleSearchResultButtonClick'](_0x41c2f3);})}}),this['_setupActionButtonExecution'](_0x41c2f3,_0x236e60,_0x173ce9),_0x260ce6['children']['add'](_0x41c2f3),{'listItem':_0x260ce6,'highlightViews':[_0x422bf9,_0x5ebdb5]};}['_createSearchResultIndividualActionButton'](_0x2723bb,_0x45491d){const _0x1e1385=new _0x47f6ca(this['locale']),_0x2fca36=new _0x25926c(),_0x2a8a8c=new _0x5c8003(this['locale'],_0x2fca36),_0xeaccc4=_0x2a8a8c['bindTemplate'];return _0x2a8a8c['set']({'label':_0x45491d['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x2a8a8c['extendTemplate']({'on':{'mouseenter':_0xeaccc4['to'](()=>{this['_isSearchFocused']()||_0x2a8a8c['focus']();})}}),this['_setupActionButtonExecution'](_0x2a8a8c,_0x2723bb,_0x45491d),_0x1e1385['children']['add'](_0x2a8a8c),{'listItem':_0x1e1385,'highlightViews':[_0x2fca36]};}['_createSearchResultGroupRow'](_0x33e108,_0x405c82){const _0x5a0e4d=new wt(this['locale']),_0x113fd3=new _0x314c7c();_0x113fd3['content']=_0x405c82,_0x113fd3['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5a2a1a=new _0x10267b();return _0x5a2a1a['text']=_0x33e108,_0x5a0e4d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x113fd3,_0x5a2a1a]}),{'view':_0x5a0e4d,'highlightView':_0x5a2a1a};}['_createSearchResultActionRow'](_0x238b43){const _0x1b7c9a=new wt(this['locale']),_0x3aeb47=new _0x10267b();return _0x3aeb47['text']=_0x238b43,_0x1b7c9a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3aeb47]}),{'view':_0x1b7c9a,'highlightView':_0x3aeb47};}['_createSearchResultContentView'](_0x1bb12c,_0x35e823){const _0x39527c=new wt(this['locale']);return _0x39527c['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x1bb12c,_0x35e823]}),_0x39527c;}['_setupActionButtonExecution'](_0x3c4375,_0x6a50ff,_0xaea245){_0x3c4375['on']('execute',()=>{_0x6a50ff['editing']['view']['focus'](),_0x6a50ff['commands']['execute']('aiQuickAction',_0xaea245);});}['_createActionGroupButton'](_0x579f6a,_0x3a9271,_0x46fbd7){const _0x5e098f=new _0x47f6ca(this['locale']),_0x3a7744=new _0x25926c(),_0x535f95=new vs(this['locale'],_0x3a7744),_0x543d63=_0x535f95['bindTemplate'],_0xb15aba=this['_getPanelKeystroke'](_0x46fbd7),_0x2a2d30=this['_createGroupActionsList'](_0x579f6a,_0x3a9271['actions'],_0x46fbd7);_0x535f95['set']({'label':_0x3a9271['label'],'withText':!0x0,'role':Ts,'icon':_0x3a9271['icon']??bt,'isEnabled':_0x3a9271['actions']['some'](_0x11f736=>_0x11f736['isEnabled'])}),_0x535f95['extendTemplate']({'on':{'mouseenter':_0x543d63['to'](()=>{this['_isSearchFocused']()||_0x535f95['focus']();})}});const _0xdb5790=new _0x43f8f9(this['locale']);return _0xdb5790['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x543d63['to'](_0x445ca1=>{this['_handlePanelKeydown'](_0x445ca1,_0xb15aba,_0x535f95,_0xdb5790);})}}),_0x535f95['bind']('isOn')['to'](_0xdb5790,'isVisible'),this['_bodyCollection']['add'](_0xdb5790),_0xdb5790['content']['add'](_0x2a2d30),this['_setupGroupMenuBehavior'](_0x535f95,_0xdb5790),_0x5e098f['children']['add'](_0x535f95),{'listItem':_0x5e098f,'highlightView':_0x3a7744};}['_createGroupActionsList'](_0x577b90,_0x513322,_0x14158f){const _0x21031f=new _0x50cbf8(this['locale']);return _0x21031f['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x513322['forEach'](_0x1fa9e5=>{const _0x23c02b=new _0x47f6ca(this['locale']),_0x2bed85=ee({'editor':_0x577b90,'action':_0x1fa9e5,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x23c02b['children']['add'](_0x2bed85),_0x14158f['focusTracker']['add'](_0x2bed85),_0x21031f['items']['add'](_0x23c02b);}),_0x21031f;}['_setupGroupMenuBehavior'](_0x373f40,_0xcc66ec){const _0xe36597=_0x373f40['bindTemplate'],_0x59ec71=this['_getButtonKeystroke'](_0x373f40);_0x373f40['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0xe36597['to'](()=>{this['_showNestedPanel'](_0xcc66ec,_0x373f40);}),'mouseleave':_0xe36597['to'](_0x201555=>{const _0x1ef4e2=_0x201555['relatedTarget'];this['_isMovingToNestedMenu'](_0x1ef4e2,_0xcc66ec)||this['_hideNestedPanel'](_0xcc66ec);}),'keydown':_0xe36597['to'](_0x538f93=>{_0x538f93['key']==_0x59ec71&&(this['_showNestedPanel'](_0xcc66ec,_0x373f40),_0xcc66ec['content']['get'](0x0)['focus']());})}}),_0xcc66ec['on']('render',()=>{_0xcc66ec['element']?.['addEventListener']('mouseleave',_0x2126f4=>{const _0x344c5f=_0x2126f4['relatedTarget'];_0x373f40['element']?.['contains'](_0x344c5f)||this['_isMovingToNestedMenu'](_0x344c5f,_0xcc66ec)||this['_hideNestedPanel'](_0xcc66ec);});});}['_showNestedPanel'](_0x590632,_0x48269f){this['_openNestedPanels']['forEach'](_0x1cd30c=>{_0x1cd30c!==_0x590632&&_0x1cd30c['isVisible']&&_0x1cd30c['hide']();}),_0x590632['show'](),_0x590632['pin']({'positions':[_0x459c71['eastSouth']],'target':_0x48269f['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x590632);}['_hideNestedPanel'](_0x3e0b8d){_0x3e0b8d['hide'](),this['_openNestedPanels']['delete'](_0x3e0b8d);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x26c5bd=>_0x26c5bd['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x3bf6ca,_0x25d3b8){if(!_0x3bf6ca)return!0x1;if(_0x25d3b8['element']?.['contains'](_0x3bf6ca))return!0x0;const _0xcaa871=_0x3bf6ca;return _0xcaa871['closest']&&(null!==_0xcaa871['closest']('.ck-ai-quick-actions-group-panel')||null!==_0xcaa871['closest']('.ck-ai-quick-actions-group-list')||null!==_0xcaa871['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'](_0x1fc9d4){return'rtl'===_0x1fc9d4['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x4649ae){return'rtl'===_0x4649ae['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x2d057e,_0x169931,_0x26b13c,_0x117e41){_0x2d057e['key']==_0x169931&&(_0x26b13c['focus'](),this['_hideNestedPanel'](_0x117e41));}['_handleSearchResultButtonClick'](_0x545c8b){_0x545c8b['fire']('execute');}}function te(_0x2eea84){const {editor:_0x4465cf,content:_0x237e6b,buttonDefinition:_0x4fe4e3,bodyCollection:_0xdb2c89,hasSearch:_0x27f64c=!0x1}=_0x2eea84;return()=>{const _0x3ae3ad=_0x4465cf['locale'],_0x268efd=_0x2b674a(_0x3ae3ad);_0x268efd['buttonView']['set']({'icon':_0x4fe4e3['icon']??bt,'label':_0x4fe4e3['label'],'tooltip':!0x0}),_0x268efd['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5c8f58=new ao(_0x4465cf,_0x237e6b,_0x268efd,_0xdb2c89,_0x27f64c);if(_0x268efd['panelView']['children']['add'](_0x5c8f58),_0x27f64c){const _0x580956='ai-quick-actions-dropdown-selection';_0x268efd['on']('change:isOpen',(_0x5ac9b7,_0x502586,_0x569591)=>{if(_0x569591){if(_0x4465cf['plugins']['has']('AIEditing')){const _0x4684c1=_0x4465cf['plugins']['get'](S),_0x36c309=_0x4465cf['model']['document']['selection'],_0x1641fb=Array['from'](_0x36c309['getRanges']());_0x1641fb['length']>0x0&&_0x4684c1['showFakeVisualSelection'](_0x1641fb,_0x580956,!0x1,!0x0);}}else _0x4465cf['plugins']['has']('AIEditing')&&_0x4465cf['plugins']['get'](S)['hideFakeVisualSelection'](_0x580956),_0x5c8f58['resetSearch']();});}return _0x268efd;};}const ae='<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>',se='<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>',re='<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 Ft=function(_0x1968c8){return _0x1968c8['CHAT']='CHAT',_0x1968c8['ACTION']='ACTION',_0x1968c8['REVIEW']='REVIEW',_0x1968c8;}({}),Va=function(_0x4a2bf5){return _0x4a2bf5['CHAT']='AIChat',_0x4a2bf5['ACTION']='AIActions',_0x4a2bf5['REVIEW']='AIReviewMode',_0x4a2bf5;}({});class ii extends _0x45b3aa{static get['requires'](){return[_0xce2884];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x3f2ce2=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x3f2ce2),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x66780e){return function(_0x4b3b9a){const _0x2fc094=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4b3b9a['uiLanguage']),_0x54ac19=_0x2fc094||'English',_0x4f1e79=[{'id':'ask-ai','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Wt},{'id':'chat-commands','label':i(_0x4b3b9a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Wt,'actions':[{'id':'explain','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ae['replace']('%0',_0x54ac19),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':se['replace']('%0',_0x54ac19),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':re['replace']('%0',_0x54ac19),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Vt},{'id':'continue','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Bt},{'id':'fix-grammar','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Jt},{'id':'adjust-length','label':i(_0x4b3b9a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x4b3b9a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Gt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Zt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x4b3b9a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x4b3b9a,'AI_QUICK_ACTIONS_OTHER'),'icon':Xt,'actions':[]}];return _0x4f1e79;}(_0x66780e);}async['_getDefaultAndCustomActions'](){const _0x41d107=ii['getDefaultQuickActions'](this['editor']['locale']),_0x56ffb7=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x1c11c8=[];try{_0x1c11c8=await new oe({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels')})['getAvailableModels']();}catch(_0x3946b6){const _0x3d0c47=new _0x3384e8('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x3946b6});_0x49f6d0(_0x3d0c47['message']);}finally{const _0x763b02=_0x56ffb7['map'](_0x171c34=>({..._0x171c34,'icon':void 0x0}));_0x41d107['find'](_0xfa9f27=>'other'===_0xfa9f27['id'])['actions']['push'](..._0x763b02),_0x41d107['forEach'](_0x5677af=>{if('actions'in _0x5677af)_0x5677af['actions']['forEach'](_0x111ebd=>{if(_0x111ebd['isEnabled']=!!_0x1c11c8['find'](_0x36d9ce=>_0x36d9ce['id']===_0x111ebd['model'])||void 0x0===_0x111ebd['model'],!_0x111ebd['isEnabled']){const _0x1a525b=new _0x3384e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x111ebd['id'],'modelId':_0x111ebd['model']});_0x49f6d0(_0x1a525b['message']);}});else{if(_0x5677af['isEnabled']=!!_0x1c11c8['find'](_0x28b04a=>_0x28b04a['id']===_0x5677af['model'])||void 0x0===_0x5677af['model'],!_0x5677af['isEnabled']){const _0x2173a8=new _0x3384e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x5677af['id'],'modelId':_0x5677af['model']});_0x49f6d0(_0x2173a8['message']);}}});}return _0x41d107;}['_initializeQuickActionsComponentsAndCommands'](){const _0x47a159=new _0x2c3837(this['editor']['locale']);_0x47a159['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x47a159),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x47a159);}['_initializeQuickActionsDropdown'](_0x18a56f){const _0x55c1a8=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',te({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':bt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x18a56f,'hasSearch':_0x55c1a8}));}['_prepareQuickActionsDefinition'](_0x2aea17){this['_quickActionsDefinition']=_0x2aea17['map'](_0x1cc786=>{if('actions'in _0x1cc786){const _0x385869=_0x1cc786;return{..._0x385869,'actions':_0x385869['actions']['map'](_0x2ce7f1=>{const {actions:_0x2e5bb5,..._0x2a5e5f}=_0x385869;return{..._0x2ce7f1,'parent':_0x2a5e5f};})['filter'](_0x4b184d=>this['_shouldIncludeAction'](_0x4b184d))};}return _0x1cc786;})['filter'](_0x104cab=>'actions'in _0x104cab?_0x104cab['actions']['length']>0x0:this['_shouldIncludeAction'](_0x104cab));}['_shouldIncludeAction'](_0x5137d2){const _0x48ddd1=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Va[_0x5137d2['type']])&&!_0x48ddd1['includes'](_0x5137d2['id']);}['_initializeQuickActionsComponents'](_0x446ab4){this['_quickActionsDefinition']['forEach'](_0x194194=>{if('actions'in _0x194194){const _0x4ed64d=te({'editor':this['editor'],'content':_0x194194['actions'],'buttonDefinition':_0x194194,'bodyCollection':_0x446ab4});this['editor']['ui']['componentFactory']['add'](_0x194194['id'],_0x4ed64d),_0x194194['actions']['forEach'](_0x1dddb7=>{const _0x4da63f=ee({'editor':this['editor'],'action':_0x1dddb7});this['editor']['ui']['componentFactory']['add'](_0x1dddb7['id'],_0x4da63f);});}else{const _0x32c15c=ee({'editor':this['editor'],'action':_0x194194,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x194194['id'],_0x32c15c);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x383333=>{const _0x2fdf5e=new _0x25f09c(_0x383333),_0x3c8b73=i(_0x383333,'AI_QUICK_ACTIONS_HEADING');_0x2fdf5e['buttonView']['set']({'label':_0x3c8b73,'icon':bt});const _0x168b1e=new _0x445524(_0x383333);_0x168b1e['set']({'ariaLabel':_0x3c8b73,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x50497a=>{if('actions'in _0x50497a){const _0x338840=_0x50497a,_0x543632=new _0x2d3211(_0x383333,_0x2fdf5e),_0x196442=new _0x25f09c(_0x383333),_0x4386f6=new _0x445524(_0x383333);_0x196442['buttonView']['set']({'label':_0x338840['label'],'icon':_0x338840['icon']}),_0x338840['actions']['forEach'](_0x2c1d36=>{const _0x61da6b=new _0x2d3211(_0x383333,_0x196442),_0x4e3dd5=new _0x42978b(_0x383333);_0x4e3dd5['set']({'label':_0x2c1d36['displayedPrompt'],'icon':_0x2c1d36['icon'],'role':'menuitem','isEnabled':_0x2c1d36['isEnabled']}),_0x4e3dd5['on']('execute',()=>{this['_executeQuickAction'](_0x2c1d36);}),_0x4e3dd5['delegate']('execute')['to'](_0x196442),_0x61da6b['children']['add'](_0x4e3dd5),_0x4386f6['items']['add'](_0x61da6b);}),_0x196442['panelView']['children']['add'](_0x4386f6),_0x543632['children']['add'](_0x196442),_0x168b1e['items']['add'](_0x543632);}else{const _0x16c045=_0x50497a,_0x38226e=new _0x2d3211(_0x383333,_0x2fdf5e),_0xa9e4a=new _0x42978b(_0x383333);_0xa9e4a['set']({'label':_0x16c045['displayedPrompt'],'icon':_0x16c045['icon'],'role':'menuitem','isEnabled':_0x16c045['isEnabled']}),_0xa9e4a['on']('execute',()=>{this['_executeQuickAction'](_0x16c045);}),_0xa9e4a['delegate']('execute')['to'](_0x2fdf5e),_0x38226e['children']['add'](_0xa9e4a),_0x168b1e['items']['add'](_0x38226e);}});const _0x23d91c=Object['values'](Va)['some'](_0x588a68=>this['editor']['plugins']['has'](_0x588a68));return _0x2fdf5e['set']({'isEnabled':_0x23d91c}),_0x2fdf5e['panelView']['children']['add'](_0x168b1e),_0x2fdf5e;});}['_executeQuickAction'](_0x970486){const _0x2d830a=this['editor'];_0x2d830a['editing']['view']['focus'](),_0x2d830a['commands']['execute']('aiQuickAction',_0x970486);const _0x13d468=_0x2d830a['ui']['view']['menuBarView'];_0x13d468&&_0x13d468['close']&&_0x13d468['close']();}}class ci extends Qt{['execute'](_0x1fa0e1){switch(this['_expandSelectionIfCollapsed'](),_0x1fa0e1['type']){case Ft['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5b1551=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x3384e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5b1551});}this['_handleAIChatAction'](_0x1fa0e1);break;case Ft['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x32fac5=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x3384e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x32fac5});}this['_handleAIActionsAction'](_0x1fa0e1);break;case Ft['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x19880d=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x3384e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x19880d});}this['_handleAIReviewAction'](_0x1fa0e1);}}async['_handleAIChatAction'](_0x4f6f10){const _0x4d0ad1=this['editor']['plugins']['get']('AIChat'),_0x127def=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x4f6f10['id'])_0x127def['removeSelectionFromChatContext'](),await _0x4d0ad1['addSelectionToChatContext'](),_0x4d0ad1['focusPromptInput']();else await _0x4d0ad1['startConversation'](),_0x127def['removeSelectionFromChatContext'](),await _0x4d0ad1['addSelectionToChatContext'](),_0x4d0ad1['focusPromptInput'](),await _0x4d0ad1['sendMessage']({'message':_0x4f6f10['prompt']||_0x4f6f10['displayedPrompt'],'quickActionData':{'id':_0x4f6f10['id'],'displayedPrompt':_0x4f6f10['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0xcc6c06=this['editor'],_0x2057df=_0xcc6c06['model']['document']['selection'];if(!_0x2057df['isCollapsed'])return;const _0x2434ff=_0x2897cc(_0x2057df['getSelectedBlocks']())||_0xcc6c06['model']['schema']['getLimitElement'](_0x2057df);_0xcc6c06['model']['change'](_0x41874c=>{_0x41874c['setSelection'](_0x2434ff,'in');});}['_handleAIActionsActionLabel'](_0x1e7dfb){return _0x1e7dfb['parent']?.['label']&&'other'!==_0x1e7dfb['parent']?.['id']?_0x1e7dfb['parent']['label']+':\x20'+_0x1e7dfb['displayedPrompt']:_0x1e7dfb['displayedPrompt'];}async['_handleAIActionsAction'](_0x499676){const _0x8e9bd=this['editor']['plugins']['get']('AIActions'),_0x204cc0=_0x499676['prompt']?{'userMessage':_0x499676['prompt'],'model':_0x499676['model']}:{'actionName':_0x499676['actionName']||_0x499676['id'],'args':_0x499676['args']},_0x2a9faa=this['_handleAIActionsActionLabel'](_0x499676);await _0x8e9bd['executeAction'](_0x204cc0,_0x2a9faa,_0x499676['icon']);}async['_handleAIReviewAction'](_0x8e53c5){console['log']('handleAIReviewAction',_0x8e53c5);}}class ti extends _0x45b3aa{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5ec969=this['editor'],_0x507204=new ci(this['editor']);if(_0x5ec969['commands']['add']('aiQuickAction',_0x507204),_0x5ec969['plugins']['has']('AIChat')){const _0x236afe=this['editor']['plugins']['get']('AIChat');_0x5ec969['model']['document']['selection']['on']('change:range',(_0x59442b,_0x58506f)=>{_0x58506f['directChange']&&_0x236afe['removeSelectionFromChatContext']();});}}}class Ne extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x416cd1=this['documentContextContent']['children']['map'](_0x37c4f4=>({'node':_0x37c4f4,'id':dt(_0x37c4f4,'data-id')})),_0x64de22=this['parsedMergedContent']['children']['map'](_0x7a9924=>({'node':_0x7a9924,'id':dt(_0x7a9924,'data-id')||_0x418744()})),_0x57e0e9=_0x33fd73(_0x416cd1,_0x64de22,{'comparator':(_0x32eeb2,_0x154824)=>_0x32eeb2['id']==_0x154824['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x57e0e9['length']&&_0x57e0e9[_0x57e0e9['length']-0x1]['removed'];)_0x57e0e9['pop']();}const _0x306dda=_0x57e0e9['map'](_0x1f4ae6=>{const _0x3e48d=_0x1f4ae6['added']?'new':_0x1f4ae6['removed']?'removed':'modified';return{'node':_0x1f4ae6['value'][0x0]['node'],'type':_0x3e48d,'id':_0x1f4ae6['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x306dda,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3e9c1c,_0x3c5022){return _0x3c5022;}}class yt extends pi{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x183576){super(_0x183576),this['content']=_0x183576['content'],this['version']=_0x183576['version'],this['actionName']=_0x183576['actionName'],this['args']=_0x183576['args'],this['userMessage']=_0x183576['userMessage'],this['model']=_0x183576['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'](_0x9ecdce){const _0x48a692=new Ne({'editor':this['editor'],'documentContextContent':this['content'],..._0x9ecdce});return this['replies']['push'](_0x48a692),_0x48a692['delegate'](...wi)['to'](this),this['fire']('replyCreated',_0x48a692),_0x48a692;}}class ri extends _0x45b3aa{static get['requires'](){return[R,_0x57edf4,S,mt,it];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new ft();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x35792b){super(_0x35792b),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x344b26,_0x3a2ddc,_0x20af14){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4f89fb,anchorData:_0x2b3579}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x344b26,_0x4f89fb,_0x2b3579,_0x3a2ddc,_0x20af14);}}const {modelFragment:_0x3d3f3f,anchorData:_0x5ef38b}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x344b26,_0x3d3f3f,_0x5ef38b,_0x3a2ddc,_0x20af14);}['_getExecuteDataRegular'](){const _0x54dfec=this['editor']['model']['document']['selection'];if(_0x54dfec['isCollapsed']){const _0x27b78b=_0x2897cc(_0x54dfec['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x54dfec);this['editor']['model']['change'](_0xf09fae=>{_0xf09fae['setSelection'](_0x27b78b,'in');});}const _0x2ff651=_0x54dfec['getFirstRange'](),_0x661c94=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x54dfec),_0x2ff651['start'],_0x2ff651['end']),_0x3390ef=_0x54dfec['getFirstRange']()['start'],_0x476e1f=new Map();let _0x1f46f8=_0x661c94;for(let _0x1a4df5=0x0;_0x1a4df5<_0x3390ef['path']['length'];_0x1a4df5++)_0x476e1f['set'](_0x1f46f8,_0x3390ef['path'][_0x1a4df5]),_0x1f46f8=_0x1f46f8['getChild'](0x0);return{'modelFragment':_0x661c94,'anchorData':_0x476e1f};}['_getExecuteDataInTable'](){const _0x45a359=this['editor']['model']['document']['selection'],_0xe21a10=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x28f5c6=_0x45a359['getFirstRange']()['start']['parent']['parent'],_0x2fc52c=this['_wrapWithCommonAncestors'](_0xe21a10,this['editor']['model']['createPositionBefore'](_0x28f5c6),this['editor']['model']['createPositionAfter'](_0x28f5c6)),_0x99de8d=_0x45a359['getFirstRange']()['start'],_0x266c4d=new Map();let _0x45b36f=_0x2fc52c;for(let _0xfd7b54=0x0;_0xfd7b54<_0x99de8d['path']['length'];_0xfd7b54++)if(_0x266c4d['set'](_0x45b36f,_0x99de8d['path'][_0xfd7b54]),_0xfd7b54<_0x99de8d['path']['length']-0x1)_0x45b36f=_0x45b36f['getChild'](0x0);else{let _0x4fa520=_0x45b36f['nextSibling'];for(;_0x4fa520;)_0x266c4d['set'](_0x4fa520,_0x99de8d['path'][_0xfd7b54]),_0x4fa520=_0x4fa520['nextSibling'];}return{'modelFragment':_0x2fc52c,'anchorData':_0x266c4d};}['_executeAction'](_0x156a3b,_0x57a529,_0x47d2ad,_0x439b4e,_0x2f9fa0){const _0x1ef3cd=this['editor']['plugins']['get'](S),_0x4c0ad9=this['editor']['plugins']['get'](mt),_0x3bda56=this['editor']['model']['document']['selection'],_0x4a6d20=_0x1ef3cd['modelToViewWithIds'](_0x57a529),_0x1f9bc8=this['editor']['data']['processor']['toData'](_0x4a6d20),_0x174414=this['editor']['model']['document']['version'],_0x3191dd=[..._0x3bda56['getRanges']()];let _0x46da5a=this['editor']['config']['get']('ai.availableReplyActions')||[...H];this['editor']['plugins']['has']('TrackChanges')||(_0x46da5a=_0x46da5a['filter'](_0x307708=>'insertSuggestion'!=_0x307708));const _0x4d6324=new _t(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x46da5a});return _0x4c0ad9['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x439b4e,'icon':_0x2f9fa0||bt,'mainView':_0x4d6324,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x3191dd}),this['_setLoadingState'](_0x4d6324,_0x4c0ad9),this['listenTo'](_0x4c0ad9,'applySuggestion',()=>{this['_applyChanges'](_0x57a529,_0x47d2ad,!0x1);}),this['listenTo'](_0x4c0ad9,'insertSuggestion',()=>{this['_applyChanges'](_0x57a529,_0x47d2ad,!0x0);}),this['listenTo'](_0x4c0ad9,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x4c0ad9,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x6d5570=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x169934=_0x6d5570['changeGroups'][0x0];_0x169934&&'pending'===_0x169934['state']&&_0x6d5570['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x4c0ad9);}),this['_createInteraction'](_0x1f9bc8,_0x174414,_0x4d6324,_0x4c0ad9,_0x156a3b);}['_wrapWithCommonAncestors'](_0x282f79,_0xfbd95f,_0x446401){const _0x522ac3=this['editor']['model']['createRange'](_0xfbd95f,_0x446401)['getCommonAncestor'](),_0x1673da=_0x522ac3['is']('documentFragment')?[]:_0x522ac3['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1673da['length']){const _0x51144c=_0x1673da['map'](_0x1c6af8=>_0x1c6af8['_clone'](!0x1));for(let _0xd09a3b=0x1;_0xd09a3b<_0x51144c['length'];_0xd09a3b++)_0x51144c[_0xd09a3b-0x1]['_appendChild'](_0x51144c[_0xd09a3b]);return _0x51144c[_0x51144c['length']-0x1]['_appendChild'](_0x282f79),new jt(_0x51144c[0x0]);}return _0x282f79;}async['_createInteraction'](_0xbfc7de,_0x205ee7,_0x4c7fbb,_0xf8286b,_0x3d72c6){const _0x3a2f36=this['editor'];this['_interactionParams']={'action':_0x3d72c6,'content':_0xbfc7de,'version':_0x205ee7,'mainView':_0x4c7fbb,'aiBalloon':_0xf8286b};const _0x91a445=new yt({'connector':this['_aiConnector'],'editor':_0x3a2f36,'content':_0xbfc7de,'version':_0x205ee7,..._0x3d72c6});this['_interactions']['push'](_0x91a445),_0x4c7fbb['hideError']();const _0x2066c4=(_0x5857aa,_0x3d5a3d,_0xa3b2a8=!0x1,_0x304d77='streaming')=>this['_promiseQueue']['enqueue'](async _0x584a74=>{try{const _0x5eb974=xt({'editor':_0x3a2f36,'changeGroups':_0x5857aa['changeGroups'],'documentContextContent':_0x5857aa['documentContextContent'],'showDiff':_0xa3b2a8,'trimUnchanged':!0x1});await _0x3d5a3d['updateContent']({'parts':_0x5eb974,'renderingStrategy':_0x304d77,'abortSignal':_0x584a74});}catch(_0x1c54d6){if(this['_isAbortError'](_0x1c54d6))return;throw _0x1c54d6;}});this['_interaction']['on']('replyCreated',(_0x53b76f,_0x4aee0c)=>{_0x4c7fbb['hideLoader'](),_0xf8286b['startAutoScroll'](),_0x2066c4(_0x4aee0c,_0x4c7fbb)['catch'](_0x31522a=>{this['_isAbortError'](_0x31522a)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x31522a),this['_setErrorState'](_0x91a445,_0x4c7fbb));});}),this['_interaction']['on']('replyContentUpdated',(_0x501486,_0x220dec)=>{_0x2066c4(_0x220dec,_0x4c7fbb)['catch'](_0x10e868=>{this['_isAbortError'](_0x10e868)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x10e868),this['_setErrorState'](_0x91a445,_0x4c7fbb));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x4c7fbb,_0xf8286b),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x515217){this['_isAbortError'](_0x515217)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x515217),this['_setErrorState'](_0x91a445,_0x4c7fbb));}finally{_0xf8286b['stopAutoScroll']();}}),this['listenTo'](_0x4c7fbb,'toggleSuggestionDisplayMode',async(_0x1e5729,{showDiff:_0x2a24fb})=>{try{this['_balloonShowDiff']=_0x2a24fb;const _0x2ae502=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2ae502&&await _0x2066c4(_0x2ae502,_0x4c7fbb,_0x2a24fb,'static');}catch(_0x50e546){this['_isAbortError'](_0x50e546)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x50e546),this['_setErrorState'](_0x91a445,_0x4c7fbb));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x417887,{reply:_0x2db90f})=>{const _0x3cf7da={'positiveCount':_0x2db90f['changeGroups']['filter'](_0x6a510f=>'accepted'===_0x6a510f['state'])['length'],'totalCount':_0x2db90f['changeGroups']['length']},_0x462469=this['_interaction']['actionCallId'],_0x42d912=this['_interaction']['actionName'];_0x42d912?this['_aiConnector']['upsertAIActionRating'](_0x42d912,_0x462469,_0x3cf7da):this['_aiConnector']['upsertCustomAIActionRating'](_0x462469,_0x3cf7da);}),this['_setLoadingState'](_0x4c7fbb,_0xf8286b);try{const _0x463ca5=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x463ca5;}catch(_0x5cae0e){if(this['_isAbortError'](_0x5cae0e))return;_0x4c7fbb['hideLoader'](),this['_setErrorState'](_0x91a445,_0x4c7fbb);}}['_applyChanges'](_0x461d75,_0x346c08,_0xb3a765){const _0xf171f2=this['editor'];if(_0xb3a765&&!_0xf171f2['plugins']['has']('TrackChanges'))throw new _0x3384e8('ai-no-track-changes',null);const _0x4adbd9=this['editor']['plugins']['get'](it),_0x5b7ece=this['_interaction'],_0x58b105=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1e240d=_0x58b105['changeGroups'];_0x58b105['setChangeGroupState'](0x0,'accepted');let _0x3fc5ea=ot({'editor':_0xf171f2,'reply':_0x58b105,'interaction':_0x5b7ece,'groups':_0x1e240d,'transform':!0x1,'documentCompare':_0x4adbd9,'documentCompareOptions':{'anchor':_0xf171f2['model']['createPositionAt'](_0x461d75,0x0),'markDeletions':_0xb3a765}});_0x3fc5ea=this['_filterOperationsOutsideRange'](_0x3fc5ea,_0x346c08);for(const _0x94f88b of _0x3fc5ea)this['_anchorOperation'](_0x346c08,_0x94f88b,_0xf171f2['model']['document']['getRoot']());const _0x5afc9c=_0x5b7ece['getDocumentContext']()['version'],_0x3ceb33=_0xf171f2['model']['document']['history']['getOperations'](_0x5afc9c),_0x4af90b={'document':_0xf171f2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3c34c2=Ot(_0x3fc5ea,_0x3ceb33,_0x4af90b)['operationsA'];_0xf171f2['model']['change'](_0x5b7254=>{if(_0x5b7254['setSelection'](_0xf171f2['model']['document']['selection']['focus']),_0xb3a765)_0xf171f2['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3c34c2);else{for(const _0x526c66 of _0x3c34c2)_0x526c66['baseVersion']=_0xf171f2['model']['document']['version'],et(_0xf171f2,_0x526c66),_0x5b7254['batch']['addOperation'](_0x526c66),_0xf171f2['model']['applyOperation'](_0x526c66);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x1271db,_0x46f83){return _0x1271db['filter'](_0x578429=>{if('rename'==_0x578429['type']){const _0x45b6fa=_0x578429['position']['nodeAfter'];return!_0x46f83['has'](_0x45b6fa);}if(_0x578429['type']['indexOf']('Attribute')>-0x1){const _0x5dc6f0=_0x578429['range']['start']['nodeAfter'];return!_0x46f83['has'](_0x5dc6f0);}return!0x0;});}['_anchorOperation'](_0x2e1c5c,_0x3c20a9,_0x4b0a3d){const _0x170c1a=_0x3c20a9['clone']();for(const _0x412c83 in _0x3c20a9){const _0x2268d7=_0x3c20a9[_0x412c83];_0x2268d7 instanceof nt?_0x3c20a9[_0x412c83]=new nt(_0x167648(_0x2268d7['start']),_0x167648(_0x2268d7['end'])):_0x2268d7 instanceof Dt&&(_0x3c20a9[_0x412c83]=_0x167648(_0x2268d7));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x170c1a['type'])){if(_0x170c1a['isDocumentOperation']=!0x1,_0x170c1a['baseVersion']=null,'remove'==_0x170c1a['type']){const _0x4e6088=_0x170c1a['sourcePosition'],_0x5ede55=_0x170c1a['howMany'];new ht(_0x4e6088,_0x5ede55)['_execute']();}else _0x170c1a['_execute']();}function _0x167648(_0x5dc88b){if('$graveyard'==_0x5dc88b['root']['rootName'])return _0x5dc88b;const _0x265520=[];let _0x498cf3=_0x5dc88b['root'];for(let _0x2036d4=0x0;_0x2036d4<_0x5dc88b['path']['length'];_0x2036d4++){const _0x1836d3=_0x2e1c5c['get'](_0x498cf3)||0x0;_0x265520[_0x2036d4]=_0x5dc88b['path'][_0x2036d4]+_0x1836d3,_0x498cf3=_0x498cf3['getChildAtOffset'](_0x5dc88b['path'][_0x2036d4]);}return new Dt(_0x4b0a3d,_0x265520,_0x5dc88b['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x3544b0,content:_0x5b4a3f,version:_0x13b1a2,mainView:_0x5b85a0,aiBalloon:_0x54181f}=this['_interactionParams'];_0x5b85a0['areChangesVisible']=!0x1,_0x5b85a0['hideError'](),this['_clearErrorState'](_0x5b85a0,_0x54181f);const _0x1a5121=_0x5b85a0;_0x1a5121['miniToolbarView']&&_0x1a5121['miniToolbarView']['showChangesButton']&&_0x1a5121['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':kt}),this['_clearSuggestionContent'](_0x5b85a0),_0x5b85a0['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x5b85a0),this['_createInteraction'](_0x5b4a3f,_0x13b1a2,_0x5b85a0,_0x54181f,_0x3544b0)['catch'](_0x507ec8=>{this['_isAbortError'](_0x507ec8)||console['error']('Error\x20refreshing\x20interaction:',_0x507ec8);});}['_clearSuggestionContent'](_0x20c286){const _0x5377e0=_0x20c286['bodyView']['_children'];for(;_0x5377e0['length']>0x0;)_0x5377e0['remove'](_0x5377e0['first']);_0x20c286['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x146a05){return!!_0x146a05['message']&&_0x146a05['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x1ea4e6=new _0x5c8003(this['editor']['locale']),_0x5be9f3=new _0x5c8003(this['editor']['locale']),_0x21f978=new wt(this['editor']['locale']),_0x283fff=new _0x5c8003(this['editor']['locale']);_0x1ea4e6['set']({'icon':vt,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x5be9f3['set']({'icon':Nt,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x21f978['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x283fff['set']({'icon':Tt,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x1ea4e6['bind']('isEnabled')['to'](this,'isBusy',_0x32b2f4=>!_0x32b2f4),_0x1ea4e6['on']('execute',()=>{this['_refreshInteraction']();}),_0x5be9f3['bind']('isEnabled')['to'](this,'isBusy',_0x34d14d=>!_0x34d14d),_0x5be9f3['on']('execute',()=>{this['_navigateToPrevious']();}),_0x283fff['bind']('isEnabled')['to'](this,'isBusy',_0x339918=>!_0x339918),_0x283fff['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x5be9f3,this['_navigationCounter']=_0x21f978,this['_navigationNextButton']=_0x283fff,this['_customViews']['add'](_0x1ea4e6);}['_navigateToPrevious'](){const _0x437183=this['_interactions']['length'];this['_currentInteractionIndex']<_0x437183-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x42114b){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x42114b;const {mainView:_0xd2595a}=this['_interactionParams'],_0x402d72=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x402d72)return;if(_0x402d72['hasError'])return this['_setErrorState'](_0x402d72,_0xd2595a),void this['_updateNavigationUI']();if(!_0x402d72['replies']['length'])return;_0xd2595a['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0xd2595a,this['_interactionParams']['aiBalloon']);const _0x50dc8b=_0x402d72['replies'][_0x402d72['replies']['length']-0x1];if(_0x50dc8b){const _0x46c060=this['editor'];this['_clearSuggestionContent'](_0xd2595a);try{const _0x2e73a2=xt({'editor':_0x46c060,'changeGroups':_0x50dc8b['changeGroups'],'documentContextContent':_0x50dc8b['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0xd2595a),await new Promise(_0x1afa73=>setTimeout(_0x1afa73,0x32)),await _0xd2595a['updateContent']({'parts':_0x2e73a2,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1c0671){this['_isAbortError'](_0x1c0671)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1c0671);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x31846e=this['_interactions']['length'],_0x1ed8b1=_0x31846e>0x1,_0x5acf7d=this['_interactionParams']?.['mainView'];if(_0x1ed8b1){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x5acf7d?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x5acf7d?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x5acf7d?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x46ecc7=_0x31846e-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x46ecc7+'/'+_0x31846e),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x31846e-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x5acf7d?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x5acf7d?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x5acf7d?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x3a82c4,_0x165b52){_0x3a82c4['setLoading'](),_0x165b52['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x634982,_0x17bc20){const _0x45efd2=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x17bc20['showError'](_0x45efd2),_0x634982['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x17bc20['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0xd33c5c,_0x17913d){_0xd33c5c['clearErrorState'](),_0x17913d['balloonView']['toolbar']&&(_0x17913d['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x5bcb06,_0x2c0655){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x5bcb06['clearLoading'](),_0x2c0655['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0xe82d3b=>{'isEnabled'in _0xe82d3b&&(_0xe82d3b['isEnabled']=!0x1);});}}class Ga extends _0x45b3aa{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf0d12d){super(_0xf0d12d),_0xf0d12d['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x2ab3de,title:_0x37c8f4,description:_0x2c448d,isParameterized:_0x36635a,useArgs:_0x1fd919,options:_0xa85df0}){this['id']=_0x2ab3de,this['title']=_0x37c8f4,this['description']=_0x2c448d,this['isParameterized']=_0x36635a,this['useArgs']=_0x1fd919,this['options']=_0xa85df0;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x57c3e5){this['_models']=_0x57c3e5;}}class si extends ts(){['_checks'];constructor(_0x92a9b1){super(),this['_checks']=this['_mapCheckDefinitions'](_0x92a9b1);}get['checks'](){return this['_checks'];}['getCheckById'](_0x2fdda4){return this['checks']['find'](_0x978033=>_0x978033['id']===_0x2fdda4);}['removeCheckById'](_0x44fdce){this['_checks']=this['_checks']['filter'](_0x5ef0d8=>_0x5ef0d8['id']!==_0x44fdce);}['_mapCheckDefinitions'](_0x499730){return _0x499730['map'](_0x763cb6=>'custom'===_0x763cb6['id']?new Bs(_0x763cb6):new js(_0x763cb6));}}class Rs extends _0xe5b3f8(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x423df2,contentNew:_0x3b3494,contentInitial:_0x3f51af,documentVersion:_0x166c83}){super(),this['id']=_0x423df2,this['contentNew']=_0x3b3494,this['contentInitial']=_0x3f51af,this['documentVersion']=_0x166c83;}}class Ds extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x666d19,_0x38a1cd,_0x408edb){super(),this['id']=_0x666d19,this['parent']=_0x408edb,this['_data']=_0x38a1cd,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class zs extends ts(){['id']=_0x418744();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x4b2c14,_0x23716e,_0x228feb,_0x6cd90c,_0xf915fc){super(),this['_sourceCheck']=_0x23716e,this['_documentData']=_0x4b2c14,this['_aiConnector']=_0x228feb,this['_reviewParams']=_0x6cd90c,this['_reviewArgs']=_0xf915fc,this['on']('change:status',(_0x38d69f,_0x32f29c,_0x40cae2)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x40cae2,'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'](_0x5c1e32=>'pending'===_0x5c1e32['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x442cb0){this['_documentData']=_0x442cb0;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0xed8775=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x430b2f of _0xed8775)'unmodified'!==_0x430b2f['data']['operation']&&('error'!==_0x430b2f['data']['operation']?'review-metadata'!==_0x430b2f['event']?this['_addReviewCheckResult'](_0x430b2f['data']['dataId'],_0x430b2f['data']['textDelta']):this['callId']=_0x430b2f['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x3508b1){this['_currentError']=_0x3508b1,_0x3508b1 instanceof Error&&_0x3508b1['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'](_0x4138e9,_0x572ec4){const _0x5520dd=this['_results']['get'](_0x4138e9);if(!_0x5520dd)return;const _0x3e9924=[];_0x572ec4['forEach']((_0xc6d773,_0x4cab06)=>{const _0x314717=new Ds(_0x5520dd['id']+'-'+_0x4cab06,_0xc6d773,_0x5520dd);_0x314717['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x314717,'status':_0x314717['status']});}),_0x314717['on']('change:isActivated',()=>{_0x314717['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x314717}):this['fire']('reviewCheckResultDeactivated',{'change':_0x314717});}),this['_changes']['push'](_0x314717),_0x3e9924['push'](_0x314717);}),this['fire']('reviewCheckResultReady',{'changes':_0x3e9924,'result':_0x5520dd,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x265e5d){const _0x1bd140=this['_changes']['find'](_0x1a2105=>_0x1a2105['id']===_0x265e5d);return!(!_0x1bd140||'pending'!==_0x1bd140['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xe47671=>!0x0===_0xe47671['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4f8496=>'pending'===_0x4f8496['status']);}['getChangeById'](_0x26e5e2){return this['_changes']['find'](_0x39c3ee=>_0x39c3ee['id']===_0x26e5e2);}['markAllChangesAsAccepted'](){for(const _0x533145 of this['_changes'])'pending'===_0x533145['status']&&(_0x533145['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x2b375f){const _0x513e72=this['_changes']['find'](_0x42f1b6=>_0x42f1b6['id']===_0x2b375f);_0x513e72&&'pending'===_0x513e72['status']&&(_0x513e72['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x577882){const _0x13d297=this['_changes']['find'](_0x4c9d30=>_0x4c9d30['id']===_0x577882);_0x13d297&&'pending'===_0x13d297['status']&&(_0x13d297['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4891f9){const _0x21ddd2=this['_changes']['find'](_0x506d6e=>_0x506d6e['id']===_0x4891f9);_0x21ddd2&&'pending'===_0x21ddd2['status']&&(_0x21ddd2['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x5c825c){const _0x48b525=this['_changes']['find'](_0x307d55=>_0x307d55['id']===_0x5c825c);_0x48b525&&'outdated'===_0x48b525['status']&&(_0x48b525['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3335e6){this['_changes']['filter'](_0x549e21=>_0x549e21['isActivated']&&_0x549e21['id']!==_0x3335e6)['forEach'](_0x5bb1df=>{_0x5bb1df['isActivated']=!0x1;});const _0x1e0a30=this['_changes']['find'](_0x55608e=>_0x55608e['id']===_0x3335e6);_0x1e0a30&&'pending'===_0x1e0a30['status']&&(_0x1e0a30['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x2404c2=>_0x2404c2['isActivated'])['forEach'](_0x2c67ce=>{_0x2c67ce['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xd79d48){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x1d41d5;if(_0xd79d48){const _0x19547d=this['_changes']['find'](_0x4d55f2=>_0x4d55f2['id']===_0xd79d48);if(_0x19547d&&_0x19547d['isRated'])return;_0x19547d&&(_0x1d41d5=_0x19547d['parent']['id'],_0x19547d['isRated']=!0x0);}const _0x7c8697={'positiveCount':this['_changes']['filter'](_0x1a5c8a=>'accepted'===_0x1a5c8a['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x7c8697,this['callId'],_0x1d41d5);}['_addReviewCheckResult'](_0x31358c,_0x107a24){const _0x136a07=this['_documentData']['elements']['get'](_0x31358c);if(!_0x136a07)return;const _0x548f6e=_0x136a07['getContent']();if(_0x548f6e===_0x107a24)return;const _0x2c576f=new Rs({'id':_0x31358c,'contentInitial':_0x548f6e,'contentNew':_0x107a24,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2c576f['id'],_0x2c576f),this['fire']('reviewCheckResultAdded',{'result':_0x2c576f,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x44f940=>'pending'===_0x44f940['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x8d90ae=>'pending'===_0x8d90ae['status'])['length']&&(this['status']='finished'));}}class hi extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x46250=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3781b1=0x0;_0x3781b1<this['_reviewParams']['length'];_0x3781b1++){if(!this['_reviewParams'][_0x3781b1]||!this['_sourceCheck']['options'][_0x3781b1])continue;const _0x293130=this['_sourceCheck']['options'][_0x3781b1],_0x4c7fc8=_0x293130['data']?.['find'](_0x2a4ef1=>_0x2a4ef1['id']===this['_reviewParams'][_0x3781b1]);_0x4c7fc8&&_0x46250['push'](_0x4c7fc8['label']);}return _0x46250['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0xb384eb,_0x5cd417,_0xca63df){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x5cd417,_0xb384eb,_0xca63df);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends zs{['_prompt'];['_model'];constructor(_0x5989f8,_0x1e941c,_0x1a9fe6,_0x1cef71,_0x876dfa){super(_0x1a9fe6,_0x1cef71,_0x876dfa),this['_prompt']=_0x5989f8,this['_model']=_0x1e941c;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5e1930,_0x2c775c,_0x21c1fb){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2c775c,_0x5e1930,_0x21c1fb);}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class me extends _0x36f460{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[R];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x32877a=this['context']['config']['get']('ai.reviewMode.translations');if(_0x32877a){for(const _0x53c02f of ni)'translate'===_0x53c02f['id']&&(_0x53c02f['options'][0x0]['data']=_0x32877a);}const _0x4ba46d=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x4ba46d);const _0x5e7d51=this['_aiReviewCheckList']['checks']['find'](_0x21bb40=>'custom'===_0x21bb40['id']);if(_0x5e7d51)try{const _0x49d037=await new oe({'connector':this['_aiConnector']})['getAll']();_0x5e7d51['models']=_0x49d037['map'](_0x5bde75=>({..._0x5bde75,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x5bde75['id']['toUpperCase'](),_0x5bde75['description'])}));}catch(_0x4de045){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x3384e8('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x4de045}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x18967f,_0x3d08ac)=>{const _0x13d998=this['_aiReviewCheckList']['getCheckById'](_0x3d08ac['id']);if(_0x13d998){this['_onDiffChange'](this['_isDiffOn']),_0x3d08ac['isCustom']?this['_currentReviewCheckRun']=new oi(_0x3d08ac['args']['prompt'],_0x3d08ac['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x13d998,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x13d998,this['_aiConnector'],_0x3d08ac['params'],_0x3d08ac['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4a3f32,_0x3b09a2)=>{'data'===_0x3b09a2['status']||'loading'===_0x3b09a2['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x3b09a2)):'finished'===_0x3b09a2['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x3b09a2['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x3b09a2['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x3b09a2['status']?(this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x3384e8('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x3b09a2['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x3384e8('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x3b09a2['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x3b09a2['status']&&'error-chunk'!==_0x3b09a2['status']&&'error-general'!==_0x3b09a2['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x50282a,_0x24cbe1)=>{if(!this['_currentReviewCheckRun'])throw new _0x3384e8('ai-review-mode-no-current-check-run',this);const _0x84c168=this['_aiReviewModeEditing']['diffContent'](_0x24cbe1['result']['contentInitial'],_0x24cbe1['result']['contentNew']);_0x24cbe1['source']['addResultChanges'](_0x24cbe1['result']['id'],_0x84c168);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3114bb,_0x3e7ff6)=>{for(const _0x544150 of _0x3e7ff6['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x544150);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x3e7ff6['changes'],_0x3e7ff6['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x596cb9,_0x40ad21)=>{this['_aiReviewModeUi']['updateChangeState'](_0x40ad21['change']['id'],_0x40ad21['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x33c939,_0x2e3f8a)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x2e3f8a['change']['id']);const _0x557c8e=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x2e3f8a['change']['id']);if(!_0x557c8e)return;if('content'===this['_changeActivationSource']){const _0x5dccbc=this['_aiReviewModeUi']['getChangeElement'](_0x2e3f8a['change']['id']);_0x5dccbc&&_0x597cbc(_0x5dccbc['closest']('.ck-ai-review-mode__check-run-result')||_0x5dccbc);}else{if('panel'===this['_changeActivationSource']){const _0x1ed51a={'target':_0x557c8e['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x2618c2(_0x1ed51a);}}const _0x1795de=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x2e3f8a['change'],_0x557c8e['domElement'],void 0x0,'click',_0x1795de?.['editing']?.['view']?.['getDomRoot'](),_0x1795de?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x58115c){_0x58115c instanceof Error&&_0x58115c['message']['includes']('ai-request-aborted')||(_0x58115c instanceof _0x3384e8?this['_logError'](_0x58115c):this['_logError'](new _0x3384e8('ai-review-mode-check-run-failed',this,{'error':_0x58115c})));}}else this['_logError'](new _0x3384e8('ai-review-mode-source-check-not-found',this,{'checkId':_0x3d08ac['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4ab749=this['_currentReviewCheckRun']['getActiveChanges']();_0x4ab749['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4ab749['map'](_0x2c3be0=>_0x2c3be0['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x4fcb5d,_0x1a8781)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1a8781['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x1a8781['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1a8781['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1a8781['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x54e3ab,_0x3f0581)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3f0581['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x3f0581['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x3f0581['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3f0581['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x33d4d1,_0x238244)=>{this['_isDiffOn']=_0x238244['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x19d58a,_0x34afa7)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x34afa7['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x456ca1,_0x100860)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x100860['changeId']);const _0xaed370=this['_currentReviewCheckRun']['getChangeById'](_0x100860['changeId']);if(!_0xaed370)return;const _0x40deb4=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0xaed370,_0x100860['markerElement'],_0x100860['domEvent'],'click',_0x40deb4?.['editing']?.['view']?.['getDomRoot'](),_0x40deb4?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x549bd1,_0x422881)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x4bc278=this['_currentReviewCheckRun']['getChangeById'](_0x422881['changeId']);if(!_0x4bc278)return;const _0x1dcf69=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x4bc278,_0x422881['markerElement'],_0x422881['domEvent'],'hover',_0x1dcf69?.['editing']?.['view']?.['getDomRoot'](),_0x1dcf69?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x326677,_0xe15d9)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0xe15d9['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x2ea7db,_0x40d81b)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x40d81b['changeId']);});}['_onReviewModeRunLeave'](_0x15a7cc=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x15a7cc&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x523760=this['_aiReviewModeEditing']['getEditor']();_0x523760&&_0x523760['editing']['view']['change'](_0xea0f80=>{const _0x29c194=_0x523760['editing']['view']['document']['getRoot']();_0xea0f80['removeClass']('ck-ai-review-mode-diff',_0x29c194),_0xea0f80['removeClass']('ck-ai-review-mode-highlights',_0x29c194);});}['_onDiffChange'](_0x61b682){const _0x42979d=this['_aiReviewModeEditing']['getEditor']();_0x61b682?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x42979d&&_0x42979d['editing']['view']['change'](_0x3b39f2=>{const _0x23c384=_0x42979d['editing']['view']['document']['getRoot']();_0x3b39f2['removeClass']('ck-ai-review-mode-diff',_0x23c384),_0x3b39f2['removeClass']('ck-ai-review-mode-highlights',_0x23c384),_0x3b39f2['addClass'](_0x61b682?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x23c384);});}['_translateReviewChecks'](_0x359dbc){return _0x359dbc['map'](_0x5a5411=>{const _0x5b1c5b='AI_REVIEW_CHECK_'+_0x5a5411['id']['toUpperCase']()['replaceAll']('-','_'),_0x236267={..._0x5a5411,'title':this['_getTranslationWithDefault'](_0x5b1c5b+'_TITLE',_0x5a5411['title']),'description':this['_getTranslationWithDefault'](_0x5b1c5b+'_DESCRIPTION',_0x5a5411['description'])};return _0x5a5411['options']&&(_0x236267['options']=_0x5a5411['options']['map'](_0x37932c=>({..._0x37932c,'label':this['_getTranslationWithDefault'](_0x5b1c5b+'_OPTIONS_LABEL',_0x37932c['label']||''),'data':_0x37932c['data']?_0x37932c['data']['map'](_0x2ed1ba=>({..._0x2ed1ba,'label':this['_getTranslationWithDefault'](_0x5b1c5b+'_OPTIONS_DATA_'+_0x2ed1ba['id']['toUpperCase'](),_0x2ed1ba['label'])})):void 0x0}))),_0x236267;});}['_getTranslationWithDefault'](_0x2df795,_0x517981){const _0x79c54d=i(this['context']['locale'],_0x2df795);return _0x79c54d===_0x2df795?_0x517981:_0x79c54d;}['_logError'](_0x5ecf40){_0x49f6d0(_0x5ecf40['message']),_0x5ecf40['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends wt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x457e2f,_0x3c9128){super(_0x457e2f),this['_defaultValue']=_0x3c9128['default']||(_0x3c9128['data']['length']>0x0?_0x3c9128['data'][0x0]['id']:''),this['_defaultLabel']=_0x3c9128['data']['find'](_0x355977=>_0x355977['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x2b674a(this['locale']);const _0xf33c28=this['_prepareListOptions'](_0x3c9128['data']);_0x562328(this['_dropdownView'],_0xf33c28,{'role':'menu','ariaLabel':_0x3c9128['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1086c3=>{_0x1086c3['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x51fb9a=>{this['formValue']=_0x51fb9a['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x51fb9a['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x326d81=[]){const _0x1650eb=new _0x5c5f1f();this['resetToDefault']();for(const _0x24bee7 of _0x326d81){const _0x397d88=new _0x9d6116({'label':_0x24bee7['label'],'withText':!0x0,'role':'menuitemradio','id':_0x24bee7['id'],'model':_0x24bee7});_0x397d88['bind']('isOn')['to'](this,'formValue',_0x2fa72a=>_0x2fa72a===_0x397d88['id']);const _0x559a9f={'type':'button','model':_0x397d88};_0x1650eb['add'](_0x559a9f);}return _0x1650eb;}}class ic extends _0x47f6ca{['_formItem']=null;constructor(_0x33f9e2,_0x4cdb0b,_0xf5234){super(_0x33f9e2),this['argsKey']=_0x4cdb0b?.['argsKey'];if('dropdown'===_0x4cdb0b['formType'])this['_formItem']=new Mr(this['locale'],_0x4cdb0b);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x2ea3eb=new _0xa23978(this['locale'],{'children':[this['_formItem']],'class':[_0xf5234?'ck-form__row_with-submit':'']});_0xf5234&&_0x2ea3eb['children']['add'](_0xf5234),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x2ea3eb]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Qs extends _0x56bdff{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3e76ee){super(_0x3e76ee),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x11d7cc(),this['minRows']=Qs['MIN_ROWS'],this['maxRows']=Qs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends wt{['focusTracker']=new _0x3b8d6f();['keystrokes']=new _0x11d7cc();['focusCycler'];['_focusables']=new ft();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2863af,_0x2de7ee){super(_0x2863af),this['_check']=_0x2de7ee,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x2de7ee['models']&&_0x2de7ee['models']['length']>0x0?_0x2de7ee['models'][0x0]['id']:'',this['_defaultLabel']=_0x2de7ee['models']&&_0x2de7ee['models']['length']>0x0?_0x2de7ee['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x114356(this['locale'],()=>new Qs(_0x2863af)),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 _0x5c5f1f(),this['_setModelList'](),_0x562328(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0xa23978(this['locale'],{'children':[this['promptInputView']]}),new _0xa23978(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x47b31a,_0x37fb59)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x37fb59()):_0x37fb59();}),this['focusCycler']=new _0x767b6d({'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'](_0x1b03bb=>{this['_focusables']['add'](_0x1b03bb),this['focusTracker']['add'](_0x1b03bb['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 _0xbabf22 of this['_getFormValidators']()){const _0x428f2c=_0xbabf22();if(_0x428f2c)return this['promptInputView']['errorText']=_0x428f2c,!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 _0x5adb79=new _0x5c8003(this['locale']),t=this['locale']['t'];return _0x5adb79['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x5adb79['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5adb79;}['_createCancelButtonView'](){const _0x335bc9=new _0x5c8003(this['locale']),t=this['locale']['t'];return _0x335bc9['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x335bc9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1cd466=>{_0x1cd466['stopPropagation']();})}}),_0x335bc9['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x335bc9;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0xdcf7a7=this['_check']['models'];if(this['resetToDefault'](),_0xdcf7a7?.['length']){const _0x1a424c=oe['getLocalized'](this['locale'],_0xdcf7a7);for(const _0x34129c of _0x1a424c){const _0x26b9c9=new _0x9d6116({'label':_0x34129c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x34129c['id'],'model':_0x34129c});_0x26b9c9['bind']('isOn')['to'](this,'modelId',_0x9b571e=>_0x9b571e===_0x34129c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x26b9c9,'labelView':new Xs(this['locale'],_0x34129c)});}}}['_createModelSelectionDropdown'](){const _0x469500=_0x2b674a(this['locale']);return _0x469500['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x469500['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x469500,'execute',_0x744be=>{this['modelId']=_0x744be['source']['model']['id'],_0x469500['buttonView']['label']=_0x744be['source']['label'];}),_0x469500;}['_createActionsFooterView'](){const _0x3a6265=new wt(this['locale']);return _0x3a6265['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x3a6265;}}class Xs extends _0x8cf3b6{constructor(_0x5b7b6a,_0x1e2d90){super();const _0x39c05e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x39c05e['to']('style'),'id':_0x39c05e['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x39c05e['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1e2d90['description']||'']}]}]});}}class Zs extends _0x47f6ca{['_formItemsCollection']=new ft();['_customCheckView']=null;constructor(_0x530ae1,_0xcf964,_0x4c2b58){super(_0x530ae1),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0xcf964['isParameterized']);const _0x5717b0=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x79b316=>_0x79b316),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x4a2c8c=>_0x4a2c8c)],'style':{'--ck-ai-review-check-list-item-index':_0x4c2b58}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0xcf964['title']}]},_0x5717b0]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0xcf964['description']}]}]}]},..._0xcf964['isParameterized']?[this['_createParameterizedView'](_0xcf964)]:[],...'custom'===_0xcf964['id']?[this['_createCustomView'](_0xcf964)]:[]]}),this['on']('click',()=>{_0xcf964['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0xcf964['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x5478fb({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x1196a8=>{_0x1196a8['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2fe120=new _0x314c7c();return _0x2fe120['content']=_0x4c63dc,_0x2fe120['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x2fe120;}['_createParameterizedView'](_0x4fd9c3){const _0x5b5602=new wt(),_0x1833aa=this['_createFormView'](_0x4fd9c3);return _0x5b5602['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3e862f=>!_0x3e862f)]},'children':[_0x1833aa]}),_0x5b5602;}['_createFormView'](_0xbfa6c2){const _0x2fea11=new wt(),_0x5d4b0b=Array['isArray'](_0xbfa6c2['options'])?_0xbfa6c2['options']:[],_0x4f548f=new _0x5c8003(this['locale']),t=this['locale']['t'];_0x4f548f['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4f548f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x39000d=>{_0x39000d['stopPropagation']();})}}),_0x4f548f['on']('execute',()=>{const _0x1c3c21=[],_0x4da60f={};this['_formItemsCollection']['forEach'](_0x20e09c=>{_0x1c3c21['push'](_0x20e09c['value']),_0xbfa6c2['useArgs']&&_0xbfa6c2['options']&&(_0x4da60f[_0x20e09c['argsKey']]=_0x20e09c['value']);}),this['fire']('runReviewCheck',{'id':_0xbfa6c2['id'],'params':_0x1c3c21['length']?_0x1c3c21:void 0x0,'args':Object['keys'](_0x4da60f)['length']?_0x4da60f:void 0x0});});const _0x9ba65e=_0x5d4b0b['length'];return _0x5d4b0b['forEach']((_0x1b5323,_0x3f55e4)=>{const _0x16eaa5=_0x3f55e4===_0x9ba65e-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0x1b5323,_0x16eaa5?_0x4f548f:null));}),_0x2fea11['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x2fea11;}['_createCustomView'](_0x16c21c){return this['_customCheckView']=new tc(this['locale'],_0x16c21c),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1b7d28=>!_0x1b7d28)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5b32cb,_0x13cb82,_0x4e698e)=>{_0x4e698e||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x47f6ca{['_checkViews'];constructor(_0x671f4b){super(_0x671f4b),this['_checkViews']=new ft();const _0x116f93=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x116f93['if']('isVisible','ck-hidden',_0x531dd6=>!_0x531dd6)]},'children':this['_checkViews']});}['setChecks'](_0x1d3897){this['_checkViews']['clear']();for(const [_0x16aa8c,_0x13f9d8]of _0x1d3897['entries']()){const _0x588483=new Zs(this['locale'],_0x13f9d8,_0x16aa8c);_0x588483['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x588483);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x235983 of this['_checkViews'])_0x235983 instanceof Zs&&_0x235983['resetToDefault']();}}class Ps extends wt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x30271b,_0x5c1cc3){super(_0x30271b),this['id']=_0x5c1cc3,this['set']('status','pending'),this['set']('changeId',_0x5c1cc3),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x5c1cc3,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1c1b22=new wt(this['locale']);return _0x1c1b22['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x4e7e44=>!_0x4e7e44)]}}),_0x1c1b22;}['_createAcceptButtonView'](){const _0x105271=new _0x5c8003(this['locale']);return _0x105271['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x105271['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x25ea4d=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x25ea4d['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x2392f0=>'pending'!==_0x2392f0)]}}),_0x105271;}['_createDismissButtonView'](){const _0x5cf602=new _0x5c8003(this['locale']);return _0x5cf602['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5cf602['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1be986=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x1be986['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0xb034eb=>'pending'!==_0xb034eb)]}}),_0x5cf602;}['_createInfoButtonView'](){const _0x17aadc=new _0x5c8003(this['locale']);return _0x17aadc['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x26136b,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x17aadc['bind']('isOn')['to'](this,'isInfoToggleOn',_0x24401b=>_0x24401b),_0x17aadc['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x17aadc;}['_createStatusButtonView'](){const _0x213367=new _0x5c8003(this['locale']);return _0x213367['set']({'withText':!0x0,'isEnabled':!0x1}),_0x213367['bind']('label')['to'](this,'status',_0x596f43=>i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x596f43['toUpperCase']())),_0x213367['bind']('icon')['to'](this,'status',_0x5c61ca=>'ACCEPTED'===_0x5c61ca['toUpperCase']()?_0x2eaecc:'REJECTED'===_0x5c61ca['toUpperCase']()?_0x4f3ae4:_0x28b226),_0x213367['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4d0285=>'pending'===_0x4d0285)],'disabled':'disabled'}}),_0x213367;}}class vr extends _0x5c8003{constructor(_0xa71171){super(_0xa71171),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x47f6ca{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x14ddfa){super(_0x14ddfa),this['_resultViews']=new ft(),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 yi(_0x14ddfa),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 _0x540832=this['_createCombinedSkeletonLoader'](),_0x1a7620=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x1a7620['if']('isVisible','ck-hidden',_0x180a9b=>!_0x180a9b)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x42d836=>_0x42d836)]},'children':this['_resultViews']},_0x540832]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x26c769){const _0x1b0a08=new Ps(this['locale'],_0x26c769['id']);_0x1b0a08['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1b0a08),_0x1b0a08['resultResponseView']['element']['innerHTML']=_0x26c769['contentDiffed'];}['hideResult'](_0x49beb4,_0x4ac050){if('pending'===_0x4ac050)return;const _0x2dc585=this['_resultViews']['find'](_0x6f447=>_0x6f447['id']===_0x49beb4);_0x2dc585&&(_0x2dc585['status']=_0x4ac050,_0x2dc585['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0xfeaf00,_0x1e37ab){if('pending'!==_0x1e37ab)return;const _0x2f4ab8=this['_resultViews']['find'](_0x5a723e=>_0x5a723e['id']===_0xfeaf00);_0x2f4ab8&&(_0x2f4ab8['status']=_0x1e37ab,_0x2f4ab8['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x727aba,_0x51d331){this['headerTitle']=_0x727aba,this['headerSubtitle']=_0x51d331||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Ae(this['locale'],Oe['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x5bee6e=new wt(this['locale']),_0x583bef=[];for(let _0x24617a=0x0;_0x24617a<0x10;_0x24617a++){const _0x56cc0c=this['_createSkeletonLoader']();_0x56cc0c['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x583bef['push'](_0x56cc0c);}return _0x5bee6e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4c062d=>!_0x4c062d)]},'children':_0x583bef}),_0x5bee6e;}['_createErrorView'](){const _0x1e1a9d=new wt(this['locale']),_0x157955=new _0x5c8003(this['locale']),t=this['locale']['t'];return _0x1e1a9d['delegate']('retryReview')['to'](this),_0x157955['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x157955['on']('execute',()=>{this['fire']('retryReview');}),_0x1e1a9d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x321ebc=>!_0x321ebc),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x465420=>'chunk'===_0x465420)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x436805=>'chunk'===_0x436805)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4b426c=>'general'!==_0x4b426c)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1ac15=>'chunk'!==_0x1ac15)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x157955]}),_0x1e1a9d;}['_createCancelButtonView'](){const _0x4bfe74=new _0x5c8003(this['locale']);return _0x4bfe74['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x1fefe2}),_0x4bfe74['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x396cd1=>_0x396cd1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4be076=>_0x4be076)]}}),_0x4bfe74['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4bfe74;}['_createToggleDiffButtonView'](){const _0x4ce47b=new _0x5c8003(this['locale']);_0x4ce47b['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4ce47b['bind']('isEnabled')['to'](this,'isError',_0x2094ed=>!_0x2094ed),_0x4ce47b['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5a6e0f=>!_0x5a6e0f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4ac4a6=>_0x4ac4a6)]}});const _0x2583dc=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2e5590=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4ce47b['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2d4cac=>_0x2d4cac),_0x4ce47b['bind']('icon')['to'](this,'isToggleDiffOn',_0x2414c7=>_0x2414c7?_0x3ea555:_0x5811d0),_0x4ce47b['bind']('label')['to'](this,'isToggleDiffOn',_0x28724f=>_0x28724f?_0x2583dc:_0x2e5590),_0x4ce47b['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4ce47b;}['_createAcceptAllButtonView'](){const _0x45981e=new _0x5c8003(this['locale']);return _0x45981e['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x45981e['bind']('isEnabled')['to'](this,'isError',_0x4c3370=>!_0x4c3370),_0x45981e['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x43095b=>!_0x43095b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5655b4=>_0x5655b4)]}}),_0x45981e['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x45981e;}['_createExitReviewButtonView'](){const _0x1348a5=new _0x5c8003(this['locale']);return _0x1348a5['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1348a5['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x58f076=>!_0x58f076),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x51a15f=>_0x51a15f)]}}),_0x1348a5['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x1348a5;}['_createResultHeaderView'](){const _0x104dfe=new wt(this['locale']),_0x56c312=this['_createTitleView']();return _0x104dfe['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x5bed06=>_0x5bed06)]},'children':[_0x56c312,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x104dfe;}['_createTitleView'](){const _0x772cc6=new wt(this['locale']),_0x560921=new Pe();return _0x560921['bind']('isVisible')['to'](this,'isResultReady',_0x5e2ff6=>!_0x5e2ff6),_0x772cc6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x560921,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x48474f=>_0x48474f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2cc44e=>!_0x2cc44e)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x772cc6;}['_createFinishReviewButtonView'](){const _0x527c15=new vr(this['locale']);return _0x527c15['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4ca531=>!_0x4ca531)]}}),_0x527c15['delegate']('finishReview')['to'](this),_0x527c15;}}class th extends _0x47f6ca{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x4c5c22){super(_0x4c5c22),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x303994=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x303994['if']('isVisible','ck-hidden',_0x1acbea=>!_0x1acbea)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':i(_0x4c5c22,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x12a1cf=new vr(this['locale']);return _0x12a1cf['delegate']('finishReview')['to'](this),_0x12a1cf;}['_createResultHeaderView'](){const _0x4fbe35=new wt(this['locale']);return _0x4fbe35['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4fbe35;}}class hh extends wt{constructor(_0x23778b){super(_0x23778b),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0xe2733b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0xe2733b['if']('isVisible','ck-hidden',_0x1a33df=>!_0x1a33df)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0xe2733b['to']('errorMessage')}]}]});}}class ve extends wt{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x338368){super(_0x338368),this['reviewModeHeader']=new _0x24123a(_0x338368,{'label':i(_0x338368,'AI_REVIEW_MODE'),'icon':_0x17a750,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x338368),this['reviewCheckListView']=new ih(_0x338368),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x338368),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x338368),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x1911f2){this['reviewCheckResultsView']['addResult'](_0x1911f2),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewModeErrorView'](_0x37729e){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x37729e;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ie extends _0x43f8f9{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x2f08df,_0x22a8c8){super(_0x2f08df),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']()),_0x22a8c8['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x459f25){this['resultItemView']['changeId']=_0x459f25['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x459f25['contentDiffed'];}['showBalloon'](_0x17551b,_0x29f9ea,_0x3617b5,_0x54356e,_0x145530,_0x4260b6){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x17551b),this['show']();const _0x3a61a4=Array['from'](_0x29f9ea['getClientRects']())['reverse'](),_0x62c243=this['_getPointedRectIndexFromEvent'](_0x3617b5,_0x3a61a4);'click'===_0x54356e?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x17551b['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x29f9ea,_0x62c243,_0x17551b['id'],_0x145530,_0x4260b6)})):'hover'===_0x54356e&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x29f9ea,_0x62c243,_0x17551b['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_removeActiveClassFromMarkers'](){_0x47832a['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0x3948ba=>{_0x3948ba['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x2c94a8){_0x47832a['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x2c94a8+'\x22]')['forEach'](_0x75f625=>{_0x75f625['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){_0x5478fb({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x2ae713=[this['element']];return this['_pinnedTargetElement']&&_0x2ae713['push'](this['_pinnedTargetElement']),_0x2ae713;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x494e10=new wt();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x494e10['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x494e10;}['_getBestRectPositionOnClick'](_0x5264e1,_0xf9e38,_0x26a708,_0x24bbfa,_0x3d4517){const _0xca63bb=this['position']['replace']('arrow_',''),_0x462409=Array['from'](_0x5264e1['getClientRects']());let _0x4766ee,_0x6d5749=_0x462409['reverse']();return void 0x0!==_0xf9e38&&this['_isPinnedRectVisible'](_0x6d5749[_0xf9e38],_0x24bbfa,_0x3d4517)?(_0x4766ee=_0x6d5749[_0xf9e38],this['_pinnedRectIndex']=_0xf9e38):this['_isPinnedRectVisible'](_0x6d5749[0x0],_0x24bbfa,_0x3d4517)&&void 0x0===_0xf9e38?_0x4766ee=_0x6d5749[0x0]:(_0x6d5749='s'==_0xca63bb[0x0]?[..._0x462409]['reverse']():_0x462409,_0x6d5749['forEach'](_0x8a9cc1=>{this['_isPinnedRectVisible'](_0x8a9cc1,_0x24bbfa,_0x3d4517)&&(_0x4766ee=_0x8a9cc1);})),this['_pinnedTargetChangeId']=_0x26a708,this['_pinnedTargetElement']=_0x5264e1,_0x4766ee||_0x5264e1['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x2187a6,_0x252d61,_0x494113){const _0xe4ad49=Array['from'](_0x2187a6['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x252d61&&this['_pinnedTargetChangeId']!==_0x494113)return this['_pinnedRectIndex']=_0x252d61,this['_pinnedTargetElement']=_0x2187a6,this['_pinnedTargetChangeId']=_0x494113,_0xe4ad49[_0x252d61];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x494113){if(_0x2187a6!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0xe4ad49[this['_pinnedRectIndex']];}return void 0x0!==_0x252d61&&this['_pinnedTargetChangeId']!==_0x494113?(this['_pinnedRectIndex']=_0x252d61,this['_pinnedTargetElement']=_0x2187a6,this['_pinnedTargetChangeId']=_0x494113,_0xe4ad49[_0x252d61]):_0x2187a6['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x462eed,_0x311aeb){if(_0x462eed)for(let _0x23ffcf=0x0;_0x23ffcf<_0x311aeb['length'];_0x23ffcf++){const _0x7f8f22=_0x311aeb[_0x23ffcf];if(_0x462eed['clientX']>=_0x7f8f22['left']-0x3&&_0x462eed['clientX']<=_0x7f8f22['right']+0x3&&_0x462eed['clientY']>=_0x7f8f22['top']-0x3&&_0x462eed['clientY']<=_0x7f8f22['bottom']+0x3)return _0x23ffcf;}}['_isPinnedRectVisible'](_0x2552ad,_0x4b0981,_0xec8d12){const _0x5b9067=new _0x444add(_0x2552ad),_0x1742c9=_0x4b0981||document['documentElement'],_0x2724db=_0x5b9067['getIntersection'](_0x2db8df(_0xec8d12)),_0x48ecab=new _0x444add(_0x1742c9)['getIntersection'](_0x5b9067);return!!(_0x2724db&&_0x48ecab&&_0x5b9067['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ce extends _0x36f460{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Y];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1cb7c1){super(_0x1cb7c1),this['_bodyCollection']=new _0x2c3837(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ve(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ie(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x4f2d40=this['context']['plugins']['get']('AITabs');_0x4f2d40['view']['on']('activateTab',(_0x56287a,_0xe60f70)=>{'reviewMode'===_0xe60f70?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x4f2d40['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x17a750,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x31145f){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x31145f),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3f1a69){_0x3f1a69&&('error-general'!==_0x3f1a69['status']?'error-chunk'!==_0x3f1a69['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x2f45d1){this['_reviewModeView']['addCheckRunResult'](_0x2f45d1);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x454ccf){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x454ccf??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4de12a,_0x2a6c28){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x4de12a,_0x2a6c28);}['setActiveStateInResults'](_0x38e191){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4f27a9=>{_0x4f27a9['id']===_0x38e191&&_0x4f27a9['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1c48e0=>_0x1c48e0['setItemAsInactive']());}['updateChangeState'](_0x2a655f,_0x5b4c89){'accepted'===_0x5b4c89||'rejected'===_0x5b4c89||'outdated'===_0x5b4c89?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x2a655f,_0x5b4c89):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x2a655f,_0x5b4c89);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5c1f6a,_0x4c58ff,_0x2c17df,_0x30ec18,_0x125a35,_0x2aad96){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x5c1f6a,_0x4c58ff,_0x2c17df,_0x30ec18,_0x125a35,_0x2aad96);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x57a1b2){const _0x434285=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x133060=>_0x133060['id']===_0x57a1b2);return _0x434285?_0x434285['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const pe='reviewmode-';class ue extends _0x36f460{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[it,S];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x95fd7b){super(_0x95fd7b),this['_domEmitter']=new(_0x18713c())(),this['_eventEmitter']=new(_0xe5b3f8())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2e5270=q(this['context']);_0x2e5270['conversion']['for']('editingDowncast')['markerToElement']({'model':pe+'insert','view':(_0x560908,{writer:_0x3323de})=>{const _0x56861d=this['_markers']['get'](_0x560908['markerName']),_0xe9a092={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x560908['markerName']};return _0x3323de['createUIElement']('span',_0xe9a092,function(_0x58f8cf){const _0x264744=this['toDomElement'](_0x58f8cf);return _0x264744['innerHTML']=_0x56861d?.['text']||'',_0x264744;});}}),_0x2e5270['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pe+'remove-only','view':_0x103c7b=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x103c7b['markerName']}})}),_0x2e5270['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pe+'remove-context','view':_0x3f0711=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x3f0711['markerName']}})}),_0x2e5270['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pe+'remove-text','view':_0x37304a=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x37304a['markerName']}})}),_0x2e5270['conversion']['for']('dataDowncast')['markerToElement']({'model':pe+'suggestion-context','view':(_0x346f8e,{writer:_0x48449c})=>_0x48449c['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x346f8e['isOpening']?'start':'end')})}),_0x2e5270['conversion']['for']('downcast')['attributeToAttribute']({'model':st,'view':_0x29fc86}),this['_domEmitter']['listenTo'](document,'click',(_0x2331a7,_0x4309df)=>{const _0x3e6a63=_0x4309df['target'],_0x34d032=this['_findMarkerElement'](_0x3e6a63);if(!_0x34d032)return;const _0xc59a5f=_0x34d032['getAttribute']('data-marker-id'),_0x52c1da=_0xc59a5f['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0xc59a5f,'changeId':_0x52c1da,'markerElement':_0x34d032,'domEvent':_0x4309df});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x496259,_0x3c7992)=>{const _0x4005a9=_0x3c7992['target'],_0x8f82a3=_0x3c7992['relatedTarget'];let _0x2db139=this['_findMarkerElement'](_0x4005a9);if(!_0x2db139&&_0x8f82a3&&(_0x2db139=this['_findMarkerElement'](_0x8f82a3)),!_0x2db139)return;const _0x26571e=_0x2db139['getAttribute']('data-marker-id'),_0x294614=_0x26571e['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x294614,'markerElement':_0x2db139,'domEvent':_0x3c7992});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x3de0e3((_0x3847f4,_0x524ab0)=>{const _0x255810=_0x524ab0['target'];if(this['_findMarkerElement'](_0x255810))return;_0x255810['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x2e5270['model']['document']['registerPostFixer'](_0x71dc45=>this['_validateMarkers'](_0x2e5270,_0x71dc45)),_0x2e5270['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2e5270));}['getDocumentData'](){const _0x16beab=this['context']['plugins']['get']('AIEditing'),_0x249935=q(this['context']),_0x393b25=_0x249935['model'],_0xc80a99=new jt();for(const _0x4fe523 of _0x393b25['document']['getRoot']()['getChildren']()){const _0x40a2fb=_0x4fe523['_clone'](!0x0);_0xc80a99['_appendChild'](_0x40a2fb);}for(const _0x9542e of _0x393b25['markers'])_0xc80a99['markers']['set'](_0x9542e['name'],this['_changeRangeOwnerDocument'](_0x9542e['getRange']()['clone'](),_0xc80a99));const _0x3c3586=new _0x8f92f6({'ignoreElementEnd':!0x0,'startPosition':_0x393b25['createPositionAt'](_0xc80a99,0x0)}),_0x4dacdf=new Set(),_0x1efd20=new Map();for(const {item:_0xaaf160}of _0x3c3586){if(!_0xaaf160['is']('$textProxy'))continue;const _0x3b9436=_0xaaf160['parent'];if(_0x3b9436&&_0x3b9436['is']('element')){const _0xd223c5=this['_upsertDataId'](_0x3b9436,()=>_0x16beab['_nextDataId'](_0x4dacdf));_0x4dacdf['add'](_0xd223c5);for(const _0x57f035 of _0x3b9436['getChildren']())_0x57f035['is']('element')&&_0x4dacdf['add'](this['_upsertDataId'](_0x57f035,()=>_0x16beab['_nextDataId'](_0x4dacdf)));let _0x2c2063=_0x3b9436;for(;_0x2c2063['parent']&&!_0x2c2063['parent']['is']('documentFragment');)_0x2c2063=_0x2c2063['parent'],_0x2c2063['hasAttribute'](st)&&_0x2c2063['_removeAttribute'](st);_0x1efd20['set'](_0xd223c5,{'path':_0x3b9436['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2c2063['_clone'](!0x0),_0xd223c5,_0x249935['data'])}),_0x3c3586['jumpTo'](_0x393b25['createPositionAfter'](_0x3b9436));}}return{'content':_0x249935['data']['processor']['toData'](_0x249935['data']['toView'](_0xc80a99)),'version':_0x249935['model']['document']['version'],'elements':_0x1efd20};}['diffContent'](_0x54de28,_0xb446b9){const _0xa1c60c=[],_0x135ece=q(this['context']),_0x1e9e09=_0x135ece['data']['parse'](_0xb446b9,'$documentFragment'),_0x5d0618=_0x135ece['data']['parse'](_0x54de28,'$documentFragment'),_0x41186b=_0x135ece['model']['createPositionAt'](_0x5d0618,0x0);if(this['_haveSingleTopLevelElement'](_0x1e9e09)){if(!this['_hasSameTopLevelElement'](_0x5d0618,_0x1e9e09))return _0xa1c60c;}else{const _0xa3ab6a=_0x135ece['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5d0618,_0xa3ab6a)||!this['_haveOnlyInlineContent'](_0x1e9e09,_0xa3ab6a))return _0xa1c60c;}const _0x27120f=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x54de28,_0xb446b9,{'anchor':_0x41186b,'markDeletions':!0x0})['getOperations']()['filter'](_0x1bf61a=>'insert'===_0x1bf61a['type']||'marker'===_0x1bf61a['type']&&_0x1bf61a['name']['startsWith']('$markedRemove')),_0xac263b=this['_groupAdjacentOperations'](_0x27120f);let _0x3bb309=0x0;return _0x135ece['model']['change'](_0x4a09fe=>{for(let _0x483e0d=0x0;_0x483e0d<_0xac263b['length'];_0x483e0d++){const _0x4374d3=_0xac263b[_0x483e0d],_0x389199=_0x4a09fe['createDocumentFragment']();for(const _0x382787 of _0x5d0618['getChildren']())_0x4a09fe['append'](_0x382787['_clone'](!0x0),_0x389199);for(const _0x359291 of _0x4374d3['operationsIsolated'])if('insert'===_0x359291['type']){const _0x53ac82=_0x359291;_0x53ac82['baseVersion']=null,_0x53ac82['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x53ac82,_0x389199),_0x4a09fe['batch']['addOperation'](_0x359291),_0x135ece['model']['applyOperation'](_0x359291);const _0x15dadb='suggestion:insertion:id:authorId:'+_0x3bb309++,_0x6be1c8=_0x135ece['model']['createRange'](_0x53ac82['position'],_0x53ac82['position']['getShiftedBy'](_0x53ac82['howMany']));_0x389199['markers']['set'](_0x15dadb,_0x6be1c8);}else{if('marker'===_0x359291['type']&&_0x359291['name']['startsWith']('$markedRemove')){const _0x3d2ab4=_0x359291,_0x4389b8='suggestion:deletion:id:authorId:'+_0x3bb309++;this['_changeOperationOwnerDocument'](_0x3d2ab4,_0x389199),_0x389199['markers']['set'](_0x4389b8,_0x3d2ab4['newRange']);}}const _0x28ffe2=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x4374d3['operationsIsolated'][0x0]),_0x389199),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x4374d3['operationsIsolated'][_0x4374d3['operationsIsolated']['length']-0x1]),_0x389199));_0x389199['markers']['set'](pe+'suggestion-context',new nt(_0x28ffe2['start'],_0x28ffe2['end'])),_0xa1c60c['push']({..._0x4374d3,'context':this['_createGetContextFn'](_0x389199,_0x135ece['data'],{'ellipsisBefore':_0x28ffe2['hasContentBefore'],'ellipsisAfter':_0x28ffe2['hasContentAfter']}),'content':this['_createGetContentFn'](_0x389199,_0x135ece['data'])});}}),_0xa1c60c;}['markChangePositionInEditorContent'](_0x2583b4,_0x1f1380){if(!_0x2583b4['length'])return;const _0x4891a4=_0x2583b4[0x0]['parent']['id'],_0x102d18=_0x1f1380['elements']['get'](_0x4891a4);if(!_0x102d18)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4891a4);const _0x4dacc6=_0x102d18['path'],_0x562086=q(this['context']),_0x309e40=_0x562086['model']['document']['history']['getOperations'](_0x1f1380['version']),_0x477418=[];for(const _0x26abad of _0x2583b4){const _0x19b67a=_0x26abad['operationsIsolated']['map'](_0x52452c=>this['_translateOperationToEditorContent'](_0x52452c,_0x4dacc6,_0x562086['model']['document']['getRoots']()[0x0]));if(!_0x19b67a||!_0x19b67a['length'])continue;const _0x2cc18d=_0x19b67a['every'](_0x3240d9=>'marker'===_0x3240d9['type']&&_0x3240d9['name']['startsWith']('$markedRemove')),_0x3ea775={'document':_0x562086['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x107185=Ot(_0x19b67a,_0x309e40,_0x3ea775)['operationsA'];for(const _0x8133b2 of _0x107185)if('insert'===_0x8133b2['type']){const _0x299f87=_0x8133b2,_0x4df7fa=_0x299f87['nodes'];let _0x1ad9f7='';for(const _0x41caec of _0x4df7fa)_0x41caec&&_0x41caec['is']('model:$text')&&(_0x1ad9f7+=_0x41caec['data']);_0x477418['push']({'start':_0x299f87['position'],'end':_0x299f87['position'],'type':'insert','groupId':_0x26abad['id'],'text':_0x1ad9f7});}else{if('marker'===_0x8133b2['type']&&_0x8133b2['name']['startsWith']('$markedRemove')){const _0x427428=_0x8133b2;let _0x363914='remove-text';if(_0x2cc18d){const _0xa401de=this['_findAdjacentContextDistance'](_0x427428['newRange']['start'],'backward',_0x562086['model']['schema']),_0x368c76=this['_findAdjacentContextDistance'](_0x427428['newRange']['end'],'forward',_0x562086['model']['schema']);if(_0xa401de||_0x368c76){const _0x33dd31=_0x427428['newRange']['start']['getShiftedBy'](-_0xa401de),_0x55b3d6=_0x427428['newRange']['end']['getShiftedBy'](_0x368c76);_0x477418['push']({'start':_0x33dd31,'end':_0x55b3d6,'groupId':_0x26abad['id'],'type':'remove-context'});}else _0x363914='remove-only';}_0x477418['push']({'start':_0x427428['newRange']['start'],'end':_0x427428['newRange']['end'],'groupId':_0x26abad['id'],'type':_0x363914});}}}this['_insertMarkers'](_0x477418);}['clearAllMarkers'](){const _0x10a9aa=q(this['context']);_0x10a9aa['model']['change'](_0x4dcd66=>{for(const _0x11b597 of this['_markers']['keys']())_0x10a9aa['model']['markers']['get'](_0x11b597)&&_0x4dcd66['removeMarker'](_0x11b597);}),this['_markers']['clear']();}['switchToReadOnly'](){q(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){q(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x4b5e38){const _0xdf7186=q(this['context']),_0x4760ca=_0xdf7186['model'],_0x49f638=_0x4b5e38['map'](_0x3e627b=>this['_getMarkersDataForGroup'](_0x3e627b))['flat']();_0x4760ca['change'](_0x24b153=>{for(const _0xefc586 of _0x49f638){const _0x4df727=_0xdf7186['model']['markers']['get'](_0xefc586['id']);_0x4df727&&('insert'===_0xefc586['type']?_0x4760ca['insertContent'](_0x24b153['createText'](_0xefc586['text']||''),_0x4df727['getRange']()['start']):'remove-text'!==_0xefc586['type']&&'remove-only'!==_0xefc586['type']||_0x4760ca['deleteContent'](_0x4760ca['createSelection'](_0x4df727['getRange']())),_0x24b153['removeMarker'](_0xefc586['id']),this['_markers']['delete'](_0xefc586['id']));}});}['rejectChange'](_0x70dbf8){const _0x4c3493=q(this['context']),_0xec13d4=this['_getMarkersDataForGroup'](_0x70dbf8);_0x4c3493['model']['change'](_0x429d83=>{for(const _0xa963c8 of _0xec13d4)_0x429d83['removeMarker'](_0xa963c8['id']),this['_markers']['delete'](_0xa963c8['id']);});}['getEditor'](){return q(this['context']);}['getMarkerElementForChange'](_0x2d47e3){const _0x5a50c4=Array['from'](this['_markers']['values']())['filter'](_0x45ca6f=>_0x45ca6f['groupId']===_0x2d47e3);if(!_0x5a50c4['length'])return null;const _0x12589e=0x1===_0x5a50c4['length']?_0x5a50c4[0x0]:this['_sortMarkers'](_0x5a50c4)[0x0],_0x127109=q(this['context']),_0x37c391=_0x127109['model']['markers']['get'](_0x12589e['id']);if(!_0x37c391)return null;const _0x5251f9=_0x37c391['getRange'](),_0x3eed75=_0x127109['editing']['view']['getDomRoot']();if(!_0x3eed75||!_0x5251f9)return null;const _0x765907=_0x3eed75['querySelector']('[data-marker-id=\x22'+_0x12589e['id']+'\x22]');return _0x765907?{'modelRange':_0x5251f9,'domElement':_0x765907}:null;}['_validateMarkers'](_0x3ed07b,_0x54957a){const _0x21564e=Array['from'](this['_markers']['keys']()),_0x50557f=new Map();for(const _0x18ac3e of _0x21564e){const _0x22352b=_0x3ed07b['model']['markers']['get'](_0x18ac3e);if(!_0x22352b)continue;const _0xb9f226=_0x22352b['getStart']()['path'][0x0];_0x50557f['has'](_0xb9f226)||_0x50557f['set'](_0xb9f226,[]),_0x50557f['get'](_0xb9f226)['push'](_0x22352b);}const _0x4711b9=new Set();for(const _0x40825a of _0x3ed07b['model']['document']['differ']['getChanges']()){let _0x4d5231=-0x1,_0x77206d=null;if('insert'===_0x40825a['type'])_0x77206d=new nt(_0x40825a['position'],_0x40825a['position']['getShiftedBy'](_0x40825a['length'])),_0x4d5231=_0x40825a['position']['path'][0x0];else{if('remove'!==_0x40825a['type'])continue;_0x77206d=new nt(_0x40825a['position']),_0x4d5231=_0x40825a['position']['path'][0x0];}const _0x18fd68=_0x50557f['get'](_0x4d5231)||[];if(_0x18fd68['length']){for(const _0x37b01d of _0x18fd68)if(_0x77206d['root']['rootName']===_0x37b01d['getRange']()['root']['rootName']&&('insert'!==_0x40825a['type']||!_0x77206d['containsRange'](_0x37b01d['getRange']()))&&(_0x77206d['isIntersecting'](_0x37b01d['getRange']())||_0x77206d['start']['isTouching'](_0x37b01d['getRange']()['end'])||_0x77206d['end']['isTouching'](_0x37b01d['getRange']()['start']))){const _0xb99c58=this['_parseMarkerName'](_0x37b01d['name']);Array['from'](this['_markers']['values']())['filter'](_0xe04b26=>_0xe04b26['groupId']===_0xb99c58['groupId'])['forEach'](_0x547eb8=>_0x4711b9['add'](_0x547eb8['id']));}}}if(_0x4711b9['size']){for(const _0x42fd0f of _0x4711b9)_0x54957a['removeMarker'](_0x42fd0f);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x29a073){for(const {name:_0x5092cc,data:_0x5a5d61}of _0x29a073['model']['document']['differ']['getChangedMarkers']()){if(!_0x5092cc['startsWith'](pe))continue;const _0x4c5e77=_0x5a5d61['oldRange'],_0x1e1121=_0x5a5d61['newRange'],_0x448f51=_0x4c5e77&&'$graveyard'===_0x4c5e77['root']['rootName'],_0x56ce75=_0x1e1121&&'$graveyard'===_0x1e1121['root']['rootName'];if(_0x448f51&&_0x56ce75)continue;const _0xf76fbb=this['_parseMarkerName'](_0x5092cc);this['_markers']['get'](_0x5092cc)&&(_0x56ce75||!_0x1e1121?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5092cc,'changeId':_0xf76fbb['groupId']}):_0x448f51&&_0x1e1121&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5092cc,'changeId':_0xf76fbb['groupId']}));}}['_parseMarkerName'](_0x33c328){const _0x23074c=_0x33c328['split'](':'),_0x4f4bde=(_0x23074c[0x1]||'')['split']('_');return{'prefix':_0x23074c[0x0],'groupId':_0x4f4bde[0x0],'suffix':_0x4f4bde[0x1]};}['_translateOperationToEditorContent'](_0x40e5c5,_0x3276f4,_0x4756e2){if('insert'===_0x40e5c5['type']){const _0x44f1bb=_0x40e5c5;return new _0x382a49(this['_changePosition'](_0x3276f4['concat'](_0x44f1bb['position']['offset']),_0x4756e2),_0x44f1bb['nodes'],_0x44f1bb['baseVersion']);}if('marker'===_0x40e5c5['type']&&_0x40e5c5['name']['startsWith']('$markedRemove')){const _0x559d1e=_0x40e5c5;return new _0x118e33(_0x559d1e['name'],_0x559d1e['oldRange'],this['_changeRange'](_0x559d1e['newRange'],_0x3276f4['concat'](_0x559d1e['newRange']['start']['offset']),_0x3276f4['concat'](_0x559d1e['newRange']['end']['offset']),_0x4756e2),_0x559d1e['_markers'],_0x559d1e['affectsData'],_0x559d1e['baseVersion']);}return _0x40e5c5;}['_groupAdjacentOperations'](_0x1963ae){if(!_0x1963ae['length'])return[];const _0xe53208=[];let _0x2bcff9=0x0,_0x35c947=0x0,_0x400e65=[];for(let _0x3b8229=0x0;_0x3b8229<=_0x1963ae['length'];_0x3b8229++){const _0x5e2e3c=_0x1963ae[_0x3b8229],_0x4be407=_0x1963ae[_0x3b8229-0x1];!_0x5e2e3c||_0x4be407&&!this['_getOperationEnd'](_0x4be407)['isTouching'](this['_getOperationStart'](_0x5e2e3c))?(_0xe53208['push']({'operations':_0x400e65,'operationsIsolated':_0x400e65['map'](_0xd3392a=>this['_shiftOperation'](_0xd3392a['clone'](),-_0x35c947)),'groupOffset':_0x2bcff9}),_0x400e65=_0x5e2e3c?[_0x5e2e3c]:[],_0x35c947+=_0x2bcff9,_0x2bcff9=0x0):_0x400e65['push'](_0x5e2e3c),_0x5e2e3c&&'insert'===_0x5e2e3c['type']&&(_0x2bcff9+=_0x5e2e3c['howMany']);}return _0xe53208;}['_findAdjacentContextDistance'](_0x2a856c,_0x67078b,_0x1dd7aa,_0x1bb73=0x1){const _0x6df2f8=new _0x8f92f6({'startPosition':_0x2a856c,'direction':_0x67078b});let _0x4a5b01=0x0;for(let _0x3de6e0=0x0;_0x3de6e0<_0x1bb73;_0x3de6e0++){let _0x19e367=0x0,_0x54965e=!0x1,_0x174fac='forward'===_0x67078b?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x4ac97b}of _0x6df2f8)if(_0x4ac97b['is']('$textProxy')){const _0x521859=_0x174fac['exec'](_0x4ac97b['data']);if(_0x521859&&_0x521859['length']){if(_0x19e367+='forward'===_0x67078b?_0x521859['index']+_0x521859[0x0]['length']:_0x4ac97b['data']['length']-_0x521859['index'],_0x521859[0x0]['length']!==_0x4ac97b['data']['length'])break;_0x54965e=!0x0,_0x174fac='forward'===_0x67078b?/^\w+/:/\w+$/;}else{if(_0x54965e)break;_0x19e367+=_0x4ac97b['offsetSize'];}}else{if(_0x4ac97b['is']('element')){_0x1dd7aa['isInline'](_0x4ac97b)&&!_0x54965e&&(_0x19e367+=0x1);break;}}_0x4a5b01+=_0x19e367,_0x6df2f8['jumpTo'](_0x2a856c['getShiftedBy']('forward'===_0x67078b?_0x4a5b01:-_0x4a5b01));}return _0x4a5b01;}['_getChangeContext'](_0x220f06,_0x3e5132){const _0x444949=q(this['context'])['model']['schema'],_0x5a0441=this['_findAdjacentContextDistance'](_0x220f06,'backward',_0x444949,0x6),_0x4f4f03=this['_findAdjacentContextDistance'](_0x3e5132,'forward',_0x444949,0x6),_0xfe989e=_0x220f06['getShiftedBy'](-_0x5a0441),_0x23fb14=_0x3e5132['getShiftedBy'](_0x4f4f03);return{'start':_0xfe989e,'end':_0x23fb14,'hasContentBefore':!_0xfe989e['isAtStart'],'hasContentAfter':!_0x23fb14['isAtEnd']};}['_insertMarkers'](_0x43170a){const _0x251740=this['context']['plugins']['get']('AIEditing'),_0x285d7e=new Set();q(this['context'])['model']['change'](_0x1703b8=>{for(const _0x5139d5 of _0x43170a){const _0x18a864=''+pe+_0x5139d5['type']+':'+_0x5139d5['groupId']+'_'+_0x251740['_nextDataId'](_0x285d7e);this['_markers']['set'](_0x18a864,{'id':_0x18a864,'groupId':_0x5139d5['groupId'],'type':_0x5139d5['type'],'text':_0x5139d5['text']}),_0x1703b8['addMarker'](_0x18a864,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1703b8['createRange'](_0x5139d5['start'],_0x5139d5['end'])});}});}['_createGetContextFn'](_0x3212af,_0x3383c6,_0x549d28){let _0x17000f='';return()=>{if(!_0x17000f){const _0x3bc1ff=_0x3383c6['toView'](_0x3212af,{'showSuggestionHighlights':!0x0});let _0x3ce379=_0x3bc1ff['getChild'](0x0);if(_0x3ce379['is']('containerElement')||(_0x3ce379=_0x3bc1ff),!_0x3ce379)return'';let _0x3085c5=!0x1;const _0x2bd412=[];for(const _0xf088e5 of _0x3ce379['getChildren']())_0xf088e5['is']('element','span')&&_0xf088e5['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x3085c5=!0x1),_0x3085c5&&_0x2bd412['push'](_0xf088e5),_0xf088e5['is']('element','span')&&_0xf088e5['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x3085c5=!0x0);_0x3ce379['_removeChildren'](0x0,_0x3ce379['childCount']),_0x549d28?.['ellipsisBefore']&&_0x3ce379['_appendChild']('…'),_0x3ce379['_appendChild'](_0x2bd412),_0x549d28?.['ellipsisAfter']&&_0x3ce379['_appendChild']('…');const _0x5c5ef7=_0x3383c6['htmlProcessor']['domConverter']['viewToDom'](_0x3bc1ff),_0x390101=_0x3383c6['htmlProcessor']['htmlWriter']['getHtml'](_0x5c5ef7);_0x17000f=_0x390101;}return _0x17000f;};}['_createGetContentFn'](_0x448ea8,_0x191460){let _0x53e36a='';return()=>(_0x53e36a||(_0x53e36a=_0x191460['stringify'](_0x448ea8,{'showSuggestionHighlights':!0x0})),_0x53e36a);}['_createGetContentUsingDataIdFn'](_0xd9def5,_0x3f23bb,_0x352d1f){let _0x3b68b3='';return()=>{if(!_0x3b68b3){const _0x19d62c=_0x352d1f['toView'](new jt(_0xd9def5)),_0x3736a1=_0x352d1f['htmlProcessor']['domConverter']['viewToDom'](_0x19d62c)['querySelector']('[data-id=\x22'+_0x3f23bb+'\x22]');_0x3b68b3=_0x3736a1?.['outerHTML']||'';}return _0x3b68b3;};}['_findMarkerElement'](_0x23a152,_0x9a9d73=0x5){let _0x134754=_0x23a152,_0x19a7ed=null;for(let _0x2a3c56=0x0;_0x2a3c56<_0x9a9d73&&_0x134754;_0x2a3c56++){if(!_0x134754['className']){_0x134754=_0x134754['parentElement'];continue;}if(!(''+_0x134754['className'])['includes']('ck-ai_review-mode-marker_')){_0x134754=_0x134754['parentElement'];continue;}if(!_0x134754['getAttribute']('data-marker-id'))break;_0x19a7ed=_0x134754;break;}return _0x19a7ed;}['_getMarkersDataForGroup'](_0x383a43){return Array['from'](this['_markers']['values']())['filter'](_0x389b2e=>_0x389b2e['groupId']===_0x383a43);}['_getOperationStart'](_0xd160d5){return'insert'===_0xd160d5['type']?_0xd160d5['position']:_0xd160d5['newRange']['start'];}['_getOperationEnd'](_0xa62995,_0x2664ef=!0x1){return'insert'===_0xa62995['type']?_0x2664ef?_0xa62995['position']:_0xa62995['position']['getShiftedBy'](_0xa62995['howMany']):_0xa62995['newRange']['end'];}['_shiftOperation'](_0xe66847,_0x3c9c7){return'insert'===_0xe66847['type']?_0xe66847['position']=_0xe66847['position']['getShiftedBy'](_0x3c9c7):'marker'===_0xe66847['type']&&_0xe66847['newRange']&&(_0xe66847['newRange']=new nt(_0xe66847['newRange']['start']['getShiftedBy'](_0x3c9c7),_0xe66847['newRange']['end']['getShiftedBy'](_0x3c9c7))),_0xe66847;}['_changeOperationOwnerDocument'](_0x27c463,_0x3d1199){'insert'===_0x27c463['type']?_0x27c463['position']=this['_changePositionOwnerDocument'](_0x27c463['position'],_0x3d1199):'marker'===_0x27c463['type']&&_0x27c463['newRange']&&(_0x27c463['newRange']=this['_changeRangeOwnerDocument'](_0x27c463['newRange'],_0x3d1199));}['_changePositionOwnerDocument'](_0x3b78c1,_0x5da899){return new Dt(_0x5da899,_0x3b78c1['path']);}['_changeRangeOwnerDocument'](_0x4f96f2,_0xf6067e){return new nt(this['_changePositionOwnerDocument'](_0x4f96f2['start'],_0xf6067e),this['_changePositionOwnerDocument'](_0x4f96f2['end'],_0xf6067e));}['_changePosition'](_0x965292,_0x33fe60){return new Dt(_0x33fe60,[..._0x965292]);}['_changeRange'](_0x2cdbef,_0x1e79d5,_0x1f7307,_0x357eed){return new nt(this['_changePosition'](_0x1e79d5,_0x357eed),this['_changePosition'](_0x1f7307,_0x357eed));}['_sortMarkers'](_0x37b269){const _0x13feec=_0x5e7f5c=>{switch(_0x5e7f5c){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x37b269['sort']((_0x34fc6d,_0x6bab8a)=>_0x13feec(_0x34fc6d['type'])-_0x13feec(_0x6bab8a['type']));}['_hasSameTopLevelElement'](_0x54e40e,_0x1c7ce7){const _0xcff40=_0x54e40e['getChild'](0x0),_0x62ea1f=_0x1c7ce7['getChild'](0x0);return!(!_0xcff40||!_0x62ea1f)&&((!_0xcff40['is']('element')||!_0x62ea1f['is']('element')||_0xcff40['name']===_0x62ea1f['name'])&&!(_0xcff40['is']('element')&&!_0x62ea1f['is']('element')||!_0xcff40['is']('element')&&_0x62ea1f['is']('element')));}['_haveSingleTopLevelElement'](_0x2725dd){return 0x1===_0x2725dd['childCount'];}['_haveOnlyInlineContent'](_0x2a5381,_0x29b88d){for(const _0x543f94 of _0x2a5381['getChildren']())if(_0x543f94['is']('element')&&!_0x29b88d['isInline'](_0x543f94))return!0x1;return!0x0;}['_upsertDataId'](_0x43c37a,_0x5f587e){let _0x4aaef0=_0x43c37a['getAttribute'](st);return _0x4aaef0||(_0x4aaef0=_0x5f587e(),_0x43c37a['_setAttribute'](st,_0x4aaef0)),_0x4aaef0;}}class Ba extends _0x36f460{static get['requires'](){return[me,ce,ue];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,x as AIAdapter,$n as AIAssistant,n as AIAssistantUI,mt as AIBalloon,Ma as AIChat,F as AIChatController,J as AIChatHistory,Ht as AIChatHistoryController,Pt as AIChatHistoryUI,G as AIChatUI,R as AIConnector,S as AIEditing,Ua as AIEditorIntegration,Ft as AIQuickActionType,Ga as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,zs as AIReviewCheckRun,Ba as AIReviewMode,me as AIReviewModeController,ue as AIReviewModeEditing,ce as AIReviewModeUI,Y as AITabs,ye as AITextAdapter,qt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,qn as getDefaultAICommands};