@ckeditor/ckeditor5-ai 48.3.1 → 48.4.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/aiactions/aiactions.d.ts +36 -1
  2. package/dist/aiactions/model/aiactionsinteraction.d.ts +7 -1
  3. package/dist/aiassistant/aiassistantui.d.ts +0 -3
  4. package/dist/aiballoon/aiballoon.d.ts +0 -1
  5. package/dist/aichat/aichatballoon.d.ts +7 -2
  6. package/dist/aichat/aichatcontroller.d.ts +12 -2
  7. package/dist/aichat/aichatui.d.ts +20 -6
  8. package/dist/aichat/model/aichatcontext.d.ts +29 -10
  9. package/dist/aichat/model/aichatconversation.d.ts +10 -1
  10. package/dist/aichat/model/aichatinteraction.d.ts +6 -1
  11. package/dist/aichat/ui/aichatballoonview.d.ts +14 -19
  12. package/dist/aichat/ui/aichatcontrolsview.d.ts +0 -9
  13. package/dist/aichat/ui/aichatfeedview.d.ts +5 -11
  14. package/dist/aichat/ui/aichatview.d.ts +0 -4
  15. package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +4 -0
  16. package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +14 -29
  17. package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +7 -2
  18. package/dist/aichathistory/aichathistoryui.d.ts +0 -1
  19. package/dist/aichatshortcuts/aichatshortcuts.d.ts +2 -2
  20. package/dist/aiconfig.d.ts +109 -0
  21. package/dist/aicore/aiconnector.d.ts +78 -11
  22. package/dist/aicore/aicore.d.ts +53 -0
  23. package/dist/aicore/aiediting.d.ts +8 -2
  24. package/dist/aicore/aigateway.d.ts +43 -11
  25. package/dist/aicore/errors/normalizeerror.d.ts +4 -0
  26. package/dist/aicore/model/aicapabilities.d.ts +20 -5
  27. package/dist/aicore/model/aicontext.d.ts +57 -2
  28. package/dist/aicore/model/aicontextlibrary.d.ts +70 -0
  29. package/dist/aicore/model/aicontextref.d.ts +39 -0
  30. package/dist/aicore/model/aidefaultcontext.d.ts +95 -0
  31. package/dist/aicore/model/aieditorroot.d.ts +26 -0
  32. package/dist/aicore/model/aimodels.d.ts +11 -4
  33. package/dist/aicore/model/aireply.d.ts +12 -1
  34. package/dist/aicore/model/airunresult.d.ts +18 -73
  35. package/dist/aicore/model/airunsinglerootresult.d.ts +101 -0
  36. package/dist/aicore/ui/aidisclaimerview.d.ts +0 -1
  37. package/dist/aicore/ui/aiheaderview.d.ts +0 -1
  38. package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
  39. package/dist/aicore/ui/aiskeleton.d.ts +0 -1
  40. package/dist/aicore/ui/aispinner.d.ts +0 -1
  41. package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +0 -1
  42. package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +20 -5
  43. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +0 -1
  44. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +12 -1
  45. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +4 -12
  46. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +6 -1
  47. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +11 -1
  48. package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +0 -1
  49. package/dist/aicore/utils/createandattachaibodycollection.d.ts +0 -1
  50. package/dist/aicore/utils/createresizebutton.d.ts +0 -1
  51. package/dist/aicore/utils/createstartconversationbutton.d.ts +0 -1
  52. package/dist/aicore/utils/geteditorconfig.d.ts +88 -0
  53. package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
  54. package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +4 -1
  55. package/dist/aicore/utils/htmlparser.d.ts +1 -0
  56. package/dist/aicore/utils/inlineroot.d.ts +1 -0
  57. package/dist/aicore/utils/tocontextrefrequestdata.d.ts +1 -0
  58. package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +48 -25
  59. package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +2 -2
  60. package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +0 -1
  61. package/dist/aiquickactions/aiquickactions.d.ts +60 -9
  62. package/dist/aiquickactions/aiquickactionsui.d.ts +10 -4
  63. package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +6 -1
  64. package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +2 -4
  65. package/dist/aireviewcore/aireviewcoreediting.d.ts +43 -6
  66. package/dist/aireviewcore/aireviewcoreui.d.ts +3 -10
  67. package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
  68. package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +12 -1
  69. package/dist/aireviewcore/model/aireviewcheckrun.d.ts +11 -1
  70. package/dist/aireviewcore/types.d.ts +7 -1
  71. package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -2
  72. package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +7 -0
  73. package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +1 -19
  74. package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +0 -1
  75. package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +0 -1
  76. package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +0 -1
  77. package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +10 -8
  78. package/dist/aireviewcore/ui/aireviewcoreview.d.ts +3 -4
  79. package/dist/aireviewmode/aireviewgateway.d.ts +63 -44
  80. package/dist/aireviewmode/aireviewmode.d.ts +73 -5
  81. package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +8 -1
  82. package/dist/aireviewmode/aireviewmodecontroller.d.ts +2 -1
  83. package/dist/aireviewmode/model/aireviewcheckextra.d.ts +7 -2
  84. package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +2 -1
  85. package/dist/aitabs/aitabsmainview.d.ts +0 -1
  86. package/dist/aitabs/tabs/aitabsview.d.ts +0 -1
  87. package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -1
  88. package/dist/aitranslate/aitranslatecontroller.d.ts +2 -1
  89. package/dist/aitranslate/aitranslategateway.d.ts +33 -21
  90. package/dist/aitranslate/aitranslateui.d.ts +0 -1
  91. package/dist/aitranslate/model/aitranslatecheckrun.d.ts +2 -1
  92. package/dist/augmentation.d.ts +2 -0
  93. package/dist/index-content.css +0 -97
  94. package/dist/index-editor.css +2640 -2631
  95. package/dist/index.css +36 -32
  96. package/dist/index.d.ts +17 -8
  97. package/dist/index.js +19 -19
  98. package/dist/translations/af.js +1 -1
  99. package/dist/translations/af.umd.js +1 -1
  100. package/dist/translations/ar.js +1 -1
  101. package/dist/translations/ar.umd.js +1 -1
  102. package/dist/translations/ast.js +1 -1
  103. package/dist/translations/ast.umd.js +1 -1
  104. package/dist/translations/az.js +1 -1
  105. package/dist/translations/az.umd.js +1 -1
  106. package/dist/translations/be.js +1 -1
  107. package/dist/translations/be.umd.js +1 -1
  108. package/dist/translations/bg.js +1 -1
  109. package/dist/translations/bg.umd.js +1 -1
  110. package/dist/translations/bn.js +1 -1
  111. package/dist/translations/bn.umd.js +1 -1
  112. package/dist/translations/bs.js +1 -1
  113. package/dist/translations/bs.umd.js +1 -1
  114. package/dist/translations/ca.js +1 -1
  115. package/dist/translations/ca.umd.js +1 -1
  116. package/dist/translations/cs.js +1 -1
  117. package/dist/translations/cs.umd.js +1 -1
  118. package/dist/translations/da.js +1 -1
  119. package/dist/translations/da.umd.js +1 -1
  120. package/dist/translations/de-ch.js +1 -1
  121. package/dist/translations/de-ch.umd.js +1 -1
  122. package/dist/translations/de.js +1 -1
  123. package/dist/translations/de.umd.js +1 -1
  124. package/dist/translations/el.js +1 -1
  125. package/dist/translations/el.umd.js +1 -1
  126. package/dist/translations/en-au.js +1 -1
  127. package/dist/translations/en-au.umd.js +1 -1
  128. package/dist/translations/en-gb.js +1 -1
  129. package/dist/translations/en-gb.umd.js +1 -1
  130. package/dist/translations/en.js +1 -1
  131. package/dist/translations/en.umd.js +1 -1
  132. package/dist/translations/eo.js +1 -1
  133. package/dist/translations/eo.umd.js +1 -1
  134. package/dist/translations/es-co.js +1 -1
  135. package/dist/translations/es-co.umd.js +1 -1
  136. package/dist/translations/es.js +1 -1
  137. package/dist/translations/es.umd.js +1 -1
  138. package/dist/translations/et.js +1 -1
  139. package/dist/translations/et.umd.js +1 -1
  140. package/dist/translations/eu.js +1 -1
  141. package/dist/translations/eu.umd.js +1 -1
  142. package/dist/translations/fa.js +1 -1
  143. package/dist/translations/fa.umd.js +1 -1
  144. package/dist/translations/fi.js +1 -1
  145. package/dist/translations/fi.umd.js +1 -1
  146. package/dist/translations/fr.js +1 -1
  147. package/dist/translations/fr.umd.js +1 -1
  148. package/dist/translations/gl.js +1 -1
  149. package/dist/translations/gl.umd.js +1 -1
  150. package/dist/translations/gu.js +1 -1
  151. package/dist/translations/gu.umd.js +1 -1
  152. package/dist/translations/he.js +1 -1
  153. package/dist/translations/he.umd.js +1 -1
  154. package/dist/translations/hi.js +1 -1
  155. package/dist/translations/hi.umd.js +1 -1
  156. package/dist/translations/hr.js +1 -1
  157. package/dist/translations/hr.umd.js +1 -1
  158. package/dist/translations/hu.js +1 -1
  159. package/dist/translations/hu.umd.js +1 -1
  160. package/dist/translations/hy.js +1 -1
  161. package/dist/translations/hy.umd.js +1 -1
  162. package/dist/translations/id.js +1 -1
  163. package/dist/translations/id.umd.js +1 -1
  164. package/dist/translations/it.js +1 -1
  165. package/dist/translations/it.umd.js +1 -1
  166. package/dist/translations/ja.js +1 -1
  167. package/dist/translations/ja.umd.js +1 -1
  168. package/dist/translations/jv.js +1 -1
  169. package/dist/translations/jv.umd.js +1 -1
  170. package/dist/translations/kk.js +1 -1
  171. package/dist/translations/kk.umd.js +1 -1
  172. package/dist/translations/km.js +1 -1
  173. package/dist/translations/km.umd.js +1 -1
  174. package/dist/translations/kn.js +1 -1
  175. package/dist/translations/kn.umd.js +1 -1
  176. package/dist/translations/ko.js +1 -1
  177. package/dist/translations/ko.umd.js +1 -1
  178. package/dist/translations/ku.js +1 -1
  179. package/dist/translations/ku.umd.js +1 -1
  180. package/dist/translations/lt.js +1 -1
  181. package/dist/translations/lt.umd.js +1 -1
  182. package/dist/translations/lv.js +1 -1
  183. package/dist/translations/lv.umd.js +1 -1
  184. package/dist/translations/ms.js +1 -1
  185. package/dist/translations/ms.umd.js +1 -1
  186. package/dist/translations/nb.js +1 -1
  187. package/dist/translations/nb.umd.js +1 -1
  188. package/dist/translations/ne.js +1 -1
  189. package/dist/translations/ne.umd.js +1 -1
  190. package/dist/translations/nl.js +1 -1
  191. package/dist/translations/nl.umd.js +1 -1
  192. package/dist/translations/no.js +1 -1
  193. package/dist/translations/no.umd.js +1 -1
  194. package/dist/translations/oc.js +1 -1
  195. package/dist/translations/oc.umd.js +1 -1
  196. package/dist/translations/pl.js +1 -1
  197. package/dist/translations/pl.umd.js +1 -1
  198. package/dist/translations/pt-br.js +1 -1
  199. package/dist/translations/pt-br.umd.js +1 -1
  200. package/dist/translations/pt.js +1 -1
  201. package/dist/translations/pt.umd.js +1 -1
  202. package/dist/translations/ro.js +1 -1
  203. package/dist/translations/ro.umd.js +1 -1
  204. package/dist/translations/ru.js +1 -1
  205. package/dist/translations/ru.umd.js +1 -1
  206. package/dist/translations/si.js +1 -1
  207. package/dist/translations/si.umd.js +1 -1
  208. package/dist/translations/sk.js +1 -1
  209. package/dist/translations/sk.umd.js +1 -1
  210. package/dist/translations/sl.js +1 -1
  211. package/dist/translations/sl.umd.js +1 -1
  212. package/dist/translations/sq.js +1 -1
  213. package/dist/translations/sq.umd.js +1 -1
  214. package/dist/translations/sr-latn.js +1 -1
  215. package/dist/translations/sr-latn.umd.js +1 -1
  216. package/dist/translations/sr.js +1 -1
  217. package/dist/translations/sr.umd.js +1 -1
  218. package/dist/translations/sv.js +1 -1
  219. package/dist/translations/sv.umd.js +1 -1
  220. package/dist/translations/th.js +1 -1
  221. package/dist/translations/th.umd.js +1 -1
  222. package/dist/translations/ti.js +1 -1
  223. package/dist/translations/ti.umd.js +1 -1
  224. package/dist/translations/tk.js +1 -1
  225. package/dist/translations/tk.umd.js +1 -1
  226. package/dist/translations/tr.js +1 -1
  227. package/dist/translations/tr.umd.js +1 -1
  228. package/dist/translations/tt.js +1 -1
  229. package/dist/translations/tt.umd.js +1 -1
  230. package/dist/translations/ug.js +1 -1
  231. package/dist/translations/ug.umd.js +1 -1
  232. package/dist/translations/uk.js +1 -1
  233. package/dist/translations/uk.umd.js +1 -1
  234. package/dist/translations/ur.js +1 -1
  235. package/dist/translations/ur.umd.js +1 -1
  236. package/dist/translations/uz.js +1 -1
  237. package/dist/translations/uz.umd.js +1 -1
  238. package/dist/translations/vi.js +1 -1
  239. package/dist/translations/vi.umd.js +1 -1
  240. package/dist/translations/zh-cn.js +1 -1
  241. package/dist/translations/zh-cn.umd.js +1 -1
  242. package/dist/translations/zh.js +1 -1
  243. package/dist/translations/zh.umd.js +1 -1
  244. package/package.json +30 -12
  245. package/dist/aireviewmode/model/aireviewrunresult.d.ts +0 -20
  246. package/dist/aitranslate/model/aitranslaterunresult.d.ts +0 -20
package/dist/index.js CHANGED
@@ -20,22 +20,22 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x17e1f8,ContextPlugin as _0x11a14c,Editor as _0x423f99,Plugin as _0x4655d9,rootAcceptsBlocks as _0xeaa397}from'@ckeditor/ckeditor5-core';import{IconAI as _0x4fd34f,IconAIAdjustLength as _0x1a43f7,IconAIAskAI as _0x266871,IconAIChangeTone as _0x305268,IconAIChat as _0x404c28,IconAIChatCommands as _0x339ebc,IconAIContinueWriting as _0x121228,IconAIGrammarCheck as _0xd05426,IconAIHistory as _0x29ed9d,IconAIImproveWriting as _0x81a774,IconAIOther as _0x42544f,IconAIQuickActions as _0x4e05d1,IconAIReview as _0x31a7fd,IconAITranslate as _0x3ce940,IconBoxWithCheck as _0xa7db82,IconBoxWithCross as _0x5d33dc,IconBoxWithMarker as _0x556d1e,IconBrowseFiles as _0x169866,IconBulb as _0x19f12e,IconCancel as _0x3c0bfe,IconCheck as _0x734ca,IconChevronDown as _0x29cb6b,IconChevronRight as _0x27e590,IconChevronUp as _0x4771e1,IconCopy as _0x1bec33,IconDocument as _0x34f9f8,IconDocumentOutline as _0x35acaa,IconDropdownArrow as _0xcfa2c6,IconError as _0x5c8d8e,IconEye as _0x2be8a0,IconEyeCrossedOut as _0x42e446,IconFileUpload as _0x324f70,IconImage as _0x597a34,IconInfo as _0x26ee67,IconLink as _0x18b8c0,IconLoupe as _0x52a38a,IconMagicWand as _0x52c8e1,IconMaximize as _0x30fcb2,IconMinimize as _0x527ca0,IconNextArrow as _0xb5821d,IconOutdated as _0x100e23,IconPaperClip as _0x52f6a7,IconPin as _0x3f570c,IconPlus as _0x4a9c6e,IconPreviousArrow as _0x3961c4,IconRefresh as _0x4a7205,IconRobotPencil as _0x59b4d9,IconSelection as _0x582585,IconShowChangesOff as tt,IconShowChangesOn as et,IconStop as it,IconSubmit as st,IconThreeHorizontalDots as nt,IconThumbDown as rt,IconThumbUp as ot,IconWeb as at}from'@ckeditor/ckeditor5-icons';import{CKEditorError as ht,Collection as ct,DomEmitterMixin as lt,EmitterMixin as ut,FocusTracker as dt,KeystrokeHandler as _t,ObservableMixin as gt,Rect as At,ResizeObserver as It,_isMotionReduced as pt,first as mt,getConstrainedViewportRect as Et,global as Tt,insertToPriorityArray as wt,isVisible as Ct,logError as ft,logWarning as bt,scrollAncestorsToShowTarget as St,scrollViewportToShowTarget as Rt,toArray as Ot,uid as vt,version as kt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as Nt,BalloonPanelView as yt,BalloonToolbar as xt,BodyCollection as Lt,ButtonLabelView as Dt,ButtonLabelWithHighlightView as Pt,ButtonView as Ht,Dialog as Mt,DialogViewPosition as Vt,DropdownMenuPanelPositioningFunctions as Ut,FileDialogButtonView as Bt,FocusCycler as Gt,FormHeaderView as Ft,FormRowView as Kt,HighlightedTextView as Wt,IconView as Yt,InputTextView as $t,LabeledFieldView as qt,ListItemButtonView as Qt,ListItemGroupView as Xt,ListItemView as zt,ListView as jt,MenuBarMenuListItemButtonView as Jt,MenuBarMenuListItemView as Zt,MenuBarMenuListView as te,MenuBarMenuView as _0x40d16d,SearchTextView as _0xb4c045,SpinnerView as _0x528849,TextareaView as _0x3754f8,ToolbarView as _0x182e23,UIModel as _0x5ef671,View as _0x42f8f5,ViewCollection as _0x5f3be9,addListToDropdown as _0x3e8d7a,addMenuToDropdown as _0x406c29,clickOutsideHandler as _0x4c94bb,createDropdown as _0x5ba05a,createLabeledInputText as _0xa4b9,createLabeledTextarea as _0x48ca6a,submitHandler as _0x32ec98}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x15baa8,ClipboardPipeline as _0x219e5d}from'@ckeditor/ckeditor5-clipboard';import{InsertOperation as _0x496751,MarkerOperation as _0x18b70c,Matcher as _0x53cb0f,ModelDocumentFragment as _0x4a5f18,ModelPosition as _0x35d72f,ModelRange as _0x223931,ModelTreeWalker as _0x58b091,ViewDataTransfer as _0x17d082,ViewDocumentDomEventData as _0x257ddf,ViewDowncastWriter as _0x19ef87,ViewUpcastWriter as _0x4e4d06,_DetachOperation as _0x440cda,_insertIntoModelNodeList as _0x354e1a,_removeFromModelNodeList as _0x1d816f,transformOperationSets as _0x5be051}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0x226fcf,debounce as _0x46743f,escape as _0x5a08e5,escapeRegExp as _0x352160,throttle as _0x39ed78,unescape as _0x5e3805}from'es-toolkit/compat';import{createParser as _0x118144}from'eventsource-parser';import{CloudServices as _0x4fefa9}from'@ckeditor/ckeditor5-cloud-services';import{ConfirmMixin as _0x14f708,DATA_ID_MODEL_ATTRIBUTE as _0x308ef3,DATA_ID_VIEW_ATTRIBUTE as _0x24c015,DocumentCompare as _0x1f6a74,SuggestionsConversion as _0x4171c8,fixElementSuggestionRange as _0x5420f5,getAllMarkersDomElementsSorted as _0x24247e,getMarkerDomElement as _0x2a74c3}from'@ckeditor/ckeditor5-collaboration-core';import{parseDocument as _0x3a0c7f}from'htmlparser2';import{append as _0x873879,appendChild as _0x5435f7,find as _0x5b134c,findAll as _0x242f60,findOne as ti,getChildren as _0x145355,getParent as _0x36d1f9,isComment as _0x1e98cd,isTag as _0x48ca1a,prepend as _0x4a1680,prependChild as _0x405cf6,removeElement as _0x3baafe,replaceElement as _0x5e68a2,textContent as _0x314768}from'domutils';import _0x575879 from'dom-serializer';import{Document as _0x2d29a4,Element as _0x1f1d4a,NodeWithChildren as _0x504466,Text as _0x1d9d67,cloneNode as _0x5b768f,isDocument as _0x3d6db6,isText as _0x335b1f}from'domhandler';import{MarkdownGfmMdToHtml as _0x5b06d6,MarkdownGfmMdToHtmlDefaultPlugins as _0x5695e5}from'@ckeditor/ckeditor5-markdown-gfm';import _0x58df5c from'rehype-sanitize';import _0x2076e0 from'morphdom';import{diffArrays as _0x5ca782}from'diff';const fi='_ungrouppedCommands';function bi(_0x4e022e,_0x414a33){const _0x3bb15f=(0x0,_0x414a33['t'])('Other');return _0x4e022e['length']?'groupId'in _0x4e022e[0x0]?_0x4e022e:[{'groupId':fi,'groupLabel':_0x3bb15f,'order':0x1/0x0,'commands':_0x4e022e}]:[{'groupId':fi,'groupLabel':_0x3bb15f,'order':0x1/0x0,'commands':[]}];}const Si=globalThis['DataTransfer'],Ri='ai-ui';var Oi=class extends _0x4655d9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x7d2b2c}=this,_0x138bab=['ck-fake-ai-selection'];_0x7d2b2c['config']['get']('ai.assistant.useTheme')&&_0x138bab['push']('ck-ai-assistant-ui_theme'),_0x7d2b2c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ri,'view':{'classes':_0x138bab,'priority':0xc}}),_0x7d2b2c['conversion']['for']('editingDowncast')['markerToElement']({'model':Ri,'view':(_0x28928f,{writer:_0x5d099e})=>{if(!_0x28928f['markerRange']['isCollapsed'])return null;const _0x1c7ce3=_0x5d099e['createUIElement']('span');return _0x5d099e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1c7ce3),_0x1c7ce3;}});}['afterInit'](){!async function(_0x10161e){const _0x214fbb='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0x37e84b=0x78fc0,_0x23b06c=window['Date']['now'](),_0x1874de=_0x10161e['editor'],_0x3ffecd=new window['Promise'](_0x6ae912=>{_0x1874de['once']('ready',_0x6ae912);}),_0x44bfa5={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x101331=_0x1874de['config']['get']('licenseKey');async function _0x4ad6fd(){let _0x327644,_0x4a284d=null,_0x52476c=null;try{return'GPL'==_0x101331?'NotAllowed':(_0x327644=_0x2fce57(),_0x327644?(_0x327644['usageEndpoint']&&(_0x52476c=_0x4d7250(_0x327644['usageEndpoint'],_0x327644['jti'])),await _0x2d5e92()?_0x25d9b0()?_0x992240()?'Expired':_0xedcbb4()?('evaluation'==_0x327644['licenseType']&&(_0x4a284d=_0x4c9346('EvaluationLimit')),await _0x595a0e()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x992240(){const _0x1dbd3a=['evaluation','trial']['includes'](_0x327644['licenseType'])?_0x23b06c/0x3e8:0xe10*_0x37e84b;return _0x327644['exp']<_0x1dbd3a;}function _0x25d9b0(){const _0x2bc847=_0x327644['features'];return!!_0x2bc847&&(!!_0x2bc847['includes']('*')||!!_0x2bc847['includes']('AI'));}function _0xedcbb4(){const _0x430533=_0x327644['licensedHosts'];if(!_0x430533||0x0==_0x430533['length'])return!0x0;const {hostname:_0x3d738e}=new URL(window['location']['href']);if(_0x430533['includes'](_0x3d738e))return!0x0;const _0x27657c=_0x3d738e['split']('.');return _0x430533['filter'](_0x131f23=>_0x131f23['includes']('*'))['map'](_0x213d6f=>_0x213d6f['split']('.'))['filter'](_0x31dae8=>_0x31dae8['length']<=_0x27657c['length'])['map'](_0x34c655=>Array(_0x27657c['length']-_0x34c655['length'])['fill']('*'===_0x34c655[0x0]?'*':'')['concat'](_0x34c655))['some'](_0x187d52=>_0x27657c['every']((_0x5b509a,_0x493180)=>_0x187d52[_0x493180]===_0x5b509a||'*'===_0x187d52[_0x493180]));}function _0x595a0e(){return _0x4a284d&&_0x52476c?new window['Promise']((_0x5b3505,_0x22050d)=>{_0x4a284d['then'](_0x5b3505,_0x22050d),_0x52476c['then'](_0x52a514=>{'Valid'!=_0x52a514&&_0x5b3505(_0x52a514);},_0x22050d);}):_0x4a284d||_0x52476c||'Valid';}}function _0x4d7250(_0x44868d,_0x14eabd){return new window['Promise'](_0x2ede17=>{if(_0x2e8d0a())return _0x2ede17('Valid');_0x187843(),_0x1874de['decorate']('_sendUsageRequest');let _0x412b58=!0x1;const _0x153503=vt();function _0x193e76(_0x3c378f){return!!_0x3c378f&&('object'==typeof _0x3c378f||'function'==typeof _0x3c378f)&&'function'==typeof _0x3c378f['then']&&'function'==typeof _0x3c378f['catch'];}function _0x46dad6(_0x11e21e){_0x352afd(_0x11e21e)['then'](_0x5a21f3=>_0x5a21f3&&'ok'==_0x5a21f3['status']?_0x3d5277(_0x2870af(_0x153503+_0x14eabd))!=_0x5a21f3['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x13bb1b=>(_0x58df62(),_0x13bb1b),()=>{const _0xd0a302=_0x5a439e();return null==_0xd0a302?(_0x58df62(),'Valid'):_0x23b06c-_0xd0a302>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2ede17)['catch'](()=>{_0x2ede17('UsageLimit');});const _0x128ab2=0x36ee80;function _0x58df62(){const _0x5e237b='llct-'+_0x3d5277(_0x2870af(_0x44868d)),_0x402c39=_0x227dbd(_0x3d5277(window['Math']['ceil'](_0x23b06c/_0x128ab2)));window['localStorage']['setItem'](_0x5e237b,_0x402c39);}function _0x5a439e(){const _0x577df0='llct-'+_0x3d5277(_0x2870af(_0x44868d)),_0x2cc1d8=window['localStorage']['getItem'](_0x577df0);return _0x2cc1d8?window['parseInt'](_0x227dbd(_0x2cc1d8),0x10)*_0x128ab2:null;}function _0x352afd(_0x268a93){return new window['Promise']((_0x539311,_0x47a1de)=>{_0x268a93['then'](_0x539311,_0x47a1de),window['setTimeout'](_0x47a1de,0x1d4c0);});}}_0x1874de['on']('_sendUsageRequest',(_0xe8fea3,_0x58d8fe)=>{if(_0x58d8fe[0x0]!=_0x44868d)return _0x2ede17('UsageLimit');_0x58d8fe[0x1]={..._0x58d8fe[0x1],'requestId':_0x153503};},{'priority':'high'}),_0x1874de['on']('_sendUsageRequest',_0x498484=>{_0x193e76(_0x498484['return'])&&(_0x412b58=!0x0,_0x46dad6(_0x498484['return']));},{'priority':'low'}),_0x3ffecd['then'](()=>{_0x412b58||_0x2ede17('UsageLimit');});});function _0x2e8d0a(){return'auto'==_0x1874de['editing']['view']['_overlayModeHint'];}function _0x187843(){_0x1874de['editing']['view']['_overlayModeHint']='auto';}}function _0x4c9346(_0x16c477){const _0x5211ef=[new window['Promise'](_0x434932=>setTimeout(_0x434932,0x93ecc)),_0x3ffecd['then'](()=>new window['Promise'](_0x592995=>{let _0x4267de=0x0;_0x1874de['model']['on']('applyOperation',(_0x1b96e2,_0x3361dc)=>{_0x3361dc[0x0]['isDocumentOperation']&&_0x4267de++,0x5e8==_0x4267de&&(_0x592995(),_0x1b96e2['off']());});}))];return window['Promise']['race'](_0x5211ef)['then'](()=>_0x16c477);}async function _0x3096ce(){await _0x3ffecd,_0x1874de['model']['change']=_0x336617,_0x1874de['model']['enqueueChange']=_0x336617,_0x1874de['enableReadOnlyMode']('model');}function _0x2f00e2(_0x38f2bc){const _0x1c5510=_0x31187d();_0x1874de[_0x1c5510]='aiLicenseKey'+_0x38f2bc,'Valid'!=_0x38f2bc&&_0x3096ce();}function _0x31187d(){const _0x3015ff=window['String'](window['performance']['now']())['replace']('.','');let _0x324369='n';for(let _0x1578c3=0x0;_0x1578c3<_0x3015ff['length'];_0x1578c3+=0x2){let _0x56f961=window['parseInt'](_0x3015ff['substring'](_0x1578c3,_0x1578c3+0x2));_0x56f961>=0x3e&&(_0x56f961-=0x3e),_0x324369+=_0x214fbb[_0x56f961];}return _0x324369;}function _0x2fce57(){const _0x324130=_0x101331['split']('.');if(0x3!=_0x324130['length'])return null;return _0x26ab95(_0x324130[0x1]);function _0x26ab95(_0x18f4b1){const _0x2c0272=_0x2fffee(_0x18f4b1);return _0x2c0272&&_0x4f2779()?_0x2c0272:null;function _0x4f2779(){const _0x17632c=_0x2c0272['jti'],_0x1efb04=window['parseInt'](_0x17632c['substring'](_0x17632c['length']-0x8),0x10),_0x2fbca0={..._0x2c0272,'jti':_0x17632c['substring'](0x0,_0x17632c['length']-0x8)};return delete _0x2fbca0['vc'],_0x2870af(_0x2fbca0)==_0x1efb04;}}}async function _0x2d5e92(){let _0xb6e197=!0x0;try{const [_0x3662c2,_0x4319f3,_0x345276]=_0x101331['split']('.');return _0x267e8b(_0x3662c2),await _0x575708(_0x3662c2,_0x4319f3,_0x345276),_0xb6e197;}catch{return!0x1;}function _0x267e8b(_0x47dacb){const _0x2fb967=_0x2fffee(_0x47dacb);_0x2fb967&&'ES256'==_0x2fb967['alg']||(_0xb6e197=!0x1);}async function _0x575708(_0x514315,_0x3cbad4,_0x589016){const _0x18025a=window['Uint8Array']['from'](_0x227319(_0x589016),_0x58b8d6=>_0x58b8d6['charCodeAt'](0x0)),_0x4b525b=new window['TextEncoder']()['encode'](_0x514315+'.'+_0x3cbad4),_0xce929f=window['crypto']['subtle'];if(!_0xce929f)return;const _0x5a0b65=await _0xce929f['importKey']('jwk',_0x44bfa5,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0xce929f['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x5a0b65,_0x18025a,_0x4b525b)||(_0xb6e197=!0x1);}}function _0x2fffee(_0x463642){return _0x463642['startsWith']('ey')?JSON['parse'](_0x227319(_0x463642)):null;}function _0x227319(_0x3d71f8){return window['atob'](_0x3d71f8['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2870af(_0x35c6ea){let _0x403258=0x1505;function _0x3a857a(_0x58603b){for(let _0x2af89c=0x0;_0x2af89c<_0x58603b['length'];_0x2af89c++){const _0x3be4e0=_0x58603b['charCodeAt'](_0x2af89c);_0x403258=(_0x403258<<0x5)+_0x403258+_0x3be4e0,_0x403258&=_0x403258;}}function _0x3379d7(_0x1ab883){Array['isArray'](_0x1ab883)?_0x1ab883['forEach'](_0x3379d7):_0x1ab883&&'object'==typeof _0x1ab883?Object['entries'](_0x1ab883)['sort']()['forEach'](([_0xc12dd0,_0x5c2fd3])=>{_0x3a857a(_0xc12dd0),_0x3379d7(_0x5c2fd3);}):_0x3a857a(window['String'](_0x1ab883));}return _0x3379d7(_0x35c6ea),_0x403258>>>0x0;}function _0x3d5277(_0x1b58c0){return _0x1b58c0['toString'](0x10)['padStart'](0x8,'0');}function _0x227dbd(_0x58647f){return _0x58647f['split']('')['reverse']()['join']('');}function _0x336617(){}_0x2f00e2(await _0x4ad6fd());}(this);}['showFakeVisualSelection'](){const _0x522e61=this['editor']['model'];_0x522e61['change'](_0x11ff38=>{const _0x40dc5a=_0x522e61['document']['selection']['getRanges']();let _0x381e1d=0x0;for(const _0x419cb4 of _0x40dc5a){const _0x4ea76=Ri+':'+_0x381e1d;if(_0x522e61['markers']['has'](_0x4ea76))_0x11ff38['updateMarker'](_0x4ea76,{'range':_0x419cb4});else{if(_0x419cb4['start']['isAtEnd']){const _0x36dbe2=_0x419cb4['start']['getLastMatchingPosition'](({item:_0x38d814})=>!_0x522e61['schema']['isContent'](_0x38d814),{'boundaries':_0x419cb4});_0x11ff38['addMarker'](_0x4ea76,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x11ff38['createRange'](_0x36dbe2,_0x419cb4['end'])});}else _0x11ff38['addMarker'](_0x4ea76,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x419cb4});}_0x381e1d++;}});}['hideFakeVisualSelection'](){const _0x2fe469=this['editor']['model'],_0x4403d0=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Ri));_0x4403d0['length']&&_0x2fe469['change'](_0x512161=>{_0x4403d0['forEach'](_0x42e3aa=>{_0x512161['removeMarker'](_0x42e3aa);});});}['insertContent'](_0x6aa84c,_0xfcb39){const _0x43c63a=this['_getAISelection'](),_0x2e2da1=_0xfcb39||_0x43c63a['getFirstRange']();this['editor']['model']['canEditAt'](_0x2e2da1)&&this['editor']['model']['change'](_0x255dd4=>{this['hideFakeVisualSelection'](),_0xfcb39||this['_resetContentOfSelectedTableCells'](_0x255dd4,_0x43c63a),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2e2da1,'writer':_0x255dd4,'html':_0x6aa84c});});}['insertContentBelow'](_0x3eb6f9){const {model:_0x2ad866}=this['editor'],_0x7d6028=this['_getAISelection']();_0x2ad866['change'](()=>{const _0x3e1c58=this['_prepareTableInsertBelowPosition'](_0x3eb6f9,_0x7d6028)||this['_getDefaultInsertBelowPosition'](_0x7d6028);this['insertContent'](_0x3eb6f9,_0x3e1c58);});}['_getAISelection'](){const _0x2ea111=this['editor']['model'],_0x3ebee2=Array['from'](_0x2ea111['markers']['getMarkersGroup'](Ri))['map'](_0x417e05=>_0x417e05['getRange']());return _0x2ea111['createSelection'](_0x3ebee2);}['_pasteHTMLUsingClipboard']({writer:_0x31e166,html:_0x4db623,insertAt:_0x39e8c9}){const {view:_0x1b1e51}=this['editor']['editing'],_0x20d967=this['editor']['plugins']['get'](_0x219e5d),_0x5b0646=new Si();_0x5b0646['setData']('text/html',_0x4db623);const _0x3326bc=new _0x257ddf(_0x1b1e51,new ClipboardEvent('paste',{'clipboardData':_0x5b0646}),{'dataTransfer':new _0x17d082(_0x5b0646)});_0x31e166['setSelection'](_0x39e8c9);const _0x46dc72=(_0x4047d9,_0x3ebf8d)=>{_0x3ebf8d['resultRange']&&_0x31e166['setSelection'](_0x3ebf8d['resultRange']);};_0x20d967['once']('contentInsertion',_0x46dc72,{'priority':'lowest'}),_0x1b1e51['document']['fire']('paste',_0x3326bc),_0x20d967['off']('contentInsertion',_0x46dc72);}['_getDefaultInsertBelowPosition'](_0x430972){const {model:_0x10df82}=this['editor'],_0x1ec4d6=Array['from'](_0x430972['getSelectedBlocks']());return _0x1ec4d6['length']?_0x10df82['createPositionAfter'](_0x1ec4d6['pop']()):_0x430972['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3d85eb,_0x50f2f5){const {model:_0x5d0a8a,plugins:_0x29d93d}=this['editor'];if(_0x29d93d['has']('TableUtils')){const _0x576ad9=_0x29d93d['get']('TableUtils')['getSelectedTableCells'](_0x50f2f5);if(_0x576ad9['length']){const _0x35c7d8=this['_getTableRowCountFromContent'](_0x3d85eb),_0x231150=this['_createEmptyTableRows'](_0x576ad9,_0x35c7d8);return _0x5d0a8a['createPositionAt'](_0x231150,0x0);}}return null;}['_getTableRowCountFromContent'](_0x27da07){const _0x1d3d05=this['editor']['plugins']['get']('TableUtils'),_0x1c6e51=this['editor']['data']['parse'](_0x27da07,'$documentFragment'),_0x450610=Array['from'](_0x1c6e51['getChildren']())['filter'](_0x418731=>_0x418731['is']('element','table'));let _0x5e1eff=0x0;return _0x450610['forEach'](_0x21dc08=>{_0x5e1eff+=_0x1d3d05['getRows'](_0x21dc08);}),_0x5e1eff;}['_createEmptyTableRows'](_0x18bf53,_0x3eb617){const _0x34f12c=this['editor']['plugins']['get']('TableUtils'),_0x327414=_0x34f12c['getRowIndexes'](_0x18bf53),_0x10609f=_0x34f12c['getColumnIndexes'](_0x18bf53),_0x328603=_0x327414['last']+0x1,_0x2b619d=_0x10609f['first'],_0x2cb7dd=_0x18bf53[0x0]['findAncestor']('table');for(let _0x2e78fa=0x0;_0x2e78fa<_0x3eb617;_0x2e78fa++)_0x34f12c['insertRows'](_0x2cb7dd,{'at':_0x328603});return _0x2cb7dd['getChild'](_0x328603)['getChild'](_0x2b619d);}['_resetContentOfSelectedTableCells'](_0x2bb1fa,_0x1b2baf){const {plugins:_0x2802e5}=this['editor'],{model:_0xa13de1}=_0x2bb1fa;_0x2802e5['has']('TableUtils')&&_0x2802e5['get']('TableUtils')['getSelectedTableCells'](_0x1b2baf)['length']&&_0xa13de1['deleteContent'](_0x1b2baf);}},vi=class extends _0x4655d9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}},ki=class extends Error{constructor(_0x3b05e5){super(_0x3b05e5),this['name']='AIRequestError';}};function Ni(_0x4e5400,_0x259968,_0x107cb3){const t=_0x4e5400['t'];switch(_0x259968){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',_0x107cb3);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x107cb3);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'},_0x107cb3);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x259968;}}var yi=class extends _0x17e1f8{['_commandDefinitions'];constructor(_0x567d07,_0x16dcb2){super(_0x567d07),this['_commandDefinitions']=_0x16dcb2,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x265c5c,_0x38a937,_0x3df7a0)=>{this['isEnabled']&&(this['enabledCommandsIds']=xi(this['_commandDefinitions'],_0x3df7a0));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xb04cf0,_0x6fd80b,_0x18132f)=>{this['enabledCommandsIds']=_0x18132f?xi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3038d9=this['editor']['model'];this['_hasContext']=function(_0xf9c39a){const _0x2a15b6=_0xf9c39a['document']['selection'];return _0x2a15b6['isCollapsed']?0x0!==[..._0x2a15b6['getSelectedBlocks']()]['length']&&![..._0x2a15b6['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xf9c39a['hasContent'](_0x2a15b6['getFirstRange']());}(_0x3038d9);const _0x223b2a=_0x3038d9['document']['selection'],_0x20c04b=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x38c16d of _0x223b2a['getRanges']())for(const _0x3417f7 of _0x38c16d['getItems']())if(_0x3417f7['is']('element')&&_0x20c04b['includes'](_0x3417f7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x296188='',_0x1391ab='',_0x4ded3b='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x296188,_0x1391ab,_0x4ded3b);}};function xi(_0x5e557a,_0x4c8aca){const _0x1920aa=new Set();for(const _0x4e6990 of _0x5e557a['values']())(_0x4c8aca||!0x1===_0x4e6990['requiresContent'])&&_0x1920aa['add'](_0x4e6990['id']);return Array['from'](_0x1920aa);}const Li=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Di=/* #__PURE__ -- @preserve */
24
- gt();var Pi=class extends Di{['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x34786a,_0x99a913,_0x5abfdf){super(),this['editor']=_0x34786a,this['textAdapter']=_0x99a913,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5abfdf,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x45b42b,_0x30bda7,_0x22c56d)=>{this['view']['value']=this['_sanitizeHTML'](_0x22c56d);}),this['listenTo'](this['view'],'submitPrompt',(_0x59a232,_0x19406e)=>{const _0x5d4499=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x19406e,_0x5d4499,'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:_0x191100,query:_0x5af08a,htmlContent:_0x4f118b,label:_0x3c8338,mainActionLabel:_0x3d2ac4}){this['view']['prompt']=_0x3c8338,this['view']['mainAction']=_0x3d2ac4,this['initialContext']=_0x4f118b,_0x5af08a&&(this['view']['isRendered']?this['_handleQuery'](_0x5af08a,_0x4f118b,_0x191100,_0x3c8338):this['view']['once']('render',()=>{this['_handleQuery'](_0x5af08a,_0x4f118b,_0x191100,_0x3c8338);}));}['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'](_0x1bb398,_0xceb425,_0x2a9bc3,_0x1f0fbc){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xceb425,this['previousQuery']=_0x1bb398,this['previousLabel']=_0x1f0fbc||_0x1bb398,this['previousActionId']=_0x2a9bc3,new Promise(_0xbd6175=>{this['textAdapter']['makeRequest']({'query':_0x1bb398,'context':_0xceb425,'onData':_0x31231f=>{this['currentResponse']=_0x31231f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2a9bc3})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x233e1c=>{_0x233e1c instanceof ki?this['view']['handleError'](_0x233e1c['message']):this['view']['handleError'](),_0xbd6175();})['finally'](()=>{this['stopProcessing'](),_0xbd6175();});});}['_parseAndNormalizeContent'](_0x5bc5a6,_0x3bb37d=!0x1){const _0x120366=Li['exec'](_0x5bc5a6);_0x5bc5a6=_0x120366?_0x5bc5a6['substring'](_0x120366[0x1]['length']):_0x5bc5a6['length']<0x64&&!_0x3bb37d?'':this['_stripMarkdownSyntax'](_0x5bc5a6);const _0x4cbd55=this['_domParser']['parseFromString'](_0x5bc5a6,'text/html');if(_0x120366){const _0x1e818f=Array['from'](_0x4cbd55['body']['childNodes']);_0x1e818f['reverse']();for(const _0x5b715b of _0x1e818f){if(_0x5b715b['nodeType']==Node['ELEMENT_NODE'])break;_0x5b715b['remove']();}}const _0x52d5aa=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4cbd55['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x52d5aa);const _0x3107f8=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x3d749a=this['editor']['data']['toModel'](_0x52d5aa);return _0x3107f8||_0x3d749a['markers']['clear'](),this['editor']['data']['stringify'](_0x3d749a);}['_normalizeResponseHeadings'](_0x2155f2){const _0x4c75d1=new _0x4e4d06(this['editor']['editing']['view']['document']),_0xd9b259=new _0x53cb0f({'name':/^h[1-5]$/}),_0x121109=[];let _0x1aeeb0=!0x1;for(const _0x8e3163 of _0x2155f2)_0x8e3163['is']('element')&&_0xd9b259['match'](_0x8e3163)&&(_0x121109['push'](_0x8e3163),'h1'==_0x8e3163['name']&&(_0x1aeeb0=!0x0));if(_0x1aeeb0){for(const _0x3b1f73 of _0x121109)_0x4c75d1['rename']('h'+(parseInt(_0x3b1f73['name'][0x1])+0x1),_0x3b1f73);}}['_isH1TagSupportEnabled'](){const {data:_0x341c66,editing:_0x14bd3a}=this['editor'],_0x2f05f1=_0x341c66['htmlProcessor']['toView']('<h1></h1>'),_0x454c5a=_0x341c66['toView'](_0x341c66['toModel'](_0x2f05f1));return!!_0x14bd3a['view']['domConverter']['viewToDom'](_0x454c5a)['querySelector']('h1');}['_sanitizeHTML'](_0x506c9a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x506c9a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2456ee){const _0x1d7807=_0x2456ee['trim']();return _0x1d7807['startsWith']('```html')?_0x1d7807['endsWith']('```')?_0x1d7807['substring'](0x7,_0x1d7807['length']-0x3):_0x1d7807['substring'](0x7):_0x2456ee;}};const Hi={'REPLACE':'replace','INSERT':'insert'};var Mi=class extends _0x182e23{constructor(_0x260821){super(_0x260821),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4cab78=>Ni(_0x260821,'AI_'+_0x4cab78['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ni(_0x260821,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ni(_0x260821,'Try\x20again')),this['stopButton']=this['_createButton'](Ni(_0x260821,'Stop'));const _0x5ac384=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5ac384['if']('isVisible','ck-hidden',_0xd21ee8=>!_0xd21ee8)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2b6aea,_0x1fb91b){const _0x536888=new Ht(this['locale']);return _0x536888['set']({'label':_0x2b6aea,'class':_0x1fb91b||'','isVisible':!0x0,'withText':!0x0}),_0x536888;}},Vi=class extends _0x42f8f5{['contentFieldView'];['copyButtonView'];constructor(_0x37f981,_0x3ebd97=''){super(_0x37f981),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1a8cdf=this['bindTemplate'];this['contentFieldView']=new Ui(_0x37f981,_0x3ebd97),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1a8cdf['if']('isVisible','ck-hidden',_0x59e3de=>!_0x59e3de)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1a8cdf['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 _0x3ef1b8=!0x1;this['on']('change:value',(_0x7e5b06,_0x18cde3,_0x4a2afb)=>{const _0x42e998=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4a2afb),this['isProcessing']&&_0x42e998&&!_0x3ef1b8&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x47585e,_0x3aa9e9,_0x2f2642)=>{_0x3ef1b8=!0x1,_0x2f2642?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3ef1b8=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3ef1b8=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4e4ee5=this['locale'],_0x3473e1=new Ht(this['locale']),_0x5dd4fc='ck-ai-form__copy-button';return _0x3473e1['set']({'label':Ni(_0x4e4ee5,'Copy'),'icon':_0x1bec33,'class':_0x5dd4fc,'tooltip':!0x0}),_0x3473e1['bind']('isVisible')['to'](this,'value',_0x1b0808=>!!_0x1b0808),_0x3473e1['bind']('isEnabled')['to'](this,'isProcessing',_0x2e8efe=>!_0x2e8efe),_0x3473e1['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3473e1['icon']=_0x734ca,_0x3473e1['class']=_0x5dd4fc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3473e1['icon']=_0x1bec33,_0x3473e1['class']=_0x5dd4fc;},0x3e8);}),_0x3473e1;}['_copyHTMLToClipboard'](_0x65eead){const {window:_0xd2cf50,document:_0x27b813}=Tt;if(_0xd2cf50['ClipboardItem']){const {Blob:_0x2edf6d,ClipboardItem:_0x135921}=_0xd2cf50,_0x22d8b6=[new _0x135921({'text/html':new _0x2edf6d([_0x65eead['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2edf6d([_0x65eead['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x22d8b6);}else{const _0x58d87e=_0x27b813['createElement']('div');_0x58d87e['style']['position']='absolute',_0x58d87e['style']['left']='-9999px',_0x58d87e['innerHTML']='<span>[</span>'+_0x65eead['innerHTML']+'<span>]</span>',_0x27b813['body']['appendChild'](_0x58d87e);const _0x53028d=_0x27b813['createRange']();_0x53028d['setStartAfter'](_0x58d87e['firstElementChild']),_0x53028d['setEndBefore'](_0x58d87e['lastElementChild']);const _0x178d05=_0xd2cf50['getSelection']();_0x178d05['removeAllRanges'](),_0x178d05['addRange'](_0x53028d),_0x27b813['execCommand']('copy'),_0x58d87e['remove']();}}},Ui=class extends _0x42f8f5{constructor(_0x4b941e,_0x5ba8d8=''){super(_0x4b941e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5ba8d8,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2964bd){this['element']['innerHTML']=_0x2964bd;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x10c1b5=new _0x42f8f5(),_0x157299=this['locale'],_0x35ab18=new _0x528849();return _0x35ab18['isVisible']=!0x0,_0x10c1b5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x35ab18,{'text':Ni(_0x157299,'AI\x20is\x20writing...')}]}),_0x10c1b5['render'](),_0x10c1b5;}},Bi=class extends _0x42f8f5{constructor(_0x5dad0a,_0x91d698=''){super(_0x5dad0a);const _0x116a0d=new Yt(),_0x36b2bc=this['bindTemplate'];this['set']('text',_0x91d698),_0x116a0d['content']=_0x5c8d8e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x116a0d,{'text':_0x36b2bc['to']('text')}]});}},Gi=class extends Nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x31bb04,_0x272feb){super(_0x31bb04,_0x272feb),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',(_0x1f8dc4,_0x709dbc)=>{_0x1f8dc4['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x709dbc());});}['_createSubmitButton'](){const _0x390995=new Ht(this['locale']),_0x363f83=this['locale'];return _0x390995['set']({'icon':st,'label':Ni(_0x363f83,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x390995['on']('execute',()=>{this['submit']();}),_0x390995['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3340e1,_0x5d27e4)=>!_0x3340e1&&_0x5d27e4),_0x390995;}['_createShowHistoryButton'](){const _0x9ef47c=new Ht(this['locale']),_0x3a65a5=this['resultsView'],_0x23b10=this['locale'];_0x9ef47c['set']({'label':Ni(_0x23b10,'History'),'withText':!0x1,'icon':_0x29ed9d,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x9ef47c['bind']('isOn')['to'](_0x3a65a5,'isVisible'),_0x9ef47c['bind']('isEnabled')['to'](this,'isEnabled'),_0x9ef47c['on']('execute',()=>{_0x3a65a5['isVisible']=!_0x3a65a5['isVisible'],_0x3a65a5['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x97834b=()=>{Tt['window']['requestAnimationFrame'](()=>{if(Ct(this['element'])){const _0x47343e=new At(this['queryView']['fieldView']['element']),_0x2d07b8=_0x47343e['width'],_0x555ec0='rtl'===_0x23b10['uiLanguageDirection']?'left':'right';_0x47343e['excludeScrollbarsAndBorders'](),_0x9ef47c['element']['style'][_0x555ec0]=_0x2d07b8-_0x47343e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x97834b),this['on']('render',_0x97834b),_0x9ef47c;}['submit'](){const _0x1167cf=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1167cf);}['focus'](_0x1c8ff5){-0x1===_0x1c8ff5?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},Fi=class extends jt{['historyGroupView'];['clearHistoryButton'];constructor(_0x55ffe4){super(_0x55ffe4),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Xt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ni(_0x55ffe4,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4e436a=0x0;for(const _0x5be86c of this['items'])_0x4e436a+=_0x5be86c['items']['length'];return{'resultsCount':_0x4e436a,'totalItemsCount':_0x4e436a};}['_createClearHistoryButton'](){const _0x812a8a=this['locale'],_0x34e273=new Ht(this['locale']);return _0x34e273['set']({'label':'('+Ni(_0x812a8a,'Clear')+')','withText':!0x0}),_0x34e273['on']('execute',()=>this['fire']('clearHistory')),_0x34e273;}},Ki=class extends zt{constructor(_0x4625e9){super();const _0x5a8909=new Dt(),_0x480c15=new Ht(this['locale'],_0x5a8909);this['children']['add'](_0x480c15),_0x480c15['set']({'label':_0x4625e9['prompt'],'withText':!0x0}),_0x480c15['on']('execute',()=>{this['fire']('execute',{'value':_0x5e3805(_0x4625e9['prompt'])});});}};const Wi='CKEditor/AIFormView/PromptHistory';var Yi=class extends ct{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1547ff,_0x5d7158)=>{const _0x5529ee=$i(_0x5d7158['prompt']);for(const _0x3a597c of this)if(_0x3a597c!=_0x5d7158&&$i(_0x3a597c['prompt'])===_0x5529ee){this['remove'](_0x3a597c);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3d476d=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x3d476d));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0xbd8111=>_0xbd8111)));}};function $i(_0x2fff6e){return _0x2fff6e['toLowerCase']()['trim']();}var qi=class extends _0x42f8f5{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x19567a,_0x157fa4,_0x27a723=''){super(_0x19567a),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Hi['REPLACE']),this['_promptHistory']=new Yi(),this['errorView']=new Bi(_0x19567a),this['contentArea']=new Vi(_0x19567a,_0x27a723),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 dt(),this['keystrokes']=new _t(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Gt({'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 _0x16ec7e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x157fa4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x16ec7e['if']('isError','ck-hidden',_0x32ee48=>!_0x32ee48)]},'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'](_0xf570c=0x1){-0x1===_0xf570c?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 _0x5a11f5=this['locale'],_0x53cb82=new Gi(_0x5a11f5,{'queryView':{'label':Ni(_0x5a11f5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x48ca6a,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ni(_0x5a11f5,'Empty\x20history'),'secondary':Ni(_0x5a11f5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x53cb82['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2793d5,_0x118f83)=>_0x2793d5&&!_0x118f83),this['listenTo'](_0x53cb82,'submit',(_0x28381b,_0x49daca)=>{this['prompt']=_0x49daca;const _0x5487bf=_0x5a08e5(_0x49daca);this['fire']('submitPrompt',_0x5487bf),_0x49daca['trim']()&&this['_promptHistory']['add']({'prompt':_0x5487bf},0x0);},{'priority':'high'}),_0x53cb82;}['_createHistoryView'](){const _0x3babf7=new Fi(this['locale']);return _0x3babf7['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x3babf7['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3babf7;}['_createToolbar'](){const _0x545cf1=new Mi(this['locale']);return _0x545cf1['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x549bcb,_0x445080,_0x50262e)=>_0x549bcb&&!_0x445080&&!!_0x50262e),_0x545cf1['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x545cf1['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x37105b,_0x34d416,_0x54fb3f)=>_0x37105b&&!_0x34d416&&!!_0x54fb3f),_0x545cf1['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x545cf1['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xd9a22a,_0x529403)=>_0xd9a22a&&!_0x529403),_0x545cf1['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x545cf1['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x545cf1['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x545cf1;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xe169db=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ni(_0xe169db,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f2485){const _0x17140c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f2485||Ni(_0x17140c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const Qi=globalThis['DataTransfer'];var Xi=class extends _0x4655d9{['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[_0x15baa8,Oi,vi,Mt];}constructor(_0x157f76){super(_0x157f76),_0x157f76['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x157f76['config']['define']('ai.assistant.contentAreaCssClass',''),_0x157f76['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x157f76['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x28ab19}=this;this['_aiAdapter']=_0x28ab19['plugins']['get'](vi),this['_dialog']=_0x28ab19['plugins']['get'](Mt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1f2fb8=new yi(_0x28ab19,Array['from'](this['_commandDefinitions']['values']()));_0x28ab19['commands']['add']('showAIAssistant',_0x1f2fb8),_0x28ab19['ui']['componentFactory']['add']('aiCommands',_0x44ce79=>{const _0x4afc87=_0x5ba05a(_0x44ce79);return _0x4afc87['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4afc87['buttonView']['set']({'label':Ni(_0x44ce79,'AI\x20Commands'),'icon':_0x52c8e1,'tooltip':!0x0}),_0x4afc87['on']('execute',_0x456248=>this['_onExecute'](_0x456248['source']['id'])),_0x406c29(_0x4afc87,_0x28ab19['ui']['view']['body'],function(_0x1d67b3){const _0x31f166=ji(_0x1d67b3,bi(_0x1d67b3['config']['get']('ai.assistant.commands'),_0x1d67b3['locale']))['filter'](_0x18d6d5=>_0x18d6d5['commands']['length']);return 0x1===_0x31f166['length']?ji(_0x1d67b3,_0x31f166[0x0]['commands'])['map'](_0x470b8e=>({'id':_0x470b8e['id'],'label':_0x470b8e['label']})):_0x31f166['map'](_0xfdcccd=>{const {groupId:_0x566f67,groupLabel:_0x326000,commands:_0xa0df34}=_0xfdcccd,_0x208507=ji(_0x1d67b3,_0xa0df34)['map'](_0x5e0fab=>({'id':_0x5e0fab['id'],'label':_0x5e0fab['label']}));return{'id':_0x566f67,'menu':_0x326000||_0x566f67,'children':_0x208507};});}(_0x28ab19),{'ariaLabel':Ni(_0x44ce79,'AI\x20Commands')}),_0x4afc87['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1f2fb8['on']('change:enabledCommandsIds',_0x567979),_0x4afc87['menuView']['once']('render',_0x567979),_0x4afc87;function _0x567979(){_0x4afc87['isEnabled']=_0x1f2fb8['enabledCommandsIds']['length']>0x0;for(const _0x3dc66f of _0x4afc87['menuView']['buttons'])_0x3dc66f['isEnabled']=_0x1f2fb8['enabledCommandsIds']['includes'](_0x3dc66f['id']);}}),_0x28ab19['ui']['componentFactory']['add']('menuBar:aiCommands',_0x13d691=>{const _0x2c654d=new _0x40d16d(_0x13d691);_0x2c654d['buttonView']['set']({'label':Ni(_0x13d691,'AI\x20Commands'),'icon':_0x52c8e1}),_0x2c654d['bind']('isEnabled')['to'](_0x1f2fb8,'enabledCommandsIds',_0x1d315d=>_0x1d315d['length']>0x0);const _0x22e091=bi(_0x28ab19['config']['get']('ai.assistant.commands'),_0x13d691);return this['_populateMenuBarMenu'](_0x1f2fb8,_0x2c654d,_0x22e091,_0x4d709e=>this['_onExecute'](_0x4d709e)),_0x2c654d;}),_0x28ab19['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3ddb02=this['_createAIAssistantUIButton'](Ht);return _0x3ddb02['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3ddb02;}),_0x28ab19['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x296928=this['_createAIAssistantUIButton'](Jt);return _0x296928['set']({'role':'menuitemcheckbox'}),_0x296928;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4ae050=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x579514;for(const _0x28f7f9 in _0x4ae050){const _0x545d38=_0x28f7f9,_0x5d739b=_0x4ae050[_0x545d38];if('aiLicenseKeyValid'==_0x5d739b||'aiLicenseKeyInvalid'==_0x5d739b||'aiLicenseKeyExpired'==_0x5d739b||'aiLicenseKeyDomainLimit'==_0x5d739b||'aiLicenseKeyNotAllowed'==_0x5d739b||'aiLicenseKeyEvaluationLimit'==_0x5d739b||'aiLicenseKeyUsageLimit'==_0x5d739b){delete _0x4ae050[_0x545d38],_0x579514=_0x5d739b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x579514&&_0x4ae050['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x579514&&_0x4ae050['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x579514&&_0x4ae050['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x579514&&_0x4ae050['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x579514&&_0x4ae050['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x579514&&_0x4ae050['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x32a54e='',_0xbc502='',_0x7f852a='custom'){const _0x3c8bdf=this['editor'],_0x59a7e0=_0x3c8bdf['editing']['view'],_0x496a0a=_0x3c8bdf['plugins']['get'](Oi),_0x149cea=_0x3c8bdf['plugins']['get'](_0x15baa8);_0x496a0a['showFakeVisualSelection']();const _0x2135cf=new Qi(),_0x471ef2=new ClipboardEvent('copy',{'clipboardData':_0x2135cf}),_0x5722ef=new _0x17d082(_0x2135cf),_0x497493=new _0x257ddf(_0x59a7e0,_0x471ef2,{'dataTransfer':_0x5722ef});_0x149cea['_forceMarkersCopy']('comment',()=>{_0x59a7e0['document']['fire']('copy',_0x497493);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0x3c8bdf,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x171cb5=_0x5722ef['getData']('text/html');const _0x5b3eb8=_0x3c8bdf['model']['document']['selection'],_0x17aa2d=Array['from'](_0x5b3eb8['getRanges']());0x1===_0x17aa2d['length']&&_0x17aa2d[0x0]['isFlat']&&!_0x5b3eb8['getSelectedElement']()&&''!==_0x171cb5['replace'](/&nbsp;/g,'')['trim']()&&(_0x171cb5='<p>'+_0x171cb5+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x7f852a,'query':_0x32a54e,'htmlContent':_0x171cb5,'label':_0xbc502,'mainActionLabel':Hi[_0x3c8bdf['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x59b4d9,'title':Ni(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Vt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x496a0a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x34768d=new Map(),_0x1353d0=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x229ebf of _0x1353d0)for(const _0x578cc9 of _0x229ebf['commands'])_0x34768d['set'](_0x578cc9['id'],{..._0x578cc9,'groupId':_0x229ebf['groupId'],'groupLabel':_0x229ebf['groupLabel']||_0x229ebf['groupId']});return _0x34768d;}['_createAIAssistantUIButton'](_0x15a69f){const _0xab0984=this['editor'],_0x117955=_0xab0984['commands']['get']('showAIAssistant'),_0x39a746=new _0x15a69f(_0xab0984['locale']);return _0x39a746['set']({'label':Ni(_0xab0984['locale'],'AI\x20Assistant'),'icon':_0x59b4d9,'isToggleable':!0x0}),_0x39a746['bind']('isEnabled')['to'](_0x117955),_0x39a746['bind']('isOn')['to'](this['_dialog'],'id',_0x30658e=>'aiAssistant'===_0x30658e),this['listenTo'](_0x39a746,'execute',()=>{_0x39a746['isOn']?this['hideUI']():_0x117955['execute']();}),_0x39a746;}['_initView'](){const _0x290c26=this['editor']['plugins']['get'](Oi);this['_formView']=new qi(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',()=>{_0x290c26['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x290c26['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x11aba6,ui:{ariaLiveAnnouncer:_0x2a89c5}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2eedfc,_0x361702,_0x2b09b7)=>{const _0x5e46f9=this['_aiAssistantController']['currentContext'];_0x2b09b7?_0x2a89c5['announce'](Ni(_0x11aba6,'AI\x20is\x20writing')):_0x5e46f9&&_0x2a89c5['announce'](Ni(_0x11aba6,'Generated\x20content:\x20%0',_0x5e46f9),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x509d63,_0x3f4b2b,_0x1074a2)=>{if(_0x1074a2){const _0x47773b=this['_formView']['errorView']['text'];_0x2a89c5['announce'](Ni(_0x11aba6,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x47773b));}});}['_onExecute'](_0x2c999c){const _0x3034ec=this['_commandDefinitions']['get'](_0x2c999c),_0x31a123=this['editor'],_0x362854=_0x31a123['model']['document']['selection'],_0x250169=_0x31a123['commands']['get']('showAIAssistant'),_0x21cdd3=_0x31a123['plugins']['get'](Oi),_0x4fd35b=''+('_ungrouppedCommands'!==_0x3034ec['groupId']?_0x3034ec['groupLabel']+':\x20':'')+_0x3034ec['label'];if(!0x1!==_0x3034ec['requiresContent']&&_0x362854['isCollapsed']){const _0x21658b=mt(_0x362854['getSelectedBlocks']())||_0x31a123['model']['schema']['getLimitElement'](_0x362854);_0x31a123['model']['change'](_0x273ca9=>{_0x273ca9['setSelection'](_0x21658b,'in');});}_0x21cdd3['showFakeVisualSelection'](),_0x250169['execute'](_0x3034ec['prompt'],_0x4fd35b,'command:'+_0x2c999c);}['_populateMenuBarMenu'](_0x4a6ebc,_0x3fbe82,_0x568842,_0x238c89){const _0x1d9fca=this['editor'],_0x1c50e3=_0x1d9fca['locale'],_0x2e0037=new te(_0x1c50e3),_0x586857=ji(_0x1d9fca,_0x568842)['filter'](_0x3eef59=>_0x3eef59['commands']['length']);0x1===_0x586857['length']?this['_getMenuBarGroupButtons']({'command':_0x4a6ebc,'commands':_0x586857[0x0]['commands'],'parentMenuView':_0x3fbe82,'onExecute':_0x238c89})['forEach'](_0x421603=>_0x2e0037['items']['add'](_0x421603)):_0x586857['forEach'](({groupId:_0x23d653,groupLabel:_0x6bf53f,commands:_0x1bdbca})=>{const _0x49f96a=new Zt(_0x1c50e3,_0x3fbe82),_0x3f46d7=new _0x40d16d(_0x1c50e3),_0x47e21c=new te(_0x1c50e3),_0x97a73e=this['_getMenuBarGroupButtons']({'command':_0x4a6ebc,'commands':_0x1bdbca,'parentMenuView':_0x3f46d7,'onExecute':_0x238c89});_0x3f46d7['buttonView']['set']({'label':_0x6bf53f||_0x23d653}),_0x3f46d7['delegate']('execute')['to'](_0x3fbe82),_0x47e21c['items']['addMany'](_0x97a73e),_0x3f46d7['panelView']['children']['add'](_0x47e21c),_0x49f96a['children']['add'](_0x3f46d7),_0x2e0037['items']['add'](_0x49f96a);}),_0x3fbe82['panelView']['children']['add'](_0x2e0037);}['_getMenuBarGroupButtons']({command:_0x310091,commands:_0x5d8b63,parentMenuView:_0x4be29c,onExecute:_0x22fbc6}){const _0x202d0b=this['editor'],_0x1cec91=_0x202d0b['locale'];return ji(_0x202d0b,_0x5d8b63)['map'](_0x802e01=>{const _0x55540e=new Zt(_0x1cec91,_0x4be29c),_0xdf2259=new Jt(_0x1cec91);return _0xdf2259['set']({'label':_0x802e01['label']}),_0xdf2259['delegate']('execute')['to'](_0x4be29c),_0xdf2259['on']('execute',()=>_0x22fbc6(_0x802e01['id'])),_0xdf2259['bind']('isEnabled')['to'](_0x310091,'enabledCommandsIds',_0x2acbdf=>_0x2acbdf['includes'](_0x802e01['id'])),_0x55540e['children']['add'](_0xdf2259),_0x55540e;});}};function zi(_0x66449c,_0x2146c4){return void 0x0!==_0x66449c['order']&&void 0x0===_0x2146c4['order']?0x1:void 0x0===_0x66449c['order']&&void 0x0!==_0x2146c4['order']?-0x1:void 0x0!==_0x66449c['order']&&void 0x0!==_0x2146c4['order']?_0x66449c['order']-_0x2146c4['order']:0x0;}function ji(_0x58d99b,_0x37848f){_0x37848f['sort'](zi);const _0xdf8e64={},_0x3fc18f=[];for(const _0x20f767 of _0x37848f)if(void 0x0!==_0x20f767['order']){if(_0x20f767['order']in _0xdf8e64)throw new ht('ai-commands-config-order-collision',_0x58d99b,{'conflictingDefinitions':[_0x20f767,_0xdf8e64[_0x20f767['order']]]});_0xdf8e64[_0x20f767['order']]=_0x20f767,_0x3fc18f['splice'](_0x20f767['order'],0x0,_0x20f767);}else _0x3fc18f['push'](_0x20f767);return _0x3fc18f;}var Ji=class extends _0x4655d9{static get['requires'](){return[Xi,Oi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x392051){super(_0x392051);const _0x5083ef=_0x392051['config'],_0x2e1e0d=_0x392051['locale'];_0x5083ef['define']('ai.assistant.preserveComments',!0x0),_0x5083ef['define']('ai.assistant.commands',Zi(_0x2e1e0d)),_0x5083ef['define']('ai.assistant.extraCommandGroups',[]),_0x5083ef['define']('ai.assistant.removeCommands',[]);let _0x3db07c=bi(_0x5083ef['get']('ai.assistant.commands'),_0x2e1e0d);const _0x7256bb=_0x5083ef['get']('ai.assistant.extraCommandGroups'),_0x74acf3=_0x5083ef['get']('ai.assistant.removeCommands');_0x7256bb['forEach'](_0x148ae8=>{const _0x33cab8=_0x3db07c['find'](_0x1fcade=>_0x1fcade['groupId']===_0x148ae8['groupId']);_0x33cab8?_0x33cab8['commands']=_0x33cab8['commands']['concat'](_0x148ae8['commands']):_0x3db07c['push'](_0x148ae8);}),_0x3db07c=_0x3db07c['filter'](_0x26d631=>!_0x74acf3['includes'](_0x26d631['groupId'])),_0x3db07c['forEach'](_0x1958c0=>{_0x1958c0['commands']=_0x1958c0['commands']['filter'](_0x1f171a=>!_0x74acf3['includes'](_0x1f171a['id']));}),_0x5083ef['set']('ai.assistant.commands',_0x3db07c);}};function Zi(_0x3ab40e){return[{'groupId':'editOrReview','groupLabel':Ni(_0x3ab40e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ni(_0x3ab40e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ni(_0x3ab40e,'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':Ni(_0x3ab40e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ni(_0x3ab40e,'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':Ni(_0x3ab40e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ni(_0x3ab40e,'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':Ni(_0x3ab40e,'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':Ni(_0x3ab40e,'Change\x20tone'),'commands':[{'id':'professional','label':Ni(_0x3ab40e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ni(_0x3ab40e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ni(_0x3ab40e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ni(_0x3ab40e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ni(_0x3ab40e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ni(_0x3ab40e,'Change\x20style'),'commands':[{'id':'business','label':Ni(_0x3ab40e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ni(_0x3ab40e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ni(_0x3ab40e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ni(_0x3ab40e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ni(_0x3ab40e,'Translate'),'commands':[{'id':'translateEnglish','label':Ni(_0x3ab40e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ni(_0x3ab40e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ni(_0x3ab40e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ni(_0x3ab40e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ni(_0x3ab40e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ni(_0x3ab40e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ni(_0x3ab40e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ni(_0x3ab40e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var ts=class extends _0x4655d9{['abortController'];static get['requires'](){return[vi];}constructor(_0x52e401){super(_0x52e401),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](vi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x466008){return this['sendRequest'](_0x466008)['catch'](_0x21c52a=>{if(_0x21c52a instanceof ki)return Promise['reject'](_0x21c52a);if('AbortError'==_0x21c52a['name'])return Promise['resolve']();throw console['error'](_0x21c52a),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x419979,_0x4415f9){const _0x3a0ea6=this['editor']['locale'],_0x516c4d={'Content-Type':'application/json'};if('object'==typeof _0x419979)Object['assign'](_0x516c4d,_0x419979);else{if(_0x419979)try{const _0x20eefc=await _0x419979(_0x4415f9);Object['assign'](_0x516c4d,_0x20eefc);}catch{return Promise['reject'](new ki(Ni(_0x3a0ea6,'AI_ERROR_GET_HEADERS')));}}return _0x516c4d;}async['_prepareRequestParameters'](_0x29b23d,_0x3c2264){const _0x3a2d7a=this['editor']['locale'];if('object'==typeof _0x29b23d)return _0x29b23d;try{return await _0x29b23d(_0x3c2264);}catch{return Promise['reject'](new ki(Ni(_0x3a2d7a,'AI_ERROR_GET_PARAMETERS')));}}},es=class extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4ad63e){super(_0x4ad63e),_0x4ad63e['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4ad63e['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4ad63e['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4ad63e['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4ad63e['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4ad63e['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x1e4cf0,context:_0x4d62c8,onData:_0x4d0f16,actionId:_0x37f714}){const _0x2f3921=this['editor']['locale'],_0x2e24d1=await this['prepareMessages'](_0x1e4cf0,_0x4d62c8,_0x37f714),_0x2c2be4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x37f714),_0x26407f=await this['_prepareRequestParameters'](this['_requestParameters'],_0x37f714),_0x311820={'messages':_0x2e24d1,..._0x26407f},_0x13ded4={'method':'POST','headers':_0x2c2be4,'body':JSON['stringify'](_0x311820),'signal':this['abortController']['signal']},_0x2dd5e3=await fetch(this['_apiUrl'],_0x13ded4);if(_0x2dd5e3['ok'])return _0x26407f['stream']?await this['_readStreamableResponse'](_0x2dd5e3,_0x4d0f16):await this['_readStaticResponse'](_0x2dd5e3,_0x4d0f16),Promise['resolve']();{const _0x1bb10f=await _0x2dd5e3['text']();return _0x1bb10f['includes']('context_length_exceeded')?Promise['reject'](new ki(Ni(_0x2f3921,'AI_ERROR_CONTEXT_LENGTH'))):_0x1bb10f['includes']('Moderation')?Promise['reject'](new ki(Ni(_0x2f3921,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1bb10f));}}async['prepareMessages'](_0x595983,_0x4cbc40,_0x19a129){let _0x427113,_0x490b40;return _0x4cbc40?(_0x427113='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.',_0x490b40='Instruction:\x0a'+_0x595983+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4cbc40):(_0x427113='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.',_0x490b40=_0x595983),[{'role':'system','content':_0x427113},{'role':'user','content':_0x490b40}];}async['_readStreamableResponse'](_0x379876,_0xa981db){const _0x3d68a8=_0x379876['body']['getReader'](),_0x7c0a86=new TextDecoder();let _0x5ecdc8='',_0x59551b='',_0x240b42='',_0x236faa=!0x1;for(;!_0x236faa;){const {done:_0x3816a5,value:_0x21101e}=await _0x3d68a8['read'](),_0x349586=_0x5ecdc8+_0x7c0a86['decode'](_0x21101e);let _0x16e95d='';_0x236faa=_0x3816a5;try{_0x16e95d=this['_cleanUpData'](_0x349586),_0x5ecdc8='';}catch{_0x5ecdc8=_0x349586;continue;}_0x59551b+=_0x16e95d,!_0x236faa&&this['_isBufferIncomplete'](_0x59551b)||_0x59551b&&(_0x240b42+=_0x59551b,_0x59551b='',_0xa981db(_0x240b42));}return Promise['resolve']();}async['_readStaticResponse'](_0x3697b1,_0x318c25){return _0x318c25((await _0x3697b1['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x596995){const _0x5e55db=_0x596995['split']('<')['length']!==_0x596995['split']('>')['length'],_0x26a7d2=_0x596995['length']<0x1e;return _0x5e55db&&_0x26a7d2;}['_cleanUpData'](_0x15ceb6){return _0x15ceb6['split'](/\n(?![^{]*\})/g)['map'](_0x2cbf2a=>_0x2cbf2a['replace']('data:\x20',''))['filter'](_0x598485=>_0x598485&&_0x598485['length']>0x0&&'[DONE]'!==_0x598485)['map'](_0x181e71=>{const {choices:_0x53beb5}=JSON['parse'](_0x181e71);if(_0x53beb5[0x0]?.['delta']?.['content'])return _0x53beb5[0x0]['delta']['content'];})['filter'](_0x160d1b=>_0x160d1b)['join']('');}},is=class extends ts{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),bt('ai-aws-adapter-not-supported');}async['sendRequest'](_0xda70cb){throw ft('ai-aws-adapter-not-supported'),new ki(Ni(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},ss=class extends Ht{constructor(_0x4cad81,_0x19a396={}){super(_0x4cad81),this['isToggleable']=!0x0,this['set']('side',_0x19a396['side']||'top');const _0x2244ec=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Ot(_0x19a396['class']||[]),_0x2244ec['to']('side',_0x1431da=>'ck-tab-button_'+_0x1431da),_0x2244ec['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},ns=class extends _0x42f8f5{['children'];constructor(_0x1bdf43,_0x2527a4={}){super(_0x1bdf43);const _0x78b6a5=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...Ot(_0x2527a4['class']||[]),_0x78b6a5['to']('class'),_0x78b6a5['if']('isVisible','ck-hidden',_0xae7119=>!_0xae7119)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},rs=class extends _0x42f8f5{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x4bc90e,_0x4a2b43={}){super(_0x4bc90e),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x4a2b43['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x4a2b43['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0x5d4a6a,_0xce8961)=>_0x5d4a6a&&!_0xce8961);const _0x3b88ea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Ot(_0x4a2b43['class']||[]),_0x3b88ea['to']('side',_0x4bab20=>'ck-tabs_'+_0x4bab20),_0x3b88ea['to']('class'),_0x3b88ea['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x3b88ea['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3b88ea['to']('side',_0x53c31e=>'ck-tabs__buttons-container_'+_0x53c31e)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3b88ea['to']('side',_0x46a1e0=>'ck-tabs__panels-container_'+_0x46a1e0)]},'children':this['panelViews']},...Ot(_0x4a2b43['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4a0d98){const _0x138f1c=this['_tabs']['get'](_0x4a0d98);return _0x138f1c||null;}['addTab'](_0x103d19){const _0x268fd3=this['_setupButton']({'id':_0x103d19['id'],'label':_0x103d19['buttonLabel'],'icon':_0x103d19['buttonIcon'],'order':_0x103d19['order']}),_0x33fc95=new ns(this['locale']);return _0x33fc95['render'](),_0x103d19['content']&&_0x33fc95['children']['add'](_0x103d19['content']),this['panelViews']['add'](_0x33fc95),this['_tabs']['set'](_0x103d19['id'],{'button':_0x268fd3,'panel':_0x33fc95,'order':void 0x0!==_0x103d19['order']?_0x103d19['order']:null}),this['fire']('addTab:'+_0x103d19['id'],{'id':_0x103d19['id'],'button':_0x268fd3,'panel':_0x33fc95}),null===this['activeTab']?this['activateTab'](_0x103d19['id']):this['_hidePanel'](_0x103d19['id']),{'button':_0x268fd3,'panel':_0x33fc95};}['activateTab'](_0x4d9daa){if(null!==_0x4d9daa&&!this['getTab'](_0x4d9daa))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4d9daa});if(this['isCollapsed']=!0x1,this['activeTab']===_0x4d9daa)return;const _0x4e7b4b=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4d9daa,_0x4d9daa&&this['_showPanel'](_0x4d9daa),this['fire']('activateTab:'+_0x4d9daa,{'newTab':_0x4d9daa,'oldTab':_0x4e7b4b});}['toggleTabPanel'](_0x3d5358){this['activeTab']===_0x3d5358?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x3d5358);}['showTab'](_0x17f63b){if(!this['getTab'](_0x17f63b))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x17f63b});this['_showPanel'](_0x17f63b),this['_showButton'](_0x17f63b),this['fire']('show:'+_0x17f63b,_0x17f63b);}['hideTab'](_0x350293){if(!this['getTab'](_0x350293))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x350293});const _0x1723da=this['activeTab'];this['_hidePanel'](_0x350293),this['_hideButton'](_0x350293);const _0xcda549=this['getTabIds']();_0x1723da===_0x350293&&_0xcda549['length']>0x1&&this['activateTab'](_0xcda549['find'](_0x8e19fe=>_0x8e19fe!==_0x350293)),this['fire']('hide:'+_0x350293,_0x350293);}['_getPanel'](_0x49d197){const _0x4f7893=this['_tabs']['get'](_0x49d197);return _0x4f7893?_0x4f7893['panel']:null;}['_showPanel'](_0x4b5565){null!==this['activeTab']&&this['activeTab']!==_0x4b5565||this['_getPanel'](_0x4b5565)['show']();}['_hidePanel'](_0x588801){const _0x164c01=this['_getPanel'](_0x588801);_0x164c01['isVisible']&&(this['activeTab']===_0x588801&&(this['activeTab']=null),_0x164c01['hide']());}['_getButton'](_0x376bc5){const _0x5440d1=this['_tabs']['get'](_0x376bc5);return _0x5440d1?_0x5440d1['button']:null;}['_showButton'](_0x29e9a3){this['_getButton'](_0x29e9a3)['show']();}['_hideButton'](_0x5336f8){this['_getButton'](_0x5336f8)['hide']();}['_setupButton'](_0xdff3cc){const _0x4d6dcc=new ss(this['locale'],{'side':this['side']}),_0x1fc0bd=this['buttonViews'];if(_0x4d6dcc['set']({'label':_0xdff3cc['label'],'icon':_0xdff3cc['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4d6dcc['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x2b40d3,_0x1d76ff)=>_0x2b40d3===_0xdff3cc['id']&&!_0x1d76ff),_0x4d6dcc['bind']('side')['to'](this,'side'),_0xdff3cc['order']){const _0x44c27b=[...this['_tabs']]['reduce']((_0x4f26eb,_0x3d7a26)=>{const _0x28d29f=_0x3d7a26[0x0],{order:_0x41fb2b}=_0x3d7a26[0x1];return!_0x41fb2b||_0x41fb2b>_0xdff3cc['order']?_0x4f26eb:_0x41fb2b>=_0x4f26eb['order']?{'id':_0x28d29f,'order':_0x41fb2b}:_0x4f26eb;},{'id':'','order':0x0}),_0x2f88d3=_0x1fc0bd['getIndex'](this['_getButton'](_0x44c27b['id']));_0x1fc0bd['add'](_0x4d6dcc,_0x2f88d3+0x1);}else _0x1fc0bd['add'](_0x4d6dcc);return _0x4d6dcc['on']('execute',()=>{this['toggleTabPanel'](_0xdff3cc['id']);}),_0x4d6dcc;}};const os=['overlay','sidebar','custom'],as=['left','right'];var hs=class extends rs{constructor(_0x16773c,_0x6cb1d0={}){super(_0x16773c,_0x6cb1d0),this['set']('type',_0x6cb1d0['type']||'sidebar'),this['set']('side',_0x6cb1d0['side']||'right'),this['set']('isVisible',_0x6cb1d0['visibleByDefault']??!0x0);const _0x59d523=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x59d523['if']('type','ck-ai-tabs__overlay',_0x1ded5f=>'overlay'===_0x1ded5f),_0x59d523['if']('type','ck-ai-tabs__sidebar',_0x5ca8bb=>'sidebar'===_0x5ca8bb),_0x59d523['if']('isVisible','ck-hidden',_0x59aba0=>!_0x59aba0)]}}),this['buttonViews']['on']('add',(_0x5674e5,_0x513214)=>{_0x513214['set']('withText',!0x1);});}},cs=class extends _0x11a14c{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xeb2d58){if(super(_0xeb2d58),!this['context']['config']['get']('ai.container'))throw new ht('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x2f01b9=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x2f01b9['showResizeButton']&&(this['showResizeButton']=_0x2f01b9['showResizeButton']),'sidebar'!==_0x2f01b9['type']&&'overlay'!==_0x2f01b9['type']||_0x2f01b9['side']&&(this['side']=_0x2f01b9['side']),'sidebar'===_0x2f01b9['type']){if(this['container']=_0x2f01b9['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x2f01b9['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x2f01b9['visibleByDefault'],'collapsible':_0x2f01b9['collapsible']}),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 _0x423f99&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}['switchType'](_0xabd0e9){if(_0xabd0e9&&this['type']!==_0xabd0e9){if(!os['includes'](_0xabd0e9))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0xabd0e9;}}['switchSide'](_0x463d0d){if(_0x463d0d&&this['side']!==_0x463d0d){if(!as['includes'](_0x463d0d))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x463d0d;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}},ls=class extends _0x11a14c{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x4fefa9];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x27f118){if(super(_0x27f118),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new ht('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x179f76=this['context']['plugins']['get'](_0x4fefa9);if(!_0x179f76['token'])throw new ht('ai-missing-token',this);this['_token']=_0x179f76['token'];}['startConversation'](_0x10ea3e,_0xe66bfd){const _0x121559=this['_sendApiRequest']('/conversations','POST',{'id':_0x10ea3e,'group':_0xe66bfd});return{'getConversation':async()=>(await _0x121559['request'])['json'](),'abortController':_0x121559['abortController']};}['queryAssistant']({message:_0x6fc9eb,conversationId:_0x3a9da7,parts:_0x591d35,capabilities:_0x51928c,model:_0x233185,attributes:_0x5747a8}){const _0x38f873={'prompt':_0x6fc9eb,'content':_0x591d35,'model':_0x233185,..._0x51928c&&{'capabilities':_0x51928c},..._0x5747a8&&{'attributes':_0x5747a8}},_0x39b171=this['_sendApiRequest']('/conversations/'+_0x3a9da7+'/messages','POST',_0x38f873,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x46a5aa=(await _0x39b171['request'])['body'];return this['_getStreamReader'](_0x46a5aa);},'abortController':_0x39b171['abortController']};}['executeCustomAction']({content:_0xa7634a,message:_0x4fa729,model:_0x415882,outputFormat:_0x381dce}){const _0x483835={'content':[{'type':'text','content':_0xa7634a}],'prompt':_0x4fa729,'model':_0x415882,'outputFormat':_0x381dce},_0x41a7b8=this['_sendApiRequest']('/actions/custom/calls','POST',_0x483835);return{'getStream':async()=>{const _0x15f688=(await _0x41a7b8['request'])['body'];return this['_getStreamReader'](_0x15f688);},'abortController':_0x41a7b8['abortController']};}['executeAction']({actionName:_0x105f2d,content:_0x211069,args:_0x21ad93}){const _0x166d4b={'content':[{'type':'text','content':_0x211069}],'args':_0x21ad93},_0x1aa312=this['_sendApiRequest']('/actions/system/'+_0x105f2d+'/calls','POST',_0x166d4b);return{'getStream':async()=>{const _0xf4fe56=(await _0x1aa312['request'])['body'];return this['_getStreamReader'](_0xf4fe56);},'abortController':_0x1aa312['abortController']};}['uploadFile'](_0x3cd084,_0x494ead,_0x2f5b39){const _0x27e64a=new FormData();_0x27e64a['append']('file',_0x494ead,_0x494ead['name']),_0x2f5b39&&_0x27e64a['append']('attributes',JSON['stringify'](_0x2f5b39));const _0x2a1205=this['_sendApiRequest']('/conversations/'+_0x3cd084+'/files','POST',_0x27e64a);return{'getId':async()=>(await _0x2a1205['request'])['json'](),'abortController':_0x2a1205['abortController']};}['uploadDocuments'](_0x41d320,_0x314461){const _0x3cf2d5={'documents':_0x314461['map'](_0x35c4b2=>({'content':_0x35c4b2['content'],'attributes':{'version':_0x35c4b2['version'],'sessionId':_0x35c4b2['sessionId'],'channelId':_0x35c4b2['channelId'],'rootName':_0x35c4b2['rootName'],'selections':_0x35c4b2['selections']},...void 0x0!==_0x35c4b2['name']?{'name':_0x35c4b2['name']}:{},...void 0x0!==_0x35c4b2['description']?{'description':_0x35c4b2['description']}:{}}))},_0x584a9c=this['_sendApiRequest']('/conversations/'+_0x41d320+'/documents/batch','POST',_0x3cf2d5);return{'getIds':async()=>(await _0x584a9c['request'])['json'](),'abortController':_0x584a9c['abortController']};}['fetchDocuments'](_0x51d5a4,_0x324d39){const _0x25b6e=new URLSearchParams();_0x25b6e['append']('documentIds',_0x324d39['join'](','));const _0x15c4e2=this['_sendApiRequest']('/conversations/'+_0x51d5a4+'/documents/batch?'+_0x25b6e['toString'](),'GET');return{'getDocuments':async()=>(await _0x15c4e2['request'])['json'](),'abortController':_0x15c4e2['abortController']};}['fetchConversations'](_0x2f8396,_0x42264e={}){const _0x45572b=new URLSearchParams();_0x45572b['append']('group',_0x2f8396),_0x45572b['append']('excludeEmpty',!0x1!==_0x42264e['excludeEmpty']?'true':'false'),_0x45572b['append']('limit',_0x42264e['limit']?_0x42264e['limit']['toString']():'100'),_0x45572b['append']('sortBy',_0x42264e['sortBy']?_0x42264e['sortBy']:'createdAt'),_0x45572b['append']('order',_0x42264e['order']?_0x42264e['order']:'desc');const _0x315fdf=this['_sendApiRequest']('/conversations?'+_0x45572b['toString'](),'GET');return{'getConversations':async()=>(await(await _0x315fdf['request'])['json']())['items'],'abortController':_0x315fdf['abortController']};}['deleteConversation'](_0x4edc80){const _0x1c2043=this['_sendApiRequest']('/conversations/'+_0x4edc80,'DELETE');return{'execute':async()=>{await _0x1c2043['request'];},'abortController':_0x1c2043['abortController']};}['updateConversation'](_0x14e737,_0x23fb4a){const _0x588a37=this['_sendApiRequest']('/conversations/'+_0x14e737,'PATCH',_0x23fb4a);return{'getResult':async()=>(await _0x588a37['request'],_0x23fb4a),'abortController':_0x588a37['abortController']};}['fetchConversation'](_0x2002e6){const _0x202d9f=this['_sendApiRequest']('/conversations/'+_0x2002e6,'GET');return{'getConversation':async()=>(await _0x202d9f['request'])['json'](),'abortController':_0x202d9f['abortController']};}['fetchConversationMessages'](_0x58934f){const _0x2cc4c1=this['_sendApiRequest']('/conversations/'+_0x58934f+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x2cc4c1['request'])['json']())['items'],'abortController':_0x2cc4c1['abortController']};}['uploadUrl'](_0x56654d,_0x141bc7,_0x4a2859){const _0x3ac6ca=this['_sendApiRequest']('/conversations/'+_0x56654d+'/web-resources','POST',{'url':_0x141bc7,'attributes':_0x4a2859});return{'getId':async()=>(await _0x3ac6ca['request'])['json'](),'abortController':_0x3ac6ca['abortController']};}['getModels'](_0x1f05ac='en'){const _0x30748a=new URLSearchParams();_0x30748a['append']('language',_0x1f05ac);const _0x478852='/models/1?'+_0x30748a['toString'](),_0x1a5759=this['_sendApiRequest'](_0x478852,'GET',void 0x0,{'useCache':!0x0});return{'list':async()=>await(await _0x1a5759['request'])['json'](),'abortController':_0x1a5759['abortController']};}['deleteFile'](_0x2975b5,_0x406bbd){const _0x4548a2=this['_sendApiRequest']('/conversations/'+_0x2975b5+'/files/'+_0x406bbd,'DELETE');return{'execute':async()=>{await _0x4548a2['request'];},'abortController':_0x4548a2['abortController']};}['deleteDocument'](_0x5fe453,_0x15f8d7){const _0x17bf36=this['_sendApiRequest']('/conversations/'+_0x5fe453+'/documents/'+_0x15f8d7,'DELETE');return{'execute':async()=>{await _0x17bf36['request'];},'abortController':_0x17bf36['abortController']};}['deleteWebResource'](_0xc3a144,_0xa52943){const _0x275db8=this['_sendApiRequest']('/conversations/'+_0xc3a144+'/web-resources/'+_0xa52943,'DELETE');return{'execute':async()=>{await _0x275db8['request'];},'abortController':_0x275db8['abortController']};}['cancelStream'](_0x3a1ba3,_0x53a635){const _0x3334df=this['_sendApiRequest']('/conversations/'+_0x3a1ba3+'/messages/'+_0x53a635+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x3334df['request'];},'abortController':_0x3334df['abortController']};}['resumeStream'](_0x3ce26a,_0x30dd89,_0x4853aa='0-0'){const _0x10be51=new URLSearchParams({'lastEventId':_0x4853aa}),_0x5aec61=this['_sendApiRequest']('/conversations/'+_0x3ce26a+'/messages/'+_0x30dd89+'/stream?'+_0x10be51['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x26a519=await _0x5aec61['request'];return this['_getStreamReader'](_0x26a519['body']);},'abortController':_0x5aec61['abortController']};}['callSystemReview']({reviewName:_0x5bd89f,content:_0x3d95d4,args:_0x58b9f4}){const _0x3f8738=this['_sendApiRequest']('/reviews/system/'+_0x5bd89f+'/calls','POST',{'content':[{'type':'text','content':_0x3d95d4}],'args':_0x58b9f4});return{'getStream':async()=>{const _0x9ba1bc=(await _0x3f8738['request'])['body'];return this['_getStreamReader'](_0x9ba1bc);},'abortController':_0x3f8738['abortController']};}['processDocument']({document:_0x2deb83,prompt:_0x47a96a,model:_0x35ae11}){const _0x1c6587=this['_sendApiRequest']('/documents/process','POST',{'document':_0x2deb83,'prompt':_0x47a96a,'model':_0x35ae11});return{'getResult':async()=>(await _0x1c6587['request'])['json'](),'abortController':_0x1c6587['abortController']};}['callCustomReview']({content:_0x439f65,prompt:_0x2f089a,model:_0x164455}){const _0x445724=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x439f65}],'prompt':_0x2f089a,'model':_0x164455});return{'getStream':async()=>{const _0x244cdd=(await _0x445724['request'])['body'];return this['_getStreamReader'](_0x244cdd);},'abortController':_0x445724['abortController']};}['upsertAIChatRating'](_0x346ba3,_0x417200,_0x19409e){const _0x194e68=this['_sendApiRequest']('/conversations/'+_0x346ba3+'/messages/'+_0x417200+'/ratings','PUT',{'positiveCount':_0x19409e['positiveCount'],'totalCount':_0x19409e['totalCount'],'modificationId':_0x19409e['modificationId']});return{'execute':async()=>{await _0x194e68['request'];},'abortController':_0x194e68['abortController']};}['upsertAIActionRating'](_0x59a652,_0x676bf,_0x806020){const _0x47fe12=this['_sendApiRequest']('/actions/system/'+_0x59a652+'/calls/'+_0x676bf+'/ratings','PUT',{'positiveCount':_0x806020['positiveCount'],'totalCount':_0x806020['totalCount']});return{'execute':async()=>{await _0x47fe12['request'];},'abortController':_0x47fe12['abortController']};}['upsertCustomAIActionRating'](_0x383682,_0x49a5dd){const _0x45e0b7=this['_sendApiRequest']('/actions/custom/calls/'+_0x383682+'/ratings','PUT',{'positiveCount':_0x49a5dd['positiveCount'],'totalCount':_0x49a5dd['totalCount']});return{'execute':async()=>{await _0x45e0b7['request'];},'abortController':_0x45e0b7['abortController']};}['upsertAIReviewRating'](_0x41d28c,_0x270a3a,_0x38a753,_0xb13b15){const _0x56a923=this['_sendApiRequest']('/reviews/system/'+_0x41d28c+'/calls/'+_0x270a3a+'/ratings','PUT',{'positiveCount':_0x38a753['positiveCount'],'totalCount':_0x38a753['totalCount'],'dataId':_0xb13b15});return{'execute':async()=>{await _0x56a923['request'];},'abortController':_0x56a923['abortController']};}['upsertCustomAIReviewRating'](_0x38fb92,_0x22f542,_0x204189){const _0xb7523d=this['_sendApiRequest']('/reviews/custom/calls/'+_0x38fb92+'/ratings','PUT',{'positiveCount':_0x22f542['positiveCount'],'totalCount':_0x22f542['totalCount'],'dataId':_0x204189});return{'execute':async()=>{await _0xb7523d['request'];},'abortController':_0xb7523d['abortController']};}['_sendApiRequest'](_0x1ec7fa,_0x34f5e6,_0x519676,_0x3294e2={}){const {useCache:_0x290d9e=!0x1,apiUrl:_0x487057=this['_apiUrl']}=_0x3294e2,_0x354ccb=new AbortController(),_0x308dd2=_0x290d9e?_0x34f5e6+':'+_0x1ec7fa:null;if(_0x308dd2){const _0x68bec1=this['_responseCache']['get'](_0x308dd2);if(_0x68bec1)return{'request':_0x68bec1['then'](_0x42af27=>_0x42af27['clone']()),'abortController':_0x354ccb};}const _0x199444=_0x519676 instanceof FormData,_0x121861={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':kt};_0x519676&&!_0x199444&&(_0x121861['Content-Type']='application/json');const _0x189426={'method':_0x34f5e6,'headers':_0x121861,'signal':_0x354ccb['signal']};_0x519676&&(_0x189426['body']=_0x199444?_0x519676:JSON['stringify'](_0x519676));const _0x35f834=fetch(''+_0x487057+_0x1ec7fa,_0x189426)['catch'](_0x397f0a=>{_0x308dd2&&this['_responseCache']['delete'](_0x308dd2),this['_handleError'](_0x397f0a);})['then'](_0x45a9f8=>_0x45a9f8['ok']?_0x45a9f8:_0x45a9f8['json']()['then'](_0x37c1bd=>{throw _0x308dd2&&this['_responseCache']['delete'](_0x308dd2),{'url':_0x487057,'path':_0x1ec7fa,'method':_0x34f5e6,'body':_0x519676,'status':(_0x45a9f8||{})['status'],'statusText':(_0x45a9f8||{})['statusText'],'code':_0x37c1bd['code'],'message':_0x37c1bd['message'],'traceId':_0x37c1bd['traceId']};}));return _0x308dd2&&this['_responseCache']['set'](_0x308dd2,_0x35f834['then'](_0x425206=>_0x425206['clone']())),{'request':_0x35f834,'abortController':_0x354ccb};}async*['_getStreamReader'](_0x4b2135){const _0x3615a3=[],_0x3fc349=_0x4b2135['getReader'](),_0x398422=_0x118144({'onError':_0x3e2bc6=>{this['_handleError'](_0x3e2bc6);},'onEvent':_0x495e99=>{_0x495e99['data']=JSON['parse'](_0x495e99['data']),_0x3615a3['push'](_0x495e99);}});try{let _0x535ff4=!0x1;for(;!_0x535ff4;){const {done:_0x2aa9f9,value:_0x417909}=await _0x3fc349['read']();_0x2aa9f9&&(_0x535ff4=!0x0),_0x398422['feed'](this['_decoder']['decode'](_0x417909,{'stream':!0x0})),yield*_0x3615a3,_0x3615a3['length']=0x0;}}catch(_0x31da1f){this['_handleError'](_0x31da1f);}finally{_0x3fc349['releaseLock'](),_0x398422['reset']();}}['_handleError'](_0x524b15){if(_0x524b15 instanceof ht)throw _0x524b15;if(_0x524b15 instanceof Error&&'AbortError'===_0x524b15['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x524b15});throw new ht('ai-request-failed',this,{'originalError':_0x524b15});}};function us(_0x28b840,_0x56cb71,_0x25ef87){const t=_0x28b840['t'];switch(_0x56cb71){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'},_0x25ef87);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'Response\x20stopped.'});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.'},_0x25ef87);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});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.'},_0x25ef87);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_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x25ef87);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x25ef87);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x25ef87);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x25ef87);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.'},_0x25ef87);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.'},_0x25ef87);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.'},_0x25ef87);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.'},_0x25ef87);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'},_0x25ef87);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x25ef87);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x56cb71;}}function ds(_0x41f9ea){return _0x41f9ea?_0x41f9ea instanceof _0x423f99?[_0x41f9ea]:_0x41f9ea['editors']&&0x0!==_0x41f9ea['editors']['length']?Array['from'](_0x41f9ea['editors']):[]:[];}function _s(_0x21ebbf){const _0x2aff33=ds(_0x21ebbf);if(!_0x2aff33['length'])throw new ht('ai-get-editor-from-context-no-editor');if(0x1===_0x2aff33['length'])return _0x2aff33[0x0];const _0xb6e783=_0x2aff33['find'](_0x435680=>_0x435680['ui']?.['focusTracker']?.['isFocused']);if(_0xb6e783)return _0xb6e783;const _0xb052b4=function(_0x59e71e){if(_0x59e71e instanceof _0x423f99)return;const _0x246b10=_0x59e71e;if(!_0x246b10['plugins']||!_0x246b10['plugins']['has']('AIEditing'))return;return _0x246b10['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x21ebbf);return _0xb052b4&&_0x2aff33['includes'](_0xb052b4)?_0xb052b4:_0x2aff33[0x0];}const gs='ai-selection',As=['br'];var Is=class extends _0x11a14c{constructor(_0x360840){super(_0x360840),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionIdByEditor']=new WeakMap();['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}['getSessionId'](_0x27f7b9){let _0x5e71f8=this['_sessionIdByEditor']['get'](_0x27f7b9);return _0x5e71f8||(_0x5e71f8=_0x27f7b9['plugins']['has']('RealTimeCollaborationClient')&&_0x27f7b9['plugins']['get']('RealTimeCollaborationClient')['sessionId']||vt(),this['_sessionIdByEditor']['set'](_0x27f7b9,_0x5e71f8)),_0x5e71f8;}async['getDocumentData'](){const _0x300e14=ds(this['context']);if(!_0x300e14['length'])throw new ht('ai-get-editor-from-context-no-editor');const _0x2fe778=[],_0x2884e3=new Set();for(const _0x5eba15 of _0x300e14){const _0x43f2b2=_0x5eba15['config']['get']('roots')||{};for(const _0x58e586 of _0x5eba15['model']['document']['getRoots']()){if('$graveyard'===_0x58e586['rootName'])continue;const _0x57fc17=await this['_getDocumentDataForEditorRoot'](_0x5eba15,_0x58e586,_0x2884e3),_0x417a0b=_0x43f2b2[_0x58e586['rootName']],_0x44d5fe=_0x58e586['getAttribute']('$description')??_0x417a0b?.['description'];let _0x41ab72=_0x58e586['getAttribute']('$title')??_0x417a0b?.['title'];_0x41ab72||(_0x41ab72=_0x58e586['getAttribute']('$rootEditableOptions')?.['label']??_0x417a0b?.['label']),_0x41ab72||(bt('ai-document-root-missing-title',{'editor':_0x5eba15,'rootName':_0x58e586['rootName']}),_0x41ab72=_0x58e586['rootName']),_0x2fe778['push']({'editor':_0x5eba15,'rootName':_0x58e586['rootName'],'content':_0x57fc17['content'],'version':_0x57fc17['version'],'sessionId':this['getSessionId'](_0x5eba15),'channelId':_0x5eba15['config']['get']('collaboration.channelId'),'selections':_0x57fc17['selections'],'name':_0x41ab72,'description':_0x44d5fe});}}return _0x2fe778;}async['_getDocumentDataForEditorRoot'](_0x2031f3,_0x57ea5c,_0x2e2713){const _0x40e827=_0x2031f3['data']['toView'](_0x57ea5c,{'convertAiChatSelectionMarker':!0x0}),_0x22f61f=new _0x19ef87(_0x2031f3['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x40e827,_0x22f61f,_0x2e2713);let _0x24f557=await this['_getDocumentDataStringFromView'](_0x40e827,_0x2031f3);const _0x1e05c7=this['_getMarkersInDocumentOrder'](_0x2031f3,_0x57ea5c),_0x1b2515=[];for(const _0x116148 of _0x1e05c7){const _0x231f77='<'+_0x116148['name']+':start></'+_0x116148['name']+':start>',_0x5815dc=_0x24f557['indexOf'](_0x231f77);_0x24f557=_0x24f557['substring'](0x0,_0x5815dc)+_0x24f557['substring'](_0x5815dc+_0x231f77['length']);const _0x4a9550='<'+_0x116148['name']+':end></'+_0x116148['name']+':end>',_0x38a736=_0x24f557['indexOf'](_0x4a9550);_0x24f557=_0x24f557['substring'](0x0,_0x38a736)+_0x24f557['substring'](_0x38a736+_0x4a9550['length']),_0x1b2515['push']({'markerName':_0x116148['name'],'start':_0x5815dc,'end':_0x38a736,'htmlFragment':_0x24f557['substring'](_0x5815dc,_0x38a736)});}return{'content':_0x24f557,'version':_0x2031f3['model']['document']['version'],'selections':_0x1b2515};}['afterInit'](){this['context']instanceof _0x423f99?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x304597,_0x2cb145)=>{_0x2cb145['on']('ready',()=>{this['_integrateEditor'](_0x2cb145);});});}['_setOutputDataProcessor'](_0x3410ac){this['_outputDataProcessor']=_0x3410ac;}async['_getDocumentDataStringFromView'](_0xc3b1de,_0x59821c){let _0x4c4d8f;if(this['_outputDataProcessor']){const _0x1c68e2=_0x59821c['data']['processor']['domConverter']['viewToDom'](_0xc3b1de),_0x4ad1d2=await this['_outputDataProcessor'](_0x1c68e2);_0x4c4d8f=_0x59821c['data']['processor']['htmlWriter']['getHtml'](_0x4ad1d2);}else _0x4c4d8f=_0x59821c['data']['processor']['toData'](_0xc3b1de);return _0x4c4d8f;}['_integrateEditor'](_0x564a93){if(!_0x564a93['config']['get']('collaboration.channelId'))throw new ht('ai-missing-channel-id',_0x564a93);_0x564a93['ui']['focusTracker']['on']('change:isFocused',(_0x46204e,_0x1a82e4,_0x1cd26e)=>{_0x1cd26e&&(this['_lastContentFocusedEditor']=_0x564a93);}),_0x564a93['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x564a93&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x564a93['conversion']['for']('editingDowncast')['markerToHighlight']({'model':gs,'view':({markerName:_0x1907b6})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x1907b6['split'](':')[0x1]],'priority':0xc})}),_0x564a93['conversion']['for']('dataDowncast')['markerToElement']({'model':gs+':context','view':(_0x1a6de3,{writer:_0x2e7395,options:_0x5d13b8})=>_0x5d13b8['convertAiChatSelectionMarker']?_0x2e7395['createUIElement'](_0x1a6de3['markerName']+':'+(_0x1a6de3['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x3ad8a7){const _0x102914=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x3ad8a7);const _0x3192f7=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x102914,_0x3192f7);}['hideFakeVisualSelection'](_0x49b415){const _0x36f288=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x49b415);const _0x26b95c=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x36f288,_0x26b95c);}async['modelToDataWithIds'](_0x200a07,_0x2d99e0){const _0x31ecf5=_0x2d99e0['data']['toView'](_0x200a07),_0x304f66=new _0x19ef87(_0x2d99e0['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x31ecf5,_0x304f66),this['_getDocumentDataStringFromView'](_0x31ecf5,_0x2d99e0);}['_setDataIdsOnChildren'](_0x39f5f4,_0xa8c1ef,_0x5afdb9=new Set()){let _0x484416=!0x1;for(const _0x4ba8e6 of _0x39f5f4['getChildren']()){if(!_0x4ba8e6['is']('view:element')||As['includes'](_0x4ba8e6['name']))continue;const _0xe9414e=_0x4ba8e6['is']('view:containerElement'),_0x4c154a=_0x4ba8e6['is']('view:emptyElement'),_0x77bedd=_0x4ba8e6['is']('view:rawElement'),_0x26df46=this['_setDataIdsOnChildren'](_0x4ba8e6,_0xa8c1ef,_0x5afdb9);_0x4ba8e6['hasAttribute']('data-id')?(_0x484416=!0x0,_0x5afdb9['add'](_0x4ba8e6['getAttribute']('data-id'))):(_0xe9414e||_0x4c154a||_0x77bedd||_0x26df46)&&(_0xa8c1ef['setAttribute']('data-id',this['_nextDataId'](_0x5afdb9),_0x4ba8e6),_0x484416=!0x0);}return _0x484416;}['_nextDataId'](_0x27622c){let _0x17ebf6;do{_0x17ebf6='';for(let _0x3e5e2d=0x0;_0x3e5e2d<0x4;_0x3e5e2d++)_0x17ebf6+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x27622c['has'](_0x17ebf6));return _0x27622c['add'](_0x17ebf6),_0x17ebf6;}['getSelectionText'](_0x1a0345){const _0x429cec=(_0x1a0345?_0x1a0345['model']:_s(this['context'])['model'])['document']['selection'],_0x52fac0=[],_0x52699a=Array['from'](_0x429cec['getRanges']());_0x52699a['sort']((_0x9603cc,_0x805dfa)=>_0x9603cc['start']['isBefore'](_0x805dfa['start'])?-0x1:0x1);for(const _0x46811c of _0x52699a)for(const _0x3699a7 of _0x46811c['getItems']())_0x3699a7['is']('$textProxy')?_0x52fac0['push'](_0x3699a7['data']):_0x3699a7['is']('element')&&_0x52fac0['length']>0x0&&'\x20'!==_0x52fac0[_0x52fac0['length']-0x1]&&_0x52fac0['push']('\x20');return _0x52fac0['length']?'\x22'+_0x52fac0['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x173eae){for(let _0x4632af=0x0;_0x4632af<this['_fakeSelections']['length'];_0x4632af++)if(this['_fakeSelections'][_0x4632af]['id']==_0x173eae)return void this['_fakeSelections']['splice'](_0x4632af,0x1);}['_addFakeSelection'](_0x3a19ff){this['_removeFakeSelectionById'](_0x3a19ff['id']),wt(this['_fakeSelections'],_0x3a19ff);}['_refreshFakeSelection'](_0x3dc6d6,_0x3be677){if(_0x3dc6d6==_0x3be677)return;const _0x127761=_0x3dc6d6?_0x3dc6d6['editor']:null,_0x5210b2=_0x3be677?_0x3be677['editor']:null,_0x2d53ca=(_0xb4b054,_0x11ad63)=>{const _0x1c6bcd=_0x11ad63['model']['markers']['getMarkersGroup'](gs);for(const _0x3291c3 of _0x1c6bcd)_0xb4b054['removeMarker'](_0x3291c3);},_0x13e4b9=(_0x8a9668,_0x419029,_0x24a900)=>{const _0x30b9de=_0x419029['model'];for(let _0x5ce4ee=0x0;_0x5ce4ee<_0x24a900['ranges']['length'];_0x5ce4ee++){let _0x25b3fb=_0x24a900['ranges'][_0x5ce4ee];const _0x1212e8=gs+':'+_0x24a900['id']+':'+_0x5ce4ee;if(_0x25b3fb['start']['isAtEnd']){const _0x3c190d=_0x25b3fb['start']['getLastMatchingPosition'](({item:_0x565773})=>!_0x30b9de['schema']['isContent'](_0x565773),{'boundaries':_0x25b3fb});_0x25b3fb=_0x8a9668['createRange'](_0x3c190d,_0x25b3fb['end']);}_0x8a9668['addMarker'](_0x1212e8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25b3fb});}};_0x127761&&_0x5210b2&&_0x127761===_0x5210b2&&_0x3be677?_0x127761['model']['change'](_0x38f8e9=>{_0x2d53ca(_0x38f8e9,_0x127761),_0x13e4b9(_0x38f8e9,_0x5210b2,_0x3be677);}):(_0x127761&&_0x127761['model']['change'](_0xc8b178=>_0x2d53ca(_0xc8b178,_0x127761)),_0x5210b2&&_0x3be677&&_0x5210b2['model']['change'](_0x3b9192=>_0x13e4b9(_0x3b9192,_0x5210b2,_0x3be677)));}['_getMarkersInDocumentOrder'](_0x2f5b22,_0x3cbf37){const _0x1a9d79=Array['from'](_0x2f5b22['model']['markers']['getMarkersGroup'](gs+':context'));return(_0x3cbf37?_0x1a9d79['filter'](_0x126784=>{const _0x52a009=_0x126784['getRange']();return _0x52a009&&_0x52a009['root']['rootName']===_0x3cbf37['rootName'];}):_0x1a9d79)['sort']((_0x14d3d0,_0xa8a5cf)=>_0x14d3d0['getStart']()['isBefore'](_0xa8a5cf['getStart']())?-0x1:_0x14d3d0['getStart']()['isAfter'](_0xa8a5cf['getStart']())?0x1:0x0);}};function ps(_0x25f024,_0x571425){return _0x3a0c7f(_0x25f024,_0x571425);}function ms(_0x393f4a,_0x8c8e47){return _0x575879(_0x393f4a,_0x8c8e47);}function Es(_0x58f238,_0x46ffb7,_0x2367bb){const _0x4f5458=null!==_0x46ffb7?_0x3e7ab5=>_0x3e7ab5['attribs'][_0x58f238]===_0x46ffb7:_0x23dc29=>Boolean(_0x23dc29['attribs'][_0x58f238]);return ti(_0x54bd43=>_0x48ca1a(_0x54bd43)&&_0x4f5458(_0x54bd43),_0x2367bb);}function Ts(_0x3cbd63,_0x44c7ab,_0x280a5d){const _0x3a9a84=null!==_0x44c7ab?_0x44aa2e=>_0x44aa2e['attribs'][_0x3cbd63]===_0x44c7ab:_0x51185f=>Boolean(_0x51185f['attribs'][_0x3cbd63]);return _0x242f60(_0x138ffb=>_0x48ca1a(_0x138ffb)&&_0x3a9a84(_0x138ffb),_0x280a5d);}function ws(_0x1d739f){return _0x242f60(_0x2322a0=>_0x48ca1a(_0x2322a0)&&function(_0x303d61){const _0x498458=_0x303d61['toLowerCase']();return'script'===_0x498458||'style'===_0x498458||_0x498458['includes']('-');}(_0x2322a0['name']),_0x1d739f);}function Cs(_0x19d8a7){return _0x5b134c(_0x28e53e=>_0x1e98cd(_0x28e53e),_0x19d8a7,!0x0,0x1/0x0);}function fs(_0x375fec,_0x434077){return _0x375fec&&_0x48ca1a(_0x375fec)?_0x375fec['attribs'][_0x434077]:null;}function bs(_0x407da2,_0x547b9d,_0x69e935){_0x48ca1a(_0x407da2)&&(null===_0x69e935?delete _0x407da2['attribs'][_0x547b9d]:_0x407da2['attribs'][_0x547b9d]=_0x69e935);}function Ss(_0x3f4914,_0x5ba793,_0x23cbbe){const _0x1ce17c=_0x5ba793['cloneNode'](!0x0);'beforebegin'===_0x23cbbe?_0x4a1680(_0x3f4914,_0x1ce17c):'afterbegin'===_0x23cbbe?_0x405cf6(_0x3f4914,_0x1ce17c):'beforeend'===_0x23cbbe?_0x5435f7(_0x3f4914,_0x1ce17c):'afterend'===_0x23cbbe&&_0x873879(_0x3f4914,_0x1ce17c);}function Rs(_0x29c991){const _0x19f749=[];let _0x189b99=_0x29c991;for(;_0x189b99;)_0x189b99=_0x36d1f9(_0x189b99),_0x189b99&&_0x19f749['push'](_0x189b99);return _0x19f749;}function Os(_0x326794){return _0x326794['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x429c6e){let _0x5b63db=0x0;for(;_0x429c6e['parentNode'];)_0x429c6e=_0x429c6e['parentNode'],_0x5b63db++;return _0x5b63db;}function ks(_0x4df0d5){const _0x2cfb10=[];let _0x257beb=_0x4df0d5['nextSibling'];for(;_0x257beb;)_0x2cfb10['push'](_0x257beb),_0x257beb=_0x257beb['nextSibling'];_0x2cfb10['forEach'](_0xe2e458=>{_0x3baafe(_0xe2e458);});}const Ns=/* #__PURE__ -- @preserve */
25
- gt();var ys=class extends Ns{['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};['_existingDataIds']=new Set();['_referencedExistingIds']=new Set();constructor(_0x24886a){super(),this['_generateUid']=_0x24886a||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x5abf1f,_0x29529a,_0x562a6d){this['_uidCounter']=0x0;const _0x9f24fc=_0x5abf1f['cloneNode'](!0x0);Ds(_0x29529a,_0x9f24fc);const _0x24a5f9=_0x9f24fc['childNodes'],_0x529b85=Array['from'](_0x24a5f9)['filter'](_0x21d898=>!(0x3===_0x21d898['nodeType']&&''===ms(_0x21d898)['trim']())),_0x4a4a99=_0x529b85['length'];this['_existingDataIds']=new Set(Ts('data-id',null,_0x29529a)['map'](_0x4ed842=>fs(_0x4ed842,'data-id'))['filter'](_0x232725=>!!_0x232725));for(const _0x4859a0 of _0x529b85)_0x4859a0&&_0x48ca1a(_0x4859a0)&&void 0x0===_0x4859a0['attribs']['data-id']&&bs(_0x4859a0,'data-id','new-element');if(Ts('data-id',null,_0x9f24fc)['forEach'](_0x17921e=>{const _0x78286c=fs(_0x17921e,'data-id');'new-element'===_0x78286c||this['_existingDataIds']['has'](_0x78286c)||bs(_0x17921e,'data-id','new-element');}),0x0===_0x29529a['childNodes']['length']){const _0x4e535d=[];return Ts('data-id','new-element',_0x9f24fc)['forEach'](_0x2672e0=>{const _0x58fc89=this['_generateUid']();bs(_0x2672e0,'data-id',_0x58fc89),_0x4e535d['push'](_0x58fc89);}),this['_removeSpecialComments'](_0x9f24fc),{'parsedContent':_0x9f24fc,'newNodeIds':_0x4e535d,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set();let _0x4a63c0=-0x1,_0x29c001=!0x1;for(let _0x52300c=0x0;_0x52300c<_0x4a4a99;_0x52300c++){const _0x5a1c63=_0x529b85[_0x52300c],_0x1605f5=_0x529b85[_0x52300c+0x1];if(this['_isNewNode'](_0x5a1c63)){if(-0x1===_0x4a63c0&&(_0x4a63c0=_0x52300c),this['_markWrappedElements'](_0x5a1c63),!this['_isNewNode'](_0x1605f5)){const [_0x22b84c,_0x342734]=this['_findReferenceNode'](_0x5a1c63,_0x29c001,_0x29529a);if(_0x22b84c){const _0x35d297=Array['from'](_0x529b85)['slice'](_0x4a63c0,_0x52300c+0x1);this['_insertNodes'](_0x22b84c,_0x35d297,_0x342734),_0x4a63c0=-0x1;}}}else{if(this['_isExistingContentComment'](_0x5a1c63))_0x29c001=!0x0;else{if(this['_isExistingNode'](_0x5a1c63)){const _0x2c54f4=fs(_0x5a1c63,'data-id');if(_0x2c54f4&&this['_existingDataIds']['has'](_0x2c54f4)){this['_referencedExistingIds']['add'](_0x2c54f4);const _0x594000=Es('data-id',_0x2c54f4,_0x29529a);this['_replaceNode'](_0x594000,_0x5a1c63);}}else{if(xs(_0x5a1c63)){const _0x25c45a=Ls(_0x5a1c63);Es('data-id',_0x25c45a,_0x9f24fc)||this['_touchedNodesState']['removedIds']['push'](_0x25c45a);}}}}}for(const _0x3f1d9a of this['_touchedNodesState']['removedIds']){const _0x3b41ce=Es('data-id',_0x3f1d9a,_0x29529a);_0x3b41ce&&(this['_rescueUnwrappedElements'](_0x3b41ce),this['_removeNode'](_0x3b41ce,_0x3f1d9a,_0x562a6d));}if(Ts('data-id','new-element',_0x29529a)['forEach'](_0x36cbc6=>{const _0x2a1a8a=this['_getUid'](_0x36cbc6);bs(_0x36cbc6,'data-id',_0x2a1a8a),this['_touchedNodesState']['newIds']['push'](_0x2a1a8a);}),this['_removeSpecialComments'](_0x29529a),_0x562a6d&&_0x562a6d['cutAfterUnstable']){const _0x405734=this['_findLastConfirmationPoint'](_0x529b85),_0x2f42da=this['_getLastStableElement'](_0x29529a,_0x405734);this['_markUnstableElements'](_0x29529a,_0x2f42da);}if(this['_processWrappedElements'](_0x29529a,_0x562a6d),_0x562a6d&&_0x562a6d['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x34f122=Ts('data-id',this['_touchedNodesState']['lastTouchedId'],_0x29529a);let _0x7db74c=_0x34f122[_0x34f122['length']-0x1];for(;_0x7db74c;)ks(_0x7db74c),_0x7db74c=_0x7db74c['parentNode'];}return{'parsedContent':_0x29529a,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x526ea1,_0x281942,_0x243cba){for(const _0x26b29f of _0x281942){const _0xf56734=this['_getUid'](_0x26b29f);bs(_0x26b29f,'data-id',_0xf56734),this['_touchedNodesState']['newIds']['push'](_0xf56734),this['_touchedNodesState']['lastTouchedId']=_0xf56734;}const _0x5542b1='afterbegin'===_0x243cba||'afterend'===_0x243cba?_0x281942['reverse']():_0x281942;for(const _0x417129 of _0x5542b1)Ss(_0x526ea1,_0x417129,_0x243cba);}['_replaceNode'](_0x31cbd0,_0x778279){if(!_0x31cbd0)return;if(_0x2d81ed=_0x778279,Os(ms(_0x31cbd0))===Os(ms(_0x2d81ed)))return;var _0x2d81ed;const _0x1aed14=fs(_0x31cbd0,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x1aed14),this['_touchedNodesState']['lastTouchedId']=_0x1aed14,_0x5e68a2(_0x31cbd0,_0x778279['cloneNode'](!0x0));}['_removeNode'](_0x2e73e6,_0x126835,_0x216236){if(_0x216236&&_0x216236['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x126835;const _0x42f8ae=_0x216236['replaceRemovedWith']['cloneNode'](!0x0);bs(_0x42f8ae,'data-id',_0x126835),bs(_0x42f8ae,'data-removed','true'),_0x5e68a2(_0x2e73e6,_0x42f8ae);}else _0x3baafe(_0x2e73e6);}['_findReferenceNode'](_0x422076,_0x416a23,_0x1035cc){const _0x547813=this['_findPrevElementWithDataId'](_0x422076,!0x1);if(_0x547813){const _0x28f8af=Ls(_0x547813),_0x1c4bdf=Es('data-id',_0x28f8af,_0x1035cc);if(_0x1c4bdf)return[_0x1c4bdf,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x28f8af);}const _0x4cd572=this['_findNextElementWithDataId'](_0x422076,!0x1);if(_0x4cd572){const _0x15a2f8=Ls(_0x4cd572),_0x13e876=Es('data-id',_0x15a2f8,_0x1035cc);if(_0x13e876)return[_0x13e876,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x15a2f8);}return _0x416a23?_0x422076['nextSibling']?this['_findFallbackReferenceNode'](_0x422076,_0x1035cc):[_0x1035cc['childNodes'][_0x1035cc['childNodes']['length']-0x1],'afterend']:[_0x1035cc['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x11fcb4,_0x4f613f){const _0x21f8ed=[],_0x4af925=this['_findPrevElementWithDataId'](_0x11fcb4,!0x0);if(_0x4af925){const _0x44a3af=Es('data-id',Ls(_0x4af925),_0x4f613f);_0x44a3af&&_0x21f8ed['push']([_0x44a3af,'afterend']);}const _0x42c389=this['_findNextElementWithDataId'](_0x11fcb4,!0x0);if(_0x42c389){const _0x21a06f=Es('data-id',Ls(_0x42c389),_0x4f613f);_0x21a06f&&_0x21f8ed['push']([_0x21a06f,'beforebegin']);}return _0x21f8ed['length']>0x1?vs(_0x21f8ed[0x0][0x0])<=vs(_0x21f8ed[0x1][0x0])?_0x21f8ed[0x0]:_0x21f8ed[0x1]:0x1===_0x21f8ed['length']?_0x21f8ed[0x0]:[_0x4f613f['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x5c1142,_0x51145b){let _0x583782=_0x5c1142['nextSibling'],_0x587299=null,_0x14eec3=!0x1;for(;_0x583782;){if(_0x1e98cd(_0x583782)){if(xs(_0x583782)&&(_0x587299=_0x583782),this['_isExistingContentComment'](_0x583782)&&_0x51145b&&!_0x14eec3){_0x14eec3=!0x0,_0x583782=_0x583782['nextSibling'];continue;}break;}const _0x3594f7=fs(_0x583782,'data-id');if(_0x3594f7&&'new-element'!==_0x3594f7&&this['_existingDataIds']['has'](_0x3594f7)){_0x587299=_0x583782;break;}_0x583782=_0x583782['nextSibling'];}return _0x587299;}['_findPrevElementWithDataId'](_0x241ab1,_0x472e6e){let _0x3e36d6=_0x241ab1['previousSibling'],_0xddfef3=null,_0x158b10=!0x1;for(;_0x3e36d6;){if(_0x1e98cd(_0x3e36d6)){if(xs(_0x3e36d6)&&(_0xddfef3=_0x3e36d6),this['_isExistingContentComment'](_0x3e36d6)&&_0x472e6e&&!_0x158b10){_0x158b10=!0x0,_0x3e36d6=_0x3e36d6['previousSibling'];continue;}break;}const _0x3b37ec=fs(_0x3e36d6,'data-id');if(_0x3b37ec&&'new-element'!==_0x3b37ec&&this['_existingDataIds']['has'](_0x3b37ec)){_0xddfef3=_0x3e36d6;break;}_0x3e36d6=_0x3e36d6['previousSibling'];}return _0xddfef3;}['_markWrappedElements'](_0x3723c4){_0x48ca1a(_0x3723c4)&&Ts('data-id',null,_0x3723c4)['forEach'](_0x227422=>{this['_isExistingNode'](_0x227422)&&(bs(_0x227422,'data-wrapped-id',fs(_0x227422,'data-id')),bs(_0x227422,'data-id',null));});}['_processWrappedElements'](_0x3af3e0,_0x5bb91b){Ts('data-wrapped-id',null,_0x3af3e0)['forEach'](_0xc52f=>{const _0xf299d6=fs(_0xc52f,'data-wrapped-id');if(this['_hasUnstableParent'](_0xc52f))return;const _0x95f426=Es('data-id',_0xf299d6,_0x3af3e0);bs(_0xc52f,'data-id',_0xf299d6),_0x95f426&&(this['_removeNode'](_0x95f426,_0xf299d6,_0x5bb91b),this['_touchedNodesState']['removedIds']['push'](_0xf299d6),this['_touchedNodesState']['lastTouchedId']=_0xf299d6);});}['_hasUnstableParent'](_0x79e660){let _0x3a0872=_0x79e660['parentNode'];for(;_0x3a0872;){if(fs(_0x3a0872,'data-unstable'))return!0x0;_0x3a0872=_0x3a0872['parentNode'];}return!0x1;}['_rescueUnwrappedElements'](_0x199c75){const _0x109155=new Set(this['_touchedNodesState']['removedIds']),_0x4f2e31=new Set(this['_touchedNodesState']['newIds']);Ts('data-id',null,_0x199c75)['forEach'](_0x5bf1aa=>{const _0x1a2ae8=fs(_0x5bf1aa,'data-id'),_0xe52469=!!_0x1a2ae8&&this['_referencedExistingIds']['has'](_0x1a2ae8),_0xb88774=!!_0x1a2ae8&&_0x4f2e31['has'](_0x1a2ae8);if(!_0x1a2ae8||!_0xe52469&&!_0xb88774)return;if(_0x109155['has'](_0x1a2ae8))return;let _0x5b3271=_0x5bf1aa['parentNode'],_0x18e9d8=!0x1;for(;_0x5b3271;){if(_0x5b3271===_0x199c75){_0x18e9d8=!0x0;break;}const _0x323d10=fs(_0x5b3271,'data-id');if(_0x323d10&&(this['_referencedExistingIds']['has'](_0x323d10)||_0x4f2e31['has'](_0x323d10)))return;_0x5b3271=_0x5b3271['parentNode'];}if(_0x18e9d8){if(_0x4a1680(_0x199c75,_0x5bf1aa),_0xe52469){const _0x39ccac=this['_generateUid'](),_0x51fd16=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x1a2ae8);-0x1!==_0x51fd16&&this['_touchedNodesState']['modifiedIds']['splice'](_0x51fd16,0x1),bs(_0x5bf1aa,'data-unwrapped-id',_0x1a2ae8),bs(_0x5bf1aa,'data-id',_0x39ccac),this['_touchedNodesState']['newIds']['push'](_0x39ccac),this['_touchedNodesState']['rescuedNewIds']['add'](_0x39ccac),this['_touchedNodesState']['lastTouchedId']=_0x39ccac;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x1a2ae8),this['_touchedNodesState']['lastTouchedId']=_0x1a2ae8;}});}['_getUid'](_0x44ad0a){return this['_isExistingNode'](_0x44ad0a)?fs(_0x44ad0a,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x36c946){Cs(_0x36c946)['filter'](_0x18644d=>xs(_0x18644d)||this['_isExistingContentComment'](_0x18644d))['forEach'](_0x9b35f5=>{_0x3baafe(_0x9b35f5);});}['_findLastConfirmationPoint'](_0xf54241){let _0x527a26=null,_0x3646dc=null,_0x17bd26=null,_0x3dd4d8=null;const _0x42836d=_0x332e94=>{_0x332e94&&(_0x527a26=_0x332e94),_0x17bd26=null,_0x3dd4d8=null;};for(let _0x47d376=0x0;_0x47d376<_0xf54241['length'];_0x47d376++){const _0x17c5c3=_0xf54241[_0x47d376];if(this['_isExistingContentComment'](_0x17c5c3)){_0x42836d(_0x3646dc);continue;}if(_0x48ca1a(_0x17c5c3)){const _0x597e72=fs(_0x17c5c3,'data-id'),_0x395e81=_0x47d376===_0xf54241['length']-0x1;if(_0x597e72&&'new-element'!==_0x597e72&&this['_touchedNodesState']['modifiedIds']['includes'](_0x597e72)&&!_0x395e81){_0x42836d(_0x597e72),_0x3646dc=_0x597e72;continue;}}let _0x205270=null;const _0x513a88=Ls(_0x17c5c3);if(_0x513a88&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x513a88))_0x3646dc=_0x513a88;else{if(_0x513a88&&this['_touchedNodesState']['newIds']['includes'](_0x513a88))_0x205270='N';else{if(!xs(_0x17c5c3))continue;_0x205270='R';}_0x205270===_0x3dd4d8||null===_0x3dd4d8?_0x3dd4d8=_0x205270:null!==_0x17bd26?(_0x42836d(_0x3646dc),_0x3dd4d8=_0x205270):(_0x17bd26=_0x3dd4d8,_0x3dd4d8=_0x205270),_0x3646dc=_0x513a88;}}const _0xb73c84=_0xf54241[_0xf54241['length']-0x1];return _0xb73c84&&!_0x48ca1a(_0xb73c84)&&!xs(_0xb73c84)&&_0x3646dc&&_0x42836d(_0x3646dc),_0x527a26;}['_getLastStableElement'](_0xf0eef3,_0x5401ab){if(!_0x5401ab)return null;const _0x1a260e=Es('data-id',_0x5401ab,_0xf0eef3);if(!_0x1a260e)return null;const _0x21ef3a=[_0x1a260e,...Rs(_0x1a260e)]['at'](-0x2);if(_0x21ef3a===_0x1a260e)return _0x1a260e;let _0x54af48=_0x21ef3a['previousSibling'];for(;_0x54af48&&!_0x48ca1a(_0x54af48);)_0x54af48=_0x54af48['previousSibling'];return _0x54af48;}['_markUnstableElements'](_0x36b6f1,_0x2bb23d){const _0xa0dcac=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x4c2ce1=_0x2bb23d?_0x2bb23d['nextSibling']:_0x36b6f1['firstChild'];for(;_0x4c2ce1;)_0x48ca1a(_0x4c2ce1)&&(_0xa0dcac['has'](fs(_0x4c2ce1,'data-id'))||Ts('data-id',null,_0x4c2ce1)['some'](_0x4832b8=>_0xa0dcac['has'](fs(_0x4832b8,'data-id'))))&&bs(_0x4c2ce1,'data-unstable','true'),_0x4c2ce1=_0x4c2ce1['nextSibling'];}['_isNewNode'](_0x4fb035){return Boolean('new-element'===fs(_0x4fb035,'data-id'));}['_isExistingNode'](_0x334d3f){return Boolean((fs(_0x334d3f,'data-id')||'')['length']>0x0&&'new-element'!==fs(_0x334d3f,'data-id'));}['_isExistingContentComment'](_0x252150){return Boolean(_0x1e98cd(_0x252150)&&ms(_0x252150)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function xs(_0x31bad9){return!!_0x31bad9&&Boolean(_0x1e98cd(_0x31bad9)&&ms(_0x31bad9)['match'](/removed[\s*-]data-id="[^"]+"/));}function Ls(_0x1c1726){if(!_0x1c1726)return null;if(_0x48ca1a(_0x1c1726))return fs(_0x1c1726,'data-id')??null;if(_0x1e98cd(_0x1c1726)){const _0x52e26a=ms(_0x1c1726)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x52e26a&&_0x52e26a[0x1])return _0x52e26a[0x1];}return null;}function Ds(_0x1abe3d,_0x2d3fa6){const _0x5a7362=new Map();for(const _0xd2f4ed of ws(_0x1abe3d))_0x5a7362['set'](fs(_0xd2f4ed,'data-id'),_0xd2f4ed);const _0x4a0a31=new Set();for(const _0x589fd0 of ws(_0x2d3fa6)){const _0x4922f9=fs(_0x589fd0,'data-id'),_0x4a35=_0x4922f9?_0x5a7362['get'](_0x4922f9):void 0x0;_0x4a35?(_0x5e68a2(_0x589fd0,_0x5b768f(_0x4a35,!0x0)),_0x4a0a31['add'](_0x4922f9)):_0x3baafe(_0x589fd0);}for(const _0x267465 of Cs(_0x2d3fa6))xs(_0x267465)&&_0x5a7362['has'](Ls(_0x267465))&&_0x3baafe(_0x267465);const _0x353e0a=new Set(Ts('data-id',null,_0x2d3fa6)['map'](_0x1c1836=>fs(_0x1c1836,'data-id')));for(const [_0x107d02,_0x533a6b]of _0x5a7362){if(_0x4a0a31['has'](_0x107d02))continue;let _0x219417=_0x533a6b['parent'],_0x4585f2=null;for(;_0x219417&&_0x48ca1a(_0x219417);){const _0x5a6944=fs(_0x219417,'data-id');if(_0x5a6944&&_0x353e0a['has'](_0x5a6944)){_0x4585f2=_0x5a6944;break;}_0x219417=_0x219417['parent'];}if(!_0x4585f2)continue;const _0x5710ed=Es('data-id',_0x4585f2,_0x2d3fa6);_0x5710ed&&_0x5435f7(_0x5710ed,_0x5b768f(_0x533a6b,!0x0));}}const Ps=/* #__PURE__ -- @preserve */
26
- gt();var Hs=class extends Ps{['_m2html'];constructor(){super();const _0x3a948e=Object['entries'](_0x5695e5),_0x2ed1ef=_0x3a948e['findIndex'](([_0x2eec3f])=>'rehypeDomRaw'===_0x2eec3f);if(-0x1===_0x2ed1ef)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x3a948e['splice'](_0x2ed1ef+0x1,0x0,['rehypeSanitize',_0x58df5c]),this['_m2html']=new _0x5b06d6({'plugins':Object['fromEntries'](_0x3a948e)});}['convertMarkdownToHTML'](_0x17e203){const _0x4f4a93=this['_m2html']['parse'](_0x17e203);return this['parseAndNormalizeHTML'](_0x4f4a93);}['parseAndNormalizeHTML'](_0x54a120){return this['_parseHTML'](_0x54a120);}['_parseHTML'](_0x420f99){const _0x551909=ps('<dummy>'+_0x420f99['replace'](/<[^>]*?$/g,'')+'</dummy>');return Ms(_0x551909),_0x551909['children']=_0x551909['children'][0x0]['children'],_0x551909;}};function Ms(_0x286818){for(const _0x39e4b9 of _0x286818['children'])_0x48ca1a(_0x39e4b9)?'pre'!==_0x39e4b9['name']&&Ms(_0x39e4b9):_0x335b1f(_0x39e4b9)&&(_0x39e4b9['data']=_0x39e4b9['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function Vs({changeGroups:_0x56c655,documentContextContent:_0x51b4ce,showDiff:_0x27794b,trimUnchanged:_0x1438e9=!0x0}){return _0x56c655['map'](_0x5ac42b=>{if(!_0x5ac42b['editor']||'destroyed'===_0x5ac42b['editor']['state'])return null;if(!_0xeaa397(_0x5ac42b['editor'],_0x5ac42b['rootName']))return{'type':_0x5ac42b['changes'][0x0]['type'],'index':_0x5ac42b['index'],'content':new _0x2d29a4([]),'hasChanges':!0x1};const _0x5e9c30=new _0x2d29a4([]),_0x472f6b=new _0x2d29a4([]),_0x4adc61=new Set();for(const _0x55288b of _0x5ac42b['changes'])'new'==_0x55288b['type']&&Ts('data-id',null,_0x55288b['node'])['forEach'](_0x16e04b=>{_0x4adc61['add'](fs(_0x16e04b,'data-id'));});for(const _0x3972cd of _0x5ac42b['changes'])if('removed'!=_0x3972cd['type']?_0x472f6b['children']['push'](_0x3972cd['node']['cloneNode'](!0x0)):_0x27794b||_0x4adc61['has'](_0x3972cd['id'])||_0x472f6b['children']['push'](_0x3972cd['node']['cloneNode'](!0x0)),'new'!=_0x3972cd['type']&&(_0x27794b||'removed'!=_0x3972cd['type'])){const _0xdc86f1=ti(_0x27dc43=>fs(_0x27dc43,'data-id')==_0x3972cd['id'],_0x51b4ce['get'](_0x5ac42b['documentId']),!0x0);_0xdc86f1&&_0x5e9c30['children']['push'](_0xdc86f1['cloneNode'](!0x0));}let _0x54e4fc,_0x474db5;try{({content:_0x54e4fc,hasChanges:_0x474db5}=Us(_0x5ac42b['editor'],_0x5e9c30,_0x472f6b,_0x27794b,_0x1438e9));}catch{return{'type':_0x5ac42b['changes'][0x0]['type'],'index':_0x5ac42b['index'],'content':new _0x2d29a4([]),'hasChanges':!0x1};}return{'type':_0x5ac42b['changes'][0x0]['type'],'index':_0x5ac42b['index'],'content':_0x54e4fc,'hasChanges':_0x474db5};})['filter'](_0x48edc4=>null!==_0x48edc4);}function Us(_0x50c325,_0x4204e3,_0x1fdb26,_0x5ca973,_0x2897aa=!0x0){const _0x1cb312=_0x50c325['plugins']['get']('DocumentCompare'),_0x45bdfa=ms(_0x4204e3),_0x3204de=ms(_0x1fdb26),_0xd3d72f=_0x50c325['data']['parse'](_0x45bdfa,'$root'),_0x526f33=_0x50c325['model']['createPositionAt'](_0xd3d72f,0x0),_0x583922=_0x1cb312['getDiff'](_0x45bdfa,_0x3204de,{'anchor':_0x526f33,'markDeletions':_0x5ca973,'targetEditor':_0x50c325})['getOperations']();if(0x0==_0x583922['length'])return{'content':_0x4204e3['cloneNode'](!0x0),'hasChanges':!0x1};if(_0x5ca973?function(_0x20fa9d,_0x2336d7,_0x3673fa){if(0x0==_0x20fa9d['length'])return;const _0x199750=_0x3673fa['plugins']['get']('DocumentCompare'),_0x226e3c=_0x3673fa['plugins']['get']('SuggestionsConversion');_0x3673fa['model']['change'](_0x489c8c=>{const _0x4e69dd=new Set();for(let _0x5c88b0=0x0;_0x5c88b0<_0x20fa9d['length'];_0x5c88b0++){const _0x19a4b3=_0x20fa9d[_0x5c88b0];if(_0x19a4b3['baseVersion']=null,_0x19a4b3['isDocumentOperation']=!0x1,_0x199750['isMarkedRemoveOperation'](_0x19a4b3)){const _0x23978d=_0x5420f5(_0x19a4b3['newRange'],_0x3673fa['model']),_0x465263='suggestion:deletion:'+vt()+':$aiSuggestion';_0x2336d7['markers']['set'](_0x465263,_0x23978d);}else switch(_0x19a4b3['type']){case'rename':{if(_0x19a4b3['oldName']==_0x19a4b3['newName'])break;_0x489c8c['batch']['addOperation'](_0x19a4b3),_0x3673fa['model']['applyOperation'](_0x19a4b3);const _0x459b90='$elementName',_0x190f7d=_0x19a4b3['position'],_0x5ee94e=_0x3673fa['model']['createRange'](_0x190f7d,_0x3673fa['model']['createPositionAt'](_0x190f7d['nodeAfter'],'end')),_0x4c4fb8='suggestion:attribute:'+_0x459b90+':'+vt()+':$aiSuggestion';_0x2336d7['markers']['set'](_0x4c4fb8,_0x5ee94e);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x19a4b3['oldValue']==_0x19a4b3['newValue'])break;_0x489c8c['batch']['addOperation'](_0x19a4b3),_0x3673fa['model']['applyOperation'](_0x19a4b3);const _0x40e13e=_0x19a4b3['key'];if(!_0x226e3c['isRegisteredAttribute'](_0x40e13e))break;const _0x149128=_0x5420f5(_0x19a4b3['range'],_0x3673fa['model']),_0x294b1d='suggestion:attribute:'+_0x40e13e+':'+vt()+':$aiSuggestion';_0x2336d7['markers']['set'](_0x294b1d,_0x149128);break;}case'insert':{if(_0x489c8c['batch']['addOperation'](_0x19a4b3),_0x3673fa['model']['applyOperation'](_0x19a4b3),Bs(_0x2336d7,_0x19a4b3),_0x20fa9d[_0x5c88b0+0x1]&&'move'==_0x20fa9d[_0x5c88b0+0x1]['type'])break;const _0x481836=_0x19a4b3['position'],_0x15f69f=_0x19a4b3['howMany'],_0x539ebd=_0x5420f5(_0x3673fa['model']['createRange'](_0x481836,_0x481836['getShiftedBy'](_0x15f69f)),_0x3673fa['model']),_0x101dd8='suggestion:insertion:'+vt()+':$aiSuggestion';_0x2336d7['markers']['set'](_0x101dd8,_0x539ebd);break;}case'split':{_0x489c8c['batch']['addOperation'](_0x19a4b3),_0x3673fa['model']['applyOperation'](_0x19a4b3),Bs(_0x2336d7,_0x19a4b3);const _0x139b17=_0x19a4b3['splitPosition'],_0x3c6a10=_0x19a4b3['moveTargetPosition'],_0x445b0c=_0x3673fa['model']['createRange'](_0x139b17,_0x3c6a10),_0x35117a='suggestion:insertion:'+vt()+':$aiSuggestion';_0x2336d7['markers']['set'](_0x35117a,_0x445b0c);break;}case'move':{_0x489c8c['batch']['addOperation'](_0x19a4b3),_0x3673fa['model']['applyOperation'](_0x19a4b3),Bs(_0x2336d7,_0x19a4b3);const _0x52e9b9=_0x19a4b3['getMovedRangeStart'](),_0x5bca76=_0x19a4b3['howMany'];for(let _0x1ac426=0x0;_0x1ac426<_0x5bca76;_0x1ac426++){const _0x49b278=_0x52e9b9['getShiftedBy'](_0x1ac426)['nodeAfter'];_0x4e69dd['add'](_0x49b278);}break;}case'remove':{const _0x3007a7=_0x19a4b3['sourcePosition'],_0x43199f=_0x19a4b3['howMany'],_0x49d80f=new _0x440cda(_0x3007a7,_0x43199f);_0x489c8c['batch']['addOperation'](_0x49d80f),_0x3673fa['model']['applyOperation'](_0x49d80f),Bs(_0x2336d7,_0x19a4b3);break;}}}for(const _0x58d72c of _0x4e69dd){const _0x2773a7=_0x3673fa['model']['createRangeOn'](_0x58d72c),_0x2d1087='suggestion:formatBlock:$fakeWrap:'+vt()+':$aiSuggestion';_0x2336d7['markers']['set'](_0x2d1087,_0x5420f5(_0x2773a7,_0x3673fa['model']));}});}(_0x583922,_0xd3d72f,_0x50c325):_0x50c325['model']['change'](_0x4702b8=>{for(const _0x55c293 of _0x583922)if('remove'==_0x55c293['type']){const _0x2212ac=_0x55c293['sourcePosition'],_0x5bc4c0=_0x55c293['howMany'],_0x4abed1=new _0x440cda(_0x2212ac,_0x5bc4c0);_0x4702b8['batch']['addOperation'](_0x4abed1),_0x50c325['model']['applyOperation'](_0x4abed1),Bs(_0xd3d72f,_0x55c293);}else{if('marker'==_0x55c293['type']){const _0x59d2c9=_0x55c293['name'],_0x20a4ac=_0x55c293['newRange'];null!==_0x20a4ac?_0xd3d72f['markers']['set'](_0x59d2c9,_0x20a4ac):_0xd3d72f['markers']['delete'](_0x59d2c9);}else _0x55c293['baseVersion']=null,_0x55c293['isDocumentOperation']=!0x1,_0x4702b8['batch']['addOperation'](_0x55c293),_0x50c325['model']['applyOperation'](_0x55c293),Bs(_0xd3d72f,_0x55c293);}}),_0x2897aa){const _0x3d28fc=Gs(_0x50c325,_0x583922,_0xd3d72f);Ks(_0x50c325['model'],_0x3d28fc),function(_0x31d297,_0x4c3a35){const _0x129e33=_0x4c3a35['getFirstRange']()['start'];let _0x3252e7=_0x4c3a35['getFirstRange']()['end'];const _0x4abcc9=_0x129e33['root'];(_0x3252e7['textNode']||_0x3252e7['nodeAfter']&&_0x3252e7['nodeAfter']['is']('$text'))&&(_0x354e1a(_0x3252e7,'...'),$s(_0x4abcc9,_0x3252e7,0x3),_0x3252e7=_0x3252e7['getShiftedBy'](0x3)),(_0x129e33['textNode']||_0x129e33['nodeBefore']&&_0x129e33['nodeBefore']['is']('$text'))&&(_0x354e1a(_0x129e33,'...'),$s(_0x4abcc9,_0x129e33,0x3),_0x129e33['parent']==_0x3252e7['parent']&&(_0x3252e7=_0x3252e7['getShiftedBy'](0x3)));const _0x4f6fb8=_0x31d297['createRange'](_0x31d297['createPositionAt'](_0x4abcc9,0x0),_0x129e33),_0x523790=_0x31d297['createRange'](_0x3252e7,_0x31d297['createPositionAt'](_0x4abcc9,'end')),_0x1c28a3=[..._0x4f6fb8['getMinimalFlatRanges'](),..._0x523790['getMinimalFlatRanges']()];_0x1c28a3['reverse']();for(const _0xe8cf0f of _0x1c28a3)_0x1d816f(_0xe8cf0f),Ys(_0x4abcc9,_0xe8cf0f);}(_0x50c325['model'],_0x3d28fc);}return{'content':ps(_0x50c325['data']['stringify'](_0xd3d72f,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}function Bs(_0x751d81,_0x5b4b17){for(const [_0xb33b4e,_0x2404b3]of _0x751d81['markers']){const _0x42ce4c=_0x223931['_createFromRanges'](_0x2404b3['getTransformedByOperation'](_0x5b4b17));_0x42ce4c['root']==_0x751d81?_0x751d81['markers']['set'](_0xb33b4e,_0x42ce4c):_0x751d81['markers']['delete'](_0xb33b4e);}}function Gs(_0x5b48b9,_0x27cccc,_0x2e98d3){const _0x4dc9f6=_0x5b48b9['plugins']['get']('DocumentCompare');let _0x2c5c18=_0x5b48b9['model']['createPositionAt'](_0x2e98d3,Number['POSITIVE_INFINITY']),_0xfcbf25=_0x5b48b9['model']['createPositionAt'](_0x2e98d3,0x0);for(const _0x115eb5 of _0x27cccc){let _0x54f8d7,_0x4421a7;if(_0x4dc9f6['isMarkedRemoveOperation'](_0x115eb5))_0x54f8d7=_0x115eb5['newRange']['start'],_0x4421a7=_0x115eb5['newRange']['end'];else switch(_0x2c5c18=Fs(_0x2c5c18,_0x115eb5),_0xfcbf25=Fs(_0xfcbf25,_0x115eb5),_0x115eb5['type']){case'rename':_0x54f8d7=_0x115eb5['position'],_0x4421a7=_0x54f8d7['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x54f8d7=_0x115eb5['range']['start'],_0x4421a7=_0x115eb5['range']['end'];break;case'insert':_0x54f8d7=_0x115eb5['position'],_0x4421a7=_0x54f8d7['getShiftedBy'](_0x115eb5['howMany']);break;case'split':_0x54f8d7=_0x115eb5['splitPosition'],_0x4421a7=_0x115eb5['moveTargetPosition'];break;case'merge':{const _0xbcb833=_0x115eb5['targetPosition']['path']['slice'](0x0,-0x1);_0x54f8d7=_0x5b48b9['model']['createPositionFromPath'](_0x2e98d3,_0xbcb833),_0x4421a7=_0x54f8d7['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x2561d6=_0x115eb5['howMany'],_0x2ba6af=_0x115eb5['sourcePosition']['_getTransformedByInsertion'](_0x115eb5['targetPosition'],_0x2561d6),_0x51396f=_0x115eb5['getMovedRangeStart']();'remove'==_0x115eb5['type']?(_0x54f8d7=_0x2ba6af,_0x4421a7=_0x2ba6af):(_0x54f8d7=_0x51396f,_0x4421a7=_0x51396f['getShiftedBy'](_0x2561d6));break;}}_0x54f8d7&&_0x54f8d7['isBefore'](_0x2c5c18)&&(_0x2c5c18=_0x54f8d7['clone'](),_0x2c5c18['stickiness']='toNone'),_0x4421a7&&_0x4421a7['isAfter'](_0xfcbf25)&&(_0xfcbf25=_0x4421a7['clone'](),_0xfcbf25['stickiness']='toNone');}return _0x5b48b9['model']['createSelection'](_0x5b48b9['model']['createRange'](_0x2c5c18,_0xfcbf25));}function Fs(_0x88f690,_0xc4eb7d){return'move'!=_0xc4eb7d['type']&&'remove'!=_0xc4eb7d['type']||_0xc4eb7d['sourceRange']['containsPosition'](_0x88f690)&&((_0x88f690=_0xc4eb7d['sourcePosition']['clone']())['stickiness']='toNone'),_0x88f690['getTransformedByOperation'](_0xc4eb7d);}function Ks(_0x54dec4,_0x5ee80d){Ws(_0x54dec4,_0x5ee80d,'forward');const _0x3202eb=_0x5ee80d['getFirstRange']();_0x5ee80d['setTo']([]),_0x5ee80d['setTo'](_0x3202eb,{'backward':!0x0}),Ws(_0x54dec4,_0x5ee80d,'backward');}function Ws(_0xc7115c,_0x457312,_0x43deb3){let _0x54b4a5=0x14;for(;_0x54b4a5;){_0xc7115c['modifySelection'](_0x457312,{'unit':'word','direction':_0x43deb3}),_0x54b4a5--;const _0x4032a7=_0x457312['focus']['forward'==_0x43deb3?'nodeBefore':'nodeAfter'];if(_0x4032a7&&_0x4032a7['is']('element')&&_0xc7115c['schema']['isBlock'](_0x4032a7)&&_0xc7115c['schema']['isObject'](_0x4032a7))break;}}function Ys(_0x2f14e0,_0x382d2f){for(const [_0x5b4129,_0x38b09a]of _0x2f14e0['markers']){const _0x1a4817=_0x38b09a['_getTransformedByDeletion'](_0x382d2f['start'],_0x382d2f['end']['offset']-_0x382d2f['start']['offset']);null!=_0x1a4817?_0x2f14e0['markers']['set'](_0x5b4129,_0x1a4817):_0x2f14e0['markers']['delete'](_0x5b4129);}}function $s(_0x161c9c,_0x11124b,_0x2abc5a){for(let [_0x12b3b2,_0x6d14ac]of _0x161c9c['markers'])_0x6d14ac=_0x6d14ac['_getTransformedByInsertion'](_0x11124b,_0x2abc5a,!0x1)[0x0],_0x161c9c['markers']['set'](_0x12b3b2,_0x6d14ac);}const qs=/* #__PURE__ -- @preserve */
27
- ut();var Qs=class extends qs{['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x23194a,config:_0x4ea9bc,locale:_0x5dc607}){super(),this['_connector']=_0x23194a,this['_config']=_0x4ea9bc,this['_locale']=_0x5dc607;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x2a1dd0=await this['getAll']();let _0xabe505;return _0xabe505=this['_availableModels']?this['_filterModels'](_0x2a1dd0,this['_availableModels']):_0x2a1dd0['filter'](_0x427ab4=>_0x427ab4['recommended']),_0xabe505;}async['getModel'](_0x1af182){const _0x30a3c5=await this['getAll']();if(!_0x30a3c5['length'])return null;if(_0x1af182){const _0x152bdc=this['_getModelById'](_0x30a3c5,_0x1af182);if(_0x152bdc)return _0x152bdc;bt('ai-chat-model-id-unrecognized',{'modelId':_0x1af182,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x41a4e3=await this['getAvailableModels']();if(!_0x41a4e3['length'])return null;if(this['_defaultModelId']){const _0x3169f5=this['_getModelById'](_0x41a4e3,this['_defaultModelId']);if(_0x3169f5)return _0x3169f5;bt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x41a4e3[0x0]['id']});}return _0x41a4e3[0x0];}async['isAvailable'](_0x3fd895){return(await this['getAvailableModels']())['some'](_0x490c73=>_0x490c73['name']===_0x3fd895['name']&&_0x490c73['provider']===_0x3fd895['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length']){const _0x23b259=this['_locale']['uiLanguage']||'en',_0x976d8c=await this['_connector']['getModels'](_0x23b259)['list']();this['_modelList']=_0x976d8c['items']['map'](_0xef98f4=>Xs(_0xef98f4)?{..._0xef98f4,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0xef98f4);}return[...this['_modelList']];}['_filterModels'](_0x1793b9,_0x8187a2){let _0x3ba1eb;if(_0x8187a2){_0x3ba1eb=[];const _0x3987e1=new Set(),_0x2cbacd='string'==typeof _0x8187a2?[_0x8187a2['toLocaleLowerCase']()]:_0x8187a2['map'](_0x449339=>_0x449339['toLocaleLowerCase']());for(const _0xfee7a9 of _0x2cbacd)for(const _0x370f89 of _0x1793b9)!_0x3987e1['has'](_0x370f89['id'])&&this['_isMatchingFilter'](_0x370f89,_0xfee7a9)&&(_0x3ba1eb['push'](_0x370f89),_0x3987e1['add'](_0x370f89['id']));}else _0x3ba1eb=_0x1793b9;return _0x3ba1eb;}['_isMatchingFilter'](_0x4b3674,_0x47a42a){const _0x38307e=_0x4b3674['id']['toLocaleLowerCase'](),_0xdebb37=_0x4b3674['name']['toLocaleLowerCase'](),_0x17edaf=_0x4b3674['provider']['toLocaleLowerCase']();return _0x38307e===_0x47a42a||_0xdebb37===_0x47a42a||Xs(_0x4b3674)&&'auto'===_0x47a42a||_0x17edaf===_0x47a42a||_0x38307e['startsWith'](_0x47a42a);}['_getModelById'](_0x51d19d,_0x13b908){return _0x51d19d['find'](_0x4afe1b=>Xs(_0x4afe1b)&&'auto'===_0x13b908?_0x4afe1b:_0x4afe1b['id']===_0x13b908)||null;}};function Xs(_0x2f8ba4){return _0x2f8ba4['id']['startsWith']('agent');}function zs(_0x84775c,_0x2e52f0){for(const _0x30e4d3 of _0x84775c)'noop'!==_0x30e4d3['type']&&(_0x30e4d3['_aiSource']=_0x2e52f0);}var js=class extends _0x11a14c{static get['pluginName'](){return'AIGateway';}static get['requires'](){return[_0x1f6a74];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAvailableModels'](){return new Qs({'connector':this['context']['plugins']['get']('AIConnector'),'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']})['getAll']();}['apply'](_0x415330,_0x3d0581){if('completed'!==_0x415330['status'])throw new ht('ai-gateway-apply-invalid-status',this,{'status':_0x415330['status']});const _0x1e125a=_0x415330['editor'],{applyMethod:_0x3f7bbd}=_0x3d0581;if('suggest'===_0x3f7bbd&&!_0x1e125a['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',this);const _0x218d5e='suggest'===_0x3f7bbd,_0x1a7f27=this['context']['plugins']['get'](_0x1f6a74),_0x1a381b=_0x1e125a['model']['createPositionAt'](_0x1e125a['model']['document']['getRoot'](),0x0),_0x200f94=_0x1a7f27['getDiff'](_0x415330['contentRawOld'],_0x415330['contentRawNew'],{'anchor':_0x1a381b,'markDeletions':_0x218d5e,'targetEditor':_0x1e125a}),_0x2392d7=_0x1e125a['model']['document']['history']['getOperations'](_0x415330['documentVersion']),_0x25af0a={'document':_0x1e125a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2835fa=_0x5be051(_0x200f94['getOperations'](),_0x2392d7,_0x25af0a)['operationsA'];zs(_0x2835fa,_0x3d0581['aiSource']??'api'),_0x1e125a['model']['change'](_0x262a4a=>{_0x218d5e?_0x1e125a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2835fa):_0x1a7f27['applyOperations'](_0x262a4a,_0x2835fa);});}['mergeChangesIntoContent'](_0x2cdb5b,_0x2c6315,_0x33b02b){const _0x4ee664=new Hs(),_0x58a7ab=new ys();let _0x12b925=_0x4ee664['parseAndNormalizeHTML'](_0x2c6315);for(const _0x217477 of _0x2cdb5b)try{const _0x4889ca=_0x4ee664['parseAndNormalizeHTML'](_0x217477['content']);_0x12b925=_0x58a7ab['merge'](_0x4889ca,_0x12b925,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x22dfb2){throw new ht('ai-gateway-merge-failed',this,{..._0x217477},_0x22dfb2);}return Us(_0x33b02b,_0x4ee664['parseAndNormalizeHTML'](_0x2c6315),_0x12b925,!0x1,!0x1)['content'];}},Js=class{['_editor'];['_rootName'];['_channelId'];['_sessionId'];['_documentVersion'];['_contentRawOld'];['_contentRawNew'];['_error'];['_isAborted']=!0x1;constructor(_0xb60512){this['_editor']=_0xb60512['editor'],this['_rootName']=_0xb60512['rootName'],this['_channelId']=_0xb60512['channelId'],this['_sessionId']=_0xb60512['sessionId'];}get['status'](){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get['editor'](){return this['_editor'];}get['rootName'](){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get['documentVersion'](){return this['_documentVersion'];}set['documentVersion'](_0x741386){this['_documentVersion']=_0x741386;}get['contentRawOld'](){return this['_contentRawOld'];}set['contentRawOld'](_0x324ca3){this['_contentRawOld']=_0x324ca3;}get['contentRawNew'](){return this['_contentRawNew'];}set['contentRawNew'](_0x5397e0){this['_contentRawNew']=_0x5397e0;}get['contentOld'](){return this['_dropDataIds'](this['_contentRawOld']||'');}get['contentNew'](){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x4c480a){this['_error']=_0x4c480a;}['abort'](){this['_isAborted']=!0x0;}['_dropDataIds'](_0x26cf34){return _0x26cf34['replace'](/ data-id="[a-z0-9]+"/g,'');}},Zs=class extends Js{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x20bed3){this['_summary']=_0x20bed3;}},tn=class extends _0x11a14c{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get['requires'](){return[ls,Is,js];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAvailableModels'](){return this['context']['plugins']['get']('AIGateway')['getAvailableModels']();}async['processDocument'](_0x53d92c,_0x307cda){if(!_0x53d92c)throw new ht('ai-documentprocessinggateway-missing-prompt',this);const _0x576142=await this['context']['plugins']['get'](Is)['getDocumentData']();if(!_0x576142[0x0])throw new ht('ai-documentprocessinggateway-missing-document',this);const _0x23e4fa=new Zs({'editor':_0x576142[0x0]['editor'],'rootName':_0x576142[0x0]['rootName'],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x576142[0x0]['sessionId']});if(_0x23e4fa['contentRawOld']=_0x576142[0x0]['content'],_0x23e4fa['documentVersion']=_0x576142[0x0]['version'],_0x307cda?.['signal']?.['aborted'])return _0x23e4fa['abort'](),_0x23e4fa;const _0x5ead6b=this['context']['plugins']['get']('AIConnector')['processDocument']({'document':_0x23e4fa['contentRawOld'],'prompt':_0x53d92c,'model':_0x307cda['model']});let _0x4e59aa;if(_0x307cda?.['signal']){if(_0x307cda['signal']['aborted'])return _0x5ead6b['abortController']['abort'](),_0x23e4fa['abort'](),_0x23e4fa;const _0x23f82d=_0x307cda['signal'],_0xc875cd=()=>_0x5ead6b['abortController']['abort']();_0x23f82d['addEventListener']('abort',_0xc875cd),_0x4e59aa=()=>_0x23f82d['removeEventListener']('abort',_0xc875cd);}try{const _0x53e314=await _0x5ead6b['getResult']();if(!(_0x53e314&&_0x53e314['document']&&_0x53e314['document']['length']>0x0))throw new ht('ai-documentprocessinggateway-empty-reply',this);_0x23e4fa['contentRawNew']=_0x53e314['document'],_0x23e4fa['summary']=_0x53e314['summary']||'';}catch(_0x51285e){_0x51285e instanceof Error&&_0x51285e['message']['includes']('ai-request-aborted')?_0x23e4fa['abort']():_0x23e4fa['error']=_0x51285e instanceof ht?_0x51285e:new ht('ai-documentprocessinggateway-run-failed',this,{},_0x51285e);}finally{_0x4e59aa&&_0x4e59aa();}return _0x23e4fa;}['applyResult'](_0x2bdcdd,_0x54a06f){this['context']['plugins']['get']('AIGateway')['apply'](_0x2bdcdd,_0x54a06f);}};function en(_0x5a924b){return _0x5a924b instanceof Error&&('AbortError'===_0x5a924b['name']||('AICoreError'===_0x5a924b['name']?!0x0===_0x5a924b['isAbort']:_0x5a924b['message']['startsWith']('ai-request-aborted')));}var sn=class extends Error{['code'];['severity'];['type'];['context'];['isAbort'];constructor(_0x14b4ca){super(_0x14b4ca['code'],_0x14b4ca['cause']instanceof Error?{'cause':_0x14b4ca['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x14b4ca['code'],this['severity']=_0x14b4ca['severity']??'error',this['type']=_0x14b4ca['type']??'system',this['context']=_0x14b4ca['context'],this['isAbort']=_0x14b4ca['isAbort']??en(_0x14b4ca['cause']);}},nn=class extends _0x11a14c{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['createReporter'](_0x4136c0){return new rn(this,_0x4136c0);}},rn=class{['_sink'];['_component'];constructor(_0x2ccf7b,_0x572091){this['_sink']=_0x2ccf7b,this['_component']=_0x572091;}['logError'](_0x417223,_0x210dae={}){this['_emit'](_0x417223,_0x210dae),this['_defaultLog'](_0x417223);}['reportError'](_0x1dd5a4,_0x205406={}){this['_emit'](_0x1dd5a4,_0x205406);}['_emit'](_0x401035,_0x43f4de){en(_0x401035)||this['_sink']['fire']('error',{'error':_0x401035,'component':this['_component'],'context':_0x43f4de['context']});}['_defaultLog'](_0x2fb942){if(!en(_0x2fb942)){if(_0x2fb942 instanceof sn){if('user'===_0x2fb942['type']||'network'===_0x2fb942['type'])return;if('warning'===_0x2fb942['severity'])return void console['warn'](this['_component'],_0x2fb942);}console['error'](this['_component'],_0x2fb942);}}};const on='ck-ai-button-primary',an='ck-ai-button-secondary',hn='ck-ai-button-tertiary';function cn(_0x5602f6,_0x2ada8c){const _0x347f63=new Ht(_0x5602f6),_0x56c2a6=us(_0x5602f6,'AI_TABS_LABEL_MINIMIZE'),_0x507d16=us(_0x5602f6,'AI_TABS_LABEL_MAXIMIZE');return _0x347f63['set']({'withText':!0x1,'icon':_0x30fcb2,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+hn}),_0x347f63['bind']('label')['to'](_0x2ada8c,'isMaximized',_0x15fb2b=>_0x15fb2b?_0x56c2a6:_0x507d16),_0x347f63['bind']('icon')['to'](_0x2ada8c,'isMaximized',_0x2d1c44=>_0x2d1c44?_0x527ca0:_0x30fcb2),_0x347f63['bind']('isOn')['to'](_0x2ada8c,'isMaximized'),_0x347f63['on']('execute',()=>{_0x2ada8c['fire']('resizeTabs');}),_0x347f63;}function ln(_0x200114){const _0x102289=new Lt(_0x200114);return _0x102289['attachToDom'](),_0x102289['bodyCollectionContainer']['classList']['add']('ck-ai-body'),_0x102289;}const un=/* #__PURE__ -- @preserve */
28
- gt();var dn=class extends un{['id'];['interactionId'];['type'];['content']=new Map();['sources']=[];['parsedContent']=new Map();['parsedMergedContent']=new Map();['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['_documentIdToSource']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x78fccf,isDone:_0x162e67=!0x1,isComplete:_0x498bf4,interactionId:_0x2f7488,areActionsDisabled:_0x34e596,isFromHistory:_0x468201=!0x1,documentContextContent:_0x482106,locale:_0x7f51fe,id:_0x15ba69,channelsToEditors:_0x484ab7}){super(),this['id']=_0x15ba69||vt(),this['interactionId']=_0x2f7488,this['type']=_0x78fccf,this['areActionsDisabled']=!!_0x34e596,this['isFromHistory']=_0x468201,this['locale']=_0x7f51fe,this['aiResponseParser']=new Hs(),this['aiResponseApplier']=new ys(),this['documentContextContent']=new Map(_0x482106?.['map'](_0x398c3f=>[_0x398c3f['id'],ps(_0x398c3f['content'])])||[]),this['_documentIdToSource']=new Map(_0x482106?.['map'](_0x5ae526=>[_0x5ae526['id'],{'editor':_0x484ab7['get'](_0x5ae526['channelId']),'rootName':_0x5ae526['rootName']}])||[]),this['set']('isDone',_0x162e67),this['set']('isComplete',_0x498bf4??_0x162e67),'text'===this['type']&&this['content']['set']('text','');}['appendContent'](_0x3077d9,_0x562f6a){const _0x31d104='text'===this['type']?'text':_0x562f6a;this['content']['has'](_0x31d104)||this['content']['set'](_0x31d104,''),this['content']['set'](_0x31d104,this['content']['get'](_0x31d104)+_0x3077d9),this['onContentChange'](_0x31d104);}['done'](_0x4d666f=!0x0){this['isComplete']=_0x4d666f,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x39149d,_0x112b86){this['changeGroups'][_0x39149d]['state']=_0x112b86,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x39149d,'state':_0x112b86});}['getContentParts']({showDiff:_0x214d41,groupIndex:_0x829136}){const _0x14c787=this['_getCachedContentParts'](_0x214d41,_0x829136);if(_0x14c787)return _0x14c787;let _0xc389b8=[];if(void 0x0===_0x829136)_0xc389b8=this['changeGroups'];else{const _0x4e158f=this['changeGroups']['find'](({index:_0x5e9d66})=>_0x5e9d66===_0x829136);if(!_0x4e158f)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x829136});_0xc389b8=[_0x4e158f];}const _0x145ff4=Vs({'showDiff':_0x214d41,'changeGroups':_0xc389b8,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x214d41,_0x145ff4),_0x145ff4;}['_getCachedContentParts'](_0x22a258,_0x5e4f7a){const _0x4fe278=_0x22a258?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x4fe278]['length'])return null;const _0x3d7177=this['cachedSuggestionContentParts'][_0x4fe278];if(void 0x0===_0x5e4f7a)return _0x3d7177['length']>0x0&&_0x3d7177['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x22a258,null),null):_0x226fcf(_0x3d7177);{const _0x56f9b5=_0x3d7177['find'](({index:_0x1beb28})=>_0x1beb28===_0x5e4f7a);if(_0x56f9b5)return[_0x226fcf(_0x56f9b5)];}return null;}['_setCachedContentParts'](_0x190354,_0x1357b4){const _0x555d9b=_0x190354?'withDiff':'withoutDiff';_0x1357b4?_0x1357b4['forEach'](_0x1d3c62=>{const _0x4445a=this['cachedSuggestionContentParts'][_0x555d9b],_0x5323e1=_0x4445a['find'](({index:_0x1a6aca})=>_0x1a6aca===_0x1d3c62['index']);if(_0x5323e1){const _0x45def4=_0x4445a['indexOf'](_0x5323e1);_0x4445a['splice'](_0x45def4,0x1,_0x1d3c62);}else _0x4445a['push'](_0x1d3c62);}):this['cachedSuggestionContentParts'][_0x555d9b]['length']=0x0;}['onContentChange'](_0x1c8b4f){if('modification'===this['type']){if(_0x1c8b4f)this['parsedContent']['set'](_0x1c8b4f,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x1c8b4f)));else{for(const [_0x1c7e19,_0x3e3ce2]of this['content'])this['parsedContent']['set'](_0x1c7e19,this['aiResponseParser']['parseAndNormalizeHTML'](_0x3e3ce2));}const _0x34e0eb=this['changeGroups'];for(const _0x4dd54f of this['content']['keys']())this['updateChangeGroups'](_0x4dd54f);const _0x3d710e=this['_getDifferentChangeGroups'](_0x34e0eb,this['changeGroups']);(_0x3d710e['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3d710e),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5202cc,_0x2c9843){const _0x8b2516=[];for(const _0x1b7e11 of _0x2c9843){const _0x3aef4c=_0x5202cc[_0x1b7e11['index']];_0x3aef4c?_0x3aef4c['changes']['length']!==_0x1b7e11['changes']['length']?_0x8b2516['push'](_0x1b7e11):_0x3aef4c['changes']['forEach']((_0x1c97c9,_0x125d79)=>{const _0x30e50e=_0x1b7e11['changes'][_0x125d79];_0x1c97c9['id']!==_0x30e50e['id']&&_0x8b2516['push'](_0x1b7e11);}):_0x8b2516['push'](_0x1b7e11);}return _0x8b2516;}['updateChangeGroups'](_0xfa21e3){const _0x12e4d4=this['documentContextContent']['get'](_0xfa21e3),_0x297f5d=this['parsedContent']['get'](_0xfa21e3);if(!_0x12e4d4||!_0x297f5d)return;const _0xb4d8f=new _0x1f1d4a('p',{},[new _0x1f1d4a('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x1d9d67(us(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x200d75=this['aiResponseApplier']['merge'](_0x297f5d,_0x12e4d4['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0xb4d8f});this['parsedMergedContent']['set'](_0xfa21e3,_0x200d75['parsedContent']);let _0x51ee6c=[];if(_0x242f60(_0x76d5f4=>{const _0x1e940d=fs(_0x76d5f4,'data-id');if(!_0x1e940d||!_0x3395e1(_0x1e940d))return!0x1;const _0x1140eb=[_0x76d5f4,...Rs(_0x76d5f4)]['at'](-0x2);if(_0x76d5f4!=_0x1140eb){const _0x51cca8=fs(_0x1140eb,'data-id');_0x3395e1(_0x51cca8)||(_0x51ee6c['push']({'node':_0x1140eb,'id':_0x51cca8,'type':'modified'}),_0x200d75['modifiedNodeIds']['push'](_0x51cca8));}else _0x200d75['modifiedNodeIds']['includes'](_0x1e940d)?_0x51ee6c['push']({'node':_0x76d5f4,'type':'modified','id':_0x1e940d}):_0x200d75['newNodeIds']['includes'](_0x1e940d)?_0x51ee6c['push']({'node':_0x76d5f4,'type':'new','id':_0x1e940d,'anchorId':fs(_0x76d5f4['previousSibling'],'data-id')}):_0x51ee6c['push']({'node':_0x76d5f4,'type':'removed','id':_0x1e940d});return!0x0;},this['parsedMergedContent']['get'](_0xfa21e3)),_0x51ee6c=_0x51ee6c['filter'](({node:_0x188047})=>[...Rs(_0x188047),_0x188047]['every'](_0x407001=>!fs(_0x407001,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0x587855=>_0x587855['documentId']!==_0xfa21e3),0x0==_0x51ee6c['length'])return;const _0x33ac6e=[[_0x51ee6c[0x0]]];for(let _0x2dab50=0x1;_0x2dab50<_0x51ee6c['length'];_0x2dab50++){const _0x39025a=_0x33ac6e[_0x33ac6e['length']-0x1],_0x5cf657=_0x39025a[_0x39025a['length']-0x1];_0x51ee6c[_0x2dab50]['node']['previousSibling']==_0x5cf657['node']&&'modified'!=_0x51ee6c[_0x2dab50]['type']&&'modified'!=_0x5cf657['type']?_0x39025a['push'](_0x51ee6c[_0x2dab50]):_0x33ac6e['push']([_0x51ee6c[_0x2dab50]]);}for(const _0x434125 of _0x33ac6e){const _0x140832=_0x434125[0x0],_0x120d60=_0x434125[_0x434125['length']-0x1],_0x277097=_0x524459(_0x140832['node']['previousSibling']);_0x277097&&_0x434125['unshift'](_0x277097);const _0x1446a4=_0x524459(_0x120d60['node']['nextSibling']);_0x1446a4&&_0x434125['push'](_0x1446a4);}Ts('data-wrapped-id',null,this['parsedMergedContent']['get'](_0xfa21e3))['forEach'](_0x537787=>{bs(_0x537787,'data-wrapped-id',null);});const _0x464d2c=new Map();Ts('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0xfa21e3))['forEach'](_0x499799=>{const _0x4d6b1f=fs(_0x499799,'data-unwrapped-id'),_0x3c4bc3=fs(_0x499799,'data-id');_0x464d2c['set'](_0x3c4bc3,_0x4d6b1f),bs(_0x499799,'data-id',_0x4d6b1f),bs(_0x499799,'data-unwrapped-id',null);});for(const _0x3f8c27 of _0x51ee6c){const _0x169120=_0x464d2c['get'](_0x3f8c27['id']);_0x169120&&(_0x3f8c27['id']=_0x169120);}this['changeGroups']['push'](..._0x33ac6e['map']((_0x491be4,_0xc540aa)=>({'changes':_0x491be4,'state':'pending','index':_0xc540aa,'editor':this['_documentIdToSource']['get'](_0xfa21e3)['editor'],'rootName':this['_documentIdToSource']['get'](_0xfa21e3)['rootName'],'documentId':_0xfa21e3})));const _0x4a8458=Array['from'](this['documentContextContent']['keys']());function _0x3395e1(_0x2cb087){return _0x200d75['modifiedNodeIds']['includes'](_0x2cb087)||_0x200d75['newNodeIds']['includes'](_0x2cb087)||_0x200d75['removedNodeIds']['includes'](_0x2cb087);}function _0x524459(_0x580b4d){if(_0x580b4d&&fs(_0x580b4d,'data-id')&&!fs(_0x580b4d,'data-unstable')){const _0x256510=fs(_0x580b4d,'data-id');if(!_0x3395e1(_0x256510))return{'node':_0x580b4d,'type':'context','id':_0x256510};}return null;}this['changeGroups']['sort']((_0x2185dc,_0x48ac90)=>_0x4a8458['indexOf'](_0x2185dc['documentId'])-_0x4a8458['indexOf'](_0x48ac90['documentId'])),this['changeGroups']['forEach']((_0x3a3101,_0x4248fd)=>{_0x3a3101['index']=_0x4248fd;});}};const _n=/* #__PURE__ -- @preserve */
29
- ut(),gn=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var An=class extends _n{['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;['_channelsToEditors'];constructor({connector:_0x3ae388,locale:_0x19f0b6,channelsToEditors:_0x344d84}){super(),this['id']=vt(),this['connector']=_0x3ae388,this['isStopped']=!0x0,this['locale']=_0x19f0b6,this['_channelsToEditors']=_0x344d84||new Map();}async['start'](){await this['_run']();}async['resume'](_0x5b0901){await this['_run'](_0x5b0901);}async['_run'](_0x4e4b7c){const _0x185024=[];let _0x47a7d6,_0x21a1a4,_0x4e0d95,_0x3ab233=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x4e4b7c||await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x1b2b1e=await this['currentRequest']['getStream']();for await(const _0x507392 of _0x1b2b1e){if(this['isStopped'])return;if('error'==_0x507392['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x507392['event']){case'message-metadata':this['messageId']=_0x507392['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x507392['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x507392['data']['conversationTitle'],!0x0);break;case'source':_0x185024['push'](_0x507392['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x47a7d6='modification-delta'==_0x507392['event']?'modification':'text',_0x21a1a4='modification-delta'==_0x507392['event']?_0x507392['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x47a7d6&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x47a7d6,'interactionId':this['id'],'id':_0x21a1a4,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x507392['event']&&{'documentId':_0x507392['data']['documentId']}}),'modification'==_0x47a7d6&&(this['currentReply']['sources']=_0x185024['splice'](0x0))),this['currentReply']['appendContent'](_0x507392['data']['textDelta'],_0x507392['data']['documentId']);break;case'mcp-tool-result':_0x4e0d95=JSON['parse'](_0x507392['data']['result']),this['_handleToolResultData']({'toolName':_0x507392['data']['toolName'],'data':_0x4e0d95['data'],'attributes':_0x4e0d95['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x507392['data']['toolName'],'data':_0x507392['data']['data']});}}_0x3ab233=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x185024['length']>0x0&&(this['currentReply']['sources']=_0x185024['splice'](0x0)),this['_finalizeInteraction'](_0x3ab233),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3f4001){return this['replies']['find'](_0x2d547d=>_0x2d547d['id']===_0x3f4001);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2c16d1=>_0x2c16d1['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1bc3ff){const _0x21347c=this['getDocumentContext'](),_0x21dea3=new dn({'locale':this['locale'],'documentContextContent':_0x21347c?.['documents'],..._0x1bc3ff});return this['replies']['push'](_0x21dea3),_0x21dea3['delegate'](...gn)['to'](this),this['fire']('replyCreated',_0x21dea3),_0x21dea3;}['setConversationTitle'](_0x255c9c,_0x4c4a60=!0x1){this['fire']('setConversationTitle',_0x255c9c,_0x4c4a60);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x21aa5a){this['fire']('toolDataReceived',{'type':'result','toolName':_0x21aa5a['toolName'],'data':structuredClone(_0x21aa5a['data']||{}),'attributes':structuredClone(_0x21aa5a['attributes']||{})},this);}['_handleToolNotificationData'](_0x143bc1){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x143bc1['toolName'],'data':structuredClone(_0x143bc1['data'])},this);}['_finalizeInteraction'](_0x16e8df=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x16e8df),this['currentRequest']=this['currentReply']=void 0x0;}};const In=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']]),pn=/* #__PURE__ -- @preserve */
30
- gt(),mn=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var En=class AIChatContext extends pn{['_connector'];['_config'];['_ownerId'];constructor({connector:_0x170221,config:_0x31efb0,ownerId:_0x3910d5}){super(),this['_connector']=_0x170221,this['_config']=_0x31efb0,this['_ownerId']=_0x3910d5;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return new Map(this['_pendingContextItems']);}async['populateFromMessage'](_0x5dc3d4,_0xee9d1e){const _0x341316=new Map(),{contextItem:_0x13094f,hasUnmatched:_0x3254db}=await this['_populateDocumentContextItem'](_0x5dc3d4,_0xee9d1e);_0x13094f&&_0x341316['set'](_0x13094f['id'],_0x13094f);for(const _0x569f71 of _0x5dc3d4){if('document'===_0x569f71['type'])continue;const _0x13f5aa=await this['_createContextItemFromContent'](_0x569f71);this['_addToConversationContextItem'](_0x13f5aa),_0x341316['set'](_0x13f5aa['id'],_0x13f5aa);}return{'contextItems':_0x341316,'hasUnmatched':_0x3254db};}async['_populateDocumentContextItem'](_0x3f8dbe,_0x47a0df){const _0x1d0fb8=_0x3f8dbe['filter'](_0x2a9105=>'document'===_0x2a9105['type']);if(0x0===_0x1d0fb8['length'])return{'hasUnmatched':!0x1};const _0x43c43f=_0x1d0fb8['map'](_0x4c3f7c=>_0x4c3f7c['id']),_0x1760f5=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x43c43f)['getDocuments'](),_0x33f444=new Map(_0x1760f5['map'](_0x444a2e=>[_0x444a2e['id'],_0x444a2e])),_0x172710=[];let _0x463f0d=!0x1;for(const _0x13d9fa of _0x1d0fb8){const _0x24912e=_0x33f444['get'](_0x13d9fa['id']);_0x24912e&&(this['_matchDocumentToRoot'](_0x24912e,_0x47a0df)||(_0x463f0d=!0x0),_0x172710['push']({'id':_0x24912e['id'],'content':_0x24912e['content'],'version':_0x24912e['attributes']?.['version']??0x0,'sessionId':_0x24912e['attributes']?.['sessionId']??null,'selection':[],'channelId':_0x24912e['attributes']?.['channelId']??_0x47a0df[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x24912e['attributes']?.['rootName']??_0x47a0df[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??''}));}const _0xfa9646={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x172710};return this['_addToConversationContextItem'](_0xfa9646),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0xfa9646,'hasUnmatched':_0x463f0d};}['_matchDocumentToRoot'](_0xca0ae4,_0x3bf89f){const _0x4d3327=_0xca0ae4['attributes']?.['channelId'],_0x46fdab=_0xca0ae4['attributes']?.['rootName'];if(_0x4d3327&&_0x46fdab){for(const _0x4b796c of _0x3bf89f)if(_0x4b796c['config']['get']('collaboration.channelId')===_0x4d3327){for(const _0x3993b5 of _0x4b796c['model']['document']['getRoots']())if('$graveyard'!==_0x3993b5['rootName']&&_0x3993b5['rootName']===_0x46fdab)return{'editor':_0x4b796c,'rootName':_0x3993b5['rootName']};}}}async['_createContextItemFromContent'](_0x3f913c){return'mcp-tool-context'===_0x3f913c['type']?{'id':_0x3f913c['id'],'uiId':_0x3f913c['id'],'label':_0x3f913c['data']?.['label']||_0x3f913c['id'],'type':'mcp-tool-context','mcpServerName':_0x3f913c['mcpServerName'],'toolName':_0x3f913c['toolName'],'data':_0x3f913c['data']||{}}:{'id':_0x3f913c['id'],'uiId':_0x3f913c['id'],'label':_0x3f913c['attributes']?.['label']||_0x3f913c['name']||_0x3f913c['url']||_0x3f913c['id'],'type':_0x3f913c['type'],..._0x3f913c?.['attributes']?.['resourceId']?{'resourceId':_0x3f913c['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x50d469){this['_pendingContextItems']['get'](_0x50d469)?.['isReadOnly']||this['_removeContextItem'](_0x50d469);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2087a8 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2087a8['uiId']);const _0x14a32b=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x14a32b&&this['_addContextItem']({..._0x14a32b,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3c33b1){for(const _0x3f0ff6 of _0x3c33b1['values']())this['_addToConversationContextItem'](_0x3f0ff6);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'](_0xbbfc35){return Array['from'](_0xbbfc35['values']())['flatMap'](_0xc57fc7=>this['_mapContextItemToRequestData'](_0xc57fc7));}async['addFilesToContext'](_0x4ca43f,_0x1ae75b,_0x442b5a='file'){const _0x52a958='files-'+vt();this['_startUploadOperation'](_0x52a958);try{await Promise['all'](_0x4ca43f['map'](async _0x50943d=>{const _0x4719b5='file-'+vt(),_0x16757b=_0x5a08e5(_0x50943d['name']),_0x31caff='file'===_0x442b5a&&_0x50943d['type']['startsWith']('image/')?'image':_0x442b5a;try{this['_addContextItem']({'type':_0x31caff,'label':_0x1ae75b?.['label']||_0x16757b,'uiId':_0x4719b5,'resourceId':_0x1ae75b?.['resourceId']},!0x0);const _0x553e73=this['_connector']['uploadFile'](this['_ownerId'],_0x50943d,_0x1ae75b);this['_ongoingUploads']['set'](_0x4719b5,_0x553e73['abortController']);const {id:_0x19e87b}=await _0x553e73['getId']();this['_ongoingUploads']['delete'](_0x4719b5),this['_finishContextItemLoading']({'type':_0x31caff,'id':_0x19e87b,'label':_0x1ae75b?.['label']||_0x16757b,'uiId':_0x4719b5,'resourceId':_0x1ae75b?.['resourceId']},!0x1);}catch(_0x4046d4){if(this['_ongoingUploads']['delete'](_0x4719b5),!en(_0x4046d4)){const _0x51fc09=new sn({'code':In['get'](_0x4046d4['code'])||'ai-chat-file-upload-failed','cause':_0x4046d4,'context':{'fileName':_0x16757b}});this['fire']('error',{'error':_0x51fc09});}this['_removeContextItem'](_0x4719b5);}}));}finally{this['_finishUploadOperation'](_0x52a958);}}['addCurrentDocumentToContext'](_0xa70779){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x7662b2={'type':'document','uiId':'current-document','label':_0xa70779,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x7662b2);}async['updateCurrentDocuments'](_0x116855){const _0x48857f=this['_pendingContextItems']['get']('current-document');if(!_0x48857f||!_0x116855['length']||_0x116855['every'](_0x382091=>!_0x382091['content']))return;_0x116855['length']>0x1&&_0x116855['some'](_0x2ada74=>!_0x2ada74['description'])&&bt('ai-chat-documents-missing-description');try{const _0x328928=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x116855)['getIds']();if(_0x328928['length']!==_0x116855['length']||_0x328928['some'](_0x740088=>!_0x740088?.['id'])){const _0x3e620e=new ht('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x3e620e});}_0x48857f['documents']=_0x116855['map']((_0x33c14d,_0x1efb66)=>{return{'id':_0x328928[_0x1efb66]['id'],'content':_0x33c14d['content'],'version':_0x33c14d['version'],'sessionId':_0x33c14d['sessionId'],'selection':(_0x43a3d7=_0x33c14d['selections'],_0x43a3d7?_0x43a3d7['map'](_0x42ad3c=>({'start':_0x42ad3c['start'],'end':_0x42ad3c['end']})):[]),'channelId':_0x33c14d['channelId'],'rootName':_0x33c14d['rootName']};var _0x43a3d7;});}catch(_0x25302c){const _0x3f4c0a=new sn({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x25302c});this['fire']('error',{'error':_0x3f4c0a});}}['addSelectionToContext'](_0x2ca670){this['_addContextItem']({'type':'selection','label':_0x2ca670,'uiId':'selection','content':_0x2ca670});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x34d5e9,_0x21bb63){const _0x337ddd='url-'+vt();this['_startUploadOperation'](_0x337ddd);const _0x234c91='url-'+vt();try{this['_addContextItem']({'type':'web-resource','label':_0x21bb63?.['label']||_0x34d5e9,'uiId':_0x234c91,'resourceId':_0x21bb63?.['resourceId']},!0x0);const _0x39e92b=this['_connector']['uploadUrl'](this['_ownerId'],_0x34d5e9,_0x21bb63);this['_ongoingUploads']['set'](_0x234c91,_0x39e92b['abortController']);const {id:_0x48a654}=await _0x39e92b['getId']();this['_ongoingUploads']['delete'](_0x234c91),this['_finishContextItemLoading']({'type':'web-resource','id':_0x48a654,'label':_0x21bb63?.['label']||_0x34d5e9,'uiId':_0x234c91,'resourceId':_0x21bb63?.['resourceId']},!0x1);}catch(_0x4fffe1){this['_ongoingUploads']['delete'](_0x234c91),en(_0x4fffe1)||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x34d5e9,'originalError':_0x4fffe1}),'url':_0x34d5e9}),this['_removeContextItem'](_0x234c91);}finally{this['_finishUploadOperation'](_0x337ddd);}}['addToolItemToContext'](_0x39f580){_0x39f580['id']=_0x39f580['id']??vt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x39f580['uiId'],_0x39f580),this['fire']('contextItemAdded',{'contextItem':_0x39f580,'isLoading':!0x1});}async['loadSourceResources'](_0x1afd5e,_0x220b09,_0x39c8a6){const _0x111e2c=this['_addContextOptionsState']['sources']['find'](_0x1eb388=>_0x1eb388['id']===_0x1afd5e);if(!_0x111e2c)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x1afd5e}),'sourceId':_0x1afd5e}),[];try{const _0x2a7ab5=(await _0x111e2c['getResources'](_0x220b09))['map'](_0x5bd435=>{const _0x4c5fd9=this['_isResourceInContext'](_0x5bd435['id']);return{..._0x5bd435,'isInContext':_0x4c5fd9};});return _0x111e2c['resources']=_0x2a7ab5,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1afd5e,'source':_0x111e2c,'resources':_0x2a7ab5,'uid':_0x39c8a6}),_0x2a7ab5;}catch(_0x44561c){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1afd5e,'originalError':_0x44561c}),'sourceId':_0x1afd5e,'sourceLabel':_0x111e2c['label']}),[];}}async['addResourceToContext'](_0x40e7fa,_0x45b748){if(this['_isResourceInContext'](_0x45b748['id']))return;let _0x2e6633=_0x45b748['data'];if(!_0x2e6633&&_0x40e7fa['getData'])try{_0x2e6633=await _0x40e7fa['getData'](_0x45b748['id']);}catch(_0x5bea60){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id'],'originalError':_0x5bea60}),'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']});}if(_0x2e6633)switch(_0x45b748['type']){case'web-resource':if('string'!=typeof _0x2e6633)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id'],'expectedType':'string','actualType':typeof _0x2e6633}),'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']});await this['addUrlToContext'](_0x2e6633,{'label':_0x45b748['label'],'resourceId':_0x45b748['id']});break;case'file':if(!(_0x2e6633 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id'],'expectedType':'File','actualType':typeof _0x2e6633}),'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']});await this['addFilesToContext']([_0x2e6633],{'label':_0x45b748['label'],'resourceId':_0x45b748['id']});break;case'text':if('object'!=typeof _0x2e6633||!('content'in _0x2e6633)||!('type'in _0x2e6633))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2e6633}),'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']});_0x2e6633=AIChatContext['_convertTextResourceToFile'](_0x2e6633,_0x45b748['label']),await this['addFilesToContext']([_0x2e6633],{'label':_0x45b748['label'],'resourceId':_0x45b748['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id'],'resourceType':_0x45b748['type']}),'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']}),'resourceId':_0x45b748['id'],'sourceId':_0x40e7fa['id']});}['toggleAddCurrentDocumentOptionVisibility'](_0x5a4bf8){if(void 0x0!==_0x5a4bf8)this['_addContextOptionsState']['document']['isHidden']=!_0x5a4bf8;else{const _0x3e4ee5=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3e4ee5;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static['_convertTextResourceToFile'](_0x89d2fa,_0x588ef2){switch(_0x89d2fa['type']){case'markdown':return new File([_0x89d2fa['content']],_0x588ef2,{'type':'text/markdown'});case'html':return new File([_0x89d2fa['content']],_0x588ef2,{'type':'text/html'});default:return new File([_0x89d2fa['content']],_0x588ef2,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x58cbe9){switch(_0x58cbe9['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x58cbe9['id']}];case'web-resource':return[{'type':'web-resource','id':_0x58cbe9['id']}];case'document':return _0x58cbe9['documents']?.['length']?_0x58cbe9['documents']['map'](_0x4043e0=>({'type':'document','id':_0x4043e0['id'],..._0x4043e0['selection']?.['length']&&{'selection':_0x4043e0['selection']}})):[];case'mcp-tool-context':{const _0xf892da=_0x58cbe9;return[{'type':'mcp-tool-context','mcpServerName':_0xf892da['mcpServerName'],'toolName':_0xf892da['toolName'],'data':{..._0xf892da['data'],'label':_0xf892da['label']||_0xf892da['data']?.['label']||_0xf892da['id']},'id':_0xf892da['id']}];}default:return[];}}['_addContextItem'](_0x286487,_0x6bee2d=!0x1){if(this['_pendingContextItems']['set'](_0x286487['uiId'],_0x286487),_0x286487['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x286487,'isLoading':_0x6bee2d}),'current-document'===_0x286487['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x286487['resourceId']){const _0x26fc14=this['_findSourceIdsByResourceId'](_0x286487['resourceId']);_0x26fc14&&_0x26fc14['forEach'](_0x4ec410=>{this['_updateResourceInContextState'](_0x4ec410,_0x286487['resourceId'],!0x0);});}}['_removeContextItem'](_0x2dd90f){const _0x20e70a=this['_pendingContextItems']['get'](_0x2dd90f),_0x93033f=this['_ongoingUploads']['get'](_0x2dd90f);if(_0x93033f&&(_0x93033f['abort'](),this['_ongoingUploads']['delete'](_0x2dd90f)),_0x20e70a?.['resourceId']){const _0x227a66=this['_findSourceIdsByResourceId'](_0x20e70a['resourceId']);_0x227a66&&_0x227a66['forEach'](_0x59285a=>{this['_updateResourceInContextState'](_0x59285a,_0x20e70a['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2dd90f),this['fire']('contextItemRemoved',{'uiId':_0x2dd90f,'type':_0x20e70a?.['type']}),'current-document'===_0x2dd90f&&this['toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x123c32,_0x204f63){if(this['_pendingContextItems']['has'](_0x123c32['uiId'])&&(this['_pendingContextItems']['set'](_0x123c32['uiId'],_0x123c32),this['fire']('contextItemLoadingEnded',{'contextItem':_0x123c32,'isLoading':_0x204f63}),_0x123c32['resourceId'])){const _0x181642=this['_findSourceIdsByResourceId'](_0x123c32['resourceId']);_0x181642&&_0x181642['forEach'](_0x2da926=>{this['_updateResourceInContextState'](_0x2da926,_0x123c32['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x15f1a9){this['_conversationContextItems']['set'](_0x15f1a9['uiId'],_0x15f1a9);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x46c488=>({..._0x46c488,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1a2f67=>({..._0x1a2f67,'resources':[]}))??[];}['_isResourceInContext'](_0xd3247f){for(const _0x1a53b5 of this['_pendingContextItems']['values']())if(_0x1a53b5['resourceId']===_0xd3247f)return!0x0;for(const _0x14ec7a of this['_conversationContextItems']['values']())if(_0x14ec7a['resourceId']===_0xd3247f)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x47ae5b){const _0x28d60a=[];for(const _0x43ba44 of this['_addContextOptionsState']['sources'])_0x43ba44['resources']['find'](_0x5532ca=>_0x5532ca['id']===_0x47ae5b)&&_0x28d60a['push'](_0x43ba44['id']);return 0x0===_0x28d60a['length']?null:_0x28d60a;}['_updateResourceInContextState'](_0x575daf,_0x211c4b,_0x508c36){const _0x2e1c47=this['_addContextOptionsState']['sources']['find'](_0xe7d0a6=>_0xe7d0a6['id']===_0x575daf);if(!_0x2e1c47)return;const _0xacce0a=_0x2e1c47['resources']['find'](_0x1b2f56=>_0x1b2f56['id']===_0x211c4b);_0xacce0a&&(_0xacce0a['isInContext']=_0x508c36,this['fire']('resourceStateChanged',{'sourceId':_0x575daf,'resourceId':_0x211c4b,'isInContext':_0x508c36}));}['_startUploadOperation'](_0xb3627f){this['_ongoingUploadOperations']['set'](_0xb3627f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x16ff07){this['_ongoingUploadOperations']['delete'](_0x16ff07),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}};const Tn=/* #__PURE__ -- @preserve */
31
- ut(),wn=['capabilitiesUpdated'];var Cn=class extends Tn{['_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'](_0x190726){const _0x38ea06={};return _0x190726&&_0x190726['isWebSearchEnabled']&&(_0x38ea06['webSearch']={}),_0x190726&&_0x190726['isReasoningEnabled']&&(_0x38ea06['reasoning']={}),_0x38ea06;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x17890e){_0x17890e!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x17890e,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2cf077){_0x2cf077!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2cf077,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}},fn=class extends An{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x31b62c){super(_0x31b62c),this['conversationId']=_0x31b62c['conversationId'],this['contextItems']=_0x31b62c['contextItems'],this['capabilities']=_0x31b62c['capabilities'],this['userMessage']=_0x31b62c['userMessage'],this['model']=_0x31b62c['model'],this['attributes']=_0x31b62c['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':En['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Cn['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}};const bn=/* #__PURE__ -- @preserve */
32
- ut();var Sn=class extends bn{['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];['_channelsToEditors'];['_getSessionId'];constructor(_0x29390c){super(),this['options']=_0x29390c,this['connector']=_0x29390c['connector'],this['chatModels']=_0x29390c['chatModels'],this['id']=_0x29390c['conversationId'],this['isFromHistory']=_0x29390c['isFromHistory'],this['_channelsToEditors']=_0x29390c['channelsToEditors'],this['_getSessionId']=_0x29390c['getSessionId'];}async['init'](_0x5c916a){try{this['chatContext']=new En({'connector':this['connector'],'config':_0x5c916a,'ownerId':this['id']}),this['chatContext']['delegate'](...mn)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Cn(),this['chatCapabilities']['delegate'](...wn)['to'](this),this['chatCapabilities']['init']();const _0x52ed48=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x52ed48});const _0x279d4b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x279d4b&&await this['setModel'](_0x279d4b);}catch(_0x5f1f1b){const _0x2e9c7c=new sn({'code':'ai-chat-conversation-init-failed','cause':_0x5f1f1b,'type':'network'});this['fire']('error',{'error':_0x2e9c7c});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x36edad}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x36edad,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x43c502){const _0xb9d46d=new sn({'code':'ai-chat-conversation-start-failed','cause':_0x43c502,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0xb9d46d}),_0xb9d46d;}}async['load'](_0x7012ae){try{const _0x421859=await this['connector']['fetchConversation'](_0x7012ae)['getConversation'](),_0x4a2fd0=await this['connector']['fetchConversationMessages'](_0x7012ae)['getMessages'](),_0x596b3b=_0x4a2fd0[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x421859['id'],'title'in _0x421859?this['fire']('setConversationTitle',_0x421859['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']);const _0xab1061=(await this['chatModels']['getAll']())['find'](_0x45a968=>_0x45a968['id']['toLowerCase']()===_0x596b3b['toLowerCase']());this['selectedModel']=_0xab1061,this['fire']('modelSelected',{'selectedModel':_0xab1061,'isDisabled':!0x0});const {streamingMessageId:_0x112824}=await this['_processMessagesToInteractions'](_0x4a2fd0,_0x596b3b);return _0x112824&&this['currentInteraction']?this['_resumeStream'](_0x112824):this['currentInteraction']=void 0x0,this;}catch(_0xfac5bf){const _0x3d3a57=new sn({'code':'ai-chat-conversation-init-from-id-failed','cause':_0xfac5bf,'type':'network','context':{'conversationId':_0x7012ae}});throw this['fire']('error',{'error':_0x3d3a57}),_0x3d3a57;}}async['_processMessagesToInteractions'](_0x18fce9,_0x205e4b){let _0x1bd0e0,_0x2fc789,_0x225ed4=!0x1;for(const _0x3655d0 of _0x18fce9)if('user'===_0x3655d0['role']){const {contextItems:_0x39574a,hasUnmatched:_0x58e14d}=await this['_extractContextItems'](_0x3655d0);_0x225ed4=_0x58e14d;const _0x402c03={'isReasoningEnabled':Object['hasOwn'](_0x3655d0['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3655d0['capabilities'],'webSearch')};_0x1bd0e0=this['createInteraction']({'userMessage':_0x3655d0['prompt'],'contextItems':_0x39574a,'capabilities':_0x402c03,'modelId':_0x205e4b,'attributes':_0x3655d0['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x1bd0e0,_0x2fc789=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3655d0['role']&&_0x1bd0e0){if('streaming'===_0x3655d0['status']){_0x2fc789=_0x3655d0['id'];continue;}if('error'===_0x3655d0['status'])continue;const _0x4bb59f=[];for(const _0x90b0c9 of _0x3655d0['content'])switch(_0x90b0c9['type']){case'text':case'modification':{const _0x1913c8=_0x1bd0e0['getDocumentContext'](),_0x28c15f=this['_hasSessionMismatch'](_0x1913c8)||_0x225ed4;_0x1bd0e0['currentReply']?.['type']!==_0x90b0c9['type']&&(_0x1bd0e0['currentReply']=_0x1bd0e0['createReply']({'type':_0x90b0c9['type'],'isDone':!0x0,'interactionId':_0x1bd0e0['id'],'areActionsDisabled':_0x28c15f,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x4bb59f['length']>0x0&&(_0x1bd0e0['currentReply']['sources']=_0x4bb59f['splice'](0x0))),_0x1bd0e0['currentReply']['appendContent'](_0x90b0c9['content'],_0x90b0c9['documentId']);break;}case'url':_0x4bb59f['push'](_0x90b0c9);break;case'mcp-tool-result':{const {data:_0x770408,attributes:_0x334439}=JSON['parse'](_0x90b0c9['content']);_0x1bd0e0['_handleToolResultData']({'toolName':_0x90b0c9['toolName'],'data':_0x770408,'attributes':_0x334439});break;}}'cancelled'===_0x3655d0['status']&&this['fire']('error',{'interactionId':_0x1bd0e0['id'],'error':new ht('ai-request-aborted',this)});}}return{'streamingMessageId':_0x2fc789};}async['_resumeStream'](_0x3ca97d){if(this['currentInteraction'])try{const _0xe3e3d5=this['connector']['resumeStream'](this['id'],_0x3ca97d);await this['currentInteraction']['resume'](_0xe3e3d5);}catch(_0x5e9c48){_0x5e9c48 instanceof ht&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x5e9c48});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async['_extractContextItems'](_0x29a811){return _0x29a811['content']?this['chatContext']['populateFromMessage'](_0x29a811['content'],Array['from'](this['_channelsToEditors']['values']())):{'contextItems':new Map(),'hasUnmatched':!0x1};}async['handleUserInteraction']({userMessage:_0x1a9ce9,attributes:_0x51adf8}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x228ab3=new Map(this['getPendingContextItems']()),_0x4b42a1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1e5ba8=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x1a9ce9,'contextItems':_0x228ab3,'capabilities':_0x4b42a1,'modelId':_0x1e5ba8,'attributes':_0x51adf8,'channelsToEditors':this['_channelsToEditors']}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3cd52b){if(_0x3cd52b instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3cd52b});else{const _0x58c63d=In['get'](_0x3cd52b['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x58c63d,null,{'error':_0x3cd52b})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x21aeb0,contextItems:_0x361de0,capabilities:_0x4cce54,modelId:_0xb7c96b,attributes:_0x2128d8,channelsToEditors:_0x1daf66}){const _0x5f00b6=new fn({'userMessage':_0x21aeb0,'contextItems':_0x361de0,'capabilities':_0x4cce54,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0xb7c96b,'attributes':_0x2128d8,'channelsToEditors':_0x1daf66});return _0x5f00b6['delegate'](...gn)['to'](this),this['interactions']['push'](_0x5f00b6),this['fire']('interactionCreated',_0x5f00b6),_0x5f00b6;}['getInteraction'](_0x545b5f){return this['interactions']['find'](_0x77ade9=>_0x77ade9['id']===_0x545b5f);}['removeInteraction'](_0x18c19c){const _0x768b09=this['getInteraction'](_0x18c19c);_0x768b09&&(_0x768b09['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x768b09),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['cancelLastInteractionStream'](){const _0x358cce=this['lastInteraction'];_0x358cce?.['conversationId']&&_0x358cce['messageId']&&this['connector']['cancelStream'](_0x358cce['conversationId'],_0x358cce['messageId'])['execute']()['catch'](()=>{});}['addCurrentDocumentToContext'](_0x1a2853){this['chatContext']['addCurrentDocumentToContext'](_0x1a2853);}async['updateCurrentDocumentsInContext'](_0x1947c6){await this['chatContext']['updateCurrentDocuments'](_0x1947c6);}['toggleAddCurrentDocumentOptionVisibility'](_0x30730c){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x30730c);}['_hasSessionMismatch'](_0x2e1e4c){return!!_0x2e1e4c&&_0x2e1e4c['documents']['some'](_0x1b9ffa=>{const _0x70bb25=this['_channelsToEditors']['get'](_0x1b9ffa['channelId']);return!_0x70bb25||_0x1b9ffa['sessionId']!==this['_getSessionId'](_0x70bb25);});}['addSelectionToContext'](_0x182537){this['chatContext']['addSelectionToContext'](_0x182537);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x4380ea){this['chatContext']['addFilesToContext'](_0x4380ea);}['addUrlToContext'](_0x1547fb){this['chatContext']['addUrlToContext'](_0x1547fb);}['addToolItemToContext'](_0x5be2fc){this['chatContext']['addToolItemToContext'](_0x5be2fc);}['addResourceToContext'](_0x4bd75a,_0x37b585){this['chatContext']['addResourceToContext'](_0x4bd75a,_0x37b585);}['loadSourceResources'](_0xac83fe,_0x42e10c,_0x5038c3){return this['chatContext']['loadSourceResources'](_0xac83fe,_0x42e10c,_0x5038c3);}['removeFromContext'](_0x50370b){this['chatContext']['removeFromContext'](_0x50370b);}['setWebSearch'](_0xe909f7){this['chatCapabilities']['setWebSearch'](_0xe909f7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x419560){this['chatCapabilities']['setReasoning'](_0x419560);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}['getPendingContextItems'](){return this['chatContext']['getPendingContextItems']();}async['setModel'](_0x1d6482){_0x1d6482?!0x1===await this['chatModels']['isAvailable'](_0x1d6482)&&(bt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1d6482}),_0x1d6482=(await this['chatModels']['getAvailableModels']())[0x0]):(bt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1d6482=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1d6482['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1d6482,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1d6482}));}};function Rn({documentSuggestions:_0x114f04,transform:_0x501e72,documentCompare:_0x2043e1,documentCompareOptions:_0x3c2044}){const _0x3007ec=new Map();for(const [_0x1c0f33,{groups:_0x4fbed1,documentContext:_0x241fe5,documentContent:_0x1dfb23,editor:_0x478ea2}]of _0x114f04){const _0xf3ca34=_0x241fe5['content'],_0x514b48=_0x241fe5['version'],_0x275e8f=_0x1dfb23['cloneNode'](!0x0);for(const {changes:_0x638d92}of _0x4fbed1){const _0x53132d=_0x638d92['filter'](_0x2bdd50=>'new'!=_0x2bdd50['type'])['map'](_0x2a0ccf=>Es('data-id',_0x2a0ccf['id'],_0x275e8f))['filter'](_0x37e65f=>null!==_0x37e65f),_0x2b64a7=_0x638d92['filter'](_0x49991a=>'removed'!=_0x49991a['type'])['map'](_0x121063=>_0x121063['node']['cloneNode'](!0x0));let _0x153d0a=null;if(_0x53132d['length']){_0x153d0a=_0x53132d[0x0]['previousSibling'];for(let _0x4ddc0f=0x0;_0x4ddc0f<_0x53132d['length'];_0x4ddc0f++)_0x3baafe(_0x53132d[_0x4ddc0f]);}if(_0x2b64a7['length']){_0x153d0a||(_0x638d92[0x0]['anchorId']?_0x153d0a=Es('data-id',_0x638d92[0x0]['anchorId'],_0x275e8f):(_0x153d0a=_0x2b64a7['shift'](),_0x405cf6(_0x275e8f,_0x153d0a)));for(let _0x57e2d5=0x0;_0x57e2d5<_0x2b64a7['length'];_0x57e2d5++)_0x873879(_0x153d0a,_0x2b64a7[_0x57e2d5]),_0x153d0a=_0x2b64a7[_0x57e2d5];}}const _0x5ae632=ms(_0x275e8f),_0x109b54=_0x2043e1['getDiff'](_0xf3ca34,_0x5ae632,{'targetEditor':_0x478ea2,'anchor':_0x241fe5['rootName'],..._0x3c2044})['getOperations']();if(_0x501e72){const _0x501438=_0x478ea2['model']['document']['history']['getOperations'](_0x514b48),_0x22ee77={'document':_0x478ea2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x3007ec['set'](_0x1c0f33,_0x5be051(_0x109b54,_0x501438,_0x22ee77)['operationsA']);}else _0x3007ec['set'](_0x1c0f33,_0x109b54);}return _0x3007ec;}function On({groups:_0x3f0bcd,documentContextContent:_0x27bd2f,documents:_0x1026b5}){const _0x465972=new Map();for(const _0x18274f of _0x3f0bcd){const {documentId:_0x3a92de}=_0x18274f,_0x26905a=_0x465972['get'](_0x3a92de);if(_0x26905a)_0x26905a['groups']['push'](_0x18274f),_0x26905a['indexes']['push'](_0x18274f['index']);else{const _0x475d7d=_0x1026b5['find'](_0x961906=>_0x961906['id']===_0x3a92de),_0x5a5b7f=_0x27bd2f['get'](_0x3a92de);if(!_0x475d7d||!_0x5a5b7f)continue;_0x465972['set'](_0x3a92de,{'groups':[_0x18274f],'documentContext':_0x475d7d,'documentContent':_0x5a5b7f,'editor':_0x18274f['editor'],'indexes':[_0x18274f['index']]});}}return _0x465972;}function vn(_0x4e9a9d,_0xd776ed){const _0x4485cc=_0x4e9a9d['files']['length']>0x0&&_0x4e9a9d['files']['every'](_0x56844a=>_0x56844a['type']['startsWith']('image/')),_0x6fd469=_0x4e9a9d['plainText']['trim']()['length']>0x0;if(_0x4e9a9d['files']['length']>0x0&&_0xd776ed['filesEnabled']&&(!_0x4485cc||!_0x6fd469)){const _0x54f481=_0x4e9a9d['files']['filter'](_0x13e943=>_0x13e943['name']);return _0x54f481['length']>0x0?{'type':'file','files':_0x54f481}:null;}if(_0xd776ed['urlsEnabled']){const _0x44d087=function(_0x335724){const _0x5cbee2=_0x335724['trim']();if(/\s/['test'](_0x5cbee2))return null;try{const _0x58e116=new URL(_0x5cbee2);return'http:'!==_0x58e116['protocol']&&'https:'!==_0x58e116['protocol']?null:_0x58e116['toString']();}catch{return null;}}(_0x4e9a9d['plainText']);if(_0x44d087)return{'type':'url','url':_0x44d087};}const _0x37718e=_0x4e9a9d['forceTextAttachment']?0x1:_0xd776ed['longTextThreshold']??0x1/0x0;if(_0x4e9a9d['plainText']['length']>=Math['max'](_0x37718e,0x1)&&_0xd776ed['filesEnabled']){const _0x2d86db=_0xd776ed['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x4e9a9d['plainText']],_0x2d86db,{'type':'text/plain'})]};}return null;}var kn=class extends _0x11a14c{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_hasAIChatBalloon']=!0x1;['_activeBalloon'];['_reporter'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];['_channelsToEditors']=new Map();static get['requires'](){return[ls,nn,_0x1f6a74];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['set']('isConversationReady',!0x1),this['_bodyCollection']=ln(this['context']['locale']),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aichat'),this['_aiChatModels']=new Qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x3a13ae=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5074c6,_0x14743c)=>{this['_handleUIUserMessage']({'message':_0x14743c});}),this['listenTo'](_0x3a13ae['view'],'change:activeTab',(_0xddb0b8,_0x1a7b41,_0x2539c3)=>{'chat'!==_0x2539c3&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext'](),this['activeConversation']?.['cancelLastInteractionStream']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5b58db,_0x4acca7)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4acca7));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3db229,_0x3b77ea)=>{this['activeConversation']?.['addUrlToContext'](_0x3b77ea);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x220568,_0x2e9832)=>{const _0x2408df=this['activeConversation'];if(!_0x2408df)return;_0x2e9832['hasDirectory']&&(_0x2e9832['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+vt()}));const _0x169e3d=vn(_0x2e9832,{'pastedTextLabel':us(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x169e3d&&(_0x2e9832['preventDefault'](),'url'===_0x169e3d['type']?_0x2408df['addUrlToContext'](_0x169e3d['url']):_0x2408df['chatContext']['addFilesToContext'](_0x169e3d['files'],void 0x0,_0x169e3d['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x908017,_0x3aeffe)=>{_0x3aeffe['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x3be6ac,_0xd16c31)=>{this['activeConversation']?.['addResourceToContext'](_0xd16c31['source'],_0xd16c31['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4352de,_0x1dd418)=>{this['_removeFromContext'](_0x1dd418);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x534faa,_0x492780)=>{this['activeConversation']?.['loadSourceResources'](_0x492780['sourceId'],_0x492780['query'],_0x492780['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3035e8,_0xa32f30)=>{this['activeConversation']?.['setModel'](_0xa32f30);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4255c2,{replyId:_0x3aa8f1})=>{console['log']('Liked\x20response',_0x3aa8f1);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x37c7f4,{replyId:_0x4e8491})=>{console['log']('Disliked\x20response',_0x4e8491);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xa54689,_0x60682a)=>{this['_insertSuggestion'](_0x60682a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x3bb411,{replyId:_0x26ff64,partIndex:_0x6ab622})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x26ff64,_0x6ab622);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x4c4971,{replyId:_0x3d280c,partIndex:_0xb1d155})=>{const _0x3042bb=this['_getDocumentRangeForReplyChanges'](_0x3d280c,_0xb1d155);if(!_0x3042bb)return;const {reply:_0x472c1c}=this['getInteractionAndReplyById'](_0x3d280c);'$graveyard'!=_0x3042bb['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x472c1c['changeGroups'][_0xb1d155]['editor'],'ranges':[_0x3042bb['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x1683d,_0x2fbcf9)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x2fbcf9);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x57b7b1,{replyId:_0x538ddf,showDiff:_0x1fed97})=>{const {interaction:_0x358a5d,reply:_0x577fc6}=this['getInteractionAndReplyById'](_0x538ddf),_0x33c0b2=_0x577fc6['getContentParts']({'showDiff':_0x1fed97});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x358a5d['id']+':'+_0x577fc6['id'],'parts':_0x33c0b2});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2e171e,{replyId:_0x326b5f,partIndex:_0x33ee1a})=>{this['_rejectSuggestion']({'replyId':_0x326b5f,'partIndex':_0x33ee1a}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x43e237,_0x1ffaba)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1ffaba);}),this['on']('replyCreated',(_0x18969b,_0x3b8b15)=>{this['_addFeedItemReply'](_0x3b8b15);});}['afterInit'](){this['context']instanceof _0x423f99?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x559ba1,_0x49498d)=>{_0x49498d['on']('ready',()=>{this['_integrateEditor'](_0x49498d);});}),this['_initConversation']();}async['_initConversation'](){const _0x16abfe=this['context']['config']['get']('ai.chat.initialConversation');let _0x52c834=_0x16abfe;('lastCreated'!=_0x16abfe||(_0x52c834=await this['_getLastCreatedConversationId'](),_0x52c834))&&('new'==_0x52c834?await this['_startConversationSafely']():await this['loadConversation'](_0x52c834));}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x3f06fd){this['_closeActiveBalloon'](),this['context']['plugins']['get'](cs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']();try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x3f06fd)['getConversation'](),await this['_startConversationSafely']({'id':_0x3f06fd}),await this['activeConversation']['load'](_0x3f06fd),this['_aiChatUi']['enableControls'](),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x7dc6ff){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x3f06fd}),this['_reporter']['logError'](new ht('ai-chat-conversation-not-found',this,void 0x0,_0x7dc6ff),{'context':{'operation':'load-conversation'}});}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x5b0d59){let _0x534990=null,_0x49bf53=null;this['on']('toolDataReceived',(_0x43215b,_0x2d2732,_0x2152ce)=>{_0x2152ce['id']!==_0x534990&&(_0x534990=_0x2152ce['id'],_0x49bf53=this['_getAIChatFeedAPI'](_0x2152ce)),_0x5b0d59(_0x2d2732,_0x49bf53);});}['addCurrentDocumentToChatContext'](){ds(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](_0x984e77){const _0xd3fc91=this['_aiEditing']['getSelectionText'](_0x984e77);this['activeConversation']?.['addSelectionToContext'](_0xd3fc91),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x42e515){await this['_startConversationSafely']({'modelId':_0x42e515?.['modelId']});}async['sendMessage'](_0x2e8fd6){await this['_handleUIUserMessage'](_0x2e8fd6);}['getGroupId'](){const _0x454577=this['context']['config']['get']('collaboration.channelId');if(!_0x454577)throw new ht('ai-missing-channel-id',this);return _0x454577;}['_handleRemovedConversation'](_0x189d1d){this['activeConversation']['id']===_0x189d1d&&this['_startConversationSafely']();}['_prepareDocumentSuggestions'](_0x28b8ba){const {reply:_0x1f94b3,interaction:_0x3531c9}=this['getInteractionAndReplyById'](_0x28b8ba['replyId']),_0xd90b2=void 0x0!==_0x28b8ba['partIndex']?[_0x1f94b3['changeGroups'][_0x28b8ba['partIndex']]]:_0x1f94b3['changeGroups']['filter'](_0x3d7f98=>'pending'==_0x3d7f98['state']);return _0xd90b2['map'](_0x4803d4=>_0x1f94b3['changeGroups']['indexOf'](_0x4803d4))['forEach'](_0x504b7d=>{const _0x1f9450=this['_getDocumentRangeForReplyChanges'](_0x28b8ba['replyId'],_0x504b7d);_0x1f9450&&'$graveyard'!=_0x1f9450['range']['root']['rootName']?(_0x1f94b3['setChangeGroupState'](_0x504b7d,'accepted'),void 0x0!==_0x28b8ba['partIndex']&&this['_scrollToSuggestionRange'](_0x1f9450['range'],!0x1,_0x1f9450['targetEditor'])):_0x1f94b3['setChangeGroupState'](_0x504b7d,'outdated');}),On({'groups':_0xd90b2['filter'](_0x399e62=>'accepted'===_0x399e62['state']),'documentContextContent':_0x1f94b3['documentContextContent'],'documents':_0x3531c9['getDocumentContext']()?.['documents']??[]});}['_insertSuggestion'](_0x27dba4){const _0x5a8dec=this['context']['plugins']['get'](_0x1f6a74),{reply:_0x117c3d,interaction:_0x36dc06}=this['getInteractionAndReplyById'](_0x27dba4['replyId']),_0x49fe4e=this['_prepareDocumentSuggestions'](_0x27dba4),_0x594372=Rn({'documentSuggestions':_0x49fe4e,'transform':!0x0,'documentCompare':_0x5a8dec,'documentCompareOptions':{'markDeletions':!0x0}});for(const [_0x569498,_0x51001f]of _0x594372){const {editor:_0x3db344,indexes:_0x2bdd88}=_0x49fe4e['get'](_0x569498);if(!_0x3db344['plugins']['has']('TrackChanges')){bt('ai-no-track-changes',{'editor':_0x3db344});continue;}let _0x1f0180;zs(_0x51001f,'chat'),_0x3db344['model']['change'](_0x383e18=>{_0x1f0180=_0x383e18['batch'],_0x3db344['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x51001f),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x1f0180,{'interactionId':_0x36dc06['id'],'replyId':_0x117c3d['id'],'indexes':_0x2bdd88});}this['_updateRatings'](_0x117c3d);}['_applySuggestion'](_0x5b7358){const _0x5c2f3c=this['context']['plugins']['get'](_0x1f6a74),{reply:_0xb794b9,interaction:_0x316bba}=this['getInteractionAndReplyById'](_0x5b7358['replyId']),_0x1882b6=this['_prepareDocumentSuggestions'](_0x5b7358),_0x2544b8=Rn({'documentSuggestions':_0x1882b6,'transform':!0x0,'documentCompare':_0x5c2f3c,'documentCompareOptions':{'markDeletions':!0x1}});for(const [_0x1496a4,_0xad3b94]of _0x2544b8){const {editor:_0x22d923,indexes:_0x40624b}=_0x1882b6['get'](_0x1496a4);let _0x3443dc;zs(_0xad3b94,'chat');try{_0x22d923['model']['change'](_0x31efc4=>{_0x3443dc=_0x31efc4['batch'],_0x5c2f3c['applyOperations'](_0x31efc4,_0xad3b94);}),this['_batchToChanges']['set'](_0x3443dc,{'interactionId':_0x316bba['id'],'replyId':_0xb794b9['id'],'indexes':_0x40624b});}catch(_0x54fd82){throw this['_reporter']['logError'](new sn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x54fd82})),_0x54fd82;}}this['_updateRatings'](_0xb794b9);}['_rejectSuggestion'](_0x15708e){const {reply:_0x960aac}=this['getInteractionAndReplyById'](_0x15708e['replyId']);_0x960aac['setChangeGroupState'](_0x15708e['partIndex'],'rejected');}['_openBalloonFor'](_0x1f5b8a,_0x4023bb){if(!this['_hasAIChatBalloon'])return;const {reply:_0x32b29a}=this['getInteractionAndReplyById'](_0x1f5b8a),_0x2a46b2=_0x32b29a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x2a46b2['length'])return;let _0x27b12e,_0xa7f68d;if(void 0x0!==_0x4023bb?(_0xa7f68d=_0x2a46b2['find'](_0x311984=>_0x311984['index']==_0x4023bb),_0x27b12e=_0xa7f68d?.['index']):(_0xa7f68d=_0x2a46b2[0x0],_0x27b12e=_0xa7f68d['index']),!_0xa7f68d)return void _0x32b29a['setChangeGroupState'](_0x4023bb??0x0,'outdated');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x1f5b8a&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x27b12e)return;const _0x573794=this['_getUserPresentableContentPartDocumentRange'](_0x1f5b8a,_0x32b29a,_0xa7f68d),_0x4e69f1=_0x32b29a['changeGroups']['find'](_0x2306d5=>_0x2306d5['index']==_0x27b12e)['editor'],_0xf0b2da=_0x4e69f1['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0xf0b2da&&this['_activeBalloon']['close'](),!_0x573794)return _0xf0b2da['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0xf0b2da,this['_currentPreviewedChangeGroup']={'replyId':_0x1f5b8a,'partIndex':_0x27b12e},this['_scrollToSuggestionRange'](_0x573794,!0x0,_0x4e69f1);const _0x426de7=this['_getPresentableSiblingContentPartIndex'](_0x1f5b8a,_0x27b12e,'next');_0xf0b2da['clearContent'](),_0xf0b2da['updateContent']({'part':_0xa7f68d,'renderingStrategy':'static'}),_0xf0b2da['open']({'index':_0x27b12e,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x27b12e+0x1)['toString']()),'showRotator':null!==_0x426de7,'ranges':[_0x573794],'areActionsDisabled':_0x32b29a['areActionsDisabled'],'targetEditor':_0x4e69f1}),_0xf0b2da['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1f5b8a,_0x27b12e),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1f5b8a,'index':_0x27b12e,'isActive':!0x0});}['_closeActiveBalloon'](){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}['_getPresentableSiblingContentPartIndex'](_0xe52f56,_0x114c89,_0x4db729){const {reply:_0x1a7547}=this['getInteractionAndReplyById'](_0xe52f56),_0x2552ce=_0x1a7547['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x2552ce['length'])return null;const _0x16d563='next'==_0x4db729?0x1:-0x1;function _0x2294d8(_0x3fb74a){const _0x519560=(_0x3fb74a+_0x16d563+_0x2552ce['length'])%_0x2552ce['length'];return{'siblingIndex':_0x519560,'siblingPart':_0x2552ce[_0x519560]};}const _0x23e173=_0x2552ce['findIndex'](_0x16df1f=>_0x16df1f['index']==_0x114c89);let {siblingIndex:_0x4ae061,siblingPart:_0x1f7d23}=_0x2294d8(_0x23e173);for(;!this['_getUserPresentableContentPartDocumentRange'](_0xe52f56,_0x1a7547,_0x1f7d23);)if({siblingIndex:_0x4ae061,siblingPart:_0x1f7d23}=_0x2294d8(_0x4ae061),_0x4ae061===_0x23e173)return null;return _0x1f7d23['index'];}['_getUserPresentableContentPartDocumentRange'](_0x2c3fee,_0x5d5416,_0xd52178){const _0x30d1a2=_0x5d5416['changeGroups'];if(!_0xd52178['hasChanges'])return null;const _0x2c097b=_0x30d1a2['find'](_0x341083=>_0x341083['index']==_0xd52178['index']);if('pending'!==_0x2c097b?.['state'])return null;if(!_0x2c097b?.['editor']||'destroyed'===_0x2c097b['editor']['state'])return _0x5d5416['setChangeGroupState'](_0xd52178['index'],'outdated'),null;const _0x5d25ce=this['_getDocumentRangeForReplyChanges'](_0x2c3fee,_0xd52178['index']);if(!_0x5d25ce)return _0x5d5416['setChangeGroupState'](_0xd52178['index'],'outdated'),null;const {range:_0xf602df,currentIndex:_0x5f2654}=_0x5d25ce;return'$graveyard'==_0xf602df['root']['rootName']?(_0x5d5416['setChangeGroupState'](_0x5f2654,'outdated'),null):_0x5d25ce['range'];}['_getDocumentRangeForReplyChanges'](_0x1795da,_0xe82584){const {reply:_0x50bd9d,interaction:_0x51e57d}=this['getInteractionAndReplyById'](_0x1795da),_0x7c2c10=_0x50bd9d['changeGroups']['filter'](_0x54b319=>'pending'==_0x54b319['state']),_0x98a6fc=_0x7c2c10['map'](_0x2da3fb=>_0x50bd9d['changeGroups']['indexOf'](_0x2da3fb));void 0x0===_0xe82584&&(_0xe82584=_0x98a6fc[0x0]);const _0x4f473e=_0x98a6fc['indexOf'](_0xe82584);if(-0x1==_0x4f473e)return null;const _0xd43b51=_0x7c2c10[_0x4f473e],_0x5e5023=_0xd43b51['editor'];if(!_0x5e5023||'destroyed'===_0x5e5023['state'])return null;if(!_0xeaa397(_0x5e5023,_0xd43b51['rootName']))return null;const _0x294ba1=_0x50bd9d['documentContextContent']['get'](_0xd43b51['documentId']),_0x235352=new _0x2d29a4([]),_0xff0fa0=new _0x2d29a4([]);for(const _0x484a1d of _0xd43b51['changes'])if('removed'!=_0x484a1d['type']&&_0xff0fa0['children']['push'](_0x484a1d['node']['cloneNode'](!0x0)),'new'!=_0x484a1d['type']){const _0x46392d=ti(_0x6ca226=>fs(_0x6ca226,'data-id')==_0x484a1d['id'],_0x294ba1,!0x0);_0x235352['children']['push'](_0x46392d['cloneNode'](!0x0));}if(0x0==_0x235352['children']['length']){if(_0xd43b51['changes'][0x0]['anchorId']){const _0x26eb62=Es('data-id',_0xd43b51['changes'][0x0]['anchorId'],_0x294ba1);_0x235352['children']['unshift'](_0x26eb62['cloneNode'](!0x0)),_0xff0fa0['children']['unshift'](_0x26eb62['cloneNode'](!0x0)),_0x26eb62['nextSibling']&&(_0x235352['children']['push'](_0x26eb62['nextSibling']['cloneNode'](!0x0)),_0xff0fa0['children']['push'](_0x26eb62['nextSibling']['cloneNode'](!0x0)));}else{const _0x26cbf7=_0x294ba1['children'][0x0];if(!_0x26cbf7)return null;_0x235352['children']['push'](_0x26cbf7['cloneNode'](!0x0)),_0xff0fa0['children']['push'](_0x26cbf7['cloneNode'](!0x0));}}const _0xd86181=_0x51e57d['getDocumentContext'](),_0x1f7f70=_0xd86181['documents']['find'](_0x27fc73=>_0x27fc73['id']==_0xd43b51['documentId'])['content'],_0x1c1600=_0x5e5023['model']['document']['getRoot'](_0xd43b51['rootName']),_0x5e1558=_0x5e5023['data']['parse'](_0x1f7f70,_0x1c1600),_0x765715=ms(_0x235352),_0x45b163=_0x5e5023['data']['parse'](_0x765715,_0x1c1600),_0x68b9dc=_0x5e5023['data']['parse'](_0x765715,_0x1c1600),_0x1b75ca=_0x5e5023['model']['createPositionAt'](_0x45b163,0x0),_0x4f02c8=ms(_0xff0fa0),_0x275450={'targetEditor':_0x5e5023,'anchor':_0x1b75ca,'markDeletions':!0x1};let _0x291e13;try{_0x291e13=_0x5e5023['plugins']['get'](_0x1f6a74)['getDiff'](_0x765715,_0x4f02c8,_0x275450)['getOperations']();}catch(_0x13176b){return this['_reporter']['reportError'](new sn({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0x13176b,'context':{'replyId':_0x1795da,'partIndex':_0xe82584}})),null;}if(!_0x291e13['length'])return null;_0x5e5023['model']['change'](_0x43639f=>{for(const _0x14f52b of _0x291e13)if('remove'==_0x14f52b['type']){const _0x8391b5=_0x14f52b['sourcePosition'],_0x375605=_0x14f52b['howMany'],_0x2b3ab4=new _0x440cda(_0x8391b5,_0x375605);_0x43639f['batch']['addOperation'](_0x2b3ab4),_0x5e5023['model']['applyOperation'](_0x2b3ab4);}else'marker'!==_0x14f52b['type']&&(_0x14f52b['baseVersion']=null,_0x14f52b['isDocumentOperation']=!0x1,_0x43639f['batch']['addOperation'](_0x14f52b),_0x5e5023['model']['applyOperation'](_0x14f52b));});const _0x3a65d8=Gs(_0x5e5023,_0x291e13,_0x45b163);Ks(_0x5e5023['model'],_0x3a65d8);const _0x5e109e=_0x3a65d8['getFirstRange']()['start']['path']['slice'](),_0x1b9087=_0x3a65d8['getFirstRange']()['end']['path']['slice'](),_0x3c53f1=[];let _0x183e07=_0x45b163,_0x1fad63=_0x68b9dc;for(let _0x2aff65=0x0;_0x2aff65<_0x1b9087['length'];_0x2aff65++){const _0x2e1022=_0x183e07['maxOffset']-_0x1b9087[_0x2aff65];_0x3c53f1[_0x2aff65]=_0x1fad63['maxOffset']-_0x2e1022,_0x183e07=_0x183e07['getChildAtOffset'](_0x1b9087[_0x2aff65]),_0x1fad63=_0x1fad63['getChildAtOffset'](_0x3c53f1[_0x2aff65]);}const _0x43be76=_0x5e5023['model']['createRange'](_0x5e5023['model']['createPositionFromPath'](_0x68b9dc,_0x5e109e),_0x5e5023['model']['createPositionFromPath'](_0x68b9dc,_0x3c53f1)),_0x4b8029=_0x68b9dc['getChild'](0x0)['getAttribute'](_0x308ef3),_0x57a394=Array['from'](_0x5e1558['getChildren']())['find'](_0x5ea338=>_0x5ea338['getAttribute'](_0x308ef3)==_0x4b8029)['getPath'](),_0x402af4=_0x43be76['start']['path']['slice'](),_0x5df73c=_0x43be76['end']['path']['slice']();_0x402af4[0x0]=_0x57a394[0x0]+_0x402af4[0x0],_0x5df73c[0x0]=_0x57a394[0x0]+_0x5df73c[0x0];let _0x39bb0f=_0x5e5023['model']['createRange'](_0x5e5023['model']['createPositionFromPath'](_0x5e5023['model']['document']['getRoot'](_0xd43b51['rootName']),_0x402af4),_0x5e5023['model']['createPositionFromPath'](_0x5e5023['model']['document']['getRoot'](_0xd43b51['rootName']),_0x5df73c));const _0x2948a8=_0xd86181['documents']['find'](_0x402a17=>_0x402a17['id']==_0xd43b51['documentId'])['version'],_0x2b4587=_0x5e5023['model']['document']['history']['getOperations'](_0x2948a8);for(const _0x44cdd8 of _0x2b4587)_0x39bb0f=_0x223931['_createFromRanges'](_0x39bb0f['getTransformedByOperation'](_0x44cdd8));return{'range':_0x39bb0f,'currentIndex':_0xe82584,'targetEditor':_0x5e5023};}['_integrateEditorBalloon'](_0x2d5cd5){if(!_0x2d5cd5['plugins']['has']('AIChatBalloon'))return;const _0x333d36=_0x2d5cd5['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x333d36['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x333d36,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x3e5420,partIndex:_0x1de06b}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x49fe7a}=this['getInteractionAndReplyById'](_0x3e5420),_0x3a194c=_0x49fe7a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x1de06b});_0x333d36['updateContent']({'part':_0x3a194c[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x333d36,'applySuggestion',()=>{const {replyId:_0x10a0ab,partIndex:_0x5af9bc}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x10a0ab,'partIndex':_0x5af9bc}),_0x333d36['setState']('accepted');}),this['listenTo'](_0x333d36,'insertSuggestion',()=>{const {replyId:_0x59375b,partIndex:_0x45b321}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x59375b,'partIndex':_0x45b321}),_0x333d36['setState']('accepted');}),this['listenTo'](_0x333d36,'rejectSuggestion',()=>{const {replyId:_0x96920e,partIndex:_0x517f72}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x96920e,'partIndex':_0x517f72}),_0x333d36['setState']('rejected');}),this['listenTo'](_0x333d36,'showNext',()=>{const {replyId:_0x593797,partIndex:_0x2e6213}=this['_currentPreviewedChangeGroup'],_0x54def8=this['_getPresentableSiblingContentPartIndex'](_0x593797,_0x2e6213,'next');null!==_0x54def8&&this['_openBalloonFor'](_0x593797,_0x54def8);}),this['listenTo'](_0x333d36,'showPrevious',()=>{const {replyId:_0x85d3da,partIndex:_0x190e36}=this['_currentPreviewedChangeGroup'],_0x180b89=this['_getPresentableSiblingContentPartIndex'](_0x85d3da,_0x190e36,'previous');null!==_0x180b89&&this['_openBalloonFor'](_0x85d3da,_0x180b89);}),this['listenTo'](_0x333d36,'dialogClosed',(_0x519fc6,{id:_0x200040})=>{if('aiChatBalloon'!==_0x200040)return;const {replyId:_0x20a589,partIndex:_0x3b3ba1}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x20a589,'index':_0x3b3ba1,'isActive':!0x1}),this['_activeBalloon']===_0x333d36&&(this['_activeBalloon']=void 0x0);});}['_integrateEditor'](_0x211488){if(this['_channelsToEditors']['set'](_0x211488['config']['get']('collaboration.channelId'),_0x211488),this['_integrateEditorBalloon'](_0x211488),this['addCurrentDocumentToChatContext'](),_0x211488['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x211488['plugins']['has']('Undo')){const _0x2f6eea=_0x211488['commands']['get']('undo'),_0x57a07a=_0x211488['commands']['get']('redo');this['listenTo'](_0x2f6eea,'revert',(_0x5de734,_0xd3d921,_0x4b206d)=>{const _0x43945b=this['_batchToChanges']['get'](_0xd3d921);if(!_0x43945b)return;const _0x96a2b9=this['activeConversation']['getInteraction'](_0x43945b['interactionId']),_0x422485=_0x96a2b9?.['getReply'](_0x43945b['replyId']);this['_batchToChanges']['delete'](_0xd3d921),_0x96a2b9&&_0x422485&&(_0x43945b['indexes']['forEach'](_0x552a9=>_0x422485['setChangeGroupState'](_0x552a9,'pending')),this['_batchToChanges']['set'](_0x4b206d,_0x43945b));}),this['listenTo'](_0x57a07a,'revert',(_0x56c29b,_0x21d8fc,_0x9eda)=>{const _0xd45e63=this['_batchToChanges']['get'](_0x21d8fc);if(!_0xd45e63)return;const _0x18d04e=this['activeConversation']['getInteraction'](_0xd45e63['interactionId']),_0x44076d=_0x18d04e?.['getReply'](_0xd45e63['replyId']);this['_batchToChanges']['delete'](_0x21d8fc),_0x18d04e&&_0x44076d&&(_0xd45e63['indexes']['forEach'](_0x1f27e4=>_0x44076d['setChangeGroupState'](_0x1f27e4,'accepted')),this['_batchToChanges']['set'](_0x9eda,_0xd45e63));});}const _0x2f36cf=_0x211488['config']['get']('ai.chat.context');_0x2f36cf['alwaysAddSelection']&&_0x2f36cf['document']['enabled']&&this['listenTo'](_0x211488['model']['document']['selection'],'change:range',(_0x3e811d,_0x4f5e6d)=>{_0x4f5e6d['directChange']&&'chat'===_0x211488['plugins']['get']('AITabs')['view']['activeTab']&&(_0x211488['model']['hasContent'](_0x211488['model']['document']['selection'])?this['addSelectionToChatContext'](_0x211488):this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x474df3=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x569cea=await _0x474df3['getConversations']();return _0x569cea['length']?_0x569cea[0x0]['id']:'new';}catch(_0x202087){return this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':vt()}),this['_reporter']['logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x202087})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x4c47f1={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x4c47f1);}catch(_0x180b4b){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4c47f1['id']||vt()}),this['_reporter']['logError'](_0x180b4b),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x5d872d,modelId:_0x3682fa}={}){this['_closeActiveBalloon']();let _0x139c56=_0x3682fa;_0x139c56||(_0x5d872d||!this['activeConversation']?_0x139c56=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x139c56=this['activeConversation']['selectedModel']['id'])),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']();const _0x43b0fa=this['getGroupId'](),_0x2b2396=_0x5d872d||vt();let _0x5eb7fb;this['activeConversation']=new Sn({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x139c56,'conversationId':_0x2b2396,'group':_0x43b0fa,'locale':this['context']['locale'],'isFromHistory':!!_0x5d872d,'channelsToEditors':this['_channelsToEditors'],'getSessionId':_0x2f679=>this['_aiEditing']['getSessionId'](_0x2f679)}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',(_0x209185,_0x56059)=>{this['_aiChatUi']['createConversation'](_0x56059),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5d872d||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x533447,_0x2a252e)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2a252e['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x4ec8df=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x4ec8df);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x3d0be7=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3d0be7);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x5d16eb,_0x220e16)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x220e16,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x3d5880,_0x2f9783)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2f9783,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x5c110b,_0x1b9db8)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1b9db8['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x3e5909,_0x400a94,_0x519788)=>{this['_updateConversationTitle'](_0x400a94,_0x519788);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x3145dc,_0x4b2995)=>{void 0x0!==_0x5eb7fb&&_0x5eb7fb!==_0x4b2995['id']&&this['_updateReplyContentThrottled']['flush'](),_0x5eb7fb=_0x4b2995['id'],_0x4b2995['isFromHistory']?await this['_updateReplyContent']({'reply':_0x4b2995}):await this['_updateReplyContentThrottled']({'reply':_0x4b2995});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x4bb43d,{reply:_0xed4b06,index:_0x4215d4,state:_0xdad61f})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0xed4b06['id'],'index':_0x4215d4,'state':_0xdad61f}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0xed4b06['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4215d4&&this['_activeBalloon']?.['setState'](_0xdad61f);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x1e729b,_0x2aa4e2)=>{if(this['_aiChatUi']['addContextItem'](_0x2aa4e2['contextItem'],_0x2aa4e2['isLoading']),'selection'===_0x2aa4e2['contextItem']['type']){const _0x306853=_s(this['context']),_0x10caec=[..._0x306853['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x306853,'ranges':_0x10caec,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0x2ce54c,_0x333231)=>{this['_aiChatUi']['removeContextItem'](_0x333231['uiId']),'current-document'==_0x333231['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x333231['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x58cfa6,_0x40cde1)=>{this['_aiChatUi']['setContextItemLoading'](_0x40cde1['contextItem']['uiId'],_0x40cde1['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x175937,_0x4ee11a)=>{this['_aiChatUi']['setConversationContext'](_0x4ee11a['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x495624,_0x2518bd)=>{this['_aiChatUi']['setAddContextOptions'](_0x2518bd['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x2edb3c,_0x54040d)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x54040d['sourceId'],_0x54040d['source'],_0x54040d['resources'],_0x54040d['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x564b80,_0x8ca003)=>{this['_aiChatUi']['updateResourceState'](_0x8ca003['sourceId'],_0x8ca003['resourceId'],_0x8ca003['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x1ce4bb,_0x5af9d1)=>{this['_aiChatUi']['updateCapabilities'](_0x5af9d1);}),this['listenTo'](this['activeConversation'],'modelSelected',async(_0x4310f6,_0x11dc16)=>{try{const _0x345d24=(await this['_aiChatModels']['getAll']())['find'](_0xbb9140=>_0xbb9140['id']===_0x11dc16['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x345d24,_0x11dc16['isDisabled']);}catch(_0x141fea){this['_reporter']['logError'](new sn({'code':'ai-chat-models-unable-to-retrieve','type':'network','cause':_0x141fea}),{'context':{'operation':'model-selected'}});}}),this['listenTo'](this['activeConversation'],'error',(_0x31085a,{error:_0x4fcd7b,interactionId:_0x41ec8c,fileName:_0x5d55a2,url:_0x18ac42,sourceId:_0x2a61ba,sourceLabel:_0x161d77})=>{const _0x394735=_0x41ec8c?_0x41ec8c+':'+vt():vt();this['_reporter']['reportError'](_0x4fcd7b),_0x4fcd7b['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4fcd7b['message']['startsWith']('ai-chat-conversation-start-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5d55a2),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x18ac42),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x2a61ba&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x2a61ba),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x161d77||'source'),'id':_0x394735})):_0x4fcd7b['message']['startsWith']('ai-chat-resource-load-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-invalid-request')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-context-unsupported-file-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-context-file-too-large')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-context-file-too-many-pages')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x394735}):_0x4fcd7b['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x394735}):this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x394735});}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5d872d||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']()),this['set']('isConversationReady',!0x0);}async['_handleUIUserMessage']({message:_0x15d96d,attributes:_0x1bdd08}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x820cdd=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentsInContext'](_0x820cdd);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x15d96d,'attributes':_0x1bdd08});}['_removeFromContext'](_0x2a1d63){this['activeConversation']?.['removeFromContext'](_0x2a1d63);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5e81af){const [_0x3d7c2b,_0x39fcff]=_0x5e81af['split'](':'),_0x405911=this['activeConversation']['getInteraction'](_0x3d7c2b);return{'interaction':_0x405911,'reply':_0x405911['getReply'](_0x39fcff)};}['_scrollToSuggestionRange'](_0x1ee54b,_0x46b6eb=!0x1,_0x5bb3db){const _0x367bd8={'target':_0x5bb3db['editing']['view']['domConverter']['viewRangeToDom'](_0x5bb3db['editing']['mapper']['toViewRange'](_0x1ee54b)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x46b6eb};_0x46b6eb&&(_0x367bd8['alignToTop']=!0x0),Rt(_0x367bd8);}['_updateConversationTitle'](_0x5dec47,_0x1f45e0=!0x1){this['_aiChatUi']['setConversationTitle'](_0x5dec47||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1f45e0);}['_addFeedItemReply'](_0x114a96){'text'===_0x114a96['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x114a96):this['_aiChatUi']['addFeedItemAISuggestion'](_0x114a96);}async['_updateReplyContent']({reply:_0x4c3266,renderingStrategy:_0x4458c1}){const {id:_0x140170,interactionId:_0x15a7b9,isDone:_0x9d20cc,type:_0x1b4739,parsedContent:_0x2ad185}=_0x4c3266,_0x39709c=_0x15a7b9+':'+_0x140170;if('modification'===_0x1b4739){const _0x3a4fca=_0x4c3266['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x39709c,'parts':_0x3a4fca,'isDone':_0x9d20cc,'skipLoadingEffects':_0x4c3266['isFromHistory']});}else'text'===_0x1b4739&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x39709c,'parsedContent':_0x2ad185['get']('text'),'renderingStrategy':_0x4458c1,'isDone':_0x9d20cc});_0x9d20cc&&_0x4c3266['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x39709c,_0x4c3266['sources']);}['_updateReplyContentThrottled']=_0x39ed78(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x2f8bc2=this['activeConversation']?.['lastInteraction'];_0x2f8bc2&&(_0x2f8bc2['stop'](),this['_aiChatUi']['stopInteraction'](_0x2f8bc2)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x52dc8e=this['activeConversation']?.['lastInteraction'];if(_0x52dc8e){for await(const _0x5ae47e of _0x52dc8e['replies'])this['_aiChatUi']['hasFeedItem'](_0x5ae47e['id'])||this['_addFeedItemReply'](_0x5ae47e),await this['_updateReplyContent']({'reply':_0x5ae47e,'renderingStrategy':'static'});}}['_updateRatings'](_0x703660){const _0x3fcea4={'positiveCount':_0x703660['changeGroups']['filter'](_0x4c6a43=>'accepted'===_0x4c6a43['state'])['length'],'totalCount':_0x703660['changeGroups']['length'],'modificationId':_0x703660['id']},_0x4aba64=this['activeConversation']['getInteraction'](_0x703660['interactionId'])['messageId'];_0x4aba64&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x4aba64,_0x3fcea4);}['_getAIChatFeedAPI'](_0x46b21e){const _0x17a066=this['_aiChatUi'],_0x41d52a=()=>{_0x46b21e['resetWebSearchState'](),_0x46b21e['resetReasoningState'](),_0x17a066['clearLoadingMessage']();},_0x4014e1=()=>{_0x46b21e['currentReply']&&(_0x46b21e['currentReply']['done'](),_0x46b21e['currentReply']=void 0x0);};return{'insertTextReply':(_0x12c2fb,_0x252372)=>{_0x4014e1(),_0x41d52a();const _0x362462=_0x46b21e['currentReply']=_0x46b21e['createReply']({'type':'text','interactionId':_0x46b21e['id'],'id':_0x252372||vt(),'channelsToEditors':this['_channelsToEditors']});return _0x362462['appendContent'](_0x12c2fb),_0x4014e1(),_0x362462;},'insertCustomElement':async(_0x439408,_0x295368)=>(_0x4014e1(),_0x41d52a(),_0x17a066['addFeedItemCustomElement'](_0x439408,_0x295368||vt())),'setLoadingMessage':_0x11daeb=>{_0x17a066['setLoadingMessage'](_0x11daeb);},'clearLoadingMessage':()=>{_0x17a066['clearLoadingMessage']();}};}['_checkRemoveCurrentDocumentFromChatContext'](){ds(this['context'])['find'](_0x4fface=>'destroyed'!==_0x4fface['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const Nn=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],yn=[...Nn,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function xn(_0x513e49){const _0x260092=new AbortController();return{'promise':new Promise((_0x71c24f,_0x5bd799)=>{const _0x26c563=setTimeout(_0x71c24f,_0x513e49);_0x260092['signal']['addEventListener']('abort',()=>{clearTimeout(_0x26c563),_0x5bd799();});}),'abortController':_0x260092};}var Ln=class{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x375ae4){this['options']={'delay':_0x375ae4?.['delay']??0xa,'textNodeStyle':_0x375ae4?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x3cdddc,targetElement:_0x3326f4,abortSignal:_0x594477}){this['isStreaming']&&this['stop'](),_0x594477?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x5b768f(_0x3cdddc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3b22f8=0x0;_0x3b22f8<this['currentIndex'];_0x3b22f8++)this['nodesList'][_0x3b22f8]['shouldBeStreamed']=!0x0;do{const _0x421203=Date['now'](),_0x52f5ea=this['nodesList'][this['currentIndex']],_0x1f23eb=_0x421203-this['lastUpdateTime'];if(_0x52f5ea){_0x52f5ea['shouldBeStreamed']=!0x0;let _0x94489c=_0x52f5ea['parent'];for(;_0x94489c;)_0x94489c['shouldBeStreamed']=!0x0,_0x94489c=_0x94489c['parent'];}if(_0x1f23eb<this['options']['delay'])try{const {promise:_0x52c804,abortController:_0x4874ce}=xn(this['options']['delay']-_0x1f23eb);this['timeoutAbortController']=_0x4874ce,await _0x52c804;}catch(_0xec9014){return;}_0x2076e0(_0x3326f4,'<'+_0x3326f4['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3326f4['tagName']+'>',{'childrenOnly':!0x0}),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0xedb1f}){Array['from'](_0xedb1f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x57c79a=>{_0x57c79a['replaceWith'](_0x57c79a['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x22596d){let _0x2c8fd4='';if(function(_0x1fa6e6){return _0x3d6db6(_0x1fa6e6);}(_0x22596d)){for(const _0x38ed9d of _0x22596d['children'])_0x2c8fd4+=this['renderNode'](_0x38ed9d);}else{if(Hn(_0x22596d)){if(!_0x22596d['shouldBeStreamed'])return'';const _0x144159=_0x22596d,_0xeacb11=Object['entries'](_0x144159['attribs'])['map'](([_0x1098e9,_0x7de0b4])=>_0x1098e9+'=\x22'+_0x7de0b4+'\x22')['join']('\x20');_0x2c8fd4+='<'+_0x144159['tagName']+(_0xeacb11?'\x20'+_0xeacb11:'')+'>';for(const _0x5cd7ee of _0x145355(_0x144159))_0x2c8fd4+=this['renderNode'](_0x5cd7ee);_0x2c8fd4+='</'+_0x144159['tagName']+'>';}else{if(!Pn(_0x22596d))return'';if(!_0x22596d['shouldBeStreamed'])return'';!function(_0xef046f){return!(!_0xef046f['parent']||!Hn(_0xef046f['parent']))&&(!!Dn['includes'](_0xef046f['parent']['tagName'])&&!_0x314768(_0xef046f)['match'](/^\s*[<>]\s*$/));}(_0x22596d)?_0x2c8fd4+=_0x575879(_0x22596d):_0x2c8fd4+=_0x575879(new _0x1f1d4a('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x22596d]));}}return _0x2c8fd4;}['getParsedDocumentNodeList'](){const _0x168b0d=[];return function(_0x3ae94d,_0x563ad0){const _0x1bb064=_0x5fa40b=>{if(_0x563ad0(_0x5fa40b),_0x5fa40b instanceof _0x504466)for(let _0x2d24fc=0x0;_0x2d24fc<_0x5fa40b['children']['length'];_0x2d24fc++){const _0x311a19=_0x5fa40b['children'][_0x2d24fc];_0x1bb064(_0x311a19);}};for(let _0x4e7ab9=0x0;_0x4e7ab9<_0x3ae94d['children']['length'];_0x4e7ab9++)_0x1bb064(_0x3ae94d['children'][_0x4e7ab9]);}(this['document'],_0x221d99=>{if(Pn(_0x221d99)){const _0x394c84=this['splitTextNodeIntoWordNodes'](_0x221d99);_0x394c84['length']&&_0x168b0d['push'](..._0x394c84);}_0x221d99['isWordSplitSource']||_0x221d99['isWordSplitResult']||_0x168b0d['push'](_0x221d99);}),_0x168b0d;}['splitTextNodeIntoWordNodes'](_0x480e97){if(_0x480e97['isWordSplitSource']||_0x480e97['isWordSplitResult'])return[];const _0x26e6b6=_0x314768(_0x480e97)['match'](/(?:\s*\S+\s*)/g),_0x1cfff4=[];if(_0x26e6b6&&_0x26e6b6['length']>0x1){for(const _0x1eb133 of _0x26e6b6){const _0xd8933a=new _0x1d9d67(_0x1eb133);_0xd8933a['isWordSplitResult']=!0x0,_0x4a1680(_0x480e97,_0xd8933a),_0x1cfff4['push'](_0xd8933a);}_0x480e97['isWordSplitSource']=!0x0,_0x3baafe(_0x480e97);}return _0x1cfff4;}};const Dn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Pn(_0x591588){return _0x335b1f(_0x591588);}function Hn(_0x442977){return _0x48ca1a(_0x442977);}function Mn(_0x3aa46d,_0x439c1f){_0x3aa46d['cleanUpAnimations']({'targetElement':_0x439c1f}),_0x439c1f['querySelectorAll']('[data-id]')['forEach'](_0x554d90=>{_0x554d90['removeAttribute']('data-id');});}var Vn=class extends _0x42f8f5{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x3fbe6e){super();const _0xe7ff79=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new Ln(),this['options']=_0x3fbe6e,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xe7ff79['if']('isDone','ck-ai-chat__feed__item_done'),_0xe7ff79['if']('isVisible','ck-hidden',_0x400e42=>!_0x400e42),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){Mn(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async['streamIntoElement'](_0x31e4a8,_0x12cb12,_0x3d3989){await this['htmlStreamer']['stream']({'document':_0x31e4a8,'targetElement':_0x12cb12,'abortSignal':_0x3d3989});}},Un=class extends _0x42f8f5{['showChangesToggleView'];constructor(_0x249a7e,_0x537607){super(_0x249a7e),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Bn(_0x249a7e),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+hn,'label':us(_0x249a7e,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x537607['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1c19e4=>_0x1c19e4?et:tt),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x253fcd=new Yt();_0x253fcd['content']=_0x34f9f8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x537607['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x253fcd,{'tag':'span','children':[us(_0x249a7e,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}},Bn=class extends Ht{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}};const Gn={'accepted':_0xa7db82,'rejected':_0x5d33dc,'outdated':_0x5d33dc};var Fn=class extends _0x42f8f5{['stateIconView'];constructor(_0x8c700){super(_0x8c700);const _0x26c497=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Kn(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x26c497['to']('state',_0x39e6c7=>'ck-ai-suggestion__content-part-state_'+_0x39e6c7),_0x26c497['if']('isVisible','ck-hidden',_0x2d1c63=>!_0x2d1c63)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x26c497['to']('state',_0x5717f4=>{switch(_0x5717f4){case'accepted':return us(_0x8c700,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x8c700,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x8c700,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1efd9a){this['state']=_0x1efd9a;}},Kn=class extends Yt{constructor(){super(),this['set']('state','accepted'),this['content']=Gn[this['state']],this['on']('change:state',()=>{this['content']=Gn[this['state']];});}},Wn=class extends _0x182e23{['_applyButton'];['_suggestButton'];constructor(_0x2266c5,_0x3429ca,_0x107b9e){super(_0x2266c5);const _0x5c89cc=Boolean(_0x107b9e);this['set']('isEnabled',!_0x5c89cc),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x21655c=[];if(_0x5c89cc){const _0xe5c63a=new Ht(_0x2266c5);_0xe5c63a['set']({'label':us(_0x2266c5,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x26ee67}),_0xe5c63a['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x21655c['push'](_0xe5c63a);}else{_0x3429ca['includes']('applySuggestion')&&(this['_applyButton']=new Ht(_0x2266c5),this['_applyButton']['set']({'label':us(_0x2266c5,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xa7db82}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',_0x4e0275=>!_0x4e0275),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x21655c['push'](this['_applyButton'])),_0x3429ca['includes']('insertSuggestion')&&(this['_suggestButton']=new Ht(_0x2266c5),this['_suggestButton']['set']({'label':us(_0x2266c5,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x556d1e}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x21655c['push'](this['_suggestButton']));const _0x147989=new Ht(_0x2266c5);_0x147989['set']({'label':us(_0x2266c5,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5d33dc}),_0x147989['bind']('isEnabled')['to'](this),_0x147989['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x21655c['push'](_0x147989);}this['items']['addMany'](_0x21655c);const _0x30d46e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x30d46e['if']('isVisible','ck-hidden',_0x3bafb8=>!_0x3bafb8)]}});}['setButtonsVisibility']({showApplyButton:_0x143da6,showSuggestButton:_0x541f8d}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x143da6),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x541f8d);}},Yn=class extends _0x42f8f5{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x4598f0,{part:_0x1ca818,uiIndex:_0x4309b2,availableActions:_0x5b8095,areActionsDisabled:_0x36457b}){super(_0x4598f0),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['toolbarView']=new Wn(_0x4598f0,_0x5b8095,_0x36457b),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1ca818['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1ca818['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1ca818['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn')['to'](this),this['stateView']=new Fn(_0x4598f0),this['titleLabelView']=new $n(_0x4598f0,_0x4309b2),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x5810fa,_0x121791,_0x274c70,_0x27be97)=>{'pending'===_0x27be97?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x274c70?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x274c70),this['children']['add'](this['stateView']));});}},$n=class extends _0x42f8f5{constructor(_0x4f40af,_0xa4d948){super(_0x4f40af),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x4f40af,'AI_SUGGESTION_CONTENT_PART_TITLE',_0xa4d948['toString']())]});}},qn=class extends _0x42f8f5{['htmlStreamer'];constructor(_0x3b5f95){super(_0x3b5f95),this['htmlStreamer']=new Ln(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x435a85,renderingStrategy:_0x3e8d61,abortSignal:_0x5b4f9d}){const _0x2fcc0c=_0x5b768f(_0x435a85['content'],!0x0);for(const _0x3b620b of ws(_0x2fcc0c))_0x3baafe(_0x3b620b);'streaming'===_0x3e8d61?await this['htmlStreamer']['stream']({'document':_0x2fcc0c,'targetElement':this['element'],'abortSignal':_0x5b4f9d}):_0x2076e0(this['element'],'<'+this['element']['tagName']+'>'+ms(_0x2fcc0c)+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='',this['element']['scrollTop']=0x0;}['cleanUpStreamingArtifacts'](){Mn(this['htmlStreamer'],this['element']);}},Qn=class extends _0x42f8f5{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x156018,{part:_0x2ed4f7,uiIndex:_0x1fdf66,areActionsDisabled:_0x5adfef,availableActions:_0xcea49b}){super(_0x156018);const _0x11ffb4=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1);const _0x5660f7=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x5adfef;};this['on']('change:state',_0x5660f7),this['on']('change:isDone',_0x5660f7),_0x5660f7(),this['_children']=this['createCollection'](),this['_headerView']=new Yn(_0x156018,{'part':_0x2ed4f7,'uiIndex':_0x1fdf66,'availableActions':_0xcea49b,'areActionsDisabled':_0x5adfef}),this['_headerView']['bind']('isEnabled','state','isTrackChangesOn')['to'](this),this['_headerView']['delegate'](...Nn)['to'](this),this['_streamableContentView']=new qn(_0x156018),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x11ffb4['to']('state',_0x356fcc=>'ck-ai-suggestion__body__content-part_'+_0x356fcc),_0x11ffb4['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x11ffb4['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x11ffb4['if']('isVisible','ck-hidden',_0x36a73a=>!_0x36a73a)]},'children':this['_children'],'on':{'mouseenter':_0x11ffb4['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2ed4f7['index']});}),'mouseleave':_0x11ffb4['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2ed4f7['index']});}),'click':_0x11ffb4['to'](_0x166477=>{const _0x5bda30=_0x166477['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x5bda30)&&this['fire']('showChangeInText',{'index':_0x2ed4f7['index']});})}});}async['updateContent']({part:_0x3ae1b4,showUnchangedParts:_0x1b1674=!0x1,abortSignal:_0x4aee68}){this['partDefinition']=_0x3ae1b4,this['isVisible']=this['partDefinition']['hasChanges']||_0x1b1674,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x3ae1b4,'renderingStrategy':'static','abortSignal':_0x4aee68});}['markAsDone'](){this['isDone']=!0x0;}},Xn=class extends _0x42f8f5{constructor(_0x516c4a,_0x37bd1c){super(_0x516c4a),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1840ad=>!_0x1840ad)]},'children':this['_createSkeletonItems'](_0x37bd1c)});}['_createSkeletonItems'](_0x203f57){const _0x4a9397=['ck','ck-ai-skeleton__item'];return _0x203f57['map'](_0x59d85c=>{let _0xdcb776='';switch(_0x59d85c['attributes']['align']){case'right':_0xdcb776='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xdcb776='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xdcb776='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x59d85c['tag'],'attributes':{'class':[..._0x4a9397,_0x59d85c['attributes']['class']?_0x59d85c['attributes']['class']:''],'style':'width:\x20'+_0x59d85c['attributes']['width']+';\x20height:\x20'+_0x59d85c['attributes']['height']+';'+_0xdcb776}};});}};const zn={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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':jn(0x5,'100%','44px','right'),'aiChatResources':jn(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 jn(_0x278317,_0x5dcfe8,_0x2c696e,_0x5aec7c){return new Array(_0x278317)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x5dcfe8,'height':_0x2c696e,'align':_0x5aec7c}}));}const Jn=/* #__PURE__ -- @preserve */
33
- ut();var Zn=class extends Jn{['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x20dbf3){const _0x2c8169=this['createTask'](_0x20dbf3);return this['queue']['push'](_0x2c8169),this['_processQueue'](),_0x2c8169['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(_0x116251=>{this['once']('_queueEmpty',()=>{_0x116251();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xfbf35f=this['queue']['shift']();try{await _0xfbf35f['callback'](this['_abortController']['signal']),_0xfbf35f['resolve']();}catch(_0x58fe3a){_0xfbf35f['reject'](_0x58fe3a);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x352bed){let _0x543966,_0x107e3f;const _0x168f6d=new Promise((_0x2cc408,_0x40e2c3)=>{_0x543966=_0x2cc408,_0x107e3f=_0x40e2c3;});return{'callback':_0x352bed,'resolve':_0x543966,'reject':_0x107e3f,'completePromise':_0x168f6d};}},tr=class extends Vn{constructor(_0xa2e9ce){super(_0xa2e9ce),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0xa2e9ce['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x54774a){this['element']['innerHTML']=_0x54774a;}};const er=['applySuggestion','insertSuggestion'];var ir=class extends _0x42f8f5{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x256bd9,_0x5d2dd5=[...er],_0x11f775){super(_0x256bd9);const _0x3e6f2f=this['bindTemplate'],_0x1ec9ce=Boolean(_0x11f775);if(this['set']('isEnabled',!_0x1ec9ce),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1ec9ce){const _0x5eda32=new Ht(_0x256bd9);_0x5eda32['set']({'label':us(_0x256bd9,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x26ee67}),_0x5eda32['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0xcf2c6b=new _0x42f8f5(_0x256bd9);_0xcf2c6b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x256bd9,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x5eda32]}]}),this['children']['add'](_0xcf2c6b);}else this['_applyChangesButton']=new Ht(_0x256bd9),this['_applyChangesButton']['set']({'label':us(_0x256bd9,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5d2dd5['includes']('applySuggestion'),'class':on}),this['_insertSuggestionsButton']=new Ht(_0x256bd9),this['_insertSuggestionsButton']['set']({'label':us(_0x256bd9,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5d2dd5['includes']('insertSuggestion'),'class':an}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x2e3758=>{_0x2e3758['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x3e6f2f['if']('isVisible','ck-hidden',_0x5c0ec3=>!_0x5c0ec3)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1dc89b){this['isVisible']=_0x1dc89b;}['_switchButtonLabelsPlurality'](_0x1bfe5c){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x1bfe5c?(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},sr=class extends _0x42f8f5{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0xbe0479,_0x6783c3){super(_0xbe0479),this['bodyCollection']=_0x6783c3,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',_0x2ee8ac=>!_0x2ee8ac)]},'children':this['children']});const _0x52614e=new _0x42f8f5(this['locale']),_0x2d0910=new Yt();_0x2d0910['content']=at,_0x52614e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x2d0910,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x52614e),this['_setupBalloonPanel'](_0xbe0479);}['addSource'](_0x42adba){this['children']['add'](new nr(this['locale'],_0x42adba,this['balloonPanelView']));}['_setupBalloonPanel'](_0x763d50){this['balloonPanelView']=new yt(_0x763d50),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},nr=class extends Ht{['balloonPanelView'];['source'];constructor(_0x25a89d,_0x37b649,_0x57260b){super(_0x25a89d),this['source']=_0x37b649,this['balloonPanelView']=_0x57260b,this['set']({'label':_0x37b649['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xdb4591=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xdb4591['to'](()=>{window['open'](_0x37b649['url'],'_blank');}),'mouseenter':_0xdb4591['to'](()=>{this['_showTooltip']();}),'mouseleave':_0xdb4591['to'](()=>{this['_hideTooltip']();})}}),_0x37b649['favicon']){const _0x1c70a8=new _0x42f8f5(_0x25a89d);_0x1c70a8['setTemplate']({'tag':'img','attributes':{'src':_0x37b649['favicon']||at,'alt':_0x37b649['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1c70a8);}else this['set']('icon',at);}['_createTooltipContentView'](_0x293f52,_0x2891eb){const _0x2998bb=new _0x42f8f5(_0x293f52),_0x891159=[];let _0x1e97bc;_0x2891eb?.['favicon']?(_0x1e97bc=new _0x42f8f5(_0x293f52),_0x1e97bc['setTemplate']({'tag':'img','attributes':{'src':_0x2891eb['favicon'],'alt':_0x2891eb['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x1e97bc=new Yt(),_0x1e97bc['content']=at,_0x1e97bc['extendTemplate']({'attributes':{'alt':_0x2891eb['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x891159['push'](_0x1e97bc);const _0x3dd70a=new _0x42f8f5(_0x293f52);_0x3dd70a['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x2891eb['url']},'children':[{'text':new URL(_0x2891eb['url'])?.['hostname']}]}),_0x891159['push'](_0x3dd70a);const _0x4e0f09=new _0x42f8f5(_0x293f52);_0x4e0f09['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x891159});const _0x1747f7=new _0x42f8f5(_0x293f52);return _0x1747f7['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x2891eb['title']['length']>0x190?_0x2891eb['title']['substring'](0x0,0x190)+'...':_0x2891eb['title']}]}),_0x2998bb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x4e0f09,_0x1747f7]}),_0x2998bb;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[yt['defaultPositions']['northArrowSouth'],yt['defaultPositions']['northArrowSouthWest'],yt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0xaac3e2=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0xaac3e2);}},rr=class extends _0x42f8f5{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x46743f(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x26f76c,_0x5c1775){super(_0x26f76c);const {areActionsDisabled:_0x5bdb0d,showUnchangedParts:_0x3bcb20,availableActions:_0xba6f24}=_0x5c1775;this['_areActionsDisabled']=_0x5bdb0d,this['_showUnchangedParts']=_0x3bcb20,this['_availableActions']=_0xba6f24,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new Xn(_0x26f76c,zn['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Zn(),this['_emptyPartsWarningView']=new tr({'id':'empty-parts-warning','initialContent':us(_0x26f76c,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ir(_0x26f76c,_0x5c1775['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new sr(this['locale'],_0x5c1775['bodyCollection']),_0x5c1775['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Nn)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0x467510=>_0x467510 instanceof Qn);}async['updateContentParts']({parts:_0x1f77e4,abortSignal:_0x5524ff,skipLoadingEffects:_0x350b1a}){this['_cachedContentParts']['length']?_0x1f77e4['forEach'](_0x537bb3=>{const _0x21e51b=this['_cachedContentParts']['findIndex'](_0x150549=>_0x150549['index']==_0x537bb3['index']);-0x1===_0x21e51b?this['_cachedContentParts']['push'](_0x537bb3):this['_cachedContentParts'][_0x21e51b]=_0x537bb3;}):this['_cachedContentParts']=_0x1f77e4;const _0x3c59b4=this['_showUnchangedParts']?_0x1f77e4:_0x1f77e4['filter'](_0x1d418b=>_0x1d418b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3c59b4['length']>0x1),_0x350b1a&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x1337c8 of _0x3c59b4)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1b3779=>{let _0x3c4abf=this['getPartView'](_0x1337c8['index']);if(!_0x3c4abf){if(_0x3c4abf=new Qn(this['locale'],{'part':_0x1337c8,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3c4abf['delegate'](...Nn)['to'](this),_0x3c4abf['bind']('isTrackChangesOn')['to'](this),!_0x350b1a&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x1b3779),_0x1b3779['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x3c4abf,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x350b1a||this['_showSkeletonDebounced']();}await _0x3c4abf['updateContent']({'part':_0x1337c8,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1b3779}),_0x3c4abf['markAsDone']();});return _0x5524ff?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x2484e6,_0xd3f081){const _0x35ffb2=this['getPartView'](_0x2484e6);_0x35ffb2&&(_0x35ffb2['state']=_0xd3f081),this['hasPendingParts']='pending'==_0xd3f081||this['_contentPartViews']['some'](_0x1fec5a=>'pending'==_0x1fec5a['state']);}['setPartActive'](_0x2f1089,_0x3b4e64){if(!0x1===_0x2f1089){for(const _0x7f0571 of this['_contentPartViews'])_0x7f0571['isActive']=!0x1;}else{const _0x15fc0e=this['getPartView'](_0x2f1089);_0x15fc0e&&(_0x15fc0e['isActive']=_0x3b4e64);}}['updateSources'](_0x30e7bf){_0x30e7bf['forEach'](_0x1f2c5e=>this['_sourcesView']['addSource'](_0x1f2c5e)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x2a9252){return this['_contentPartViews']['find'](_0x4a426d=>_0x4a426d['partDefinition']['index']==_0x2a9252)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2c57a6=!this['_cachedContentParts']['find'](({hasChanges:_0x5a3086})=>_0x5a3086),_0x5ba95b=!!this['_cachedContentParts']['find'](({hasChanges:_0xc13690})=>!_0xc13690);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x5ba95b,_0x2c57a6?this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x47f119=>_0x47f119['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x4637c3){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x1a1766=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x1a1766>0x0){const {promise:_0x2e1dad,abortController:_0x3121df}=xn(_0x1a1766);_0x4637c3?.['addEventListener']('abort',()=>_0x3121df['abort']()),await _0x2e1dad['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x122e72=>_0x122e72['partDefinition']['hasChanges'])['length']>0x0;}},or=class extends _0x42f8f5{['bodyView'];['children'];['headerView'];constructor(_0x211c79,_0x4a6941,_0x292b80){super(_0x211c79);const {showDiff:_0xd55ac3,areActionsDisabled:_0x1abb96,showUnchangedParts:_0x5724c9,availableActions:_0x11d312}=_0x4a6941;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new Un(_0x211c79,{'showDiff':_0xd55ac3}),this['headerView']['on']('toggleShowChanges',(_0x3894a8,_0x232916)=>{this['areChangesVisible']=_0x232916['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x232916['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new rr(_0x211c79,{'areActionsDisabled':_0x1abb96,'showUnchangedParts':!!_0x5724c9,'availableActions':_0x11d312,'bodyCollection':_0x292b80}),this['bodyView']['delegate'](...Nn)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x5c3ff1){await this['bodyView']['updateContentParts'](_0x5c3ff1);}['updateSources'](_0x2a4e0f){this['bodyView']['updateSources'](_0x2a4e0f);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},ar=class extends Vn{['containerView'];constructor(_0x59c701,_0x521687,_0x4c4152){super(_0x521687),this['set']('isTrackChangesOn',!0x1),this['containerView']=new or(_0x59c701,{'showDiff':_0x521687['showDiff'],'areActionsDisabled':_0x521687['areActionsDisabled'],'availableActions':_0x521687['availableActions']},_0x4c4152),this['containerView']['on']('toggleSuggestionDisplayMode',(_0xcd0bd,_0x6d6e9b)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x6d6e9b['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x224bb1,{index:_0x549f2d})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x549f2d});}),this['containerView']['on']('applySuggestion',(_0xba57fd,{index:_0x58144e}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x58144e});}),this['containerView']['on']('insertSuggestion',(_0x4f6279,{index:_0x4e10b6}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4e10b6});}),this['containerView']['on']('rejectSuggestion',(_0x5cdc2b,{index:_0x55e5ae})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x55e5ae});}),this['containerView']['on']('mouseOverSuggestion',(_0xfca0e6,{index:_0x1c52b1})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1c52b1});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1f6a91,{index:_0x211fd7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x211fd7});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2ff0ea){await this['containerView']['updateContent'](_0x2ff0ea);}['updatePartState'](_0x1e49d3,_0xf235ba){this['containerView']['bodyView']['updatePartState'](_0x1e49d3,_0xf235ba);}['setPartActive'](_0x2c036d,_0x2fc7e8){!0x1===_0x2c036d?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x2c036d,_0x2fc7e8);}['updateSources'](_0x4cd139){this['containerView']['updateSources'](_0x4cd139);}['getPartView'](_0x49b7de){return this['containerView']['bodyView']['getPartView'](_0x49b7de);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},hr=class extends Vn{['replyContainer'];['_bodyCollection'];constructor(_0x436980,_0x22388d,_0x486df7){super(_0x22388d),this['_bodyCollection']=_0x486df7,this['locale']=_0x436980,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x42f8f5(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':ps(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3ee412,renderingStrategy:_0x858d92,abortSignal:_0x335538}){'streaming'===_0x858d92?await this['streamIntoElement'](_0x3ee412,this['replyContainer']['element'],_0x335538):this['replyContainer']['element']['innerHTML']=_0x575879(_0x3ee412);}['updateSources'](_0x71a930){const _0x247310=new sr(this['locale'],this['_bodyCollection']);_0x247310['children']['addMany'](_0x71a930['map'](_0x1a68b9=>new nr(this['locale'],_0x1a68b9,_0x247310['balloonPanelView']))),_0x247310['isVisible']=!0x0,this['children']['add'](_0x247310);}},cr=class extends _0x528849{constructor(_0x592fec=void 0x0){super();const _0x20f0da=_0x592fec?'ck-ai-spinner_'+_0x592fec:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x20f0da]}});}};const lr={'file':_0x324f70,'image':_0x597a34,'document':_0x34f9f8,'web-resource':_0x18b8c0,'text':_0x324f70,'selection':_0x582585,'mcp-tool-context':_0x34f9f8},ur='ck-ai-chat-context-chip',dr='ck-ai-chat-context-chip_wide',_r='ck-ai-chat-context-chip_document',gr='ck-ai-chat-context-chip__label',Ar='ck-ai-chat-context-chip__type-icon',Ir='ck-ai-chat-context-controls__chip-tooltip',pr='n';var mr=class extends Ht{constructor(_0x4dd3b6,_0x1fdae4,_0x2aeed5,_0xdeecf9,_0x292a66=!0x1){super(_0x4dd3b6),this['_isAnimationOnEnterEnabled']=_0xdeecf9,this['_initializeProperties'](_0x1fdae4,_0x2aeed5,_0x292a66),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'](_0x27880a,_0x2f752c,_0x43df59){this['set']('label',_0x27880a['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x27880a['type']),this['set']('id',_0x27880a['uiId']),this['set']('readonly',_0x2f752c),this['set']('isLoading',_0x43df59);}['_setupTemplate'](){const _0x159f73=this['_createIconView'](),_0x33a412=this['_createRemoveButton'](),_0x151031=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x151031),'children':this['_createTemplateChildren'](_0x159f73,_0x33a412,_0x151031)});}['_createTemplateAttributes'](_0x29033b){return{'class':[ur,_0x29033b['if']('itemType',_r,_0x5c2d9f=>'document'==_0x5c2d9f),_0x29033b['if']('itemType',dr,_0x5ccb87=>'selection'==_0x5ccb87)],'data-cke-tooltip-text':_0x29033b['to']('label',Er),'data-cke-tooltip-position':pr,'data-cke-tooltip-class':Ir};}['_createTemplateChildren'](_0x22f437,_0x5f2739,_0x14df65){const _0x5919fa=this['_createLabelElement'](_0x14df65),_0x439a36=this['_createLoaderIcon']();return this['readonly']?[_0x22f437,_0x5919fa]:[_0x22f437,_0x439a36,_0x5919fa,_0x5f2739];}['_createLabelElement'](_0x41f3ec){return{'tag':'span','attributes':{'class':gr},'children':[{'text':_0x41f3ec['to']('label')}]};}['_createRemoveButton'](){const _0x185cce=new Ht(this['locale']);return _0x185cce['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3c0bfe}),this['_setupRemoveButtonEvent'](_0x185cce),_0x185cce;}['_setupRemoveButtonEvent'](_0x628a0a){_0x628a0a['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x23f3ee=this['bindTemplate'],_0x32b416=new Yt();return _0x32b416['content']=lr[this['itemType']],_0x32b416['extendTemplate']({'attributes':{'class':[Ar,_0x23f3ee['if']('isLoading','ck-hidden',_0x34cd72=>_0x34cd72)]}}),_0x32b416;}['_handleAnimationEndOnce'](_0x2a1613,_0x982448){if(!_0x2a1613)return;const _0x5c4313=()=>{_0x982448(),_0x2a1613['removeEventListener']('animationend',_0x5c4313),_0x2a1613['removeEventListener']('webkitAnimationEnd',_0x5c4313);};_0x2a1613['addEventListener']('animationend',_0x5c4313),_0x2a1613['addEventListener']('webkitAnimationEnd',_0x5c4313);}['_createLoaderIcon'](){const _0x434df3=new cr('small');return _0x434df3['bind']('isVisible')['to'](this,'isLoading',_0x5458a6=>_0x5458a6),_0x434df3;}};function Er(_0x416383){if(!_0x416383)return _0x416383;if(_0x416383['length']<=0x78)return _0x416383;const _0x3fac7d=_0x416383['slice'](0x0,0x78),_0x10b3df=_0x3fac7d['lastIndexOf']('\x20');return(_0x10b3df>0x0?_0x3fac7d['slice'](0x0,_0x10b3df):_0x3fac7d)+'…';}const Tr={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},wr='300px';var Cr=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4adbd3,_0x2c101d,_0x4b9abc,_0x4f6296,_0x256329){this['_locale']=_0x4adbd3,this['_visibleChips']=_0x2c101d,this['_config']={...Tr,..._0x4b9abc,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x4b9abc['cssClasses']}},this['_overflowChips']=new ct(),this['_bodyCollection']=_0x4f6296,this['_parentView']=_0x256329||null;}['setContainerElement'](_0x7cdbd){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x7cdbd,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 _0x59f3d3=[...this['_visibleChips'],...this['_overflowChips']],_0x52d3f8=this['_createCalculationContainer'](),_0x4a598d=this['_calculateOverflowInContainer'](_0x52d3f8,_0x59f3d3),_0x28bb4b=_0x52d3f8['_ancestorsToRestore'];_0x28bb4b&&this['_restoreAncestorVisibility'](_0x28bb4b),_0x52d3f8['remove'](),this['_applyOverflowResults'](_0x59f3d3,_0x4a598d);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4c94bb({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x1f98d7=new Ht(this['_locale']);_0x1f98d7['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x22e32a=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x22e32a['push'](this['_config']['cssClasses']['controlsButton']),_0x1f98d7['extendTemplate']({'attributes':{'class':_0x22e32a}}),_0x1f98d7;}['_createShowMoreBalloonPanelView'](){const _0x56b541=new yt(this['_locale']);return _0x56b541['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x56b541),_0x56b541;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2dfa62=>{_0x2dfa62['disableAnimationOnEnter']();});const _0x48b06d=new _0x42f8f5(this['_locale']);_0x48b06d['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x48b06d);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x56c874=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x56c874?'':'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'](_0xe99689){const _0x14ab66=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x60dbbb=this['_containerElement']?.['classList'];if(_0x60dbbb){const _0x5267ac=_0x60dbbb[0x0]||'',_0xbe2475=_0xe99689['querySelector']('.'+_0x5267ac),_0xcf4cbf=_0xe99689['querySelector'](_0x14ab66);return _0xbe2475||_0xcf4cbf||_0xe99689;}return _0xe99689['querySelector'](_0x14ab66)||_0xe99689;}['_calculateContainerWidth'](){const _0x242cf1=this['_parentView']?.['element']||this['_containerElement'];if(!_0x242cf1)return wr;const _0x34516a=window['getComputedStyle'](_0x242cf1)['width'];if('auto'===_0x34516a||'0px'===_0x34516a||!_0x34516a){const _0x245b93=_0x242cf1['parentElement'];if(_0x245b93){const _0xca1ee8=window['getComputedStyle'](_0x245b93);return'auto'!==_0xca1ee8['width']?_0xca1ee8['width']:wr;}return wr;}return _0x34516a;}['_applyCalculationStyles'](_0x569515,_0x39c192){this['_config']['cssClasses']['calculationContainer']&&_0x569515['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x569515['style']['width']=_0x39c192,_0x569515['style']['position']='absolute',_0x569515['style']['top']='-9999px',_0x569515['style']['left']='-9999px',_0x569515['style']['opacity']='0',_0x569515['style']['pointerEvents']='none',_0x569515['style']['zIndex']='-1',_0x569515['style']['visibility']='visible\x20!important',_0x569515['style']['display']='block\x20!important',_0x569515['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x529086){_0x529086['forEach'](({element:_0x480da0,originalDisplay:_0x1df24f,originalVisibility:_0x17629b})=>{_0x480da0['style']['display']=_0x1df24f,_0x480da0['style']['visibility']=_0x17629b;});}['_makeAncestorsVisible'](_0x5c15ef){const _0x231e6e=[];let _0x3f1078=_0x5c15ef;for(;_0x3f1078&&_0x3f1078!==document['body'];){const _0x4cea2a=window['getComputedStyle'](_0x3f1078);'none'!==_0x4cea2a['display']&&'hidden'!==_0x4cea2a['visibility']||(_0x231e6e['push']({'element':_0x3f1078,'originalDisplay':_0x3f1078['style']['display'],'originalVisibility':_0x3f1078['style']['visibility']}),_0x3f1078['style']['display']='block',_0x3f1078['style']['visibility']='visible'),_0x3f1078=_0x3f1078['parentElement'];}return _0x231e6e;}['_createContainerElements'](){let _0x155731,_0x4efee3;return this['_parentView']?.['element']?(_0x155731=this['_parentView']['element']['cloneNode'](!0x0),_0x4efee3=this['_findTargetContainer'](_0x155731)):(_0x155731=document['createElement']('div'),_0x4efee3=_0x155731),{'calculationContainer':_0x155731,'targetContainer':_0x4efee3};}['_createCalculationContainer'](){const {calculationContainer:_0x54f164,targetContainer:_0x2e7d00}=this['_createContainerElements'](),_0x579fe8=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x54f164,_0x579fe8);const _0x27d62b=(this['_parentView']?.['element']||this['_containerElement'])?.['parentElement'];_0x27d62b?_0x27d62b['appendChild'](_0x54f164):document['body']['appendChild'](_0x54f164),_0x54f164['_targetContainer']=_0x2e7d00;const _0xb7dd5c=this['_makeAncestorsVisible'](_0x27d62b||null);return _0x54f164['offsetWidth'],_0x54f164['_ancestorsToRestore']=_0xb7dd5c,_0x54f164;}['_calculateOverflowInContainer'](_0x545e50,_0x1041cd){const _0x3241b6=_0x545e50['_targetContainer']||_0x545e50,_0xd7d556=[],{rowCount:_0x44bc67}=this['_renderChipsAndCountRows'](_0x3241b6,_0x1041cd);if(_0x44bc67<=this['_config']['maxVisibleRows'])return _0xd7d556;const _0x4aa275=_0x1041cd['slice']();for(;_0x4aa275['length']>0x0;){if(this['_testButtonFit'](_0x545e50,_0x3241b6,_0x4aa275)){const _0x20c80b=_0x1041cd['filter'](_0x2bb520=>!_0x4aa275['includes'](_0x2bb520));_0xd7d556['push'](..._0x20c80b);break;}if(!_0x4aa275['pop']())break;}return _0xd7d556;}['_renderChipsAndCountRows'](_0x56d55b,_0x1b0d1c){_0x56d55b['innerHTML']='',_0x1b0d1c['forEach'](_0x1ae7d0=>{if(_0x1ae7d0['element']){const _0x5b8696=_0x1ae7d0['element']['cloneNode'](!0x0);_0x56d55b['appendChild'](_0x5b8696);}}),_0x56d55b['offsetWidth'];const _0x10e5ba=_0x56d55b['children'],_0x1e7365=[];return Array['from'](_0x10e5ba)['forEach'](_0xc26b44=>{const _0x4a188c=_0xc26b44['getBoundingClientRect']()['top'];_0x1e7365['some'](_0x350f4d=>Math['abs'](_0x350f4d-_0x4a188c)<this['_config']['rowDetectionTolerance'])||_0x1e7365['push'](_0x4a188c);}),{'rowCount':_0x1e7365['length']};}['_createMockButton'](){const _0x55e932=document['createElement']('button');return _0x55e932['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x55e932['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x55e932['textContent']='+\x201',_0x55e932;}['_testButtonFit'](_0x3f64b0,_0x42d0e8,_0x24a26a){this['_renderChipsAndCountRows'](_0x42d0e8,_0x24a26a);const _0x1ca538=this['_createMockButton']();_0x3f64b0['appendChild'](_0x1ca538),_0x3f64b0['offsetWidth'];const _0x2979e5=[..._0x42d0e8['children'],_0x1ca538],_0x5a83ee=[];_0x2979e5['forEach'](_0x79b635=>{const _0x2d5f44=_0x79b635['getBoundingClientRect']()['top'];_0x5a83ee['some'](_0x291743=>Math['abs'](_0x291743-_0x2d5f44)<this['_config']['rowDetectionTolerance'])||_0x5a83ee['push'](_0x2d5f44);});const _0x46dc95=_0x5a83ee['length'];return _0x1ca538['remove'](),_0x46dc95<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x50b739,_0x40c44c){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x50b739['forEach'](_0x1773e0=>{_0x40c44c['includes'](_0x1773e0)?this['_overflowChips']['add'](_0x1773e0):this['_visibleChips']['add'](_0x1773e0);});}['_updateOverflowUI'](_0x75c413){if(_0x75c413>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x75c413>0x0&&this['_showMoreButtonView']){const _0x183d47=''+this['_config']['showMoreLabelPrefix']+(_0x75c413<0x63?_0x75c413:'99');this['_showMoreButtonView']['label']=_0x183d47;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x34b4f6,_0x43dcf4){this['_distributeChips'](_0x34b4f6,_0x43dcf4),this['_updateOverflowUI'](_0x43dcf4['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x50ef3d=>{_0x50ef3d[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 _0x5eab9e=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x5eab9e['width']||0x0===_0x5eab9e['height'])return!0x1;const _0x4b09c2=window['innerHeight']||document['documentElement']['clientHeight'],_0x2d717e=window['innerWidth']||document['documentElement']['clientWidth'];return _0x5eab9e['bottom']>=-0xc8&&_0x5eab9e['top']<=_0x4b09c2+0xc8&&_0x5eab9e['right']>=-0xc8&&_0x5eab9e['left']<=_0x2d717e+0xc8;}};const fr='ck-ai-chat__feed__context-chips',br='ck-ai-chat-context-chips-wrapper',Sr='ck-ai-chat-context-chips-wrapper-balloon',Rr='ck-ai-chat-controls-button',Or='ck-ai-chat-controls_context_show-more-button',vr='ck-ai-chat-context-controls__show-more-balloon-panel';var kr=class extends _0x42f8f5{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x4a12be,_0x917e46,_0x912648){super(_0x4a12be),this['_bodyCollection']=_0x912648,this['_createContextChips'](_0x917e46);const _0x457da3={'cssClasses':{'showMoreButton':Or+'\x20'+hn,'showMoreBalloon':vr,'overflowContainer':Sr,'controlsButton':Rr}};this['_overflowManager']=new Cr(_0x4a12be,this['_contextChips'],_0x457da3,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[fr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':br},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x461391=this['element']['querySelector']('.'+br);_0x461391&&(this['_overflowManager']['setContainerElement'](_0x461391),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1247f0){for(const _0x16cb72 of _0x1247f0){const _0xe0b0a3=new mr(this['locale'],_0x16cb72,!0x0,!0x1);this['_contextChips']['add'](_0xe0b0a3);}}},Nr=class extends Vn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0xfd3672,_0x497ef3,_0xe2cdc4){super(_0x497ef3),this['_locale']=_0xfd3672,this['_bodyCollection']=_0xe2cdc4,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 kr(this['_locale'],this['options']['contextItems']['filter'](_0xccf496=>!_0xccf496['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x42f8f5(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}},yr=class extends Vn{['capabilities'];constructor(_0x3f09fa,_0x32d810){super(_0x32d810);const {isWebSearchEnabled:_0x485887,isReasoningEnabled:_0x2ff01a}=_0x32d810['capabilities'],_0x195c8d=[];let _0x4d2129='';_0x485887&&_0x2ff01a?(_0x4d2129=us(_0x3f09fa,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x195c8d['push'](xr(at)),_0x195c8d['push'](xr(_0x19f12e))):_0x485887?(_0x4d2129=us(_0x3f09fa,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x195c8d['push'](xr(at))):_0x2ff01a&&(_0x4d2129=us(_0x3f09fa,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x195c8d['push'](xr(_0x19f12e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4d2129?'':'ck-hidden']}});const _0xa6a812=new _0x42f8f5();_0xa6a812['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x195c8d,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4d2129]}]}),this['children']['add'](_0xa6a812),this['capabilities']=_0x32d810['capabilities'];}};function xr(_0x5ea982){const _0x38b8e9=new Yt();return _0x38b8e9['content']=_0x5ea982,_0x38b8e9;}const Lr=['wheel','touchstart','pointerdown','keydown'],Dr=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var Pr=class{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x2ba852){this['element']=_0x2ba852,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0xb476cf of Lr){const _0x1d74bf='keydown'!==_0xb476cf;this['element']['addEventListener'](_0xb476cf,this['_onUserEvent']['bind'](this),{'passive':_0x1d74bf,'signal':this['abortController']['signal']});}}['start']({smooth:_0x462c1c=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x462c1c?'smooth':'auto',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'](_0x4a67a7){if(this['isRunning']){if('keydown'===_0x4a67a7['type']){const _0x61a5eb=_0x4a67a7['key'];if(!Dr['includes'](_0x61a5eb))return;}_0x4a67a7 instanceof WheelEvent?_0x4a67a7['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x182f2c,scrollHeight:_0x1f3156,clientHeight:_0x39130c}=this['element'];return _0x1f3156-_0x182f2c-_0x39130c<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},Hr=class extends Vn{constructor(_0x2459a2){super(_0x2459a2),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}},Mr=class extends _0x42f8f5{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x377e92,_0x4e416a){super(_0x377e92),this['_bodyCollection']=_0x4e416a,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...yn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Pr(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3643fa,_0x8df9ac){let _0x2680c6;return'ai-reply'===_0x3643fa?_0x2680c6=new hr(this['locale'],_0x8df9ac,this['_bodyCollection']):'ai-suggestion-reply'===_0x3643fa?(_0x2680c6=new ar(this['locale'],_0x8df9ac,this['_bodyCollection']),_0x2680c6['bind']('isTrackChangesOn')['to'](this)):_0x2680c6='user-message'===_0x3643fa?new Nr(this['locale'],_0x8df9ac,this['_bodyCollection']):'interaction-header'===_0x3643fa?new yr(this['locale'],_0x8df9ac):'custom-element'===_0x3643fa?new Hr(_0x8df9ac):new tr(_0x8df9ac),this['children']['add'](_0x2680c6),_0x2680c6;}async['updateReplyItem']({id:_0x53e662,parsedContent:_0x158b81,renderingStrategy:_0x4c53af,abortSignal:_0x14d22d}){const _0x376c1b=this['getItemById'](_0x53e662);if(!(_0x376c1b instanceof hr))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x376c1b,'id':_0x53e662,'parsedContent':_0x158b81});await _0x376c1b['updateContent']({'parsedContent':_0x158b81,'renderingStrategy':_0x4c53af,'abortSignal':_0x14d22d});}async['updateWebSources'](_0x258e31,_0x3e9289){const _0x229774=this['getItemById'](_0x258e31);if(_0x229774 instanceof ar)_0x229774['updateSources'](_0x3e9289);else{if(!(_0x229774 instanceof hr))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x229774,'id':_0x258e31,'sources':_0x3e9289});_0x229774['updateSources'](_0x3e9289);}}async['updateSuggestionItem']({id:_0x55d75d,parts:_0x186b4c,abortSignal:_0x5c08ba,skipLoadingEffects:_0x3ca179}){const _0xc05f3a=this['getItemById'](_0x55d75d);if(!(_0xc05f3a instanceof ar))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0xc05f3a,'id':_0x55d75d,'parts':_0x186b4c});await _0xc05f3a['updateContent']({'parts':_0x186b4c,'abortSignal':_0x5c08ba,'skipLoadingEffects':_0x3ca179});}['updateSuggestionPartState']({id:_0x24d996,index:_0x1a1657,state:_0x1a74ba}){const _0x545c09=this['getItemById'](_0x24d996);if(!(_0x545c09 instanceof ar))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x24d996});_0x545c09['updatePartState'](_0x1a1657,_0x1a74ba);}['setSuggestionPartActive']({id:_0x587f6d,index:_0x534c43,isActive:_0x1d0260}){const _0x4b36b9=this['getItemById'](_0x587f6d);if(!(_0x4b36b9 instanceof ar))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x587f6d});this['children']['filter'](_0x171549=>_0x171549 instanceof ar)['forEach'](_0x8c1ec2=>{_0x8c1ec2['setPartActive'](!0x1);}),_0x4b36b9['setPartActive'](_0x534c43,_0x1d0260);}['markItemAsDone'](_0x2541e2){this['getItemById'](_0x2541e2)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x377ba9=>_0x377ba9['options']['id']);}['removeItem'](_0x5f1041){this['children']['remove'](this['getItemById'](_0x5f1041));}['hasItem'](_0x5d640c){return!!this['children']['find'](_0x38659f=>_0x38659f['options']['id']['includes'](_0x5d640c));}['scrollToSuggestion'](_0x361fc9,_0x216007){const _0x35ed8a=this['getItemById'](_0x361fc9);if(!(_0x35ed8a instanceof ar))return void bt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x361fc9,'partIndex':_0x216007});const _0x3ef32f=_0x35ed8a['getPartView'](_0x216007);_0x3ef32f?St(_0x3ef32f['element'],0x14,this['element']['parentElement'],!0x0,!0x0):bt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x361fc9,'partIndex':_0x216007});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x3056e3=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x3056e3,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x333f6e=new Xn(this['locale'],zn['aiFeed']);return _0x333f6e['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x333f6e;}['_createFeedItems'](){const _0x1cca4b=new _0x42f8f5(this['locale']);return _0x1cca4b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1cca4b;}['_createFeedLoader'](){const _0x3b7536=new _0x42f8f5(this['locale']);return _0x3b7536['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x423dd5=>!_0x423dd5)]},'children':this['_createLoaderChildren']()}),_0x3b7536;}['_createLoaderChildren'](){const _0x311495=new cr();return _0x311495['isVisible']=!0x0,[_0x311495,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x7ef417){const _0x410c5c=this['children']['find'](_0x540172=>_0x540172['options']['id']['includes'](_0x7ef417));if(!_0x410c5c)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x7ef417});return _0x410c5c;}['setLoadingMessage'](_0x4e9992){this['set']('loadingMessage',_0x4e9992);}['toggleLoadingSkeleton'](_0x2492b3){this['set']('isLoadingSkeletonVisible',_0x2492b3);}['startAutoScroll'](_0x1649ec={}){this['scrollManager']['start'](_0x1649ec);}['stopAutoScroll'](){this['scrollManager']['stop']();}},Vr=class extends jt{['filter'](){let _0x20f48=0x0;for(const _0x2ed862 of this['items'])_0x20f48+=_0x2ed862['items']['length'];return{'resultsCount':_0x20f48,'totalItemsCount':_0x20f48};}};function Ur(_0x279c04){const _0x5bf4c8=[];let _0x2a3189=!0x1;for(const _0x10523f of Array['from'](_0x279c04['items'])){if('file'!==_0x10523f['kind'])continue;if(_0x10523f['webkitGetAsEntry']()?.['isDirectory']){_0x2a3189=!0x0;continue;}const _0x1a7210=_0x10523f['getAsFile']();_0x1a7210&&_0x5bf4c8['push'](_0x1a7210);}return{'files':_0x5bf4c8,'hasDirectory':_0x2a3189};}const Br='ck-ai-chat__prompt-input_highlighted';var Gr=class AIChatPromptInputView extends Nt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x17455e,_0x1cc687){super(_0x17455e,{'queryView':{'label':'','creator':_0x48ca6a,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Vr(_0x17455e),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x1cc687,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['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',(_0x314c66,_0xc80874)=>!_0x314c66&&!_0xc80874),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3584ea,_0x43a2fa)=>{this['isUploadInProgress']||this['isEmpty']||_0x3584ea['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x43a2fa());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x2c025e=>this['_handlePaste'](_0x2c025e)),this['element']['addEventListener']('drop',_0x3171c9=>this['_handleDrop'](_0x3171c9));}['_handlePaste'](_0x1afb18){const _0x2c1574=_0x1afb18['clipboardData'];if(!_0x2c1574)return;const {files:_0x649c2d,hasDirectory:_0x59a1ea}=Ur(_0x2c1574),_0x31fbc9={'files':_0x649c2d,'plainText':_0x2c1574['getData']('text/plain'),'hasDirectory':_0x59a1ea,'forceTextAttachment':!0x1,'preventDefault':()=>_0x1afb18['preventDefault']()};this['fire']('promptInputPaste',_0x31fbc9);}['_handleDrop'](_0x461d5d){const _0xfcb169=_0x461d5d['dataTransfer'];if(!_0xfcb169)return;const _0x3e22ba={'files':[],'plainText':_0xfcb169['getData']('text/uri-list')||_0xfcb169['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x461d5d['preventDefault']()};this['fire']('promptInputPaste',_0x3e22ba);}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3391ad=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3391ad)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1e372=_0x5a08e5(_0x3391ad);this['fire']('sendUserMessage',_0x1e372),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x351247){this['queryView']['fieldView']['set']('placeholder',_0x351247);}['focus'](_0x3ce232=!0x1){super['focus'](),_0x3ce232&&(this['element']['classList']['contains'](Br)||(this['element']['classList']['add'](Br),setTimeout(()=>{this['element']['classList']['remove'](Br);},0x320)));}['_createSubmitButton'](){const _0x2c8373=new Ht(this['locale']);return _0x2c8373['set']({'icon':st,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+on,'isEnabled':!0x1}),_0x2c8373['on']('execute',()=>{this['submit']();}),_0x2c8373;}['setIsUploadInProgress'](_0x8872eb){this['isUploadInProgress']=_0x8872eb;}['_setUpAddContextButtonPositioning'](){const _0x2ff134=this['locale'],_0x275112=()=>{Tt['window']['requestAnimationFrame'](()=>{if(Ct(this['element'])){const _0x44832b=new At(this['queryView']['fieldView']['element']),_0x541aef=new At(this['_addContextButtonView']['element']),_0x17c16d=_0x44832b['width'],_0x3013df='rtl'===_0x2ff134['uiLanguageDirection']?'right':'left';_0x44832b['excludeScrollbarsAndBorders']();const _0x118360=_0x17c16d-_0x44832b['width']+0x1;this['_addContextButtonView']['element']['style'][_0x3013df]='calc('+(_0x17c16d-_0x541aef['width']-_0x118360)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x275112),this['on']('render',()=>{_0x275112(),this['_queryViewResizeObserver']=new It(this['queryView']['fieldView']['element'],()=>{_0x275112();});});}},Fr=class extends _0x42f8f5{constructor(_0x4a6718){super(_0x4a6718);const _0x4832f8=new Yt();_0x4832f8['content']=_0x324f70,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x4832f8,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':us(_0x4a6718,'AI_CHAT_DROP_ZONE_HINT')}]}]});}['attach'](_0x36fcbf){let _0x3e2835=0x0;_0x36fcbf['addEventListener']('dragenter',_0x55a009=>{_0x55a009['dataTransfer']&&(_0x3e2835++,0x1===_0x3e2835&&this['fire']('dragEnter'),_0x36fcbf['classList']['add']('ck-ai-chat-controls_drag-over'));}),_0x36fcbf['addEventListener']('dragover',_0x133b83=>{_0x133b83['dataTransfer']&&_0x133b83['preventDefault']();}),_0x36fcbf['addEventListener']('dragleave',()=>{--_0x3e2835<=0x0&&(_0x3e2835=0x0,_0x36fcbf['classList']['remove']('ck-ai-chat-controls_drag-over'));}),_0x36fcbf['addEventListener']('drop',_0x18e895=>{_0x18e895['preventDefault'](),_0x3e2835=0x0,_0x36fcbf['classList']['remove']('ck-ai-chat-controls_drag-over'),this['_handleDrop'](_0x18e895);});}['_handleDrop'](_0xc2ec13){const _0x2d0106=_0xc2ec13['dataTransfer'];if(!_0x2d0106)return;const {files:_0x4845ec,hasDirectory:_0x1857ba}=Ur(_0x2d0106),_0xe1bef3={'files':_0x4845ec,'plainText':_0x2d0106['getData']('text/uri-list')||_0x2d0106['getData']('text/plain'),'hasDirectory':_0x1857ba,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0xe1bef3);}};const Kr='ck-ai-chat__prompt-capabilities',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls-button--commands',$r='ck-ai-chat-controls__model-selection',qr='ck-ai-chat-controls__model-selection__item-name',Qr='ck-ai-chat-controls__model-selection__item-description',Xr='ck-ai-chat-controls__model-selection__item-capabilities',zr='n';var jr=class extends _0x42f8f5{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x2e3c77){super(_0x2e3c77),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4a896a=>'selector'===_0x4a896a),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2c3694=>_0x2c3694?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x23427e=>_0x23427e),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5eab47=>_0x5eab47),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x896fc4=>us(this['locale'],_0x896fc4?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x9c7885=>_0x9c7885),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x5d86cc=>us(this['locale'],_0x5d86cc?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Kr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new ct(),_0x3e8d7a(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x329191,_0x24353e){if(_0x24353e)this['set']('modelDisplayMode','hidden');else{const _0x4ebf83=0x1===_0x329191['length'];this['set']('modelDisplayMode',_0x4ebf83?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x329191?.['length'])for(const _0xdb3dc8 of _0x329191){const _0x51d5f5=new _0x5ef671({'label':_0xdb3dc8['name'],'withText':!0x0,'role':'menuitemradio','id':_0xdb3dc8['id'],'model':_0xdb3dc8});_0x51d5f5['bind']('isOn')['to'](this,'activeModelId',_0x5c24b8=>_0x5c24b8===_0xdb3dc8['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x51d5f5,'labelView':new Jr(this['locale'],_0xdb3dc8)});}}['setWebSearch'](_0x1d1072){this['set']('webSearchActive',_0x1d1072);}['setReasoning'](_0x314312){this['set']('reasoningActive',_0x314312);}['setModel'](_0x1b86ff){if(!_0x1b86ff)return;this['activeModelId']=_0x1b86ff['id'],this['activeModelName']=_0x1b86ff['name']||_0x1b86ff['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x1b86ff['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x1b86ff['name']);const _0x45b4e8=_0x1b86ff['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x45b4e8),this['_webSearchButton']['set']('isVisible',_0x45b4e8);const _0x47fa47=_0x1b86ff['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x47fa47),this['_reasoningButton']['set']('isVisible',_0x47fa47);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x1a69c9){this['set']('modelSelectorEnabled',!0x1),_0x1a69c9&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0xd2e539=new Ht();return _0xd2e539['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':at,'class':Wr+'\x20'+hn,'isToggleable':!0x0,'tooltipPosition':zr}),_0xd2e539['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0xd2e539;}['_createReasoningButton'](){const _0x22242f=new Ht();return _0x22242f['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x19f12e,'class':Wr+'\x20'+hn,'isToggleable':!0x0,'tooltipPosition':zr}),_0x22242f['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x22242f;}['_createCommandsButton'](){const _0x275ee5=new Ht();return _0x275ee5['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x4fd34f,'withText':!0x0,'class':Wr+'\x20'+hn,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':zr}),_0x275ee5['extendTemplate']({'attributes':{'class':[Yr]}}),_0x275ee5['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x275ee5;}['_createModelSelectionDropdown'](){const _0x809aee=_0x5ba05a(this['locale']);return _0x809aee['set']({'panelPosition':'ne','class':[$r]}),_0x809aee['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':zr,'class':hn}),this['listenTo'](_0x809aee,'execute',_0x9e4726=>{this['fire']('selectModel',_0x9e4726['source']['model']);}),_0x809aee;}['_createModelNameView'](){const _0x2d91be=new Zr(this['locale']);return _0x2d91be['bind']('text')['to'](this,'activeModelName',_0x1c1bf7=>_0x1c1bf7??''),_0x2d91be['bind']('isVisible')['to'](this,'modelDisplayMode',_0x314c7a=>'name'===_0x314c7a),_0x2d91be;}},Jr=class extends Dt{constructor(_0x3e65a1,_0x45f6d4){super();const _0x168137=this['bindTemplate'],_0x10f3ad=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x168137['to']('style'),'id':_0x168137['to']('id')},'children':[{'tag':'div','attributes':{'class':[qr]},'children':[{'text':_0x168137['to']('text')}]},{'tag':'div','attributes':{'class':[Qr]},'children':[{'tag':'span','children':[{'text':_0x45f6d4['description']}]}]},{'tag':'div','attributes':{'class':[Xr]},'children':_0x10f3ad}]}),_0x10f3ad['addMany'](this['_getCapabilityParts'](_0x3e65a1,at,'AI_CHAT_SEARCH_WEB',_0x45f6d4['capabilities']['webSearch']?.['enabled']??!0x1)),_0x10f3ad['addMany'](this['_getCapabilityParts'](_0x3e65a1,_0x19f12e,'AI_CHAT_REASONING',_0x45f6d4['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2ddef1,_0x484977,_0x263234,_0x453ea4){const _0x3d6fed=new Yt();_0x3d6fed['content']=_0x484977;const _0x5b9e8a=new _0x42f8f5(_0x2ddef1);_0x5b9e8a['setTemplate']({'tag':'span','children':[{'text':us(_0x2ddef1,_0x263234)+':\x20'}]});const _0x3b12e4=new _0x42f8f5(_0x2ddef1);return _0x3b12e4['setTemplate']({'tag':'span','children':[{'text':us(_0x2ddef1,_0x453ea4?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3d6fed,_0x5b9e8a,_0x3b12e4];}},Zr=class extends _0x42f8f5{constructor(_0x4c7ef8){super(_0x4c7ef8),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x258f67=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x258f67['if']('isVisible','ck-hidden',_0x2f9d46=>!_0x2f9d46)]},'children':[{'text':_0x258f67['to']('text')}]});}};const to='ck-ai-chat-context-controls__url-form',eo='ck-ai-chat-context-controls__url-input-section';var io=class extends _0x42f8f5{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x5d7b3f){super(_0x5d7b3f),this['focusTracker']=new dt(),this['keystrokes']=new _t(),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 Gt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x88f813=>{this['focusTracker']['add'](_0x88f813['element']),this['keystrokes']['listenTo'](_0x88f813['element']);}),_0x32ec98({'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'](_0x2bfd66){this['urlInputField']['errorText']=_0x2bfd66,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xf3a47e=new Ht(this['locale']);return _0xf3a47e['set']({'icon':_0x3961c4,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x2917e7,_0x2d9071,_0xf06685)=>{_0xf3a47e['set']({'class':['ck-button-icon\x20ck-button-back'+(_0xf06685?'':'\x20ck-hidden')]});}),_0xf3a47e;}['_createUrlInputField'](){const _0x4a93c3=new qt(this['locale'],_0xa4b9);return _0x4a93c3['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4a93c3['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4a93c3;}['_createConfirmButton'](){const _0x33343f=new Ht(this['locale']);return _0x33343f['set']({'icon':_0x734ca,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x33343f;}['_setupTemplate'](){const _0x5ef110=new Ft(this['locale'],{'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5ef110['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':to,'tabindex':'-1'},'children':[_0x5ef110,{'tag':'div','attributes':{'class':eo},'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',_0x3af4fb=>{_0x3af4fb['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x6ed9f9,_0x15f743)=>{this['clear'](),this['fire']('cancel'),_0x15f743();});}['_handleSubmit'](){const _0x21cd52=this['getValue']()['trim']();_0x21cd52?this['_isValidUrl'](_0x21cd52)?(this['clearError'](),this['fire']('submitUrl',_0x21cd52)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x3b7d25=this['getValue']()['trim'](),_0x39d74c=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x3b7d25['length']>0x0&&!_0x39d74c;}['_isValidUrl'](_0x4bfc81){try{return!!new URL(_0x4bfc81);}catch{return!0x1;}}};const so='ck-ai-chat-resources__item',no='ck-ai-chat-resources__item--in-context',ro='ck-ai-chat-resources__item-title',oo='ck-ai-chat-resources__item__icon';var ao=class extends zt{['resource'];['_titleView'];['_iconView'];constructor(_0x2d585c,_0x12814f){super(_0x2d585c),this['resource']=_0x12814f,this['set']('isInContext',!!_0x12814f['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4159e8){if(_0x4159e8['isInContext'])return _0x734ca;switch(_0x4159e8['type']){case'document':return _0x34f9f8;case'web-resource':return _0x18b8c0;case'file':case'text':return _0x324f70;default:return _0x35acaa;}}['highlightText'](_0x4b4698){if(!_0x4b4698||''===_0x4b4698['trim']())return void this['_titleView']['highlightText'](null);const _0x231824=new RegExp(_0x352160(_0x4b4698),'gi');this['_titleView']['highlightText'](_0x231824);}['updateResourceState'](_0x10abd0){this['resource']['isInContext']=_0x10abd0,this['isInContext']=_0x10abd0,this['_updateIcon']();}['_createTitleView'](){const _0x37c0b0=new Wt();return _0x37c0b0['text']=this['resource']['label'],_0x37c0b0['extendTemplate']({'tag':'span','attributes':{'class':[ro]}}),_0x37c0b0;}['_createIconView'](){const _0x53912d=new Yt();return _0x53912d['content']=this['getResourceIcon'](this['resource']),_0x53912d;}['_setupTemplate'](){const _0x2f94d6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[so,_0x2f94d6['if']('isVisible','ck-hidden',_0x1e2ccb=>!_0x1e2ccb),_0x2f94d6['if']('isInContext',no)]},'children':[{'tag':'div','attributes':{'class':[oo]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2f94d6['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}};const ho='ck-ai-chat-resources__list';var co=class extends jt{['_source'];constructor(_0x2bac67,_0x31afa4){super(_0x2bac67),this['_source']=_0x31afa4,this['extendTemplate']({'attributes':{'class':[ho]}});}['setResources'](_0xc9dccf,_0x3cf3d8){this['items']['clear']();let _0x3ac676=_0xc9dccf;if(this['_source']['useDefaultFiltering']&&_0x3cf3d8&&''!==_0x3cf3d8['trim']()){const _0x2ee5dc=new RegExp(_0x3cf3d8['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3ac676=_0xc9dccf['filter'](_0xb51005=>_0x2ee5dc['test'](_0xb51005['label']));}for(const _0x1228a8 of _0x3ac676){const _0x1c4376=new ao(this['locale'],_0x1228a8);_0x1c4376['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1228a8);}),this['items']['add'](_0x1c4376);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x3cf3d8);}['highlightText'](_0x3494c8){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4f5796=>{_0x4f5796['highlightText'](_0x3494c8);});}['updateResourceState'](_0xdc7773,_0x589ebd){for(const _0x1053bf of this['items']){const _0xc86a7d=_0x1053bf;_0xc86a7d['resource']['id']===_0xdc7773&&_0xc86a7d['updateResourceState'](_0x589ebd);}}['_handleResourceSelection'](_0x7a621,_0x46a6b4){this['fire']('addResourceToContext',{'source':_0x7a621,'resource':_0x46a6b4});}},lo=class extends qt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x1eb8c7){const t=_0x1eb8c7['t'],_0x161a06={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0xa4b9,'label':us(_0x1eb8c7,'AI_CHAT_SEARCH_RESOURCES')};super(_0x1eb8c7,_0x161a06['creator']),this['label']=_0x161a06['label'],this['_viewConfig']=_0x161a06,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x1eb8c7,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4760f2){this['fire']('search',_0x4760f2);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new Yt(),this['iconView']['content']=_0x52a38a,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x48ee8c,t){this['resetButtonView']=new Ht(_0x48ee8c),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3c0bfe,'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',_0x34fd3b=>!_0x34fd3b),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);}},uo=class extends _0x42f8f5{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x3193fb,_0x102f3a){super(_0x3193fb),this['_source']=_0x102f3a['source'],this['_searchInputVisibleFrom']=_0x102f3a['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 _0x5f3be9([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new lo(this['locale']);}['_createSearchSection'](){const _0x191ad1=new _0x42f8f5(this['locale']);return _0x191ad1['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x473bf3,_0x1450c0)=>{this['loadResources'](_0x1450c0),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1450c0);}),_0x191ad1;}['_createResourcesListView'](){const _0x4b96af=new co(this['locale'],this['_source']);return _0x4b96af['delegate']('addResourceToContext')['to'](this),_0x4b96af['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x4b96af;}['_createSkeletonView'](){const _0x15d0a6=new Xn(this['locale'],zn['aiChatResources']);return _0x15d0a6['bind']('isVisible')['to'](this,'isLoading'),_0x15d0a6;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x23d4a9){const _0x26a94d=vt();this['_latestLoadResourcesUid']=_0x26a94d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x23d4a9,'uid':_0x26a94d}),this['isLoading']=!0x0;}['setResources'](_0xe61d0e,_0x346dbd){if(_0x346dbd&&_0x346dbd!==this['_latestLoadResourcesUid'])return;const _0x340990=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xe61d0e,_0x340990),_0xe61d0e['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x557257,_0x1048e8){this['_resourcesListView']['updateResourceState'](_0x557257,_0x1048e8);}};const _o='ck-ai-chat-context-controls__source-balloon-panel',go='ck-button-icon\x20ck-button-back',Ao='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';var Io=class{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4f7c1c,_0x4a3b64,_0x3722b7){this['_locale']=_0x4f7c1c,this['_bodyCollection']=_0x4a3b64,this['_config']=_0x3722b7;}['showSourceResourcesBalloon']({source:_0x5491b8,withBackButton:_0x29d617}){let _0x25d600=this['_sourceResourceBalloons']['get'](_0x5491b8['id']);_0x25d600||(_0x25d600=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5491b8['id'],_0x25d600),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x25d600)),this['_addSourceResourceContent']({'balloonPanel':_0x25d600,'source':_0x5491b8,'withBackButton':_0x29d617}),_0x25d600['show']();const _0x1942f4=this['_config']['getTargetElement']();_0x1942f4&&_0x25d600['pin']({'target':_0x1942f4,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1e475d,_0x4ec93e,_0xf5135e){const _0x5f5c3b=this['_sourceResourceBalloons']['get'](_0x1e475d);if(!_0x5f5c3b)return;const _0xa79838=this['_getResourcesViewFromBalloon'](_0x5f5c3b);_0xa79838&&(_0xa79838['setResources'](_0x4ec93e,_0xf5135e),_0xa79838['once']('change:isLoading',()=>{_0x5f5c3b['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x378a35){const _0x17b62f=this['_sourceResourceBalloons']['get'](_0x378a35);_0x17b62f&&requestAnimationFrame(()=>{_0x17b62f['hide'](),this['_sourceResourceBalloons']['delete'](_0x378a35),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x4bab1f of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x4bab1f);}['isAnyResourceBalloonVisible'](){for(const _0x3421c5 of this['_sourceResourceBalloons']['values']())if(_0x3421c5['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x18fce2,_0x17cd9d,_0x1b9563){const _0xb96a61=this['_sourceResourceBalloons']['get'](_0x18fce2);if(!_0xb96a61||!_0xb96a61['isVisible'])return;const _0x17e51a=this['_config']['getTargetElement']();if(!_0x17e51a)return;_0xb96a61['pin']({'target':_0x17e51a,'limiter':this['_config']['getLimiterElement']()});const _0x5e8345=this['_getResourcesViewFromBalloon'](_0xb96a61);_0x5e8345&&_0x5e8345['updateResourceState'](_0x17cd9d,_0x1b9563);}['destroy'](){for(const _0x26dd50 of this['_sourceResourceBalloons']['values']())_0x26dd50['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x219ae0=new yt(this['_locale']);return _0x219ae0['extendTemplate']({'attributes':{'class':_o}}),this['_bodyCollection']['add'](_0x219ae0),_0x219ae0;}['_addSourceResourceContent']({balloonPanel:_0x479060,source:_0xa38aa4,withBackButton:_0x4bec11}){_0x479060['content']['clear']();const _0x16956a=this['_createBalloonHeader']({'balloonPanel':_0x479060,'source':_0xa38aa4,'withBackButton':_0x4bec11});_0x479060['content']['add'](_0x16956a);const _0x437ee6=this['_createBalloonResourcesView'](_0xa38aa4);_0x479060['content']['add'](_0x437ee6);}['_createBalloonHeader']({balloonPanel:_0x3159d4,source:_0x15e7b6,withBackButton:_0x15ab1e}){const _0x3f3c2b=new Ft(this['_locale'],{'label':_0x15e7b6['label'],'class':Ao});return _0x15ab1e&&_0x3f3c2b['children']['add'](this['_createBackButton'](_0x3159d4),0x0),_0x3f3c2b;}['_createBackButton'](_0x137528){const _0x5ab527=new Ht(this['_locale']);return _0x5ab527['set']({'icon':_0x3961c4,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':go}),_0x5ab527['on']('execute',()=>{_0x137528['hide'](),this['_config']['onBackToContext']();}),_0x5ab527;}['_createBalloonResourcesView'](_0x766408){const _0x4d2614=new uo(this['_locale'],{'source':_0x766408,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x4d2614['on']('loadSourceResources',(_0x4e265f,_0x1e2b89)=>{this['_config']['onLoadSourceResources'](_0x1e2b89);}),_0x4d2614['on']('addResourceToContext',(_0x4e0dc8,_0x48e78b)=>{this['_config']['onResourceSelected'](_0x48e78b['source'],_0x48e78b['resource']),this['closeSourceResourceBalloon'](_0x766408['id']);}),_0x4d2614;}['_getResourcesViewFromBalloon'](_0x15910a){const _0xc1a870=_0x15910a['content']['get'](0x1);return _0xc1a870 instanceof uo?_0xc1a870:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5bf047){_0x4c94bb({'emitter':_0x5bf047,'contextElements':[_0x5bf047['element']],'callback':()=>{_0x5bf047['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5bf047['isVisible']});}};const po=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],mo='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',To='ck-ai-chat-context-controls__add-context-balloon-panel',wo='ck-ai-chat-context-controls__add-context-button',Co='ck-ai-chat-context-controls__url-balloon-panel',fo='ck-ai-chat-context-controls__balloon-button',bo='ck-ai-chat-context-controls__balloon-button-source',So='ck-ai-chat-controls-button',Ro='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',vo='ck-ai-chat-context-controls__show-more-balloon-panel',ko='ck-ai-chat',No=[yt['defaultPositions']['northArrowSouthWest'],yt['defaultPositions']['northArrowSouth'],yt['defaultPositions']['northArrowSouthEast'],yt['defaultPositions']['southArrowNorthWest'],yt['defaultPositions']['southArrowNorth'],yt['defaultPositions']['southArrowNorthEast']];var yo=class extends _0x42f8f5{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x33b0d9,_0x4a327c){super(_0x33b0d9),this['bodyCollection']=_0x4a327c['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x33b0d9),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x33b0d9),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x33b0d9),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x33b0d9,_0x4a327c);const _0x4806a1={'cssClasses':{'showMoreButton':Oo+'\x20'+hn,'showMoreBalloon':vo,'overflowContainer':Ro,'controlsButton':So}};this['_overflowManager']=new Cr(_0x33b0d9,this['_currentContextsChips'],_0x4806a1,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'](_0x4e3afb,_0x3a2738){const _0x1b08c6=this['_createContextButton'](_0x4e3afb,'current',!0x0,_0x3a2738);this['_addContextToCollection'](_0x1b08c6,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x68f8da){this['_removeContextFromCollection'](_0x68f8da,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x68f8da,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x43f9ff,_0x456ff5){let _0x145dc6=this['_currentContextsChips']['find'](_0x445774=>_0x445774['id']===_0x43f9ff);_0x145dc6||(_0x145dc6=this['_overflowManager']['overflowChips']['find'](_0x173868=>_0x173868['id']===_0x43f9ff)),_0x145dc6&&(_0x145dc6['isLoading']=_0x456ff5);}['setConversationContext'](_0x3624f0){this['_conversationContextsChips']['clear']();for(const _0x27e8be of _0x3624f0){const _0x5ad32e=this['_createContextButton'](_0x27e8be,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5ad32e,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x11e456,_0x2ff55e,_0x31fd27){this['_resourcesBalloonView']['updateResourceState'](_0x11e456,_0x2ff55e,_0x31fd27);}['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;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x313f92,withBackButton:_0x38f8a3}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x313f92,'withBackButton':_0x38f8a3}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xd55535,_0x2d7b1f,_0x456591,_0x38710c){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xd55535,_0x456591,_0x38710c);}['closeSourceResourceBalloon'](_0x1a0343){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1a0343),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xd2da11){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xd2da11),this['_setAddContextButtonEnabled'](_0xd2da11);}['_setAddContextButtonEnabled'](_0x1a5c2b){const _0x433438=!_0x1a5c2b['document']['isHidden']&&_0x1a5c2b['document']['enabled'],_0x45f58f=_0x1a5c2b['urls']['enabled'],_0x57502a=_0x1a5c2b['files']['enabled'],_0x47876a=_0x1a5c2b['sources']['length']>0x0,_0x232246=_0x1a5c2b['customItems']&&_0x1a5c2b['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x433438||_0x45f58f||_0x57502a||_0x47876a||_0x232246;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[mo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x22a95f){const _0x486eee=new Ht(_0x22a95f);return _0x486eee['set']({'label':us(_0x22a95f,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':So+'\x20'+wo+'\x20'+hn,'icon':_0x52f6a7,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x486eee;}['_createAddContextBalloonPanelView'](_0x43a343){return this['_createBaseBalloonPanel'](_0x43a343,To);}['_createUrlBalloonPanelView'](_0x34c85e){const _0x1dfa31=this['_createBaseBalloonPanel'](_0x34c85e,Co);return this['_addUrlContent'](_0x1dfa31,_0x34c85e),_0x1dfa31;}['_createResourcesBalloonView'](_0x178f67,_0x1add2a){const _0xff063d={'searchInputVisibleFrom':_0x1add2a['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No});},'onResourceSelected':(_0x258601,_0x430cc9)=>{this['fire']('addResourceToContext',{'source':_0x258601,'resource':_0x430cc9});},'onLoadSourceResources':_0x52b8ee=>{this['fire']('loadSourceResources',_0x52b8ee);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Io(_0x178f67,_0x1add2a['bodyCollection'],_0xff063d);}['_getLimiterElement'](){return this['element']?.['closest']('.'+ko)||document['body'];}['_createBaseBalloonPanel'](_0x38a831,_0xbfca0f){const _0x45c001=new yt(_0x38a831);return _0x45c001['extendTemplate']({'attributes':{'class':_0xbfca0f}}),this['bodyCollection']['add'](_0x45c001),_0x45c001;}['_setBalloonPanelContent'](_0x3c558b,_0x50f3c8,_0x34dd86){if(_0x3c558b['content']['clear'](),!_0x34dd86['document']['isHidden']&&_0x34dd86['document']['enabled']){const _0x500aca=this['_createBalloonButton'](_0x50f3c8,{'label':us(_0x50f3c8,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x34f9f8});_0x500aca['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3c558b['content']['add'](_0x500aca);}if(_0x34dd86['urls']['enabled']){const _0x105877=this['_createBalloonButton'](_0x50f3c8,{'label':us(_0x50f3c8,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x18b8c0});_0x105877['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No}),this['_urlInputView']['focus']();}),_0x3c558b['content']['add'](_0x105877);}if(_0x34dd86['files']['enabled']){const _0xd06eae=new Bt(_0x50f3c8);_0xd06eae['set']({'label':us(_0x50f3c8,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x169866,'withText':!0x0,'tooltip':!0x0,'class':fo,'allowMultipleFiles':!0x0}),_0xd06eae['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xd06eae['on']('done',(_0x28eb4d,_0x2453dd)=>{this['fire']('addFileToContext',_0x2453dd);}),_0xd06eae['tooltip']=!0x0,_0x3c558b['content']['add'](_0xd06eae);}for(const _0xa34cf0 of _0x34dd86['sources']){const _0x360db1=this['_createBalloonButton'](_0x50f3c8,{'label':_0xa34cf0['label'],'icon':_0xa34cf0['icon']||_0x35acaa,'type':'source'});_0x3c558b['content']['add'](_0x360db1),_0x360db1['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0xa34cf0,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x1fb306 of _0x34dd86['customItems']||[]){const _0x1e92d7=this['_createBalloonButton'](_0x50f3c8,{'label':_0x1fb306['label'],'icon':_0x1fb306['icon']||_0x35acaa,'type':'customItem'});_0x3c558b['content']['add'](_0x1e92d7),_0x1e92d7['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x1fb306);});}this['_hasExactlyOneSource']=0x1===_0x3c558b['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x119887,_0x46a54c){this['_urlInputView']=new io(_0x46a54c),this['_urlInputView']['on']('submitUrl',(_0x5a47a8,_0x5dd253)=>{this['_handleUrlSubmit'](_0x5dd253);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No});}),_0x119887['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x46db06,_0x527d05){const _0x52a2d8='source'===_0x527d05['type']?new xo(_0x46db06):new Ht(_0x46db06);return _0x52a2d8['set']({'label':_0x527d05['label'],'icon':_0x527d05['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':fo}),_0x52a2d8;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4c94bb({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x34bc4f){const _0x2a4841=this['_addContextBalloonConfig'];_0x2a4841['buttonView']['isOn']=_0x34bc4f,_0x34bc4f?_0x2a4841['balloonView']['show']():_0x2a4841['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x54835e,buttonView:_0x4a184f,hideMethod:_0x5a6f35}=this['_addContextBalloonConfig'];_0x4c94bb({'emitter':_0x54835e,'contextElements':[_0x54835e['element'],_0x4a184f['element']],'callback':()=>{_0x5a6f35();},'activator':()=>_0x4a184f['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x32a6d3,_0x47e91e,_0x5b4dce=!0x1,_0x6c7bb9=!0x1){const _0x287cc1='conversation'===_0x47e91e||!0x0===_0x32a6d3['isReadOnly'],_0x8891fb=new mr(this['locale'],_0x32a6d3,_0x287cc1,_0x5b4dce,_0x6c7bb9);return _0x287cc1||_0x8891fb['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x8891fb['id']);}),_0x8891fb;}['_addContextToCollection'](_0x6b8fdf,_0x2bf33a){_0x2bf33a['add'](_0x6b8fdf,0x0);}['_removeContextFromCollection'](_0x141148,_0x18e91c){const _0x414152=_0x18e91c['find'](_0x339537=>_0x339537['id']===_0x141148);_0x414152&&_0x18e91c['remove'](_0x414152);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0xb1aea3){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0xb1aea3);}},xo=class extends Ht{['arrowView'];constructor(_0x4f35a0){super(_0x4f35a0),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[bo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x13ed18=new Yt();return _0x13ed18['content']=_0xcfa2c6,_0x13ed18['extendTemplate']({'attributes':{'class':bo+'__arrow'}}),_0x13ed18;}},Lo=class extends _0x42f8f5{['_cancelButtonView'];['_loaderView'];constructor(_0x96bd98){super(_0x96bd98),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 _0x5644a6=new Ht(this['locale']);return _0x5644a6['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':an+'\x20ck-ai-button-stop-generating','icon':it}),_0x5644a6['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5644a6;}['_createLoaderView'](){const _0x4fa1a8=new _0x42f8f5(this['locale']);return _0x4fa1a8['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':us(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4fa1a8;}},Do=class extends _0x42f8f5{['_contextPanelView'];['_promptInputView'];['_dropZoneView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];['_filesEnabled'];constructor(_0x522d13,_0x12630b){super(_0x522d13),this['_filesEnabled']=_0x12630b['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x522d13,{'bodyCollection':_0x12630b['bodyCollection'],'searchInputVisibleFrom':_0x12630b['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x522d13),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x522d13),this['_loaderView']=this['_createLoaderView'](_0x522d13),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x522d13),this['_dropZoneView']=new Fr(_0x522d13),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste')['to'](this),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),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'](...po)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x34b935=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x34b935['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x34b935['if']('isLoading','ck-hidden',_0x2a98c0=>_0x2a98c0||!this['isModelAvailable']),_0x34b935['if']('isModelAvailable','ck-hidden',_0x2da885=>!_0x2da885||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x34b935['if']('isLoading','ck-hidden',_0x46944a=>!_0x46944a)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x34b935['if']('isModelAvailable','ck-hidden',_0xd75263=>_0xd75263)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView']]}),_0x4c94bb({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}['_createContextPanelView'](_0x27eda9,_0x31340e){return new yo(_0x27eda9,_0x31340e);}['_createPromptInputView'](_0x2c6c96){return new Gr(_0x2c6c96,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x16770e){return new jr(_0x16770e);}['_createLoaderView'](_0x36c4ba){return new Lo(_0x36c4ba);}['_createModelUnavailableMessageView'](_0x53ec76){const _0x4c9a08=new Po(_0x53ec76);return _0x4c9a08['delegate']('startConversation')['to'](this),_0x4c9a08;}['_handlePromptInputFocus'](_0x125e3e,_0x531f66,_0x17a93f){_0x17a93f?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x4c64b0,_0xf0a1b2){this['_contextPanelView']['addContextItem'](_0x4c64b0,_0xf0a1b2);}['removeContextItem'](_0x41370f){this['_contextPanelView']['removeContextItem'](_0x41370f);}['setContextItemLoading'](_0x15c37e,_0x4f2ccd){this['_contextPanelView']['setContextItemLoading'](_0x15c37e,_0x4f2ccd);}['setIsUploadInProgress'](_0x4a5204){this['_promptInputView']['setIsUploadInProgress'](_0x4a5204);}['setConversationContext'](_0x1c0ece){this['_contextPanelView']['setConversationContext'](_0x1c0ece);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x28287d,_0x4886ee,_0x17426c){this['_contextPanelView']['updateResourceState'](_0x28287d,_0x4886ee,_0x17426c);}['setWebSearch'](_0x2ebc9e){this['_promptCapabilitiesView']['setWebSearch'](_0x2ebc9e);}['setReasoning'](_0x18d825){this['_promptCapabilitiesView']['setReasoning'](_0x18d825);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x21b820){this['_contextPanelView']['setAddContextOptions'](_0x21b820);}['setInputPlaceholder'](_0x409ec0){this['_promptInputView']['setPlaceholderText'](_0x409ec0);}['setModelList'](_0x16c438,_0x33ef91){this['_promptCapabilitiesView']['setModelList'](_0x16c438,_0x33ef91);}['setModel'](_0x39ac1c){_0x39ac1c?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x39ac1c)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3690d9){this['_promptCapabilitiesView']['disableModelSelector'](_0x3690d9);}['populateSourceResourceBalloon'](_0x1cafc0,_0x27c1d9,_0x1e1900,_0x401780){this['_contextPanelView']['populateSourceResourceBalloon'](_0x1cafc0,_0x27c1d9,_0x1e1900,_0x401780);}['closeSourceResourceBalloon'](_0x55b4f3){this['_contextPanelView']['closeSourceResourceBalloon'](_0x55b4f3);}['focusPromptInput'](_0x16c09a=!0x1){this['_promptInputView']['focus'](_0x16c09a);}['setPromptInputValue'](_0xbc0cc1){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0xbc0cc1;}},Po=class extends _0x42f8f5{constructor(_0x1f8bd0){super(_0x1f8bd0);const _0x3e4f4d=new Ht(_0x1f8bd0);_0x3e4f4d['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3e4f4d['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x3e4f4d]}]});}},Ho=class extends Ft{['resizeButton'];constructor(_0x3a2cdd,_0x61d57e){super(_0x3a2cdd,{'label':_0x61d57e['label'],'class':'ck-ai-header\x20'+_0x61d57e['class'],'icon':_0x61d57e['icon']}),this['set']('isMaximized',!0x1),_0x61d57e['content']&&this['children']['add'](_0x61d57e['content']),_0x61d57e['showResizeButton']&&(this['resizeButton']=cn(_0x3a2cdd,this),this['children']['add'](this['resizeButton']));}},Mo=class extends _0x42f8f5{constructor(_0x3f6b7a){super(_0x3f6b7a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x3f6b7a,'AI_DISCLAIMER_TEXT')}]}]});}};function Vo(_0x42405c,_0x2b05e7){const _0x3fa9a6=new Ht(_0x42405c);return _0x3fa9a6['set']({'label':us(_0x42405c,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4a9c6e,'class':'ck-ai-chat__start-conversation\x20'+an}),_0x3fa9a6['on']('execute',()=>{_0x2b05e7['fire']('startConversation');}),_0x3fa9a6;}var Uo=class extends _0x42f8f5{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5eaa21,_0x16ee02){super(_0x5eaa21),this['_bodyCollection']=ln(_0x5eaa21);const _0x2d406e=Vo(_0x5eaa21,this);this['chatHeader']=new Ho(_0x5eaa21,{'label':us(_0x5eaa21,'AI_CHAT_HEADING'),'icon':_0x404c28,'class':'ck-ai-header_chat','content':_0x2d406e,'showResizeButton':_0x16ee02['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new Mr(_0x5eaa21,this['_bodyCollection']),this['chatFeed']['delegate'](...yn)['to'](this),this['chatControls']=new Do(_0x5eaa21,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x16ee02['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x16ee02['filesEnabled']}),this['chatControls']['delegate'](...yn)['to'](this),this['chatDisclaimer']=new Mo(_0x5eaa21),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5eaa21['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x2da39d,_0x2579c8,_0x122095,_0x61f2b4){this['chatControls']['populateSourceResourceBalloon'](_0x2da39d,_0x2579c8,_0x122095,_0x61f2b4);}['closeSourceResourceBalloon'](_0x28577c){this['chatControls']['closeSourceResourceBalloon'](_0x28577c);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}},Bo=class extends _0x11a14c{static get['requires'](){return[cs];}['_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(_0x153335){super(_0x153335);const _0x3103f5=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Zn(),this['_view']=new Uo(this['context']['locale'],{'showResizeButton':_0x3103f5['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x3103f5),this['_view']['delegate'](...yn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x23232b,{showDiff:_0x4b9b63})=>{this['showDiff']=_0x4b9b63;}),this['disableControls'](),_0x3103f5['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x404c28,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x3103f5['view'],'isMaximized',_0x41ef25=>_0x41ef25),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x4c5be3=>_0x4c5be3),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x515f79){const _0x5deace=this['context']['config']['get']('ai.chat.welcomeMessage')??us(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x515f79['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x5deace}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x44d4af,staticMessage:_0x583808}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x44d4af,'initialContent':'<p>'+_0x583808+'</p>'});});}async['addFeedItemUserMessage'](_0x2cc0f5){const _0x18fdb=_0x2cc0f5['attributes']?.['displayedPrompt']||_0x2cc0f5['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2cc0f5['contextItems']['values']()),'initialContent':'<p>'+_0x18fdb+'</p>','id':_0x2cc0f5['id']});});}async['addFeedItemError']({errorMessage:_0x2a237f,id:_0x542f00}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2a237f+'</p>','id':_0x542f00});});}async['addFeedItemAIReply'](_0x2b1b6b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2b1b6b['interactionId']+':'+_0x2b1b6b['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x6f163a){const _0x174c67=ds(this['context']),_0x3e2c2c=_0x174c67['map'](_0x5ba408=>_0x5ba408['config']['get']('ai.availableReplyActions')||[...er]);let _0x50055a=_0x3e2c2c['reduce']((_0x3f820a,_0xcc4ae4)=>_0x3f820a['filter'](_0xaa27a7=>_0xcc4ae4['includes'](_0xaa27a7)),_0x3e2c2c[0x0]||[...er]);const _0x5e1db8=_0x174c67['every'](_0x5080ea=>_0x5080ea['plugins']['has']('TrackChanges')),_0x408347=_0x174c67['map'](_0x117edd=>_0x117edd['commands']['get']('trackChanges'));return _0x5e1db8?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x408347,'value',(..._0x48bad2)=>_0x48bad2['some'](_0x578e99=>_0x578e99))):_0x50055a=_0x50055a['filter'](_0x384ad7=>'insertSuggestion'!=_0x384ad7),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x6f163a['interactionId']+':'+_0x6f163a['id'],'areActionsDisabled':_0x6f163a['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x50055a}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x1f3e2d,_0x212436){return this['_promiseQueue']['enqueue'](async()=>{const _0xb85da2=this['_view']['chatFeed']['children']['last'];if(_0xb85da2 instanceof yr)return this['_view']['chatFeed']['children']['remove'](_0xb85da2),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1f3e2d['id'],'capabilities':{'isWebSearchEnabled':_0xb85da2['capabilities']['isWebSearchEnabled']||_0x212436['isWebSearchEnabled'],'isReasoningEnabled':_0xb85da2['capabilities']['isReasoningEnabled']||_0x212436['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1f3e2d['id'],'capabilities':_0x212436});});}async['addFeedItemCustomElement'](_0x5ef117,_0x8b7261){let _0x3bda1f;return await this['_promiseQueue']['enqueue'](async()=>{_0x3bda1f=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x5ef117,'id':_0x8b7261});}),_0x3bda1f;}['removeFeedItem'](_0x4fb312){this['_view']['chatFeed']['removeItem'](_0x4fb312);}['hasFeedItem'](_0x37ebc4){return this['_view']['chatFeed']['hasItem'](_0x37ebc4);}['updateFeedInteractionHeader'](_0x5c5eb9){const _0x166a8a=this['_view']['chatFeed']['children']['find'](_0x56d447=>_0x56d447['options']['id']==_0x5c5eb9['id']&&_0x56d447 instanceof yr);_0x166a8a&&_0x166a8a['set']('isVisible',_0x5c5eb9['isVisible']);}async['updateFeedItemAIReplyContent'](_0x27dd11){const _0x1cfd31=_0x27dd11['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xd255f2=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x27dd11,'abortSignal':_0xd255f2,'renderingStrategy':_0x1cfd31}),_0x27dd11['isDone']&&this['markFeedItemAsDone'](_0x27dd11['id']);});}['updateFeedItemAIReplySources'](_0x4606b2,_0x387bae){this['_view']['chatFeed']['updateWebSources'](_0x4606b2,_0x387bae);}async['updateFeedItemAIReplySuggestionContent'](_0x696eb0){return this['_promiseQueue']['enqueue'](async _0x3b7c66=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x696eb0,'abortSignal':_0x3b7c66}),_0x696eb0['isDone']&&this['markFeedItemAsDone'](_0x696eb0['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x199a1a){this['_view']['chatFeed']['updateSuggestionPartState'](_0x199a1a);}['setFeedItemAIReplySuggestionPartActive'](_0x14bdaa){this['_view']['chatFeed']['setSuggestionPartActive'](_0x14bdaa);}['markFeedItemAsDone'](_0x559beb){this['_view']['chatFeed']['markItemAsDone'](_0x559beb);}['removeFeedInteraction'](_0x5838ba){this['_view']['chatFeed']['getItemIds']()['filter'](_0x369404=>_0x369404['startsWith'](_0x5838ba))['forEach'](_0x27ed3c=>this['_view']['chatFeed']['removeItem'](_0x27ed3c));}['startInteraction'](){const _0x327677=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x327677),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x459b97){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4e0bd8=>_0x4e0bd8['startsWith'](_0x459b97['id']))['forEach'](_0x30ac95=>this['markFeedItemAsDone'](_0x30ac95)),this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x260e7a,_0x26e4e9){this['_view']['chatControls']['addContextItem'](_0x260e7a,_0x26e4e9);}['removeContextItem'](_0x4232f3){this['_view']['chatControls']['removeContextItem'](_0x4232f3);}['setContextItemLoading'](_0x5cf765,_0xb0ec0a){this['_view']['chatControls']['setContextItemLoading'](_0x5cf765,_0xb0ec0a);}['setIsUploadInProgress'](_0x5b9401){this['_view']['chatControls']['setIsUploadInProgress'](_0x5b9401);}['setConversationContext'](_0x4fb235){this['_view']['chatControls']['setConversationContext'](_0x4fb235);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x46d334,_0x4123e2,_0x12ad4d){this['_view']['chatControls']['updateResourceState'](_0x46d334,_0x4123e2,_0x12ad4d);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2cbe1c){this['_view']['chatControls']['setAddContextOptions'](_0x2cbe1c);}['updateCapabilities'](_0x2524e0){this['_view']['chatControls']['setWebSearch'](_0x2524e0['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2524e0['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2524e0));}['setSelectedModel'](_0x1eb26d,_0x5b3321){this['_view']['chatControls']['setModel'](_0x1eb26d),_0x5b3321&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x4a7e1e){this['feedItemRenderingStrategy']=_0x4a7e1e;}['toggleLoadingSkeleton'](_0x43a7e2){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x43a7e2);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['emptyConversationTitle'](){this['setConversationTitle']('');}['setConversationTitle'](_0x3130ac,_0x48439c=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x48439c&&!pt()&&_0x3130ac['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x3130ac);this['_view']['chatHeader']['label']=_0x3130ac;}['setLoadingMessage'](_0x1bacda){this['_view']['chatFeed']['setLoadingMessage'](_0x1bacda);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x4e440a){let _0x7cf94e=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4e440a[_0x7cf94e],_0x7cf94e++,_0x7cf94e===_0x4e440a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x232828){return _0x232828['isWebSearchEnabled']&&_0x232828['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x232828['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x232828['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x403822){return _0x403822?_0x403822['isWebSearchEnabled']&&_0x403822['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x403822['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x403822['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x11b418,_0x48eee2,_0x2ed97a,_0x3bbc6c){this['_view']['populateSourceResourceBalloon'](_0x11b418,_0x48eee2,_0x2ed97a,_0x3bbc6c);}['closeSourceResourceBalloon'](_0x1b1277){this['_view']['closeSourceResourceBalloon'](_0x1b1277);}['setPromptInputValue'](_0x56cb05){this['_view']['chatControls']['setPromptInputValue'](_0x56cb05);}['focusPromptInput'](_0x555978=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x555978);}['scrollFeedToSuggestion'](_0x52c188,_0x3c3570){this['_view']['chatFeed']['scrollToSuggestion'](_0x52c188,_0x3c3570);}['startAutoScroll'](_0x3f9429={}){this['_view']['chatFeed']['startAutoScroll'](_0x3f9429);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}},Go=class extends jt{['sections'];constructor(_0x2c54df,_0x489c11){super(_0x2c54df),this['sections']=_0x489c11,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x3ccc14){let _0x1f4a74=0x0,_0x1f1fc4=0x0;for(const _0x20ed8e of this['sections']){const {resultsCount:_0xc6fbb8,totalItemsCount:_0x8be97}=_0x20ed8e['filter'](_0x3ccc14);_0x1f4a74+=_0xc6fbb8,_0x1f1fc4+=_0x8be97;}return{'resultsCount':_0x1f4a74,'totalItemsCount':_0x1f1fc4};}},Fo=class extends zt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3ed3b7,{title:_0x4b4d9e,items:_0x297771}){super(_0x3ed3b7);const _0x5414bd=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4b4d9e,this['itemsViews']=_0x297771;const _0x560e4c=new _0x42f8f5(_0x3ed3b7);_0x560e4c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new jt(_0x3ed3b7),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5414bd['if']('isVisible','ck-hidden',_0x403c64=>!_0x403c64)]},'children':[_0x560e4c,this['_itemsListView']]});}['filter'](_0x588315){const _0x5e7bb0=this['itemsViews']['length'];let _0x458cb3=0x0;for(const _0x48267d of this['itemsViews'])_0x588315?(_0x48267d['isVisible']=!!_0x48267d['isMatching'](_0x588315),_0x48267d['highlightText'](_0x588315)):(_0x48267d['isVisible']=!0x0,_0x48267d['highlightText'](null)),_0x48267d['isVisible']&&_0x458cb3++;return this['isVisible']=_0x458cb3>0x0,{'resultsCount':_0x458cb3,'totalItemsCount':_0x5e7bb0};}['getItem'](_0x3bb03e){return this['itemsViews']['find'](_0x1bf73a=>_0x1bf73a['id']===_0x3bb03e);}['removeItem'](_0xfee7f1){const _0x38fec1=this['itemsViews']['indexOf'](_0xfee7f1);-0x1!==_0x38fec1&&(this['itemsViews']['splice'](_0x38fec1,0x1),this['_itemsListView']['items']['remove'](_0xfee7f1));}};const Ko=/* #__PURE__ -- @preserve */
34
- _0x14f708(zt);var Wo=class AIChatHistoryListItemView extends Ko{['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(_0x8cfa7c,_0x48d138){super(_0x8cfa7c);const _0x339aef=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x48d138['pinned']),this['set']('loadingState',null),this['set']('title',_0x48d138['title']),this['id']=_0x48d138['id'];const {createdAt:_0x33deac,active:_0x549219=!0x1}=_0x48d138;this['_titleView']=new Wt(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4e0f13=this['_createCheckView'](),_0x1e66cc=this['_createPinButtonView'](_0x8cfa7c),_0xf51032=this['_createMenuDropdownView'](),_0x342296=this['_createEditInputView'](_0x8cfa7c),_0x200273=this['_createAcceptEditButtonView'](_0x8cfa7c,_0x342296),_0x26d72f=this['_createCancelEditButtonView'](_0x8cfa7c);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x1e66cc),this['actions']['add'](_0xf51032),this['on']('change:isEdit',(_0x460e71,_0x4ec096,_0x4125f3)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4125f3?(this['actions']['add'](_0x200273),this['actions']['add'](_0x26d72f),this['mainContent']['add'](_0x342296),_0x342296['element']['value']=this['title']||'',_0x342296['element']['focus']()):(this['actions']['add'](_0x1e66cc),this['actions']['add'](_0xf51032),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x549219?'ck-ai-chat-history__item--active':'',_0x339aef['if']('isVisible','ck-hidden',_0x2cd4d4=>!_0x2cd4d4),_0x339aef['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',_0x339aef['if']('loadingState','ck-hidden',_0x48395f=>!!_0x48395f)]},'children':_0x549219?[_0x4e0f13]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x339aef['if']('loadingState','ck-hidden',_0x4384dd=>!_0x4384dd)]},'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-container',_0x339aef['if']('loadingState','ck-hidden',_0x3ad535=>!!_0x3ad535)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x339aef['if']('loadingState','ck-hidden',_0x50dbc9=>!_0x50dbc9)]},'children':[{'text':_0x339aef['to']('loadingState',_0xad597c=>_0xad597c?us(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0xad597c]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x33deac]}]},{'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'](_0x29ab8d){this['set']('title',_0x29ab8d);}['updateLoadingState'](_0x45715e,_0x128d45){this['set']('loadingState',_0x128d45?_0x45715e:null);}['_createCheckView'](){const _0x44533a=new Yt();return _0x44533a['set']({'content':_0x734ca}),_0x44533a;}['_createPinButtonView'](_0x145495){const _0x5e0b1f=new Ht(_0x145495);return _0x5e0b1f['set']({'label':us(_0x145495,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x3f570c,'withText':!0x1,'tooltip':!0x0}),_0x5e0b1f['bind']('isOn')['to'](this,'pinned'),_0x5e0b1f['on']('execute',()=>{const _0x4a42fb=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4a42fb});}),_0x5e0b1f;}['_createMenuDropdownView'](){const _0x3b5cba=_0x5ba05a(this['locale']),_0xdc7b20=_0x3b5cba['panelView']['children'];_0x3b5cba['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':nt}),_0x3b5cba['panelPosition']='sw';const _0x5c9ca4=new Ht(this['locale']);_0x5c9ca4['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x5c9ca4['withText']=!0x0,_0x5c9ca4['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1d785b=new Ht(this['locale']);_0x1d785b['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1d785b['withText']=!0x0,_0x1d785b['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x10739f=new jt(this['locale']),_0x147260=new zt(this['locale']);_0x147260['children']['add'](_0x5c9ca4);const _0x2fb417=new zt(this['locale']);return _0x2fb417['children']['add'](_0x1d785b),_0x10739f['items']['addMany']([_0x147260,_0x2fb417]),_0xdc7b20['add'](_0x10739f),_0x3b5cba;}['_createEditInputView'](_0x5bae95){const _0x900a0=new $t(_0x5bae95),_0x24981b=_0x900a0['bindTemplate'];return _0x900a0['extendTemplate']({'on':{'keydown':_0x24981b['to'](_0x216682=>{'Enter'==_0x216682['key']&&this['_commitEditInputValue'](_0x900a0);})}}),_0x900a0;}['_createAcceptEditButtonView'](_0x88bb92,_0x24c6ca){const _0xf299f9=new Ht(_0x88bb92);return _0xf299f9['set']({'icon':_0x734ca,'withText':!0x1,'tooltip':us(_0x88bb92,'AI_CHAT_HISTORY_ACCEPT')}),_0xf299f9['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xf299f9['on']('execute',()=>{this['_commitEditInputValue'](_0x24c6ca);}),_0xf299f9;}['_commitEditInputValue'](_0x13b13e){const _0x117591=_0x13b13e['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x117591});}['_createCancelEditButtonView'](_0x5c918c){const _0xf783c3=new Ht(_0x5c918c);return _0xf783c3['set']({'icon':_0x3c0bfe,'withText':!0x1,'tooltip':us(_0x5c918c,'AI_CHAT_HISTORY_CANCEL')}),_0xf783c3['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xf783c3['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0xf783c3;}['_createSpinnerView'](){const _0x11e4eb=new cr('tiny');return _0x11e4eb['isVisible']=!0x0,_0x11e4eb;}['isMatching'](_0x40a1bc){return'string'==typeof this['title']&&this['title']['match'](_0x40a1bc)?{'title':!0x0}:null;}['highlightText'](_0x3ba70d){this['_titleView']['highlightText'](_0x3ba70d);}},Yo=class extends _0x42f8f5{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x12b134,_0x4065cb){super(_0x12b134),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x5e6b1f=Vo(_0x12b134,this);this['headerView']=new Ho(_0x12b134,{'label':us(_0x12b134,'AI_CHAT_HISTORY_HEADING'),'icon':_0x29ed9d,'class':'ck-ai-header_history','content':_0x5e6b1f,'showResizeButton':_0x4065cb}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new Go(_0x12b134,[]),this['sectionsView']['delegate'](...$o)['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',_0x17c864=>!_0x17c864)]}}),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':[this['headerView'],{'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 _0x265b73=new _0xb4c045(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x418488=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x418488),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x47ce29=this['_createErrorView']();return _0x47ce29['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x27d5b8=>!_0x27d5b8)]}}),_0x265b73['on']('render',()=>{_0x265b73['children']['add'](_0x47ce29,0x1);}),_0x265b73['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1fee39=>!_0x1fee39)]}}),_0x265b73;}['_createSkeletonView'](){const _0x82d2ec=new Xn(this['locale'],zn['aiHistory']);return _0x82d2ec['bind']('isVisible')['to'](this,'isLoading'),_0x82d2ec;}['_createErrorView'](){const _0x33f454=new _0x42f8f5(this['locale']),_0x3f13a6=new Ht(this['locale']);_0x3f13a6['set']({'withText':!0x1,'icon':_0x3c0bfe,'class':'ck-ai-notification_error__dismiss-button'}),_0x3f13a6['bind']('isVisible')['to'](this,'hasItems',_0x174143=>!!_0x174143),_0x3f13a6['on']('execute',()=>{this['errorMessage']='';});const _0x2dce83=this['bindTemplate'];return _0x33f454['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2dce83['to']('errorMessage')}]},_0x3f13a6]}),_0x33f454;}['_createEmptyStateView'](){const _0x48c202=new _0x42f8f5(this['locale']);return _0x48c202['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x345850=>!_0x345850)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x48c202;}['_createListItemViews'](_0x5cf9ae,_0x4d3142){const _0x11b55e=[];for(const _0x594f27 of _0x5cf9ae){const _0x271c0c=new Wo(_0x4d3142,_0x594f27);_0x271c0c['delegate'](...$o)['to'](this),_0x11b55e['push'](_0x271c0c);}return _0x11b55e;}['updateHistoryItemsWithCategories'](_0x2de169){const _0x3c4825=this['locale']||'en',_0x44be0d=[];for(const _0x3aaac4 of _0x2de169){const _0x5bc24c=this['_createListItemViews'](_0x3aaac4['items'],_0x3c4825);_0x44be0d['push'](new Fo(_0x3c4825,{'title':_0x3aaac4['title'],'items':_0x5bc24c}));}this['sectionsView']['sections']=_0x44be0d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x44be0d),this['hasItems']=_0x2de169['some'](_0x589dfc=>_0x589dfc['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x47148b){for(const _0x108532 of this['sectionsView']['sections']){const _0x1f6821=_0x108532['getItem'](_0x47148b);if(_0x1f6821){if(_0x108532['removeItem'](_0x1f6821),0x0===_0x108532['itemsViews']['length']){const _0x42fc7b=this['sectionsView']['sections']['indexOf'](_0x108532);-0x1!==_0x42fc7b&&(this['sectionsView']['sections']['splice'](_0x42fc7b,0x1),this['sectionsView']['items']['remove'](_0x108532));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x42012e,_0x1cdc0e){for(const _0x1f8fb5 of this['sectionsView']['sections']){const _0xa997df=_0x1f8fb5['getItem'](_0x42012e);if(_0xa997df){_0xa997df['updateTitle'](_0x1cdc0e);break;}}}['updateItemLoadingState'](_0x3e5cf7,_0x1041d2,_0x5e6d01){for(const _0x21e0fa of this['sectionsView']['sections']){const _0x2da1dc=_0x21e0fa['getItem'](_0x3e5cf7);if(_0x2da1dc){_0x2da1dc['updateLoadingState'](_0x1041d2,_0x5e6d01);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3e1c05=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3e1c05);}}};const $o=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var qo=class extends _0x11a14c{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3372d0){super(_0x3372d0);const _0x5aac97=this['context']['plugins']['get']('AITabs');this['_historyView']=new Yo(this['context']['locale'],_0x5aac97['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x5aac97),this['_historyView']['delegate'](...$o)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x5aac97['view'],'isMaximized',_0x19e69d=>_0x19e69d),_0x5aac97['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x29ed9d,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x192696){this['_historyView']['removeHistoryItem'](_0x192696);}['updateItems'](_0x1ec1d9){this['_historyView']['updateHistoryItemsWithCategories'](_0x1ec1d9);}['updateItemTitle'](_0x5f4dc2,_0x2e89fa){this['_historyView']['updateItemTitle'](_0x5f4dc2,_0x2e89fa);}['updateItemLoadingState'](_0x9749c3,_0x29a95f,_0x44b996){this['_historyView']['updateItemLoadingState'](_0x9749c3,_0x29a95f,_0x44b996);}['setLoadingSkeleton'](_0x5a603a){this['_historyView']['isLoading']=_0x5a603a;}['showError'](_0x230c8c){this['_historyView']['errorMessage']=_0x230c8c;}['hideError'](){this['_historyView']['errorMessage']='';}};const Qo=/* #__PURE__ -- @preserve */
35
- gt();var Xo=class extends Qo{['id'];['createdAt'];constructor({id:_0x46d2a3,title:_0x549dfc,createdAt:_0x1a7e31,updatedAt:_0x4f72ed,pinned:_0x2fa97b}){super(),this['id']=_0x46d2a3,this['createdAt']=new Date(_0x1a7e31),this['set']('title',_0x549dfc),this['set']('updatedAt',_0x4f72ed?new Date(_0x4f72ed):null),this['set']('pinned',_0x2fa97b||!0x1);}['updateTitle'](_0x2d82d6){this['set']('title',_0x2d82d6),this['updatedAt']=new Date();}['updatePinned'](_0x53c1bc){this['set']('pinned',_0x53c1bc),this['updatedAt']=new Date();}};const zo=/* #__PURE__ -- @preserve */
36
- ut();var jo=class extends zo{['items']=[];['connector'];['group'];constructor({connector:_0x33fd32,group:_0x24210d}){super(),this['connector']=_0x33fd32,this['group']=_0x24210d;}async['init'](){try{const _0x4c721f=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x4c721f);}catch(_0x444d6e){this['fire']('error',{'error':_0x444d6e,'operation':'init'});}}['addItem'](_0x3c1f07){this['items']['push'](_0x3c1f07);}async['removeItem'](_0x244a0d){const _0x446a38=this['items']['findIndex'](_0x2c54a9=>_0x2c54a9['id']===_0x244a0d);if(-0x1===_0x446a38)return!0x1;try{return await this['connector']['deleteConversation'](_0x244a0d)['execute'](),this['items']['splice'](_0x446a38,0x1),this['fire']('itemRemoved',{'itemId':_0x244a0d}),!0x0;}catch(_0x49591f){return this['fire']('error',{'error':_0x49591f,'operation':'removeItem','itemId':_0x244a0d}),!0x1;}}['getItem'](_0x3242cc){return this['items']['find'](_0x4cd78c=>_0x4cd78c['id']===_0x3242cc);}async['updateItemTitle'](_0x407402,_0x264a15){const _0x27ecd5=this['getItem'](_0x407402);if(!_0x27ecd5)return!0x1;try{return await this['connector']['updateConversation'](_0x407402,{'title':_0x264a15})['getResult'](),_0x27ecd5['updateTitle'](_0x264a15),this['fire']('itemUpdated',{'itemId':_0x407402,'updates':{'title':_0x264a15}}),!0x0;}catch(_0x1975cf){return this['fire']('error',{'error':_0x1975cf,'operation':'updateItemTitle','itemId':_0x407402}),!0x1;}}async['updateItemPinned'](_0x238c2a,_0x5914a8){const _0x178ca7=this['getItem'](_0x238c2a);if(!_0x178ca7)return!0x1;try{return await this['connector']['updateConversation'](_0x238c2a,{'pinned':_0x5914a8})['getResult'](),_0x178ca7['updatePinned'](_0x5914a8),this['fire']('itemUpdated',{'itemId':_0x238c2a,'updates':{'pinned':_0x5914a8}}),!0x0;}catch(_0x1b934c){return this['fire']('error',{'error':_0x1b934c,'operation':'updateItemPinned','itemId':_0x238c2a}),!0x1;}}['loadItems'](_0x22b148){try{this['items']=[],_0x22b148['map'](_0x18040e=>{this['addItem'](new Xo(_0x18040e));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x5b745b){this['fire']('error',{'error':_0x5b745b,'operation':'loadItems'});}}['getItems'](_0x540865={}){const _0x5acd63=void 0x0!==_0x540865['pinned']&&_0x540865['pinned'],_0x46419c=_0x540865['from']?new Date(_0x540865['from']['getFullYear'](),_0x540865['from']['getMonth'](),_0x540865['from']['getDate']()):null,_0x44697a=_0x540865['to']?new Date(_0x540865['to']['getFullYear'](),_0x540865['to']['getMonth'](),_0x540865['to']['getDate']()):null;return this['items']['filter'](_0x48cf5d=>{if(_0x48cf5d['pinned']!==_0x5acd63)return!0x1;if(_0x44697a){const _0x42ab9f=new Date(_0x48cf5d['createdAt']['getFullYear'](),_0x48cf5d['createdAt']['getMonth'](),_0x48cf5d['createdAt']['getDate']());return _0x46419c?_0x46419c['getTime']()===_0x44697a['getTime']()?_0x42ab9f['getTime']()===_0x46419c['getTime']():_0x42ab9f<_0x44697a&&_0x42ab9f>=_0x46419c:_0x42ab9f<_0x44697a;}return!0x0;});}},Jo=class extends _0x11a14c{['_aiConnector'];['_reporter'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[ls,nn,kn,qo,cs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](ls),this['_aiChatHistoryUi']=this['context']['plugins']['get'](qo),this['_aiChatController']=this['context']['plugins']['get'](kn),this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aichathistory');const _0x24ce50=this['context']['plugins']['get'](cs);try{const _0x52e348=this['_aiChatController']['getGroupId']();this['history']=new jo({'connector':this['_aiConnector'],'group':_0x52e348}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x8bed36,_0x5c7acb)=>{this['_setItemLoading'](_0x5c7acb['id'],'remove'),this['_handleRemove'](_0x5c7acb['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x5a38f2,_0x32a2f7)=>{this['_setItemLoading'](_0x32a2f7['id'],'rename'),this['_handleEditTitle'](_0x32a2f7['id'],_0x32a2f7['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x344b09,_0x11824d)=>{void 0x0!==_0x11824d['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x11824d['itemId'],_0x11824d['updates']['title']),void 0x0!==_0x11824d['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x11824d['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1b4ba2,_0xd9db7)=>{this['_aiChatController']['_handleRemovedConversation'](_0xd9db7['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0xd9db7['itemId']),this['_clearItemLoading'](_0xd9db7['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x36b549,_0x2dc55f)=>{this['_handleHistoryErrorUI'](_0x2dc55f['error'],_0x2dc55f['operation'],_0x2dc55f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x32e7ff,_0xb415fd)=>{this['_handleSelectConversation'](_0xb415fd['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x3eb223,_0x186a86)=>{const _0x1e46aa=_0x186a86['pinned']?'pin':'unpin';this['_setItemLoading'](_0x186a86['id'],_0x1e46aa),this['_handleTogglePin'](_0x186a86['id'],_0x186a86['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x24ce50['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x24ce50['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x4e4915){this['_handleHistoryErrorUI'](_0x4e4915,'init');}}async['_handleEditTitle'](_0x28b65d,_0xa54360){await this['history']['updateItemTitle'](_0x28b65d,_0xa54360);}async['_handleTogglePin'](_0x32c129,_0x29b253){await this['history']['updateItemPinned'](_0x32c129,_0x29b253);}async['_handleRemove'](_0x1422f9){await this['history']['removeItem'](_0x1422f9);}async['_handleSelectConversation'](_0x1a3c2d){await this['_aiChatController']['loadConversation'](_0x1a3c2d);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x3668f0=this['_aiChatController']['activeConversation']?.['id'],_0x35d9a4=this['_getCategorizedItems']()['map'](_0x51c38d=>({'title':_0x51c38d['title'],'items':_0x51c38d['items']['map'](_0x6f64ce=>({'id':_0x6f64ce['id'],'title':_0x6f64ce['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x6f64ce['createdAt'])['toLocaleDateString'](),'active':_0x6f64ce['id']===_0x3668f0,'pinned':_0x6f64ce['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x35d9a4);}['_setItemLoading'](_0x1d795c,_0x23deaa){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1d795c,_0x23deaa,!0x0);}['_clearItemLoading'](_0x2cee0a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2cee0a,null,!0x1);}['_handleHistoryErrorUI'](_0x2e2d8e,_0x56c776,_0x53c5d9){const _0x343ca4=this['_generateErrorMessage'](_0x56c776,_0x53c5d9);this['_aiChatHistoryUi']['showError'](_0x343ca4),this['_reporter']['reportError'](_0x2e2d8e,{'context':{'operation':_0x56c776}}),_0x53c5d9&&this['_clearItemLoading'](_0x53c5d9),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x1269d8,_0x5e9e91){const _0x44558a=_0x5e9e91?this['history']['getItem'](_0x5e9e91):null,_0xd2cc56=_0x44558a?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x1269d8){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0xd2cc56);case'updateItemPinned':{const _0x31a133=us(this['context']['locale'],_0x44558a?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x31a133,_0xd2cc56]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0xd2cc56);case'init':case'loadItems':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x28d03c=new Date(),_0x3f1f08=new Date(_0x28d03c['getFullYear'](),_0x28d03c['getMonth'](),_0x28d03c['getDate']()),_0x1c7656=new Date(_0x3f1f08);_0x1c7656['setDate'](_0x1c7656['getDate']()-0x1);const _0x104282=new Date(_0x3f1f08);_0x104282['setDate'](_0x104282['getDate']()-0xe);const _0x573232=this['history']['getItems']({'pinned':!0x0}),_0x2a5222=this['history']['getItems']({'from':_0x3f1f08,'to':_0x3f1f08}),_0x13f047=this['history']['getItems']({'from':_0x1c7656,'to':_0x1c7656}),_0x1b2676=this['history']['getItems']({'from':_0x104282,'to':_0x1c7656}),_0x2b550f=this['history']['getItems']({'to':_0x104282}),_0x33a3b8=[];return _0x573232['length']>0x0&&_0x33a3b8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x573232}),_0x2a5222['length']>0x0&&_0x33a3b8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x2a5222}),_0x13f047['length']>0x0&&_0x33a3b8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x13f047}),_0x1b2676['length']>0x0&&_0x33a3b8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1b2676}),_0x2b550f['length']>0x0&&_0x33a3b8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2b550f}),_0x33a3b8;}},Zo=class extends _0x11a14c{static get['requires'](){return[Jo,qo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ta=class extends _0x11a14c{static get['requires'](){return[kn,Is,Bo,Zo,tn];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31cd2a){super(_0x31cd2a),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}},ea=class extends Ht{['id'];constructor(_0x2374a1,_0x47582a){super(_0x2374a1);const {id:_0x299314,type:_0x5a9eae,icon:_0x5e9f6d}=_0x47582a;this['id']=_0x299314,this['set']({'label':_0x47582a['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x47582a['id']}}),_0x5e9f6d?this['icon']=_0x5e9f6d:'chat'===_0x5a9eae?this['icon']=_0x404c28:'review'===_0x5a9eae?this['icon']=_0x31a7fd:'translate'===_0x5a9eae&&(this['icon']=_0x3ce940);}},ia=class extends _0x42f8f5{['listView'];constructor(_0x493d74,_0x2b442c){super(_0x493d74),this['set']('isEnabled',!0x0);const _0x12e480=_0x2b442c['map'](_0x3a1717=>{const _0xf92bb6=new zt(this['locale']),_0x4f72f3=new ea(this['locale'],_0x3a1717);return _0x4f72f3['bind']('isEnabled')['to'](this),_0xf92bb6['children']['add'](_0x4f72f3),_0x4f72f3['delegate']('execute')['to'](this),_0xf92bb6;});this['listView']=new jt(this['locale']),this['listView']['items']['addMany'](_0x12e480),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const sa='chat-shortcuts';var na=class extends _0x11a14c{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];['_listenedConversation'];static get['requires'](){return[Bo];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Bo),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x324504=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0x909ed3=_0x324504['activeConversation'];_0x909ed3['isFromHistory']||this['_injectShortcuts'](_0x909ed3);}),this['listenTo'](_0x324504,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x337ab3=['chat','review','translate'];this['_shortcuts']['forEach'](_0x218e2d=>{let _0x4aeda4=!0x0;if(_0x218e2d['id']&&_0x218e2d['label']&&_0x337ab3['includes'](_0x218e2d['type'])?'chat'===_0x218e2d['type']&&(_0x4aeda4='string'==typeof _0x218e2d['prompt']):_0x4aeda4=!0x1,!_0x4aeda4)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x218e2d});});}['_injectShortcuts'](_0x3e957e){this['_removeShortcuts'](),this['_shortcutsView']=new ia(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],sa),this['_shortcutsView']['on']('execute',_0x39be7b=>{const _0xeef715=_0x39be7b['source']['id'];this['_executeShortcut'](_0xeef715);}),this['_listenedConversation']=_0x3e957e,this['listenTo'](_0x3e957e,'uploadProgressChanged',(_0x1525bc,_0x293ef4)=>{this['_shortcutsView']['isEnabled']=!_0x293ef4['isUploadInProgress'];});}['_removeShortcuts'](){const _0x5794f0=this['context']['plugins']['get'](Bo);_0x5794f0['hasFeedItem'](sa)&&_0x5794f0['removeFeedItem'](sa),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3dd924){const _0x4375c7=this['_shortcuts']['find'](_0x4e5e6d=>_0x4e5e6d['id']===_0x3dd924),_0x30882b=_0x4375c7['type'];'chat'===_0x30882b?this['_runChatShortcut'](_0x4375c7):'review'===_0x30882b?_0x4375c7['commandId']?this['_runReviewShortcut'](_0x4375c7):this['_switchTab']('reviewMode'):'translate'===_0x30882b&&(_0x4375c7['language']?this['_runTranslateShortcut'](_0x4375c7):this['_switchTab']('translate'));}['_switchTab'](_0x144287){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x144287});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x144287);}async['_runChatShortcut']({prompt:_0x4bbf04,draftMode:_0x3c2d55,useWebSearch:_0x9d4444=!0x1,useReasoning:_0x44a8c0=!0x1,model:_0x34cff9}){const _0x4dcbb9=this['context']['plugins']['get']('AIChatController'),_0x17f8be=_0x4dcbb9['activeConversation'];let _0x75509d;_0x75509d=_0x34cff9?await _0x17f8be['chatModels']['getModel'](_0x34cff9):await _0x17f8be['chatModels']['getDefault'](),_0x75509d&&await _0x17f8be['setModel'](_0x75509d),_0x17f8be['setWebSearch'](_0x9d4444),_0x17f8be['setReasoning'](_0x44a8c0),_0x4dcbb9['addCurrentDocumentToChatContext'](),_0x3c2d55?(this['_aiChatUI']['setPromptInputValue'](_0x4bbf04),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x4dcbb9['sendMessage']({'message':_0x4bbf04});}['_runReviewShortcut']({commandId:_0x52f200,model:_0x297c4c,prompt:_0x5b6c52,params:_0x35f94c}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x595d5e={'id':_0x52f200,'isCustom':'custom'===_0x52f200};_0x297c4c&&_0x5b6c52&&(_0x595d5e['args']={'model':_0x297c4c,'prompt':_0x5b6c52}),_0x35f94c&&(_0x595d5e['params']=_0x35f94c),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x595d5e);}['_runTranslateShortcut']({language:_0x25de1f}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x25de1f,'args':{'language':_0x25de1f}});}},ra=class extends _0x17e1f8{constructor(_0x5cf728){super(_0x5cf728);const _0x6791a4=_0x5cf728['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x6791a4,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x59fb01=this['editor']['plugins']['get']('AITabs')['view'];_0x59fb01['isVisible']=!_0x59fb01['isVisible'];}},oa=class extends _0x4655d9{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x511052=this['editor'];_0x511052['commands']['add']('toggleAi',new ra(_0x511052)),_0x511052['ui']['componentFactory']['add']('toggleAi',()=>{const _0x44f25d=this['_createAIUIButton'](Ht);return _0x44f25d['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x44f25d;}),_0x511052['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x328873=this['_createAIUIButton'](Jt);return _0x328873['set']({'role':'menuitemcheckbox'}),_0x328873;});}['_createAIUIButton'](_0x4b000d){const _0xfc2044=this['editor'],_0x37855f=_0xfc2044['commands']['get']('toggleAi'),_0x1ef76d=new _0x4b000d(_0xfc2044['locale']);return _0x1ef76d['set']({'label':us(_0xfc2044['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x266871,'isToggleable':!0x0}),_0x1ef76d['bind']('isEnabled')['to'](_0x37855f),_0x1ef76d['bind']('isOn')['to'](_0x37855f,'value',_0x443578=>!!_0x443578),this['listenTo'](_0x1ef76d,'execute',()=>{_0x37855f['execute']();}),_0x1ef76d;}};const aa=['applySuggestion','insertSuggestion','showNext','showPrevious'];var ha=class extends _0x42f8f5{['_errorView'];constructor(_0x2ee4d5){super(_0x2ee4d5),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x43bdb3){this['showError'](_0x43bdb3);}['showError'](_0x304132){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x304132,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x1df1c0=new _0x42f8f5(this['locale']),_0x540b9a=new _0x42f8f5(this['locale']);return _0x540b9a['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x1df1c0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x42649d=>!_0x42649d)]},'children':[_0x540b9a]}),_0x1df1c0;}};const ca=0xa;var la=class extends _0x11a14c{static get['requires'](){return[Is];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_editor'];['_isUpdatingMarkers']=!0x1;['open'](_0x528e51){const {id:_0x174b3b}=this['_currentConfig']??{};this['_currentConfig']=_0x528e51,this['_editor']=_0x528e51['targetEditor'];const {id:_0x317736}=this['_currentConfig'];this['isOpen']&&_0x174b3b===_0x317736?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x501ab2=this['_editor'];if(!_0x501ab2)return;const _0x278d1f=_0x501ab2['plugins']['get']('Dialog');_0x278d1f['isOpen']&&this['_currentConfig']&&_0x278d1f['id']===this['_currentConfig']['id']&&_0x278d1f['hide']();}['_updateDialog'](){const _0x3c4663=this['_editor']['plugins']['get']('Dialog'),{icon:_0x4ee051,title:_0x58c813}=this['_currentConfig'];_0x3c4663['view']?.['headerView']&&(_0x3c4663['view']['headerView']['label']=_0x58c813,_0x3c4663['view']['headerView']['iconView']&&_0x4ee051&&(_0x3c4663['view']['headerView']['iconView']['content']=_0x4ee051)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x3c4663['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](Is)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](Is)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x5c5084=this['_editor']['plugins']['get']('Dialog'),{id:_0x482932,title:_0x68cc81,icon:_0x308a5d,class:_0x435d6d,mainView:_0x272943}=this['_currentConfig'];_0x272943['delegate'](...aa)['to'](this),_0x5c5084['show']({'title':_0x68cc81,'icon':_0x308a5d,'hasCloseButton':!0x0,'id':_0x482932,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x435d6d||''),'content':_0x272943,'onShow':_0x7bd9cd=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x7bd9cd['view']?.['updatePosition']();const _0x3e5146=this['_getSelectionElements']();_0x3e5146&&_0x3e5146[0x0]&&Rt({'target':_0x3e5146[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x7bd9cd['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x482932});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x482932}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1554b0,_0xa27fc6,_0x7bf56a){const _0x5a25f2=_0xa27fc6||_0x7bf56a;if(!_0x5a25f2)return null;const _0x7612cb=this['_getSelectionElements']();if(!_0x7612cb||0x0===_0x7612cb['length'])return{'left':Math['round'](_0x5a25f2['left']+_0x5a25f2['width']/0x2-_0x1554b0['width']/0x2),'top':Math['round'](_0x5a25f2['top']+_0x5a25f2['height']/0x2-_0x1554b0['height']/0x2)};const _0x3d3fa1=Math['round'](_0x5a25f2['left']+_0x5a25f2['width']/0x2-_0x1554b0['width']/0x2),_0x499b9c=_0x7612cb['map'](_0x53207a=>new At(_0x53207a)),_0x4ef215=_0x1554b0['height'];return{'left':_0x3d3fa1,'top':this['_calculateOptimalTopPosition'](_0x499b9c,_0x4ef215,_0x5a25f2)};}['_calculateOptimalTopPosition'](_0x524d65,_0x300889,_0x1eed30){const _0x4eea29=new At(Tt['window']),_0x415bf6=_0x524d65['map'](_0x1b2f57=>_0x1b2f57['getVisible']())['filter'](_0xf468a7=>_0xf468a7),_0x68dbfa=At['getBoundingRect'](_0x415bf6);if(!_0x68dbfa)return Math['round'](_0x1eed30['top']+_0x1eed30['height']/0x2);const _0x32908c=_0x4eea29['getIntersection'](_0x68dbfa);if(!_0x32908c)return Math['round'](_0x1eed30['top']+_0x1eed30['height']/0x2);const _0x5627c5=_0x1eed30['getVisible'](),_0x460129=_0x5627c5&&_0x68dbfa['height']>_0x5627c5['height'],_0x5465df=_0x32908c['top'],_0x44dad8=_0x32908c['bottom'];if(_0x460129){const _0x508c81=_0x4eea29['top']+_0x4eea29['height']/0x2-_0x300889/0x2,_0x39c729=_0x5465df-ca-_0x4eea29['top'],_0x38b9be=_0x4eea29['bottom']-_0x44dad8-ca;return _0x39c729>=_0x300889?Math['max'](ca,_0x5465df-_0x300889-ca):_0x38b9be>=_0x300889?_0x44dad8+ca:Math['max'](ca,_0x508c81);}const _0x281391=_0x5465df-_0x300889,_0x1f1f63=_0x4eea29['bottom']-_0x44dad8-ca,_0x5a1d8d=_0x5465df-ca-_0x4eea29['top'];let _0x104ab1;return _0x104ab1=_0x1f1f63>=_0x300889?_0x44dad8+ca:_0x5a1d8d>=_0x300889?_0x281391-ca:_0x5465df+_0x68dbfa['height']/0x2-_0x300889/0x2,_0x104ab1;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0xba1503=this['_editor'];this['listenTo'](_0xba1503['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x2bca1c,data:{newRange:_0x443260}}of _0xba1503['model']['document']['differ']['getChangedMarkers']())if(_0x2bca1c['startsWith']('ai-selection:')&&(_0x443260&&(_0x443260['start']['isEqual'](_0x443260['end'])||'$graveyard'==_0x443260['root']['rootName'])||null==_0x443260)){const _0x497eb=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x497eb),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0xdab4c9=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0xdab4c9['model']['document']);}['_getSelectionElements'](){const _0x3fe8d3=this['_editor'];return _0x24247e(_0x3fe8d3['editing'],[..._0x3fe8d3['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3fe8d3['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getCurrentDomRootName'](){const _0x1afe60=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x1afe60&&_0x1afe60['rootName']?_0x1afe60['rootName']:null;}},ua=class extends _0x182e23{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x1e83ee,_0x438a37={}){super(_0x1e83ee),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x438a37};const _0x3fe841=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3fe841?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x47ef94){this['showChangesButton']['isEnabled']=_0x47ef94;}['_setupRatingButtons'](){this['likeButton']=new Ht(this['locale']),this['likeButton']['set']({'icon':ot,'label':us(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':hn,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Ht(this['locale']),this['dislikeButton']['set']({'icon':rt,'label':us(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':hn,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Ht(this['locale']),this['copyButton']['set']({'icon':_0x1bec33,'label':us(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+hn,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x117bf2=new Yt();_0x117bf2['set']({'content':_0x734ca}),_0x117bf2['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\x20'+hn,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+hn;},0x7d0);}),this['copyButton']['children']['add'](_0x117bf2);}['_setupShowChangesButton'](){this['showChangesButton']=new Ht(this['locale']),this['showChangesButton']['set']({'icon':tt,'label':us(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':hn}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x4cb09f=>_0x4cb09f?et:tt),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},da=class extends ha{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x3fd8c9,_0x5cec46){super(_0x3fd8c9);const _0x3e4b4b=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new dt(),this['_keystrokes']=new _t(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Gt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x5cec46,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new qn(_0x3fd8c9),this['_partToolbarView']=new Wn(_0x3fd8c9,_0x5cec46['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x5cec46),this['_stateView']=new Fn(_0x3fd8c9),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ua(_0x3fd8c9,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new _a(_0x3fd8c9,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x1796d6,_0x1167e9,_0x1a2b7c,_0x1797f3)=>{let _0xfa2320,_0x3b4203;'pending'===_0x1797f3?(_0xfa2320=this['_partToolbarView'],_0x3b4203=this['_stateView']):(_0xfa2320=this['_stateView'],_0x3b4203=this['_partToolbarView']),this['_stateView']['setState'](_0x1a2b7c),_0xfa2320['isVisible']=!0x1,_0x3b4203['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x3e4b4b['to']('_state',_0x59b56d=>'ck-ai-chat-balloon-main_state_'+_0x59b56d)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x5cec46);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x32adb9){_0x32adb9?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x32adb9);}['clearContent'](){this['_streamableContentView']['clear']();}['setState'](_0x3d2d6e){this['_state']=_0x3d2d6e;}['showError'](_0x5b7f8b){super['showError'](_0x5b7f8b),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2e0ebc){super['showBlockingError'](_0x2e0ebc),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x2203a5){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x2203a5;}['togglePartToolbarEnabled'](_0x224804){this['_partToolbarView']['isEnabled']=_0x224804;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5a709a,showSuggestButton:_0x279802}){_0x5a709a=_0x5a709a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x279802=_0x279802&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5a709a,'showSuggestButton':_0x279802});}['_createNextButtonView'](){const _0x45cc8e=new Ht(this['locale']);return _0x45cc8e['set']({'icon':_0x29cb6b,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x45cc8e['on']('execute',()=>{this['fire']('showNext');}),_0x45cc8e;}['_createPreviousButtonView'](){const _0x365cbb=new Ht(this['locale']);return _0x365cbb['set']({'icon':_0x4771e1,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x365cbb['on']('execute',()=>{this['fire']('showPrevious');}),_0x365cbb;}},_a=class extends _0x42f8f5{constructor(_0x3b4b31,_0x4293a1){super(_0x3b4b31),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x4293a1});}},ga=class extends _0x4655d9{static get['requires'](){return[Mt,la];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0xbe5a27){super(_0xbe5a27),this['set']('showDiff',!0x1);}['open'](_0x363741){const _0x3c367a=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x3c367a['plugins']['get']('AIBalloon')['open']({..._0x363741,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x363741['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x363741['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x4e6afa){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x4e6afa);}['clearContent'](){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}['setState'](_0x459b51){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x459b51);}['_createChatBalloonView'](){const _0x6934c5=this['editor'],_0x2e41f9=_0x6934c5['plugins']['get']('AIBalloon'),_0x4f1455=_0x6934c5['commands']['get']('trackChanges');let _0x4650a9=_0x6934c5['config']['get']('ai.availableReplyActions')||[...er];_0x6934c5['plugins']['has']('TrackChanges')||(_0x4650a9=_0x4650a9['filter'](_0x1ea023=>'insertSuggestion'!=_0x1ea023));const _0x15de1c=new da(_0x6934c5['locale'],{'availableActions':_0x4650a9,'showApplyButton':!0x0,'showSuggestButton':!!_0x4f1455});return _0x15de1c['bind']('showDiff')['to'](this),_0x15de1c['delegate'](...Nn)['to'](this),_0x15de1c['delegate']('showPrevious','showNext')['to'](this),_0x2e41f9['delegate']('dialogClosed')['to'](this),_0x15de1c['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x15de1c['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x15de1c['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4f1455&&_0x15de1c['bind']('isTrackChangesOn')['to'](_0x4f1455,'value'),_0x15de1c['render'](),_0x15de1c;}['_toggleRotatorButtonsInDialogHeader'](_0x27c6de){const _0x4e05ad=this['editor'],_0x45ee2a=_0x4e05ad['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x27c6de),_0x45ee2a['has'](this['_chatBalloonView']['previousButtonView'])||(_0x45ee2a['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x4e05ad['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x45ee2a['remove'](this['_chatBalloonView']['previousButtonView']),_0x45ee2a['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}},Aa=class extends _0x4655d9{static get['requires'](){return[oa,ga,_0x4171c8];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Ia(_0x1292c8){const {editor:_0x45917b,action:_0x1d5158,withText:_0x3d4ddf=!0x1,withIcon:_0x117ffe=!0x0,isInDropdown:_0x3e633e=!0x0,shouldPreventFocus:_0xffbf0d=!0x1,actionButtons:_0x1acab9}=_0x1292c8;return()=>{const _0x2f2cb6=_0x45917b['locale'],_0x3ed164=new Ht(_0x2f2cb6),_0x102a24=_0x3ed164['bindTemplate'];_0x3e633e&&_0x3ed164['extendTemplate']({'on':{'mouseenter':_0x102a24['to'](()=>{_0xffbf0d&&_0xffbf0d()||_0x3ed164['focus']();})}}),_0x1acab9['push']({'buttonView':_0x3ed164,'action':_0x1d5158});const _0x58fa14=_0x1d5158['icon']??_0x1d5158['parent']?.['icon'];return _0x3ed164['set']({'label':_0x1d5158['label'],'withText':_0x3d4ddf,'role':'menuitem','icon':_0x117ffe?_0x58fa14??_0x4e05d1:void 0x0,'tooltip':!_0x3d4ddf,'class':'ck-ai-quick-actions-button','isEnabled':_0x1d5158['isEnabled']}),_0x3ed164['on']('execute',()=>{_0x45917b['editing']['view']['focus'](),_0x45917b['commands']['execute']('aiQuickAction',_0x1d5158);}),_0x3ed164;};}var pa=class extends Qt{['arrowView'];constructor(_0x1e683d,_0x4184e2){super(_0x1e683d,_0x4184e2);const _0x52b631=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',_0x21769a=>String(_0x21769a)),'data-cke-tooltip-disabled':_0x52b631['to']('isOn')},'on':{'mouseenter':_0x52b631['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x52ce50=new Yt();return _0x52ce50['content']=_0xcfa2c6,_0x52ce50['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x52ce50;}},ma=class extends jt{['_allListItems'];['_allSearchableItems'];constructor(_0xc4df0a,_0x44c5b0,_0x82d1ea){super(_0xc4df0a),this['_allListItems']=_0x44c5b0,this['_allSearchableItems']=_0x82d1ea;}['filter'](_0x3570f0){if(!_0x3570f0)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x47b0f7=_0x3570f0['source']['toLowerCase']()['trim'](),_0x2fdb4c=this['_allSearchableItems']['filter'](_0x46298a=>(_0x46298a['groupLabel']?_0x46298a['label']+'\x20('+_0x46298a['groupLabel']+')':_0x46298a['label'])['toLowerCase']()['includes'](_0x47b0f7));return this['items']['clear'](),this['items']['addMany'](_0x2fdb4c['sort']((_0x5c4cb1,_0x1fbe65)=>{const _0x1c7a15=_0x5c4cb1['groupLabel'],_0x53f263=_0x1fbe65['groupLabel'];return _0x1c7a15||_0x53f263?_0x1c7a15?0x1:-0x1:0x0;})['map'](_0x52b92c=>_0x52b92c['item'])),this['_highlightQuery'](_0x47b0f7,_0x2fdb4c),{'resultsCount':_0x2fdb4c['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x3d5f34,_0x2a4d4b){if(!_0x3d5f34)return;const _0x34be94=new RegExp(_0x352160(_0x3d5f34),'gi');_0x2a4d4b['forEach'](_0xe8c53=>{_0xe8c53['highlightViews']&&_0xe8c53['highlightViews']['forEach'](_0x53e240=>{'function'==typeof _0x53e240['highlightText']&&_0x53e240['highlightText'](_0x34be94);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x191b59=>{_0x191b59['highlightViews']&&_0x191b59['highlightViews']['forEach'](_0x56f314=>{'function'==typeof _0x56f314['highlightText']&&_0x56f314['highlightText'](null);});});}};const Ea='menu',Ta='menuitem';var wa=class extends _0x42f8f5{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];['_actionButtons'];constructor(_0x536428,_0x1e249e,_0x4a91d8,_0x500779,_0x4f6be0=!0x1,_0x325916=[]){const _0x510176=_0x536428['locale'];super(_0x510176),this['_bodyCollection']=_0x500779,this['_hasSearch']=_0x4f6be0,this['_actionButtons']=_0x325916;const _0x3236ee=this['_createListItems'](_0x536428,_0x1e249e,_0x4a91d8);this['optionsListView']=new ma(_0x510176,_0x3236ee,this['_allSearchableItems']),this['optionsListView']['role']=Ea,this['optionsListView']['items']['addMany'](_0x3236ee),this['focusTracker']=new dt(),this['keystrokes']=new _t(),_0x4f6be0&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3236ee,this['focusCycler']=new Gt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4f6be0&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x129f3f=_0x4f6be0&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x5f3be9(_0x129f3f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x510176['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0xb4c045(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x138c57=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x138c57);}['_createListItems'](_0x272a63,_0x120cde,_0x2c2731){const _0x12e5c8=new _0x5f3be9();return _0x120cde['forEach'](_0x3b53c3=>{if('actions'in _0x3b53c3){const {listItem:_0x34ff49}=this['_createActionGroupButton'](_0x272a63,_0x3b53c3,_0x2c2731);_0x12e5c8['add'](_0x34ff49),_0x3b53c3['actions']['forEach'](_0x3441cb=>{const {listItem:_0x3c77ef,highlightViews:_0x55694d}=this['_createSearchResultActionButton'](_0x272a63,_0x3441cb,_0x3b53c3['label'],_0x3b53c3['icon']);this['_allSearchableItems']['push']({'item':_0x3c77ef,'label':_0x3441cb['label'],'groupLabel':_0x3b53c3['label'],'highlightViews':_0x55694d});});}else{const {listItem:_0xbdf8fb}=this['_createActionButton'](_0x272a63,_0x3b53c3);_0x12e5c8['add'](_0xbdf8fb);const _0x3e5273=_0xbdf8fb['children']['first'];if(_0x3e5273){const {listItem:_0x51b2af,highlightViews:_0x4ade74}=this['_createSearchResultActionButton'](_0x272a63,_0x3b53c3);this['_allSearchableItems']['push']({'item':_0x51b2af,'label':_0x3e5273['label']||'','highlightViews':_0x4ade74});}}}),_0x12e5c8;}['_createActionButton'](_0x3732bd,_0x2406f2,_0x45ed9a,_0x5c6e71){const _0xcf7039=new zt(this['locale']);if(_0x45ed9a&&_0x5c6e71){const _0x48ce2e=new Ht(this['locale']),_0x532395=_0x48ce2e['bindTemplate'],_0x52157b=new Wt();_0x52157b['text']=_0x2406f2['label'];const _0x296bf6=new Wt();_0x296bf6['text']=_0x45ed9a;const _0xe2d851=new Yt();_0xe2d851['content']=_0x5c6e71,_0xe2d851['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5ba82b=new _0x42f8f5(this['locale']);_0x5ba82b['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2ded31=new _0x42f8f5(this['locale']);return _0x2ded31['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x48ce2e['set']({'label':_0x2406f2['label']+'\x20('+_0x45ed9a+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x2406f2['isEnabled']}),_0x48ce2e['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x532395['if']('isEnabled','ck-disabled',_0x40ebc8=>!_0x40ebc8)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x52157b,_0x5ba82b,_0xe2d851,_0x296bf6,_0x2ded31],'on':{'mouseenter':_0x532395['to'](()=>{this['_isSearchFocused']()||_0x48ce2e['focus']();}),'click':_0x532395['to'](()=>{_0x48ce2e['fire']('execute');})}}),_0x48ce2e['on']('execute',()=>{_0x48ce2e['isEnabled']&&(_0x3732bd['editing']['view']['focus'](),_0x3732bd['commands']['execute']('aiQuickAction',_0x2406f2));}),_0xcf7039['children']['add'](_0x48ce2e),this['_actionButtons']['push']({'buttonView':_0x48ce2e,'action':_0x2406f2}),{'listItem':_0xcf7039,'highlightViews':[_0x52157b,_0x296bf6]};}{const _0x50aea7=new Pt(),_0x2f2928=new Ht(this['locale'],_0x50aea7),_0x50f212=_0x2f2928['bindTemplate'],_0x4d8772=_0x2406f2['icon']??_0x2406f2['parent']?.['icon'],_0x501ae5=void 0x0!==_0x2406f2['icon'];return _0x2f2928['set']({'label':_0x2406f2['label'],'withText':!0x0,'role':'menuitem','icon':_0x501ae5?_0x4d8772??_0x4e05d1:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x2406f2['isEnabled']}),_0x2f2928['extendTemplate']({'on':{'mouseenter':_0x50f212['to'](()=>{this['_isSearchFocused']()||_0x2f2928['focus']();})}}),_0x2f2928['on']('execute',()=>{_0x3732bd['editing']['view']['focus'](),_0x3732bd['commands']['execute']('aiQuickAction',_0x2406f2);}),_0xcf7039['children']['add'](_0x2f2928),this['_actionButtons']['push']({'buttonView':_0x2f2928,'action':_0x2406f2}),{'listItem':_0xcf7039,'highlightViews':[_0x50aea7]};}}['_createSearchResultActionButton'](_0x10d653,_0x3fe20e,_0x29293a,_0x21bd43){return _0x29293a&&_0x21bd43?this['_createSearchResultGroupedActionButton'](_0x10d653,_0x3fe20e,_0x29293a,_0x21bd43):this['_createSearchResultIndividualActionButton'](_0x10d653,_0x3fe20e);}['_createSearchResultGroupedActionButton'](_0x13f69d,_0x176ac7,_0x2cac0f,_0x410ebd){const _0x47544f=new zt(this['locale']),_0x40859c=new Ht(this['locale']),_0x2f537e=_0x40859c['bindTemplate'],{view:_0x1f42db,highlightView:_0x59be23}=this['_createSearchResultGroupRow'](_0x2cac0f,_0x410ebd),{view:_0x23eac0,highlightView:_0xbff2b9}=this['_createSearchResultActionRow'](_0x176ac7['label']),_0x45f9fd=this['_createSearchResultContentView'](_0x1f42db,_0x23eac0);return _0x40859c['set']({'label':_0x176ac7['label'],'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,'isEnabled':_0x176ac7['isEnabled']}),_0x40859c['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',_0x2f537e['if']('isEnabled','ck-disabled',_0x1e5b13=>!_0x1e5b13)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x45f9fd],'on':{'mouseenter':_0x2f537e['to'](()=>{this['_isSearchFocused']()||_0x40859c['focus']();}),'click':_0x2f537e['to'](()=>{this['_handleSearchResultButtonClick'](_0x40859c);})}}),this['_setupActionButtonExecution'](_0x40859c,_0x13f69d,_0x176ac7),_0x47544f['children']['add'](_0x40859c),this['_actionButtons']['push']({'buttonView':_0x40859c,'action':_0x176ac7}),{'listItem':_0x47544f,'highlightViews':[_0x59be23,_0xbff2b9]};}['_createSearchResultIndividualActionButton'](_0x3fee00,_0xccc0f9){const _0x399ab0=new zt(this['locale']),_0x4df346=new Pt(),_0x24d243=new Ht(this['locale'],_0x4df346),_0x15d273=_0x24d243['bindTemplate'];return _0x24d243['set']({'label':_0xccc0f9['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0xccc0f9['isEnabled']}),_0x24d243['extendTemplate']({'on':{'mouseenter':_0x15d273['to'](()=>{this['_isSearchFocused']()||_0x24d243['focus']();})}}),this['_setupActionButtonExecution'](_0x24d243,_0x3fee00,_0xccc0f9),_0x399ab0['children']['add'](_0x24d243),this['_actionButtons']['push']({'buttonView':_0x24d243,'action':_0xccc0f9}),{'listItem':_0x399ab0,'highlightViews':[_0x4df346]};}['_createSearchResultGroupRow'](_0x33b257,_0x49dcf3){const _0x3be8ec=new _0x42f8f5(this['locale']),_0x378c77=new Yt();_0x378c77['content']=_0x49dcf3,_0x378c77['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x542850=new Wt();return _0x542850['text']=_0x33b257,_0x3be8ec['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x378c77,_0x542850]}),{'view':_0x3be8ec,'highlightView':_0x542850};}['_createSearchResultActionRow'](_0x444fcb){const _0xbf0b31=new _0x42f8f5(this['locale']),_0x5418f4=new Wt();return _0x5418f4['text']=_0x444fcb,_0xbf0b31['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x5418f4]}),{'view':_0xbf0b31,'highlightView':_0x5418f4};}['_createSearchResultContentView'](_0x32b7de,_0x37a7f9){const _0x77c8ea=new _0x42f8f5(this['locale']);return _0x77c8ea['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x32b7de,_0x37a7f9]}),_0x77c8ea;}['_setupActionButtonExecution'](_0x5e9333,_0x1346f3,_0x39c6b6){_0x5e9333['on']('execute',()=>{_0x5e9333['isEnabled']&&(_0x1346f3['editing']['view']['focus'](),_0x1346f3['commands']['execute']('aiQuickAction',_0x39c6b6));});}['_createActionGroupButton'](_0x5c06e2,_0x4f43cf,_0x522501){const _0xeb6453=new zt(this['locale']),_0xa9f4b1=new Pt(),_0x5b996c=new pa(this['locale'],_0xa9f4b1),_0x5ce6b8=_0x5b996c['bindTemplate'],_0x1884b3=this['_getPanelKeystroke'](_0x522501),_0x177af1=this['_createGroupActionsList'](_0x5c06e2,_0x4f43cf['actions'],_0x522501);_0x5b996c['set']({'label':_0x4f43cf['label'],'withText':!0x0,'role':Ta,'icon':_0x4f43cf['icon']??_0x4e05d1,'isEnabled':_0x4f43cf['actions']['some'](_0x1ec61d=>_0x1ec61d['isEnabled'])}),_0x5b996c['extendTemplate']({'on':{'mouseenter':_0x5ce6b8['to'](()=>{this['_isSearchFocused']()||_0x5b996c['focus']();})}});const _0x33232c=new yt(this['locale']);return _0x33232c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5ce6b8['to'](_0x4b45ac=>{this['_handlePanelKeydown'](_0x4b45ac,_0x1884b3,_0x5b996c,_0x33232c);})}}),_0x5b996c['bind']('isOn')['to'](_0x33232c,'isVisible'),this['_bodyCollection']['add'](_0x33232c),_0x33232c['content']['add'](_0x177af1),this['_setupGroupMenuBehavior'](_0x5b996c,_0x33232c),_0xeb6453['children']['add'](_0x5b996c),this['_actionButtons']['push']({'buttonView':_0x5b996c,'action':_0x4f43cf}),{'listItem':_0xeb6453,'highlightView':_0xa9f4b1};}['_createGroupActionsList'](_0x3e0308,_0x2038b9,_0x1f8447){const _0x2b13d6=new jt(this['locale']);return _0x2b13d6['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2038b9['forEach'](_0x29722e=>{const _0x5a4942=new zt(this['locale']),_0x3b9b61=Ia({'editor':_0x3e0308,'action':_0x29722e,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x5a4942['children']['add'](_0x3b9b61),_0x1f8447['focusTracker']['add'](_0x3b9b61),_0x2b13d6['items']['add'](_0x5a4942);}),_0x2b13d6;}['_setupGroupMenuBehavior'](_0x57ef72,_0x399832){const _0x46e4ef=_0x57ef72['bindTemplate'],_0x16080e=this['_getButtonKeystroke'](_0x57ef72);_0x57ef72['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x46e4ef['to'](()=>{this['_showNestedPanel'](_0x399832,_0x57ef72);}),'mouseleave':_0x46e4ef['to'](_0x5c13e0=>{const _0x44e357=_0x5c13e0['relatedTarget'];this['_isMovingToNestedMenu'](_0x44e357,_0x399832)||this['_hideNestedPanel'](_0x399832);}),'keydown':_0x46e4ef['to'](_0x45c88c=>{_0x45c88c['key']==_0x16080e&&(this['_showNestedPanel'](_0x399832,_0x57ef72),_0x399832['content']['get'](0x0)['focus']());})}}),_0x399832['on']('render',()=>{_0x399832['element']?.['addEventListener']('mouseleave',_0x3a4e58=>{const _0x2dcdef=_0x3a4e58['relatedTarget'];_0x57ef72['element']?.['contains'](_0x2dcdef)||this['_isMovingToNestedMenu'](_0x2dcdef,_0x399832)||this['_hideNestedPanel'](_0x399832);});});}['_showNestedPanel'](_0x4ad659,_0x6c08e4){this['_openNestedPanels']['forEach'](_0x386b99=>{_0x386b99!==_0x4ad659&&_0x386b99['isVisible']&&_0x386b99['hide']();}),_0x4ad659['show'](),_0x4ad659['pin']({'positions':[Ut['eastSouth']],'target':_0x6c08e4['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4ad659);}['_hideNestedPanel'](_0x58aa45){_0x58aa45['hide'](),this['_openNestedPanels']['delete'](_0x58aa45);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0xfc939f=>_0xfc939f['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x363be9,_0x14d48b){if(!_0x363be9)return!0x1;if(_0x14d48b['element']?.['contains'](_0x363be9))return!0x0;const _0x3e617d=_0x363be9;return _0x3e617d['closest']&&(null!==_0x3e617d['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3e617d['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3e617d['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'](_0x4d21d0){return'rtl'===_0x4d21d0['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x394d6b){return'rtl'===_0x394d6b['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x22e80c,_0x4f45bc,_0x26950e,_0x460750){_0x22e80c['key']==_0x4f45bc&&(_0x26950e['focus'](),this['_hideNestedPanel'](_0x460750));}['_handleSearchResultButtonClick'](_0x428891){_0x428891['fire']('execute');}};function Ca(_0x3a2351){const {editor:_0x3c7328,content:_0x7ef507,buttonDefinition:_0x57f025,bodyCollection:_0x1a45d0,hasSearch:_0x116756=!0x1,actionButtons:_0x515683}=_0x3a2351;return()=>{const _0x51a72f=_0x3c7328['locale'],_0x2af648=_0x3c7328['commands']['get']('aiQuickAction'),_0x25a28f=_0x5ba05a(_0x51a72f);_0x25a28f['bind']('isEnabled')['to'](_0x2af648),_0x25a28f['buttonView']['set']({'icon':_0x57f025['icon']??_0x4e05d1,'label':_0x57f025['label'],'tooltip':!0x0}),_0x25a28f['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4a891a=new wa(_0x3c7328,_0x7ef507,_0x25a28f,_0x1a45d0,_0x116756,_0x515683);return _0x25a28f['panelView']['children']['add'](_0x4a891a),_0x116756&&_0x25a28f['on']('change:isOpen',(_0x4cf2fb,_0x1918f5,_0x4ecbe6)=>{if(_0x4ecbe6){if(_0x3c7328['plugins']['has']('AIEditing')){const _0x3db97e=_0x3c7328['plugins']['get'](Is),_0x239a01=_0x3c7328['model']['document']['selection'],_0x21de20=Array['from'](_0x239a01['getRanges']());_0x21de20['length']>0x0&&_0x3db97e['showFakeVisualSelection']({'editor':_0x3c7328,'ranges':_0x21de20,'id':'quick-action','priority':0x14});}}else _0x3c7328['plugins']['has']('AIEditing')&&_0x3c7328['plugins']['get'](Is)['hideFakeVisualSelection']('quick-action'),_0x4a891a['resetSearch']();}),_0x25a28f;};}const fa='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',ba='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Sa='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Ra=/* #__PURE__ -- @preserve */
37
- ((()=>({'chat':'AIChat','action':'AIActions'}))());var Oa=class AIQuickActionsUI extends _0x4655d9{['_actionButtons']=[];['_menuBarGroupViews']=[];['_reporter'];static get['requires'](){return[xt,ls,nn];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_reporter']=this['editor']['plugins']['get'](nn)['createReporter']('aiquickactions');const _0x3c5792=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x3c5792),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static['getDefaultQuickActions'](_0x26947f){return function(_0x5adacb){const _0x51e73c=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5adacb['uiLanguage'])||'English';return[{'id':'ask-ai','label':us(_0x5adacb,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x339ebc},{'id':'chat-commands','label':us(_0x5adacb,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x339ebc,'actions':[{'id':'explain','label':us(_0x5adacb,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x5adacb,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':fa['replace']('%0',_0x51e73c),'type':'chat'},{'id':'summarize','label':us(_0x5adacb,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x5adacb,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ba['replace']('%0',_0x51e73c),'type':'chat'},{'id':'highlight-key-points','label':us(_0x5adacb,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x5adacb,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Sa['replace']('%0',_0x51e73c),'type':'chat'}]},{'id':'improve-writing','label':us(_0x5adacb,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x81a774},{'id':'continue','label':us(_0x5adacb,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x121228},{'id':'fix-grammar','label':us(_0x5adacb,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0xd05426},{'id':'adjust-length','label':us(_0x5adacb,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x1a43f7,'actions':[{'id':'make-shorter','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':us(_0x5adacb,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x305268,'actions':[{'id':'make-tone-casual','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':us(_0x5adacb,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x3ce940,'actions':[{'id':'translate-to-english','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x5adacb,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x5adacb,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x42544f,'actions':[]}];}(_0x26947f);}['_getDefaultAndCustomActions'](){const _0x58d739=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x26b67c=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x4aaa83=>({..._0x4aaa83,'type':'chat'===_0x4aaa83['type']?'chat':'action','icon':void 0x0}));return _0x58d739['find'](_0x4575d3=>'other'===_0x4575d3['id'])['actions']['push'](..._0x26b67c),_0x58d739;}async['_initActionTypeQuickActions'](){try{const _0x695f69=new Qs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']}),_0x17710d=await _0x695f69['getAll'](),_0x15e8f8=(await _0x695f69['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x15e8f8),this['_enableButtonsByType']('action',_0x3e2620=>!!_0x17710d['find'](_0x3f10f9=>_0x3f10f9['id']===_0x3e2620['model'])||void 0x0===_0x3e2620['model']);}catch(_0x333152){const _0x130303=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x333152});this['_reporter']['logError'](_0x130303);}}['_initChatTypeQuickActions'](){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x2f573a=this['editor']['plugins']['get']('AIChatController');this['listenTo'](_0x2f573a,'change:isConversationReady',(_0x4ef4f7,_0x4ce7ee,_0x4fb853)=>{_0x4fb853&&this['_enableButtonsByType']('chat',()=>!0x0);}),_0x2f573a['isConversationReady']&&this['_enableButtonsByType']('chat',()=>!0x0);}['_enableButtonsByType'](_0x10abf9,_0x4b0cbc){this['_quickActionsDefinition']['forEach'](_0x58ff63=>{'actions'in _0x58ff63?_0x58ff63['actions']['forEach'](_0x5d8ec9=>{_0x5d8ec9['type']===_0x10abf9&&(_0x5d8ec9['isEnabled']=_0x4b0cbc(_0x5d8ec9));}):_0x58ff63['type']===_0x10abf9&&(_0x58ff63['isEnabled']=_0x4b0cbc(_0x58ff63));}),this['_actionButtons']['forEach'](_0x29482d=>{if(va(_0x29482d['action']))return;if(_0x29482d['action']['type']!==_0x10abf9)return;const _0x132006=_0x4b0cbc(_0x29482d['action']);if(_0x29482d['action']['isEnabled']=_0x132006,_0x29482d['buttonView']['isEnabled']=_0x132006,!_0x132006&&_0x29482d['action']['model']){const _0x280bbf=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x29482d['action']['id'],'modelId':_0x29482d['action']['model']});this['_reporter']['logError'](_0x280bbf);}}),this['_actionButtons']['filter'](_0x2f48b1=>va(_0x2f48b1['action']))['forEach'](_0x54f44f=>{_0x54f44f['buttonView']['isEnabled']=_0x54f44f['action']['actions']['some'](_0x384a66=>_0x384a66['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x7f1646,group:_0x3c46ce})=>{_0x7f1646['isEnabled']=_0x3c46ce['actions']['some'](_0x593a4c=>_0x593a4c['isEnabled']);});}['_assignDefaultModelToCustomActions'](_0x307185){this['_actionButtons']['forEach'](_0x2a8781=>{va(_0x2a8781['action'])||'action'===_0x2a8781['action']['type']&&(_0x2a8781['action']['model']||(_0x2a8781['action']['model']=_0x307185));});}['_initializeQuickActionsComponentsAndCommands'](){const _0x4b25e5=new Lt(this['editor']['locale']);_0x4b25e5['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4b25e5),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4b25e5);}['_initializeQuickActionsDropdown'](_0x4017dc){const _0x2baa69=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ca({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x4e05d1,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x4017dc,'hasSearch':_0x2baa69,'actionButtons':this['_actionButtons']}));}['_prepareQuickActionsDefinition'](_0x5e9c8f){this['_quickActionsDefinition']=_0x5e9c8f['map'](_0x2841b3=>{if('actions'in _0x2841b3){const _0x51f762=_0x2841b3;return{..._0x51f762,'actions':_0x51f762['actions']['map'](_0xf63d9e=>{const {actions:_0xa822d0,..._0x428953}=_0x51f762;return{..._0xf63d9e,'isEnabled':!0x1,'parent':_0x428953};})['filter'](_0x3ad04a=>this['_shouldIncludeAction'](_0x3ad04a))};}return{..._0x2841b3,'isEnabled':!0x1};})['filter'](_0x33d761=>'actions'in _0x33d761?_0x33d761['actions']['length']>0x0:this['_shouldIncludeAction'](_0x33d761));}['_shouldIncludeAction'](_0x163c56){const _0x222377=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ra[_0x163c56['type']])&&!_0x222377['includes'](_0x163c56['id'])&&!('chat'===_0x163c56['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x2e4961){this['_quickActionsDefinition']['forEach'](_0x5e4f36=>{if('actions'in _0x5e4f36){const _0x34f40e=Ca({'editor':this['editor'],'content':_0x5e4f36['actions'],'buttonDefinition':_0x5e4f36,'bodyCollection':_0x2e4961,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x5e4f36['id'],_0x34f40e),_0x5e4f36['actions']['forEach'](_0x4e51b9=>{const _0x585f2c=Ia({'editor':this['editor'],'action':_0x4e51b9,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x4e51b9['id'],_0x585f2c);});}else{const _0x1734f7=Ia({'editor':this['editor'],'action':_0x5e4f36,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x5e4f36['id'],_0x1734f7);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x1a7dcd=>{const _0x59fa9c=this['editor']['commands']['get']('aiQuickAction'),_0x193e41=new _0x40d16d(_0x1a7dcd),_0x8f95e=us(_0x1a7dcd,'AI_QUICK_ACTIONS_HEADING');_0x193e41['buttonView']['set']({'label':_0x8f95e,'icon':_0x4e05d1});const _0x193ff5=new te(_0x1a7dcd);return _0x193ff5['set']({'ariaLabel':_0x8f95e,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x3a130c=>{if('actions'in _0x3a130c){const _0x2beca9=_0x3a130c,_0x402878=new Zt(_0x1a7dcd,_0x193e41),_0x2784dd=new _0x40d16d(_0x1a7dcd),_0x484e2f=new te(_0x1a7dcd);_0x2784dd['buttonView']['set']({'label':_0x2beca9['label'],'icon':_0x2beca9['icon']}),_0x2beca9['actions']['forEach'](_0x14c44f=>{const _0x30e597=new Zt(_0x1a7dcd,_0x2784dd),_0x329488=new Jt(_0x1a7dcd);_0x329488['set']({'label':_0x14c44f['label'],'icon':_0x14c44f['icon'],'role':'menuitem','isEnabled':_0x14c44f['isEnabled']}),_0x329488['on']('execute',()=>{this['_executeQuickAction'](_0x14c44f);}),this['_actionButtons']['push']({'buttonView':_0x329488,'action':_0x14c44f}),_0x329488['delegate']('execute')['to'](_0x2784dd),_0x30e597['children']['add'](_0x329488),_0x484e2f['items']['add'](_0x30e597);}),_0x2784dd['isEnabled']=_0x2beca9['actions']['some'](_0x268a3f=>_0x268a3f['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x2784dd,'group':_0x2beca9}),_0x2784dd['panelView']['children']['add'](_0x484e2f),_0x402878['children']['add'](_0x2784dd),_0x193ff5['items']['add'](_0x402878);}else{const _0x10d546=_0x3a130c,_0x29faf0=new Zt(_0x1a7dcd,_0x193e41),_0x32bc63=new Jt(_0x1a7dcd);_0x32bc63['set']({'label':_0x10d546['label'],'icon':_0x10d546['icon'],'role':'menuitem','isEnabled':_0x10d546['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x32bc63,'action':_0x10d546}),_0x32bc63['on']('execute',()=>{this['_executeQuickAction'](_0x10d546);}),_0x32bc63['delegate']('execute')['to'](_0x193e41),_0x29faf0['children']['add'](_0x32bc63),_0x193ff5['items']['add'](_0x29faf0);}}),Object['values'](Ra)['some'](_0x675df1=>this['editor']['plugins']['has'](_0x675df1))?_0x193e41['bind']('isEnabled')['to'](_0x59fa9c):_0x193e41['set']({'isEnabled':!0x1}),_0x193e41['panelView']['children']['add'](_0x193ff5),_0x193e41;});}['_executeQuickAction'](_0x324bda){const _0x3ed27d=this['editor'];_0x3ed27d['editing']['view']['focus'](),_0x3ed27d['commands']['execute']('aiQuickAction',_0x324bda);const _0xbc5852=_0x3ed27d['ui']['view']['menuBarView'];_0xbc5852&&_0xbc5852['close']&&_0xbc5852['close']();}};function va(_0x286ed1){return'actions'in _0x286ed1;}function ka(_0x2be6ed,_0x3f6622){const _0x511aa0=_0x2be6ed['plugins']['get']('AITabs')['view'];_0x511aa0['isVisible']=!0x0,_0x511aa0['activateTab'](_0x3f6622);}var Na=class extends _0x17e1f8{['execute'](_0x5f3ae6){switch(this['_expandSelectionIfCollapsed'](),_0x5f3ae6['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x4ab344=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4ab344});}this['_handleAIChatAction'](_0x5f3ae6);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x43dfca=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x43dfca});}this['_handleAIActionsAction'](_0x5f3ae6);}}async['_handleAIChatAction'](_0x4543c9){const _0x54dc6b=this['editor']['plugins']['get']('AIChatController');if(ka(this['editor'],'chat'),'ask-ai'===_0x4543c9['id'])_0x54dc6b['removeSelectionFromChatContext'](),_0x54dc6b['addSelectionToChatContext'](this['editor']),_0x54dc6b['focusPromptInput']();else await _0x54dc6b['startConversation']({'modelId':_0x4543c9['model']}),_0x54dc6b['removeSelectionFromChatContext'](),_0x54dc6b['addSelectionToChatContext'](this['editor']),_0x54dc6b['focusPromptInput'](),await _0x54dc6b['sendMessage']({'message':_0x4543c9['prompt']||_0x4543c9['displayedPrompt']||_0x4543c9['label'],'attributes':{'quickActionData':{'id':_0x4543c9['id']},'displayedPrompt':_0x4543c9['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x34e686=this['editor'],_0xccc977=_0x34e686['model']['document']['selection'];if(!_0xccc977['isCollapsed'])return;const _0x281ce5=mt(_0xccc977['getSelectedBlocks']())||_0x34e686['model']['schema']['getLimitElement'](_0xccc977);_0x34e686['model']['change'](_0xf9d59b=>{_0xf9d59b['setSelection'](_0x281ce5,'in');});}['_handleAIActionsActionLabel'](_0x3df332){return _0x3df332['parent']?.['label']&&'other'!==_0x3df332['parent']?.['id']?_0x3df332['parent']['label']+':\x20'+_0x3df332['label']:_0x3df332['label'];}async['_handleAIActionsAction'](_0x40d588){const _0xdab7be=this['editor']['plugins']['get']('AIActions'),_0x2d2d76=_0x40d588['prompt']?{'userMessage':_0x40d588['prompt'],'model':_0x40d588['model']}:{'actionName':_0x40d588['actionName']||_0x40d588['id'],'args':_0x40d588['args']},_0x58ab96=this['_handleAIActionsActionLabel'](_0x40d588);await _0xdab7be['executeAction'](_0x2d2d76,_0x58ab96,_0x40d588['icon']);}},ya=class extends _0x4655d9{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4d75e5=this['editor'],_0x16220c=new Na(this['editor']);if(_0x4d75e5['commands']['add']('aiQuickAction',_0x16220c),_0x4d75e5['plugins']['has']('AIChat')){const _0x3aead8=this['editor']['plugins']['get']('AIChatController');_0x4d75e5['model']['document']['selection']['on']('change:range',(_0x8298dd,_0x51e70c)=>{_0x51e70c['directChange']&&_0x3aead8['removeSelectionFromChatContext']();});}}},xa=class extends dn{['appendContent'](_0x513785,_0x3703c7='text'){'modification'===this['type']&&'text'===_0x3703c7&&(_0x3703c7=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x513785,_0x3703c7);}['updateChangeGroups'](_0x6be329){const _0x4e9ad4=this['parsedContent']['get'](_0x6be329)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x6be329,_0x4e9ad4),this['changeGroups']=[],0x0==_0x4e9ad4['childNodes']['length'])return;Ds(this['documentContextContent']['get'](_0x6be329),this['parsedMergedContent']['get'](_0x6be329));const _0x532449=_0x5ca782(this['documentContextContent']['get'](_0x6be329)['children']['map'](_0xb53183=>({'node':_0xb53183,'id':fs(_0xb53183,'data-id')})),_0x4e9ad4['children']['map'](_0x424532=>({'node':_0x424532,'id':fs(_0x424532,'data-id')||vt()})),{'comparator':(_0x378f39,_0x54b39c)=>_0x378f39['id']==_0x54b39c['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x532449['length']&&_0x532449[_0x532449['length']-0x1]['removed'];)_0x532449['pop']();}const _0x2d6813=_0x532449['map'](_0x6f2a60=>{const _0x82b20=_0x6f2a60['added']?'new':_0x6f2a60['removed']?'removed':'modified';return{'node':_0x6f2a60['value'][0x0]['node'],'type':_0x82b20,'id':_0x6f2a60['value'][0x0]['id']};}),_0x4a6ed8=this['_documentIdToSource']['get'](_0x6be329);this['changeGroups']['push']({'changes':_0x2d6813,'state':'pending','index':this['changeGroups']['length'],'editor':_0x4a6ed8['editor'],'rootName':_0x4a6ed8['rootName'],'documentId':_0x6be329});}['_getDifferentChangeGroups'](_0xbdcb43,_0x520400){return _0x520400;}},La=class extends An{['content'];['version'];['editor'];['rootName'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x4ef980){super(_0x4ef980),this['content']=_0x4ef980['content'],this['version']=_0x4ef980['version'],this['editor']=_0x4ef980['editor'],this['rootName']=_0x4ef980['rootName'],this['actionName']=_0x4ef980['actionName'],this['args']=_0x4ef980['args'],this['userMessage']=_0x4ef980['userMessage'],this['model']=_0x4ef980['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}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':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':vt(),'channelId':this['editor']['config']['get']('collaboration.channelId')}],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x363e34){const _0x353f55=this['editor']['config']['get']('collaboration.channelId'),_0xc83043=new xa({..._0x363e34,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x353f55,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x353f55,this['editor']]])});return this['replies']['push'](_0xc83043),_0xc83043['delegate'](...gn)['to'](this),this['fire']('replyCreated',_0xc83043),_0xc83043;}},Da=class extends _0x182e23{constructor(_0x4034f7,_0x1de121=!0x0,_0x11e33=!0x0){super(_0x4034f7),this['set']('isEnabled',!0x1),_0x1de121&&(this['applyButton']=this['_createButton'](us(_0x4034f7,'AI_BALLOON_APPLY_BUTTON'),on),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x11e33&&(this['suggestButton']=this['_createButton'](us(_0x4034f7,'AI_BALLOON_SUGGEST_BUTTON'),_0x1de121?an:on),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x1de121,'showSuggestButton':_0x11e33}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4e91a4,showSuggestButton:_0x46e307}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4e91a4),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x46e307);}['_createButton'](_0x4134c2,_0x53a247){const _0x3b5279=new Ht(this['locale']);return _0x3b5279['set']({'label':_0x4134c2,'class':_0x53a247,'isVisible':!0x0,'withText':!0x0}),_0x3b5279;}},Pa=class extends _0x42f8f5{constructor(_0x219698){super(_0x219698),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':us(_0x219698,'AI_DISCLAIMER_TEXT')}]}]});}},Ha=class extends _0x42f8f5{constructor(_0x32fa8a){super(_0x32fa8a),this['set']('isVisible',!0x0);const _0x237898=new cr('small');_0x237898['isVisible']=!0x0;const _0x1ed15d=new _0x42f8f5(this['locale']);_0x1ed15d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[us(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x30e0f1=>!_0x30e0f1)]},'children':[_0x237898,_0x1ed15d]});}},Ma=class extends ha{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_miniToolbarResizeObserver'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x5c33ce,_0x106bf6){super(_0x5c33ce),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x106bf6,this['_focusTracker']=new dt(),this['_keystrokes']=new _t(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Gt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x5f3be9(),this['_addContentWrapper'](_0x106bf6),this['_addDisclaimerView'](),this['_addToolbar'](_0x106bf6),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x106bf6);}),this['on']('render',()=>{this['_setupMiniToolbarPositioning']();});}['render'](){super['render']();for(const _0x52b6fa of this['_focusables'])this['_focusTracker']['add'](_0x52b6fa['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy'](),this['_miniToolbarResizeObserver']&&this['_miniToolbarResizeObserver']['destroy']();}['focus'](_0x4ef134){-0x1===_0x4ef134?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x24d64b){this['_isLoading']=_0x24d64b;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x2c7009){super['showError'](_0x2c7009),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x33a96b){super['showBlockingError'](_0x33a96b),this['setErrorState']();}['addMiniToolbarItem'](_0x1abe7d){this['_miniToolbarView']['items']['has'](_0x1abe7d)||this['_miniToolbarView']['items']['add'](_0x1abe7d);}['removeMiniToolbarItem'](_0x407200){this['_miniToolbarView']['items']['has'](_0x407200)&&this['_miniToolbarView']['items']['remove'](_0x407200);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x132801,showSuggestButton:_0x291fe8}){_0x132801=_0x132801&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x291fe8=_0x291fe8&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x132801,'showSuggestButton':_0x291fe8});}async['updateContent'](_0x5270f7){await this['_streamableContentView']['update'](_0x5270f7);}['finalizeContent'](){this['_streamableContentView']['cleanUpStreamingArtifacts']();}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x5cf4f2){this['_contentWrapper']=new _0x42f8f5(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content',this['bindTemplate']['if']('_isErrorVisible','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x5cf4f2['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Pa(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x446573,showSuggestButton:_0x18043c}){this['_toolbarView']=new Da(this['locale'],_0x446573,_0x18043c),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x223cec,_0x4350e9,_0x4098e9)=>!(_0x223cec||_0x4350e9||_0x4098e9)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x446573,'showSuggestButton':_0x18043c}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0xe3fecd){return this['_miniToolbarView']=new ua(this['locale'],_0xe3fecd),this['_miniToolbarView']['delegate'](...Nn)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x5a380c,_0x5867c4)=>!(_0x5a380c||_0x5867c4)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Ha(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new qn(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5f2e3d=new Ht(this['locale']),_0x527ed1=new Ht(this['locale']),_0x33c631=new Va(this['locale']),_0x4c16a6=new Ht(this['locale']);_0x5f2e3d['set']({'icon':_0x4a7205,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+hn}),_0x527ed1['set']({'icon':_0x3961c4,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+hn}),_0x4c16a6['set']({'icon':_0xb5821d,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+hn}),_0x5f2e3d['bind']('isEnabled')['to'](this,'isBusy',_0x48622a=>!_0x48622a),_0x5f2e3d['on']('execute',()=>{this['fire']('tryAgain');}),_0x527ed1['bind']('isEnabled')['to'](this,'isBusy',_0x45e07d=>!_0x45e07d),_0x527ed1['on']('execute',()=>{this['fire']('showPrevious');}),_0x4c16a6['bind']('isEnabled')['to'](this,'isBusy',_0x105cf5=>!_0x105cf5),_0x4c16a6['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x527ed1,this['_navigationCounter']=_0x33c631,this['_navigationNextButton']=_0x4c16a6,this['_navigationTryAgainButton']=_0x5f2e3d;}['updateMiniToolbarButtons'](_0x313f0a,_0x290e09){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0xd5515c=_0x313f0a>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0xd5515c){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xf6c706=_0x313f0a-_0x290e09;this['_navigationCounter']['setInteractionCount'](_0xf6c706+'/'+_0x313f0a),this['_navigationPreviousButton']['isEnabled']=_0x290e09<_0x313f0a-0x1,this['_navigationNextButton']['isEnabled']=_0x290e09>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0xbfc2bc){this['_isLoading']=_0xbfc2bc;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_setupMiniToolbarPositioning'](){const _0x543a5b=this['_streamableContentView']['element'],_0x2abc3e=this['_miniToolbarView']['element'],_0x28c7f6=()=>{Tt['window']['requestAnimationFrame'](()=>{const _0x586644=_0x543a5b['offsetWidth']-_0x543a5b['clientWidth'];_0x2abc3e['style']['right']='calc('+_0x586644+'px\x20+\x20var(--ck-spacing-large))';});};_0x28c7f6(),this['_miniToolbarResizeObserver']=new It(_0x543a5b,()=>{_0x28c7f6();});}['_initializeScrollManager'](){const _0x37407e=this['_getScrollableElement']();_0x37407e&&!this['_scrollManager']&&(this['_scrollManager']=new Pr(_0x37407e));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}},Va=class extends _0x42f8f5{constructor(_0x58c2e7){super(_0x58c2e7);const _0x2baee2=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x2baee2['to']('interactionCount')}]});}['setInteractionCount'](_0x5edf5e){this['set']('interactionCount',_0x5edf5e);}},Ua=class extends _0x4655d9{static get['requires'](){return[ls,nn,Mt,Is,la,_0x1f6a74];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];['_reporter'];constructor(_0xb5684b){super(_0xb5684b),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](nn)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Zn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x579a54,_0x105215,_0xa880af){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xb944e9,anchorData:_0x4a8a1c,root:_0x56c695}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x579a54,_0xb944e9,_0x4a8a1c,_0x56c695,_0x105215,_0xa880af);}const {modelFragment:_0x23320c,anchorData:_0x31e787,root:_0x4f68d8}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x579a54,_0x23320c,_0x31e787,_0x4f68d8,_0x105215,_0xa880af);}async['destroy'](){return this['_stopInteraction'](),super['destroy']();}['_createActionsBalloonView'](){const _0xa64e27=this['editor']['plugins']['has']('TrackChanges');let _0x12319f=this['editor']['config']['get']('ai.availableReplyActions')||[...er];_0xa64e27||(_0x12319f=_0x12319f['filter'](_0x1b0e82=>'insertSuggestion'!=_0x1b0e82));const _0x500079=this['editor']['commands']['get']('trackChanges'),_0x15d27a=new Ma(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0xa64e27,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x12319f});return _0x15d27a['bind']('isBusy')['to'](this),_0x500079&&_0x15d27a['bind']('isTrackChangesOn')['to'](_0x500079,'value'),_0x15d27a['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x15d27a['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x15d27a['on']('showNext',()=>{this['_navigateToNext']();}),_0x15d27a;}['_normalizeSelectionStart'](){const _0x3f818a=this['editor']['model'],_0x3f17e0=_0x3f818a['document']['selection'],_0x5ccc9f=_0x3f17e0['getFirstRange']();if(!_0x5ccc9f||_0x5ccc9f['isCollapsed'])return;const _0x2db532=mt(_0x3f17e0['getSelectedBlocks']());if(!_0x2db532)return;const _0x45a869=_0x3f818a['createPositionAt'](_0x2db532,0x0);_0x45a869['isAfter'](_0x5ccc9f['start'])&&_0x3f818a['change'](_0x4c6d54=>{_0x4c6d54['setSelection'](_0x4c6d54['createRange'](_0x45a869,_0x5ccc9f['end']));});}['_getExecuteDataRegular'](){const _0xf4f5cd=this['editor']['model']['document']['selection'],_0x352e95=_0xf4f5cd['getFirstRange']()['start']['root'];if(_0xf4f5cd['isCollapsed']){const _0x174455=mt(_0xf4f5cd['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xf4f5cd);this['editor']['model']['change'](_0x20b5f0=>{_0x20b5f0['setSelection'](_0x174455,'in');});}this['_normalizeSelectionStart']();const _0x163e97=_0xf4f5cd['getFirstRange'](),_0xa07ec9=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xf4f5cd),_0x163e97['start'],_0x163e97['end']);this['_copyMarkersToFragment'](_0xa07ec9,_0xf4f5cd,{'isTableSelection':!0x1});const _0x31150b=_0xf4f5cd['getFirstRange']()['start'],_0x2db3b9=new Map();let _0x16ea34=_0xa07ec9;for(let _0xf421e5=0x0;_0xf421e5<_0x31150b['path']['length'];_0xf421e5++)_0x2db3b9['set'](_0x16ea34,_0x31150b['path'][_0xf421e5]),_0x16ea34=_0x16ea34['getChild'](0x0);return{'modelFragment':_0xa07ec9,'anchorData':_0x2db3b9,'root':_0x352e95};}['_getExecuteDataInTable'](){const _0x34967a=this['editor']['model']['document']['selection'],_0xbefa0d=this['editor']['plugins']['get']('TableSelection'),_0x372e6e=_0x34967a['getFirstRange']()['start']['root'],_0x4f87f0=_0xbefa0d['getSelectionAsFragment'](),_0xb085f6=_0x34967a['getFirstRange']()['start']['parent']['parent'],_0x568d26=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xb085f6),this['editor']['model']['createPositionAfter'](_0xb085f6)),_0x35eb3a=this['_wrapWithCommonAncestors'](_0x4f87f0,_0x568d26['start'],_0x568d26['end']);this['_copyMarkersToFragment'](_0x35eb3a,_0x34967a,{'isTableSelection':!0x0});const _0xfe096d=_0x34967a['getFirstRange']()['start'],_0xb1d4bc=new Map();let _0x4d5ccf=_0x35eb3a;for(let _0x2a998a=0x0;_0x2a998a<_0xfe096d['path']['length'];_0x2a998a++)if(_0xb1d4bc['set'](_0x4d5ccf,_0xfe096d['path'][_0x2a998a]),_0x2a998a<_0xfe096d['path']['length']-0x1)_0x4d5ccf=_0x4d5ccf['getChild'](0x0);else{let _0x3c1f33=_0x4d5ccf['nextSibling'];for(;_0x3c1f33;)_0xb1d4bc['set'](_0x3c1f33,_0xfe096d['path'][_0x2a998a]),_0x3c1f33=_0x3c1f33['nextSibling'];}return{'modelFragment':_0x35eb3a,'anchorData':_0xb1d4bc,'root':_0x372e6e};}async['_executeAction'](_0xcbba47,_0x497781,_0x2a0463,_0x3d9619,_0x5201c9,_0x1d4f28){const _0x347388=this['editor']['plugins']['get'](Is),_0x31e1a9=this['editor']['plugins']['get'](la),_0x4d72fa=this['editor']['model']['document']['selection'],_0x194085=await _0x347388['modelToDataWithIds'](_0x497781,this['editor']),_0x4dd435=this['editor']['model']['document']['version'],_0x29f659=[..._0x4d72fa['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x31e1a9['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x5201c9,'icon':_0x1d4f28||_0x4e05d1,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x29f659,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x31e1a9),this['_interactionParams']={'action':_0xcbba47,'content':_0x194085,'version':_0x4dd435,'aiBalloon':_0x31e1a9,'modelFragment':_0x497781,'anchorData':_0x2a0463,'root':_0x3d9619},this['_setupApplyListeners'](),this['listenTo'](_0x31e1a9,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x31e1a9,'dialogClosed',(_0x5f10fb,{id:_0x1b7b08})=>{if('aiActionsBalloon'===_0x1b7b08){for(const _0x581d80 of this['_interactions']){if(0x0===_0x581d80['replies']['length']||_0x581d80['stoppedExplicitly'])continue;const _0x4725b4=_0x581d80['replies'][_0x581d80['replies']['length']-0x1],_0x23ed8d=_0x4725b4['changeGroups'][0x0];_0x23ed8d&&'pending'===_0x23ed8d['state']&&_0x4725b4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x31e1a9);}}),this['_createInteraction'](_0x194085,_0x4dd435,_0x31e1a9,_0xcbba47);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1bf5d0,anchorData:_0x51aa30,root:_0x1fe6d8}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1bf5d0,_0x51aa30,_0x1fe6d8,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1bf5d0,_0x51aa30,_0x1fe6d8,!0x0);});}['_wrapWithCommonAncestors'](_0x36e77d,_0x14a46c,_0x401d10){const _0x54c188=this['editor']['model']['createRange'](_0x14a46c,_0x401d10)['getCommonAncestor'](),_0x2a85fa=_0x54c188['is']('documentFragment')?[]:_0x54c188['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x2a85fa['length']){const _0x17bb72=_0x2a85fa['map'](_0x20365c=>_0x20365c['_clone'](!0x1));for(let _0x1ad747=0x1;_0x1ad747<_0x17bb72['length'];_0x1ad747++)_0x17bb72[_0x1ad747-0x1]['_appendChild'](_0x17bb72[_0x1ad747]);return _0x17bb72[_0x17bb72['length']-0x1]['_appendChild'](_0x36e77d),new _0x4a5f18(_0x17bb72[0x0]);}return _0x36e77d;}['_copyMarkersToFragment'](_0xf222af,_0x37f874,_0x4becca={'isTableSelection':!0x1}){const _0x5bb1f4=this['editor']['model'],_0x42edf1=Array['from'](_0x37f874['getRanges']()),_0x2758df=_0x37f874['getFirstRange']()['start'];for(const _0x5c3f5e of _0x5bb1f4['markers']){if(_0x5c3f5e['name']['startsWith']('ai-selection')||!_0x5c3f5e['affectsData'])continue;const _0x5acfa9=_0x5c3f5e['getRange']();if(!_0x42edf1['some'](_0x491e41=>_0x491e41['containsRange'](_0x5acfa9,!0x0)))continue;const _0x191ccf=this['_regularCalculateMarkerPath'](_0x5acfa9['start'],_0x2758df,_0x4becca['isTableSelection']),_0x5c5475=this['_regularCalculateMarkerPath'](_0x5acfa9['end'],_0x2758df,_0x4becca['isTableSelection']),_0x194400=_0x5bb1f4['createPositionFromPath'](_0xf222af,_0x191ccf),_0x1cd8b7=_0x5bb1f4['createPositionFromPath'](_0xf222af,_0x5c5475);if(!_0x194400['isEqual'](_0x1cd8b7)){const _0x153019=_0x5bb1f4['createRange'](_0x194400,_0x1cd8b7);_0xf222af['markers']['set'](_0x5c3f5e['name'],_0x153019);}}}['_regularCalculateMarkerPath'](_0x4b6743,_0x44b6c8,_0x56f8d6=!0x1){const _0x37e3d0=[..._0x4b6743['path']['slice']()];for(let _0x2d64ed=0x0;_0x2d64ed<Math['max'](_0x44b6c8['path']['length'],_0x4b6743['path']['length']);_0x2d64ed++){const _0x41d920=_0x44b6c8['path'][_0x2d64ed]||0x0,_0x2224a8=(_0x4b6743['path'][_0x2d64ed]||0x0)-_0x41d920;if(_0x37e3d0[_0x2d64ed]=_0x2224a8,0x0!==_0x2224a8&&!_0x56f8d6)break;}return _0x37e3d0;}async['_createInteraction'](_0x6ef4c,_0x378ed9,_0xbc896c,_0x9f2f2c){const _0x5b9785=this['editor'],_0x48cd88=_0x5b9785['model']['document']['selection']['getFirstRange']()['start']['root'];if(!_0xeaa397(_0x5b9785,_0x48cd88['rootName']))return this['_actionsBalloonView']['showBlockingError'](us(this['editor']['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),Promise['resolve']();this['_interactionParams']||(this['_interactionParams']={'action':_0x9f2f2c,'content':_0x6ef4c,'version':_0x378ed9,'aiBalloon':_0xbc896c,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x48cd88});const _0x52c264=new La({'connector':this['_aiConnector'],'locale':_0x5b9785['locale'],'content':_0x6ef4c,'version':_0x378ed9,'editor':_0x5b9785,'rootName':_0x48cd88['rootName'],..._0x9f2f2c});this['_interactions']['push'](_0x52c264);const _0x33a207=(_0x4a7737,_0x4912b3=!0x1,_0x21328e='streaming')=>{const {isDone:_0x1dfd2a}=_0x4a7737;return this['_promiseQueue']['enqueue'](async _0x596b32=>{try{const _0x471b57=Vs({'changeGroups':_0x4a7737['changeGroups'],'documentContextContent':_0x4a7737['documentContextContent'],'showDiff':_0x4912b3,'trimUnchanged':!0x1});_0x471b57['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x471b57[0x0],'renderingStrategy':_0x21328e,'abortSignal':_0x596b32}),_0x1dfd2a&&this['_actionsBalloonView']['finalizeContent']();}catch(_0x2e6e6a){if(en(_0x2e6e6a))return;throw _0x2e6e6a;}});};_0x52c264['on']('replyCreated',(_0x5ec61b,_0x2eaf6f)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x33a207(_0x2eaf6f)['catch'](_0xee4071=>{this['_reporter']['logError'](_0xee4071,{'context':{'operation':'reply-create'}}),this['_setErrorState'](_0x52c264,_0xee4071);});}),_0x52c264['on']('replyContentUpdated',(_0x44b9ee,_0x576068)=>{_0x33a207(_0x576068)['catch'](_0x19b6c4=>{this['_reporter']['logError'](_0x19b6c4,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0x52c264,_0x19b6c4);});}),_0x52c264['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5d240c){this['_reporter']['logError'](_0x5d240c,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0x52c264,_0x5d240c);}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2c4fd5,{showDiff:_0x155b5b})=>{try{this['_balloonShowDiff']=_0x155b5b;const _0x47ecec=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x47ecec&&await _0x33a207(_0x47ecec,_0x155b5b,'static');}catch(_0x44a9ee){this['_reporter']['logError'](_0x44a9ee,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0x52c264,_0x44a9ee);}}),_0x52c264['on']('replyChangeGroupStateUpdated',()=>{const _0x5c9dd2={'positiveCount':_0x52c264['replies']['reduce']((_0x483a67,_0xee440e)=>_0x483a67+_0xee440e['changeGroups']['filter'](_0x41f81a=>'accepted'===_0x41f81a['state'])['length'],0x0),'totalCount':_0x52c264['replies']['reduce']((_0x517783,_0x24492e)=>_0x517783+_0x24492e['changeGroups']['length'],0x0)},_0x48055d=_0x52c264['actionCallId'],_0xbc3a31=_0x52c264['actionName'];_0xbc3a31?this['_aiConnector']['upsertAIActionRating'](_0xbc3a31,_0x48055d,_0x5c9dd2):this['_aiConnector']['upsertCustomAIActionRating'](_0x48055d,_0x5c9dd2);}),this['_setLoadingState']();try{const _0x1255ca=await _0x52c264['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x1255ca;}catch(_0x93d529){en(_0x93d529)||this['_actionsBalloonView']['hideLoader'](),this['_reporter']['logError'](_0x93d529,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0x52c264,_0x93d529);}}['_applyChanges'](_0x4e2e6f,_0x56d36c,_0x37cd9f,_0x16a6df){const _0xad1dc0=this['editor'];if(_0x16a6df&&!_0xad1dc0['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x51b9b5=this['editor']['plugins']['get'](_0x1f6a74),_0x99e4e=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x99e4e||!_0x99e4e['replies']['length'])return;const _0x1d1d95=_0x99e4e['replies'][_0x99e4e['replies']['length']-0x1];_0x1d1d95['setChangeGroupState'](0x0,'accepted');const _0x3232b3=Rn({'documentSuggestions':On({'groups':[_0x1d1d95['changeGroups'][0x0]],'documentContextContent':_0x1d1d95['documentContextContent'],'documents':_0x99e4e['getDocumentContext']()['documents']}),'transform':!0x1,'documentCompare':_0x51b9b5,'documentCompareOptions':{'anchor':_0xad1dc0['model']['createPositionAt'](_0x4e2e6f,0x0),'markDeletions':_0x16a6df}})['values']()['next']()['value']??[],_0x37f34d=this['_filterOperationsOutsideRange'](_0x3232b3,_0x56d36c);for(const _0x343522 of _0x37f34d)this['_anchorOperation'](_0x56d36c,_0x343522,_0x37cd9f);const _0x3b1c08=_0x99e4e['getDocumentContext']()['documents'][0x0]['version'],_0x510be5=_0x5be051(_0x37f34d,_0xad1dc0['model']['document']['history']['getOperations'](_0x3b1c08),{'document':_0xad1dc0['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];zs(_0x510be5,'quickActions');try{_0xad1dc0['model']['change'](_0x1512fc=>{_0x1512fc['setSelection'](_0xad1dc0['model']['document']['selection']['focus']),_0x16a6df?_0xad1dc0['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x510be5):_0x51b9b5['applyOperations'](_0x1512fc,_0x510be5);});}catch(_0x4ff4da){throw this['_reporter']['logError'](new sn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x4ff4da})),_0x4ff4da;}this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2604d9,_0x4aadb3){return _0x2604d9['filter'](_0x5258fb=>{if('rename'==_0x5258fb['type']){const _0x229e4f=_0x5258fb['position']['nodeAfter'];return!_0x4aadb3['has'](_0x229e4f);}if(_0x5258fb['type']['indexOf']('Attribute')>-0x1){const _0x6b4a51=_0x5258fb['range']['start']['nodeAfter'];return!_0x4aadb3['has'](_0x6b4a51);}return!0x0;});}['_anchorOperation'](_0xa4c464,_0x2dcc32,_0x58161d){const _0xaf7192=_0x2dcc32['clone']();for(const _0x3c7557 in _0x2dcc32){const _0x255daa=_0x2dcc32[_0x3c7557];_0x255daa instanceof _0x223931?_0x2dcc32[_0x3c7557]=new _0x223931(_0x27a0a8(_0x255daa['start']),_0x27a0a8(_0x255daa['end'])):_0x255daa instanceof _0x35d72f&&(_0x2dcc32[_0x3c7557]=_0x27a0a8(_0x255daa));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xaf7192['type'])){if(_0xaf7192['isDocumentOperation']=!0x1,_0xaf7192['baseVersion']=null,'remove'==_0xaf7192['type']){const _0x20fde4=_0xaf7192['sourcePosition'],_0x510242=_0xaf7192['howMany'];new _0x440cda(_0x20fde4,_0x510242)['_execute']();}else _0xaf7192['_execute']();}function _0x27a0a8(_0x21ffdc){if('$graveyard'==_0x21ffdc['root']['rootName'])return _0x21ffdc;const _0x32ef4c=[];let _0x34e2c5=_0x21ffdc['root'];for(let _0x3b2f45=0x0;_0x3b2f45<_0x21ffdc['path']['length'];_0x3b2f45++){const _0x59f6fa=_0xa4c464['get'](_0x34e2c5)||0x0;_0x32ef4c[_0x3b2f45]=_0x21ffdc['path'][_0x3b2f45]+_0x59f6fa,_0x34e2c5=_0x34e2c5['getChildAtOffset'](_0x21ffdc['path'][_0x3b2f45]);}return new _0x35d72f(_0x58161d,_0x32ef4c,_0x21ffdc['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x197e94,content:_0x60555d,version:_0x26a244,aiBalloon:_0xed4c1f}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x60555d,_0x26a244,_0xed4c1f,_0x197e94)['catch'](_0x30f11a=>{this['_reporter']['logError'](_0x30f11a,{'context':{'operation':'refresh-interaction'}});});}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x43fa58=this['_interactions']['length'];this['_currentInteractionIndex']<_0x43fa58-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5e1df){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5e1df;const _0x1943b0=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1943b0)return;if(_0x1943b0['hasError'])return this['_setErrorState'](_0x1943b0),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x1943b0['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x4d916c=_0x1943b0['replies'][_0x1943b0['replies']['length']-0x1];if(_0x4d916c)try{const _0x10c297=Vs({'changeGroups':_0x4d916c['changeGroups'],'documentContextContent':_0x4d916c['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2df8fd=>setTimeout(_0x2df8fd,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x10c297[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x30e974){this['_reporter']['logError'](_0x30e974,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x4a0b69,_0x585160){if(void 0x0!==_0x585160&&en(_0x585160))return;const _0x3d8902=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x3d8902),_0x4a0b69['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}},Ba=class extends _0x4655d9{static get['requires'](){return[Oa,ya,Ua];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b8f35){super(_0x1b8f35),_0x1b8f35['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},Ga=class extends _0x42f8f5{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x456dc1,_0x4e2f37){super(_0x456dc1),this['id']=_0x4e2f37,this['set']('status','pending'),this['set']('changeId',_0x4e2f37),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x150196,_0x2801e3)=>{_0x2801e3&&_0x2801e3['target']&&'A'===_0x2801e3['target']['tagName']&&_0x2801e3['preventDefault'](),this['fire']('activateChange',{'id':_0x4e2f37,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4e2f37,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4e2f37,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x9746cd=new _0x42f8f5(this['locale']);return _0x9746cd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x53f389=>!_0x53f389)]}}),_0x9746cd;}['_createAcceptButtonView'](){const _0x371cf5=new Ht(this['locale']);return _0x371cf5['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x371cf5['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xff7ea0=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xff7ea0['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x487c48=>'pending'!==_0x487c48&&'accepted'!==_0x487c48),this['bindTemplate']['if']('status',an,_0x5e463e=>'pending'===_0x5e463e),this['bindTemplate']['if']('status',hn,_0x5b0172=>'pending'!==_0x5b0172),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1c48f8=>'accepted'===_0x1c48f8)]}}),this['on']('change:status',(_0x292e19,_0x4b6ca6,_0x3120a7)=>{_0x371cf5['isEnabled']='pending'===_0x3120a7,'accepted'===_0x3120a7&&(_0x371cf5['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x371cf5['icon']=_0x734ca);}),_0x371cf5;}['_createDismissButtonView'](){const _0x1af5d7=new Ht(this['locale']);return _0x1af5d7['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x1af5d7['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x401530=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x401530['stopPropagation']();})},'attributes':{'class':[hn,this['bindTemplate']['if']('status','ck-hidden',_0x5d7f0a=>'pending'!==_0x5d7f0a&&'rejected'!==_0x5d7f0a),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x5cd295=>'pending'===_0x5cd295),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5aa2b4=>'rejected'===_0x5aa2b4)]}}),this['on']('change:status',(_0x37942e,_0x551d52,_0x491c34)=>{_0x1af5d7['isEnabled']='pending'===_0x491c34,'rejected'===_0x491c34&&(_0x1af5d7['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x1af5d7['icon']=_0x3c0bfe);}),_0x1af5d7;}['_createInfoButtonView'](){const _0x2aed28=new Ht(this['locale']);return _0x2aed28['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x26ee67,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':hn+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x2aed28['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1d215d=>_0x1d215d),_0x2aed28['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2aed28;}['_createOutdatedButtonView'](){const _0x315252=new Ht(this['locale']);return _0x315252['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x100e23,'withText':!0x0,'isEnabled':!0x1}),_0x315252['extendTemplate']({'attributes':{'class':[hn,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x115196=>'outdated'!==_0x115196)],'disabled':'disabled'}}),_0x315252;}},Fa=class extends yt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0xb48de9,_0x3c854b){super(_0xb48de9),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']()),_0x3c854b['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x556f30){this['resultItemView']['changeId']=_0x556f30['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x556f30['contentDiffed'];}['showBalloon'](_0xba92d5,_0x42a7c5,_0x5dd5ba,_0xe09191,_0x3ca39e,_0x30cde2){const _0x227c1f=_0x42a7c5();if(!_0x227c1f)return;this['updateContent'](_0xba92d5),this['show']();const _0x38e6f8=Array['from'](_0x227c1f['getClientRects']())['reverse'](),_0x34f46c=this['_getPointedRectIndexFromEvent'](_0x5dd5ba,_0x38e6f8),_0x22fe91=_0x38e6f8[_0x34f46c??0x0];'click'===_0xe09191?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x42a7c5(),_0x34f46c,_0xba92d5['id'],_0x3ca39e,_0x30cde2)||_0x22fe91})):'hover'===_0xe09191&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x42a7c5(),_0x34f46c,_0xba92d5['id'])||_0x22fe91}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x4c94bb({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x3dc6b0=[this['element']];return this['_pinnedTargetElement']&&_0x3dc6b0['push'](this['_pinnedTargetElement']),_0x3dc6b0;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x3ebdfc=new _0x42f8f5();return this['resultItemView']=new Ga(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3ebdfc['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x3ebdfc;}['_getBestRectPositionOnClick'](_0x90e310,_0x5df00b,_0x156c15,_0x37866e,_0x5d9d1e){if(!_0x90e310)return null;const _0x7f26c5=this['position']['replace']('arrow_',''),_0x37796d=Array['from'](_0x90e310['getClientRects']());let _0x25bd73,_0x2bb13f=_0x37796d['reverse']();return void 0x0!==_0x5df00b&&this['_isPinnedRectVisible'](_0x2bb13f[_0x5df00b],_0x37866e,_0x5d9d1e)?(_0x25bd73=_0x2bb13f[_0x5df00b],this['_pinnedRectIndex']=_0x5df00b):this['_isPinnedRectVisible'](_0x2bb13f[0x0],_0x37866e,_0x5d9d1e)&&void 0x0===_0x5df00b?_0x25bd73=_0x2bb13f[0x0]:(_0x2bb13f='s'==_0x7f26c5[0x0]?[..._0x37796d]['reverse']():_0x37796d,_0x2bb13f['forEach'](_0x32aa9c=>{this['_isPinnedRectVisible'](_0x32aa9c,_0x37866e,_0x5d9d1e)&&(_0x25bd73=_0x32aa9c);})),this['_pinnedTargetChangeId']=_0x156c15,this['_pinnedTargetElement']=_0x90e310,_0x25bd73||_0x90e310['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0xf6f406,_0xb30f42,_0xc3499b){if(!_0xf6f406)return null;const _0x3f6444=Array['from'](_0xf6f406['getClientRects']())['reverse']();return void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0xb30f42&&this['_pinnedTargetChangeId']!==_0xc3499b?(this['_pinnedRectIndex']=_0xb30f42,this['_pinnedTargetElement']=_0xf6f406,this['_pinnedTargetChangeId']=_0xc3499b,_0x3f6444[_0xb30f42]):void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0xc3499b?_0xf6f406!==this['_pinnedTargetElement']?Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']]:_0x3f6444[this['_pinnedRectIndex']]:void 0x0!==_0xb30f42&&this['_pinnedTargetChangeId']!==_0xc3499b?(this['_pinnedRectIndex']=_0xb30f42,this['_pinnedTargetElement']=_0xf6f406,this['_pinnedTargetChangeId']=_0xc3499b,_0x3f6444[_0xb30f42]):_0xf6f406['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x43c191,_0x346312){if(_0x43c191)for(let _0x2b68b5=0x0;_0x2b68b5<_0x346312['length'];_0x2b68b5++){const _0x59372f=_0x346312[_0x2b68b5];if(_0x43c191['clientX']>=_0x59372f['left']-0x3&&_0x43c191['clientX']<=_0x59372f['right']+0x3&&_0x43c191['clientY']>=_0x59372f['top']-0x3&&_0x43c191['clientY']<=_0x59372f['bottom']+0x3)return _0x2b68b5;}}['_isPinnedRectVisible'](_0x23602f,_0x34b85f,_0x4dcaf7){const _0x257c6b=new At(_0x23602f),_0x5da76b=_0x34b85f||document['documentElement'],_0x1af6f8=_0x257c6b['getIntersection'](Et(_0x4dcaf7)),_0x19f298=new At(_0x5da76b)['getIntersection'](_0x257c6b);return!!(_0x1af6f8&&_0x19f298&&_0x257c6b['width']>0x0);}};const Ka=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];var Wa=class extends _0x11a14c{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xfdb992){super(_0xfdb992),this['_bodyCollection']=ln(this['context']['locale']),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Ka)['to'](this),this['_balloonSuggestionView']=new Fa(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x86794b=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x86794b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x380263){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x7d3c48=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x380263,_0x7d3c48);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5916ce){_0x5916ce&&('error-general'!==_0x5916ce['status']?'error-chunk'!==_0x5916ce['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x5d2ab6){this['_mainView']['addCheckRunResult'](_0x5d2ab6);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0xc20c7a){this['_mainView']['showGeneralReviewCoreErrorView'](_0xc20c7a??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3d3197,_0x2ba4db){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3d3197,_0x2ba4db);}['setActiveStateInResults'](_0x5882d6){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x7a0b4=>{_0x7a0b4['id']===_0x5882d6&&_0x7a0b4['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x45301d=>_0x45301d['setItemAsInactive']());}['updateChangeState'](_0x4eeb07,_0xe298ba){'accepted'===_0xe298ba||'rejected'===_0xe298ba||'outdated'===_0xe298ba?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4eeb07,_0xe298ba):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4eeb07,_0xe298ba);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x3acf05,_0x260af9,_0x448a1a,_0xc02e1a,_0x419f85,_0x1104e0){this['_balloonSuggestionView']['showBalloon'](_0x3acf05,_0x260af9,_0x448a1a,_0xc02e1a,_0x419f85,_0x1104e0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x578bd1){const _0x4b7e80=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x31af31=>_0x31af31['id']===_0x578bd1);return _0x4b7e80?_0x4b7e80['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}},Ya=class extends _0x42f8f5{constructor(_0x42bc80){super(_0x42bc80),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x4227e5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x4227e5['if']('isVisible','ck-hidden',_0x4e7919=>!_0x4e7919)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x4227e5['to']('errorMessage')}]}]});}},$a=class extends _0x42f8f5{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0xc16d45,_0x4be298){super(_0xc16d45),this['reviewCoreHeader']=_0x4be298['header'],this['generalErrorView']=new Ya(_0xc16d45),this['reviewCheckListView']=_0x4be298['list'],this['reviewCheckListView']['delegate'](...Ka)['to'](this),this['reviewCheckResultsView']=_0x4be298['results'],this['reviewCheckResultsView']['delegate'](...Ka)['to'](this),this['reviewCompletedView']=_0x4be298['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x50f1cb){this['reviewCheckResultsView']['addResult'](_0x50f1cb),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x2fde39){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x2fde39;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}},qa=class extends Ht{constructor(_0x419740,_0x299db5){super(_0x299db5),this['set']({'label':_0x419740,'withText':!0x0,'class':on}),this['on']('execute',()=>{this['fire']('finishReview');});}},Qa=class extends zt{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0xc4b3b8,_0x173544){super(_0xc4b3b8),this['_contents']=_0x173544,this['_resultViews']=new _0x5f3be9(),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['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Mo(_0xc4b3b8),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 _0x20afac=this['_createCombinedSkeletonLoader'](),_0x865719=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x865719['if']('isLoading','ck-ai_review__check-run_loading',_0x52ce8b=>_0x52ce8b),_0x865719['if']('isResultReady','ck-ai_review__check-run_ready',_0x43bac0=>_0x43bac0),_0x865719['if']('isVisible','ck-hidden',_0x1f1a9a=>!_0x1f1a9a)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x20afac,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x1e7982){const _0x38af90=new Ga(this['locale'],_0x1e7982['id']);_0x38af90['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x38af90),_0x38af90['resultResponseView']['element']['innerHTML']=_0x1e7982['contentDiffed'];}['hideResult'](_0x4013f3,_0x42db47){if('pending'===_0x42db47)return;const _0x409a1e=this['_resultViews']['find'](_0x95e313=>_0x95e313['id']===_0x4013f3);_0x409a1e&&(_0x409a1e['status']=_0x42db47,_0x409a1e['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x2d87d8,_0x5ed5f2){if('pending'!==_0x5ed5f2)return;const _0x5d0b7c=this['_resultViews']['find'](_0x403429=>_0x403429['id']===_0x2d87d8);_0x5d0b7c&&(_0x5d0b7c['status']=_0x5ed5f2,_0x5d0b7c['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x1fc4c5,_0x3051ad){this['headerTitle']=_0x1fc4c5,this['headerSubtitle']=_0x3051ad||'';}['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 Xn(this['locale'],zn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x2d83ac=new _0x42f8f5(this['locale']),_0x2c0d61=[];for(let _0x41d233=0x0;_0x41d233<0x10;_0x41d233++){const _0x61fea2=this['_createSkeletonLoader']();_0x61fea2['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x2c0d61['push'](_0x61fea2);}return _0x2d83ac['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x558921=>!_0x558921)]},'children':_0x2c0d61}),_0x2d83ac;}['_createResultsBodyView'](){const _0x4b21ad=new _0x42f8f5(this['locale']);return _0x4b21ad['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x125c1f=>_0x125c1f)]},'children':this['_resultViews']}),_0x4b21ad;}['_createErrorView'](){const _0x182a01=new _0x42f8f5(this['locale']),_0x57dacb=new Ht(this['locale']),t=this['locale']['t'];return _0x182a01['delegate']('retryReview')['to'](this),_0x57dacb['set']({'label':t('Try\x20again'),'withText':!0x0,'class':an+'\x20ck-ai_review__check-run-error-retry-button'}),_0x57dacb['on']('execute',()=>{this['fire']('retryReview');}),_0x182a01['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x57d583=>!_0x57d583),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4e2a18=>'chunk'===_0x4e2a18)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x5b8957=>'chunk'===_0x5b8957)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x112ac3=>'general'!==_0x112ac3)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x39d183=>'chunk'!==_0x39d183)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x57dacb]}),_0x182a01;}['_createCancelButtonView'](){const _0xfe8105=new Ht(this['locale']);return _0xfe8105['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[an+'\x20ck-ai-button-stop-generating'],'icon':it}),_0xfe8105['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x11b982=>_0x11b982),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x42b9cf=>_0x42b9cf)]}}),_0xfe8105['on']('execute',()=>{this['fire']('abortReviewStream');}),_0xfe8105;}['_createToggleDiffButtonView'](){const _0xb58030=new Ht(this['locale']);_0xb58030['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xb58030['bind']('isEnabled')['to'](this,'isError',_0x54c64a=>!_0x54c64a),_0xb58030['extendTemplate']({'attributes':{'class':[an,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x824ab9=>!_0x824ab9),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ff267=>_0x1ff267)]}});const _0x2750cd=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2f66c5=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xb58030['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1005bd=>_0x1005bd),_0xb58030['bind']('icon')['to'](this,'isToggleDiffOn',_0x55ac49=>_0x55ac49?_0x2be8a0:_0x42e446),_0xb58030['bind']('label')['to'](this,'isToggleDiffOn',_0xcc4791=>_0xcc4791?_0x2750cd:_0x2f66c5),_0xb58030['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xb58030;}['_createAcceptAllButtonView'](){const _0x5be6e2=new Ht(this['locale']);return _0x5be6e2['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x5be6e2['bind']('isEnabled')['to'](this,'isError',_0x3a2fcc=>!_0x3a2fcc),_0x5be6e2['extendTemplate']({'attributes':{'class':[on,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x49bb5d=>!_0x49bb5d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x21289d=>_0x21289d)]}}),_0x5be6e2['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x5be6e2;}['_createExitReviewButtonView'](){const _0x2d0721=new Ht(this['locale']);return _0x2d0721['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x2d0721['extendTemplate']({'attributes':{'class':[hn,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xed530e=>!_0xed530e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x46b676=>_0x46b676)]}}),_0x2d0721['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x2d0721;}['_createResultHeaderView'](){const _0x4fade3=new _0x42f8f5(this['locale']),_0x370068=this['_createTitleView']();return _0x4fade3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5949f7=>_0x5949f7)]},'children':[_0x370068,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x61f671=>!_0x61f671)],'title':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4fade3;}['_createTitleView'](){const _0x4eb457=new _0x42f8f5(this['locale']),_0x37f6a4=new cr();return _0x37f6a4['bind']('isVisible')['to'](this,'isResultReady',_0xc5d85b=>!_0xc5d85b),_0x4eb457['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x154c3f=>_0x154c3f)]},'children':[_0x37f6a4,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x4eb457;}['_createFinishReviewButtonView'](){const _0x1353cf=new qa(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1353cf['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3e6d16=>!_0x3e6d16)]}}),_0x1353cf['delegate']('finishReview')['to'](this),_0x1353cf;}},Xa=class extends zt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x58af5c,_0x2f5da7){super(_0x58af5c),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x2f5da7['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x2f5da7['headerText']);const _0x2db410=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x2db410['if']('isVisible','ck-hidden',_0x1435e6=>!_0x1435e6)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x2f5da7['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x7e0463){const _0x1f0f91=new qa(_0x7e0463,this['locale']);return _0x1f0f91['delegate']('finishReview')['to'](this),_0x1f0f91;}['_createResultHeaderView'](_0x1a7040){const _0x20b934=new _0x42f8f5(this['locale']);return _0x20b934['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x1a7040},'children':[{'text':_0x1a7040}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x20b934;}},za=class extends _0x42f8f5{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x17c19a,_0x200e9f){super(_0x17c19a),this['_defaultValue']=_0x200e9f['default']||(_0x200e9f['data']['length']>0x0?_0x200e9f['data'][0x0]['id']:''),this['_defaultLabel']=_0x200e9f['data']['find'](_0x17449c=>_0x17449c['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x5ba05a(this['locale']);const _0x83817=this['_prepareListOptions'](_0x200e9f['data']);_0x3e8d7a(this['_dropdownView'],_0x83817,{'role':'menu','ariaLabel':_0x200e9f['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3ee5c7=>{_0x3ee5c7['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4a0da=>{this['formValue']=_0x4a0da['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4a0da['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x1236a1=[]){const _0x481a4e=new ct();this['resetToDefault']();for(const _0x270add of _0x1236a1){const _0x103eef=new _0x5ef671({'label':_0x270add['label'],'withText':!0x0,'role':'menuitemradio','id':_0x270add['id'],'model':_0x270add});_0x103eef['bind']('isOn')['to'](this,'formValue',_0x136978=>_0x136978===_0x103eef['id']);const _0x3d99d3={'type':'button','model':_0x103eef};_0x481a4e['add'](_0x3d99d3);}return _0x481a4e;}},ja=class extends zt{['_formItem']=null;constructor(_0x448912,_0x2a5fda,_0x5c4564){if(super(_0x448912),this['argsKey']=_0x2a5fda?.['argsKey'],'dropdown'===_0x2a5fda['formType'])this['_formItem']=new za(this['locale'],_0x2a5fda);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x18b3e0=new Kt(this['locale'],{'children':[this['_formItem']],'class':[_0x5c4564?'ck-form__row_with-submit':'']});_0x5c4564&&_0x18b3e0['children']['add'](_0x5c4564),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x18b3e0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}},Ja=class AIReviewCorePromptInputView extends _0x3754f8{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1b6ee0){super(_0x1b6ee0),this['set']('isEmpty',!0x0),this['keystrokes']=new _t(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}},Za=class extends _0x42f8f5{['focusTracker']=new dt();['keystrokes']=new _t();['focusCycler'];['_focusables']=new _0x5f3be9();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x56d832,_0x42ed1c,_0x29c09c=!0x1){super(_0x56d832),this['_check']=_0x42ed1c,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x42ed1c['defaultModel']?_0x42ed1c['defaultModel']['id']:'',this['_defaultLabel']=_0x42ed1c['defaultModel']?_0x42ed1c['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new qt(this['locale'],()=>new Ja(_0x56d832)),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 ct(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x29c09c),_0x3e8d7a(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new Kt(this['locale'],{'children':[this['promptInputView']]}),new Kt(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x103ed2,_0xe11dc7)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xe11dc7()):_0xe11dc7();}),this['focusCycler']=new Gt({'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'](_0xa959b0=>{this['_focusables']['add'](_0xa959b0),this['focusTracker']['add'](_0xa959b0['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 _0x167e80 of this['_getFormValidators']()){const _0x530c73=_0x167e80();if(_0x530c73)return this['promptInputView']['errorText']=_0x530c73,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return us(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x5ca2a4=new Ht(this['locale']),t=this['locale']['t'];return _0x5ca2a4['set']({'label':t('Submit'),'withText':!0x0,'class':on}),_0x5ca2a4['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5ca2a4;}['_createCancelButtonView'](){const _0x2c5faa=new Ht(this['locale']),t=this['locale']['t'];return _0x2c5faa['set']({'label':t('Cancel'),'withText':!0x0,'class':hn}),_0x2c5faa['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x18ad64=>{_0x18ad64['stopPropagation']();})}}),_0x2c5faa['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x2c5faa;}['_setModelList'](_0x275111){this['_modelSelectionDropdownItems']['clear']();const _0x561117=this['_check']['models'];if(_0x275111)this['set']('modelDisplayMode','hidden');else{const _0x13fadb=0x1===_0x561117['length'];this['set']('modelDisplayMode',_0x13fadb?'name':'selector');}if(this['resetToDefault'](),_0x561117?.['length']){0x1===_0x561117['length']&&this['set']('activeModelName',_0x561117[0x0]['name']||_0x561117[0x0]['id']);for(const _0x1f34b9 of _0x561117){const _0x5e56a3=new _0x5ef671({'label':_0x1f34b9['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1f34b9['id'],'model':_0x1f34b9});_0x5e56a3['bind']('isOn')['to'](this,'modelId',_0x28a57d=>_0x28a57d===_0x1f34b9['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x5e56a3,'labelView':new eh(this['locale'],_0x1f34b9)});}}}['_createModelSelectionDropdown'](){const _0x25c883=_0x5ba05a(this['locale']);return _0x25c883['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x25c883['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':hn}),_0x25c883['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x18bb6e=>'selector'===_0x18bb6e),this['listenTo'](_0x25c883,'execute',_0x11ce94=>{this['modelId']=_0x11ce94['source']['model']['id'],_0x25c883['buttonView']['label']=_0x11ce94['source']['label'];}),_0x25c883;}['_createModelNameView'](){const _0x4f21e8=new th(this['locale']);return _0x4f21e8['bind']('text')['to'](this,'activeModelName',_0x5529d7=>_0x5529d7??''),_0x4f21e8['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5d4d8f=>'name'===_0x5d4d8f),_0x4f21e8;}['_createActionsFooterView'](){const _0x404085=new _0x42f8f5(this['locale']);return _0x404085['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x404085;}},th=class extends _0x42f8f5{constructor(_0x1a8f0a){super(_0x1a8f0a),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x21cef1=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x21cef1['if']('isVisible','ck-hidden',_0x883a96=>!_0x883a96)]},'children':[{'text':_0x21cef1['to']('text')}]});}},eh=class extends Dt{constructor(_0xc334f2,_0x25386a){super();const _0x56d855=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x56d855['to']('style'),'id':_0x56d855['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x56d855['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x25386a['description']||'']}]}]});}},ih=class extends zt{['_formItemsCollection']=new _0x5f3be9();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0xe17e8e,_0xc742dd,_0x382eab,_0x86f73=!0x1){super(_0xe17e8e),this['_hideModels']=_0x86f73,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0xc742dd['isParameterized']);const _0x6eb0f2=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x46dc60=>_0x46dc60),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x4c8beb=>_0x4c8beb)],'style':{'--ck-ai-review-check-list-item-index':_0x382eab}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0xc742dd['title']}]},_0x6eb0f2]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0xc742dd['description']?[{'text':_0xc742dd['description']}]:[]}]}]},..._0xc742dd['isParameterized']?[this['_createParameterizedView'](_0xc742dd)]:[],...'custom'===_0xc742dd['id']?[this['_createCustomView'](_0xc742dd,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0xc742dd['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0xc742dd['id'],'args':_0xc742dd['useArgs']?_0xc742dd['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4c94bb({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5e3b6b=>{_0x5e3b6b['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x5a5cd6=new Yt();return _0x5a5cd6['content']=_0x27e590,_0x5a5cd6['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x5a5cd6;}['_createParameterizedView'](_0x35f1e2){const _0x42b04f=new _0x42f8f5(),_0x58db01=this['_createFormView'](_0x35f1e2);return _0x42b04f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xc1e3dc=>!_0xc1e3dc)]},'children':[_0x58db01]}),_0x42b04f;}['_createFormView'](_0x3d6e18){const _0x255b78=new _0x42f8f5(),_0x29f8fb=Array['isArray'](_0x3d6e18['options'])?_0x3d6e18['options']:[],_0x471212=new Ht(this['locale']),t=this['locale']['t'];_0x471212['set']({'label':t('Submit'),'withText':!0x0,'class':on}),_0x471212['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x255efe=>{_0x255efe['stopPropagation']();})}}),_0x471212['on']('execute',()=>{const _0x32286=[],_0x3cda7b={};this['_formItemsCollection']['forEach'](_0x81328=>{_0x32286['push'](_0x81328['value']),_0x3d6e18['useArgs']&&_0x3d6e18['options']&&(_0x3cda7b[_0x81328['argsKey']]=_0x81328['value']);}),this['fire']('runReviewCheck',{'id':_0x3d6e18['id'],'params':_0x32286['length']?_0x32286:void 0x0,'args':Object['keys'](_0x3cda7b)['length']?_0x3cda7b:void 0x0});});const _0x36a351=_0x29f8fb['length'];return _0x29f8fb['forEach']((_0x3c1265,_0x36124f)=>{const _0x1349c7=_0x36124f===_0x36a351-0x1;this['_formItemsCollection']['add'](new ja(this['locale'],_0x3c1265,_0x1349c7?_0x471212:null));}),_0x255b78['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x255b78;}['_createCustomView'](_0x4f71e6,_0x56e31c=!0x1){return this['_customCheckView']=new Za(this['locale'],_0x4f71e6,_0x56e31c),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x391722=>!_0x391722)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x247dda,_0x3d26f3,_0x4d74e1)=>{_0x4d74e1||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}},sh=class extends zt{['_checkViews'];constructor(_0x2c55f8){super(_0x2c55f8),this['_checkViews']=new _0x5f3be9(),this['_setupTemplate']();}['setChecks'](_0x1a9342,_0x621fb7=!0x1){this['_checkViews']['clear']();for(const [_0xcf4760,_0x16c8d9]of _0x1a9342['entries']()){const _0x3ace38=new ih(this['locale'],_0x16c8d9,_0xcf4760,_0x621fb7);_0x3ace38['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x3ace38);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0xe09db7 of this['_checkViews'])_0xe09db7 instanceof ih&&_0xe09db7['resetToDefault']();}['_setupTemplate'](){const _0x5a9e3e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5a9e3e['if']('isVisible','ck-hidden',_0x49484d=>!_0x49484d)]},'children':this['_checkViews']});}},nh=class extends Wa{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x51908c=this['context']['plugins']['get']('AITabs'),_0x5557f2=this['context']['locale'],_0x350525=new Ho(_0x5557f2,{'label':us(_0x5557f2,'AI_REVIEW_MODE'),'icon':_0x31a7fd,'class':'ck-ai-header_review','showResizeButton':_0x51908c['showResizeButton']});return _0x350525['delegate']('resizeTabs')['to'](_0x51908c),_0x350525['bind']('isMaximized')['to'](_0x51908c['view'],'isMaximized',_0x5a9827=>_0x5a9827),new $a(this['context']['locale'],{'header':_0x350525,'list':new sh(_0x5557f2),'results':new Qa(_0x5557f2,{'generalErrorText':us(_0x5557f2,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Xa(_0x5557f2,{'headerText':us(_0x5557f2,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x5557f2,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x5557f2,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x4734f0=this['context']['plugins']['get']('AITabs');_0x4734f0['view']['on']('activateTab',(_0x486fde,{newTab:_0x5ada49,oldTab:_0x474153})=>{'reviewMode'===_0x5ada49?this['fire']('getReviewCheckList'):'reviewMode'===_0x474153&&this['fire']('leaveReview');}),_0x4734f0['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x31a7fd,'order':0x0,'content':this['_mainView']});}};const rh='review-',oh=['softBreak'],ah=['htmlScript','htmlStyle','htmlCustomElement'];var hh=class extends _0x11a14c{static get['requires'](){return[_0x1f6a74,Is];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x1ffa50){super(_0x1ffa50),this['_domEmitter']=new(lt())(),this['_eventEmitter']=new(ut())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5df059=_0x268c6b=>this['_scheduleAttachReviewEditingToEditor'](_0x268c6b);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x423f99)return void _0x5df059(this['context']);const _0x3fe439=this['context'];for(const _0xcb08aa of _0x3fe439['editors'])_0x5df059(_0xcb08aa);this['listenTo'](_0x3fe439['editors'],'add',(_0x5031d1,_0x122d41)=>{_0x5df059(_0x122d41);}),this['listenTo'](_0x3fe439['editors'],'remove',(_0x13fec4,_0x393ee2)=>{for(const [_0x6cd928,_0x5e8a8c]of this['_markers'])_0x5e8a8c['editor']===_0x393ee2&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x6cd928,'changeId':_0x5e8a8c['groupId']}),this['_markers']['delete'](_0x6cd928));});}['_scheduleAttachReviewEditingToEditor'](_0x143650){const _0x25a3e4=()=>{'destroyed'!==_0x143650['state']&&_0x143650['conversion']&&this['_attachReviewEditingToEditor'](_0x143650);};if('ready'===_0x143650['state'])return void _0x25a3e4();const _0x4b019f=()=>{this['stopListening'](_0x143650,'ready',_0x4b019f),_0x25a3e4();};this['listenTo'](_0x143650,'ready',_0x4b019f);}['_attachReviewEditingToEditor'](_0x5811d3){this['_reviewEditingAttachedEditors']['has'](_0x5811d3)||(_0x5811d3['conversion']['for']('editingDowncast')['markerToElement']({'model':rh+'insert','view':(_0x139ba2,{writer:_0xbb192b})=>{const _0x4c8a7b=this['_markers']['get'](_0x139ba2['markerName']),_0x2b9124={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4c8a7b?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x139ba2['markerName']};return _0xbb192b['createUIElement']('span',_0x2b9124,function(_0x1e7551){const _0x2e4207=this['toDomElement'](_0x1e7551);return _0x2e4207['innerHTML']=_0x4c8a7b?.['content']?.['asString']||'',_0x2e4207;});}}),_0x5811d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rh+'remove-only','view':_0x2f4545=>{const _0x3a7a08=this['_markers']['get'](_0x2f4545['markerName']),_0x2beb32=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x3a7a08?.['id']||'')&&_0x2beb32['push']('ck-ai_review__change_active'),{'classes':_0x2beb32,'attributes':{'data-marker-id':_0x2f4545['markerName']}};}}),_0x5811d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rh+'remove-context','view':_0x427553=>{const _0x22f747=this['_markers']['get'](_0x427553['markerName']),_0x563cd5=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x22f747?.['id']||'')&&_0x563cd5['push']('ck-ai_review__change_active'),{'classes':_0x563cd5,'attributes':{'data-marker-id':_0x427553['markerName']}};}}),_0x5811d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rh+'remove-text','view':_0x27fa2e=>{const _0x359d3d=this['_markers']['get'](_0x27fa2e['markerName']),_0x25e5df=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x359d3d?.['id']||'')&&_0x25e5df['push']('ck-ai_review__change_active'),{'classes':_0x25e5df,'attributes':{'data-marker-id':_0x27fa2e['markerName']}};}}),_0x5811d3['conversion']['for']('dataDowncast')['markerToElement']({'model':rh+'suggestion-context','view':(_0x27dced,{writer:_0x3819c9})=>_0x3819c9['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x27dced['isOpening']?'start':'end')})}),_0x5811d3['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x308ef3,'view':_0x24c015}),this['_updateMouseMarkerInteractionListeners'](_0x5811d3),this['listenTo'](_0x5811d3,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5811d3),{'priority':'lowest'}),this['listenTo'](_0x5811d3,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5811d3),{'priority':'lowest'}),_0x5811d3['model']['document']['registerPostFixer'](_0x1ffa5f=>this['_validateMarkers'](_0x5811d3,_0x1ffa5f)),_0x5811d3['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5811d3)),this['_reviewEditingAttachedEditors']['add'](_0x5811d3));}['_updateMouseMarkerInteractionListeners'](_0x51e838){let _0x232a1b=this['_boundEditables']['get'](_0x51e838);_0x232a1b||(_0x232a1b=new Map(),this['_boundEditables']['set'](_0x51e838,_0x232a1b));const _0x4c5b31=new Set(_0x51e838['ui']['getEditableElementsNames']());for(const _0x38e3a8 of _0x4c5b31){if(_0x232a1b['has'](_0x38e3a8))continue;const _0x49fb78=_0x51e838['ui']['getEditableElement'](_0x38e3a8);_0x232a1b['set'](_0x38e3a8,_0x49fb78),this['_attachMouseMarkerInteractionListeners'](_0x49fb78);}for(const [_0x291ffe,_0x51a090]of _0x232a1b)_0x4c5b31['has'](_0x291ffe)||(_0x232a1b['delete'](_0x291ffe),this['_domEmitter']['stopListening'](_0x51a090));}['_attachMouseMarkerInteractionListeners'](_0x412b8a){this['_domEmitter']['listenTo'](_0x412b8a,'mouseup',(_0x47b17f,_0x4d2b81)=>{const _0x154841=_0x4d2b81['target'],_0x290f61=this['_findMarkerElement'](_0x154841);if(!_0x290f61)return;const _0x25de9f=_0x290f61['getAttribute']('data-marker-id'),_0x20578a=_0x25de9f['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x25de9f,'changeId':_0x20578a,'markerElement':()=>this['_findMarkerElementById'](_0x25de9f),'domEvent':_0x4d2b81});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x412b8a,'mouseover',(_0x1677b5,_0x5639de)=>{const _0x2ca8b1=_0x5639de['target'],_0x20b68e=_0x5639de['relatedTarget'];let _0x231cfa=this['_findMarkerElement'](_0x2ca8b1);if(!_0x231cfa&&_0x20b68e&&(_0x231cfa=this['_findMarkerElement'](_0x20b68e)),!_0x231cfa)return;const _0x394ee3=_0x231cfa['getAttribute']('data-marker-id'),_0x1a1ef6=_0x394ee3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x1a1ef6,'markerElement':()=>this['_findMarkerElementById'](_0x394ee3),'domEvent':_0x5639de});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x46743f((_0x3bab5e,_0x250998)=>{const _0xc48bc0=_0x250998['target'];this['_findMarkerElement'](_0xc48bc0)||_0xc48bc0['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x21e9c2=this['context']['plugins']['get']('AIEditing'),_0x2d5257=ds(this['context']);if(!_0x2d5257['length'])throw new ht('ai-get-editor-from-context-no-editor',this);const _0x4c120e=new Set(),_0x214439=[],_0x2ec020=new Map();for(const _0x1d90c5 of _0x2d5257)for(const _0x35f05b of _0x1d90c5['model']['document']['getRoots']()){if('$graveyard'===_0x35f05b['rootName'])continue;const _0x251ed6=this['_buildDocumentDataSliceForRoot'](_0x1d90c5,_0x35f05b,_0x21e9c2,_0x4c120e);_0x214439['push'](_0x251ed6['content']);for(const [_0x28b185,_0x5cc805]of _0x251ed6['elements'])_0x2ec020['set'](_0x28b185,_0x5cc805);}return{'elements':_0x2ec020,'content':_0x214439['join']('')};}['_buildDocumentDataSliceForRoot'](_0x22dbce,_0x489628,_0xd9face,_0x39dea2){const _0x5cd0f9=_0x22dbce['model'],_0x3a2d42=new _0x4a5f18();for(const _0x37e0db of _0x489628['getChildren']())_0x3a2d42['_appendChild'](_0x37e0db['_clone'](!0x0));for(const _0x2fa7d6 of _0x5cd0f9['markers']){const _0x561f69=_0x2fa7d6['getRange']();_0x561f69&&_0x561f69['root']['rootName']===_0x489628['rootName']&&_0x3a2d42['markers']['set'](_0x2fa7d6['name'],this['_changeRangeOwnerDocument'](_0x561f69['clone'](),_0x3a2d42));}const _0x4dfc1e=new Map(),_0x44163e=_0x5cd0f9['document']['version'],_0x1054e9=new _0x58b091({'ignoreElementEnd':!0x0,'startPosition':_0x5cd0f9['createPositionAt'](_0x3a2d42,0x0)});for(const {item:_0x17401a}of _0x1054e9){if(_0x17401a['is']('element')&&_0x17401a['name']&&ah['includes'](_0x17401a['name'])){const _0x3c748f=this['_upsertDataId'](_0x17401a,()=>_0xd9face['_nextDataId'](_0x39dea2));_0x39dea2['add'](_0x3c748f);}if(!_0x17401a['is']('$textProxy'))continue;const _0x3ef8e9=_0x17401a['parent'];if(!_0x3ef8e9||!_0x3ef8e9['is']('element'))continue;const _0x5eac54=this['_upsertDataId'](_0x3ef8e9,()=>_0xd9face['_nextDataId'](_0x39dea2));_0x39dea2['add'](_0x5eac54);for(const _0x1e121c of _0x3ef8e9['getChildren']())_0x1e121c['is']('element')&&(_0x1e121c['name']&&oh['includes'](_0x1e121c['name'])||_0x39dea2['add'](this['_upsertDataId'](_0x1e121c,()=>_0xd9face['_nextDataId'](_0x39dea2))));let _0x2d236c=_0x3ef8e9;for(;_0x2d236c['parent']&&!_0x2d236c['parent']['is']('documentFragment');)_0x2d236c=_0x2d236c['parent'],_0x2d236c['hasAttribute'](_0x308ef3)&&_0x2d236c['_removeAttribute'](_0x308ef3);_0x4dfc1e['set'](_0x5eac54,{'editor':_0x22dbce,'rootName':_0x489628['rootName'],'path':_0x3ef8e9['getPath'](),'documentVersion':_0x44163e,'getContent':this['_createGetContentUsingDataIdFn'](_0x2d236c['_clone'](!0x0),_0x5eac54,_0x22dbce['data'])}),_0x1054e9['jumpTo'](_0x5cd0f9['createPositionAfter'](_0x3ef8e9));}return{'content':_0x22dbce['data']['processor']['toData'](_0x22dbce['data']['toView'](_0x3a2d42)),'elements':_0x4dfc1e};}['diffContent'](_0x26f0e4,_0x410d81,_0x29a112,_0x19ef11=!0x1){const {contentInitial:_0x259dec,contentNew:_0x4ed71e}=this['_neutralizeChangesOnUnsupportedElements'](_0x410d81,_0x29a112),_0x583627=[],_0x26e0f9=_0x26f0e4['data']['parse'](_0x4ed71e,'$documentFragment'),_0x4b00b9=_0x26f0e4['data']['parse'](_0x259dec,'$documentFragment'),_0x156be5=_0x26f0e4['model']['createPositionAt'](_0x4b00b9,0x0);if(this['_haveSingleTopLevelElement'](_0x26e0f9)){if(!this['_hasSameTopLevelElement'](_0x4b00b9,_0x26e0f9))return _0x583627;}else{const _0xd5198a=_0x26f0e4['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x4b00b9,_0xd5198a)||!this['_haveOnlyInlineContent'](_0x26e0f9,_0xd5198a))return _0x583627;}const _0x29836e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x259dec,_0x4ed71e,{'targetEditor':_0x26f0e4,'anchor':_0x156be5,'markDeletions':!0x0})['getOperations']()['filter'](_0x420d50=>'insert'===_0x420d50['type']||'marker'===_0x420d50['type']&&_0x420d50['name']['startsWith']('$markedRemove')),_0xebdcb8=this['_groupAdjacentOperations'](_0x29836e),_0x4c513a=[];if(_0x19ef11){if(_0xebdcb8['length']){const _0x1d594b=_0xebdcb8[0x0]['operations'][0x0],_0x21b82e='insert'===_0x1d594b['type']?_0x1d594b['position']:_0x1d594b['newRange']['start'],_0x399184=this['_getPositionLimitingRange'](_0x21b82e,_0x26f0e4,'inside'),_0x4a53a6=_0x399184?_0x26e0f9['getChild'](0x0)['getChildren']():_0x26e0f9['getChildren'](),_0x40ccad=_0x399184||_0x26f0e4['model']['createRangeIn'](_0x4b00b9),_0x510543=[new _0x18b70c('$markedRemove:synthetic'+vt(),null,_0x40ccad,_0x26f0e4['model']['document']['model']['markers'],!0x0,_0x26f0e4['model']['document']['version']+0x1),new _0x496751(_0x40ccad['end'],_0x4a53a6,_0x26f0e4['model']['document']['version']+0x2)];_0x4c513a['push']({'operations':_0x510543,'operationsIsolated':_0x510543,'groupOffset':0x0});}}else _0x4c513a['push'](..._0xebdcb8);let _0x44fb1c=0x0;return _0x26f0e4['model']['change'](_0x3bcdab=>{for(let _0x286ced=0x0;_0x286ced<_0x4c513a['length'];_0x286ced++){const _0x42c68c=_0x4c513a[_0x286ced],_0x27cbe2=_0x3bcdab['createDocumentFragment']();for(const _0x387cb8 of _0x4b00b9['getChildren']())_0x3bcdab['append'](_0x387cb8['_clone'](!0x0),_0x27cbe2);for(const _0x5d27d8 of _0x42c68c['operationsIsolated'])if('insert'===_0x5d27d8['type']){const _0x463288=_0x5d27d8;_0x463288['baseVersion']=null,_0x463288['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x463288,_0x27cbe2),_0x3bcdab['batch']['addOperation'](_0x5d27d8),_0x26f0e4['model']['applyOperation'](_0x5d27d8);const _0x1df1bf='suggestion:insertion:id:authorId:'+_0x44fb1c++,_0x538cfc=_0x26f0e4['model']['createRange'](_0x463288['position'],_0x463288['position']['getShiftedBy'](_0x463288['howMany']));_0x27cbe2['markers']['set'](_0x1df1bf,_0x538cfc);}else{if('marker'===_0x5d27d8['type']&&_0x5d27d8['name']['startsWith']('$markedRemove')){const _0x363ab6=_0x5d27d8,_0x2d5f7c='suggestion:deletion:id:authorId:'+_0x44fb1c++;this['_changeOperationOwnerDocument'](_0x363ab6,_0x27cbe2),_0x27cbe2['markers']['set'](_0x2d5f7c,_0x363ab6['newRange']);}}if(_0x19ef11)_0x583627['push']({..._0x42c68c,'context':this['_createGetContentFn'](_0x4b00b9,_0x26f0e4['data']),'content':this['_createGetContentFn'](_0x4b00b9,_0x26f0e4['data'])});else{const _0x105503=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x42c68c['operationsIsolated'][0x0]),_0x27cbe2),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x42c68c['operationsIsolated'][_0x42c68c['operationsIsolated']['length']-0x1]),_0x27cbe2),_0x26f0e4);_0x27cbe2['markers']['set'](rh+'suggestion-context',new _0x223931(_0x105503['start'],_0x105503['end'])),_0x583627['push']({..._0x42c68c,'context':this['_createGetContextFn'](_0x27cbe2,_0x26f0e4['data'],{'ellipsisBefore':_0x105503['hasContentBefore'],'ellipsisAfter':_0x105503['hasContentAfter']}),'content':this['_createGetContentFn'](_0x27cbe2,_0x26f0e4['data'])});}}}),_0x583627;}['markChangePositionInEditorContent'](_0x95c193,_0x507c5e){if(!_0x95c193['length'])return;const _0x1347d4=_0x95c193[0x0]['parent']['id'],_0x67179d=_0x507c5e['elements']['get'](_0x1347d4);if(!_0x67179d)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x1347d4);const _0x2f82b6=_0x67179d['path'],_0x2788a7=_0x67179d['editor'],_0x2569e2=_0x2788a7['model']['document']['getRoot'](_0x67179d['rootName']);if(!_0x2569e2)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x67179d['rootName']);const _0x18d8f8=_0x2788a7['model']['document']['history']['getOperations'](_0x67179d['documentVersion']),_0x803adf=[];for(const _0x67eb8f of _0x95c193){const _0x18dc62=_0x67eb8f['operationsIsolated']['map'](_0x4c35b0=>this['_translateOperationToEditorContent'](_0x4c35b0,_0x2f82b6,_0x2569e2));if(!_0x18dc62||!_0x18dc62['length'])continue;const _0x21aa5f=_0x18dc62['every'](_0x4819b0=>'marker'===_0x4819b0['type']&&_0x4819b0['name']['startsWith']('$markedRemove')),_0x4f1611=_0x5be051(_0x18dc62,_0x18d8f8,{'document':_0x2788a7['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];for(const _0x5a4274 of _0x4f1611)if('insert'===_0x5a4274['type']){const _0x25764c=_0x5a4274,_0x147e0c=_0x25764c['nodes'];_0x2788a7['model']['change'](_0x7b10a7=>{const _0x21c994=_0x7b10a7['createDocumentFragment']();for(const _0x24236c of _0x147e0c)_0x7b10a7['append'](_0x24236c['_clone'](!0x0),_0x21c994);_0x803adf['push']({'start':_0x25764c['position'],'end':_0x25764c['position'],'type':'insert','groupId':_0x67eb8f['id'],'content':{'asString':this['_createGetContentFn'](_0x21c994,_0x2788a7['data'])(),'asFragment':_0x21c994}});});}else{if('marker'===_0x5a4274['type']&&_0x5a4274['name']['startsWith']('$markedRemove')){const _0x1b056c=_0x5a4274;let _0x2536a0='remove-text';if(_0x21aa5f){const _0x1c003a=this['_findAdjacentContextDistance'](_0x1b056c['newRange']['start'],'backward',_0x2788a7['model']['schema']),_0x2461af=this['_findAdjacentContextDistance'](_0x1b056c['newRange']['end'],'forward',_0x2788a7['model']['schema']);if(_0x1c003a||_0x2461af){const _0x260ebe=_0x1b056c['newRange']['start']['getShiftedBy'](-_0x1c003a),_0x1d3b9b=_0x1b056c['newRange']['end']['getShiftedBy'](_0x2461af);_0x803adf['push']({'start':_0x260ebe,'end':_0x1d3b9b,'groupId':_0x67eb8f['id'],'type':'remove-context'});}else _0x2536a0='remove-only';}_0x803adf['push']({'start':_0x1b056c['newRange']['start'],'end':_0x1b056c['newRange']['end'],'groupId':_0x67eb8f['id'],'type':_0x2536a0});}}}this['_insertMarkers'](_0x803adf,_0x2788a7);}['clearAllMarkers'](){const _0x220854=new Map();for(const _0x72dfbf of this['_markers']['keys']()){const _0x5d627a=this['_markers']['get'](_0x72dfbf);_0x5d627a?.['editor']&&(_0x220854['has'](_0x5d627a['editor'])||_0x220854['set'](_0x5d627a['editor'],[]),_0x220854['get'](_0x5d627a['editor'])['push'](_0x72dfbf));}for(const [_0x3b9099,_0x4b3ad5]of _0x220854)_0x3b9099['model']['change'](_0x206753=>{for(const _0x533605 of _0x4b3ad5)_0x3b9099['model']['markers']['get'](_0x533605)&&_0x206753['removeMarker'](_0x533605);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x765c92 of ds(this['context']))_0x765c92['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x2a79e0 of ds(this['context']))_0x2a79e0['disableReadOnlyMode']('ai-review');}['applyChange'](_0x512b84,_0x32c02f=null){const _0x30dfa1=_0x512b84['map'](_0x245aef=>this['_getMarkersDataForGroup'](_0x245aef))['flat'](),_0x91c8f1=new Map();for(const _0x16e272 of _0x30dfa1)_0x91c8f1['has'](_0x16e272['editor'])||_0x91c8f1['set'](_0x16e272['editor'],[]),_0x91c8f1['get'](_0x16e272['editor'])['push'](_0x16e272);for(const [_0x5ec22d,_0x82373c]of _0x91c8f1){const _0x45f0d5=_0x5ec22d['model'],_0x232c8e=_0x5ec22d['plugins']['has']('TrackChangesEditing')?_0x5ec22d['plugins']['get']('TrackChangesEditing'):null,_0x2c763c=_0x32c02f&&_0x232c8e?new Set(_0x232c8e['getSuggestions']()['map'](_0x566908=>_0x566908['id'])):null;_0x45f0d5['change'](_0x355d22=>{const _0xf7a0b=_0x355d22['batch']['operations']['length'];for(const _0x12e18b of _0x82373c){const _0x2c2540=_0x5ec22d['model']['markers']['get'](_0x12e18b['id']);if(_0x2c2540){if('insert'===_0x12e18b['type']){if(!_0x12e18b['content'])continue;_0x45f0d5['insertContent'](_0x12e18b['content']['asFragment']||null,_0x2c2540['getRange']()['start']);}else'remove-text'!==_0x12e18b['type']&&'remove-only'!==_0x12e18b['type']||_0x45f0d5['deleteContent'](_0x45f0d5['createSelection'](_0x2c2540['getRange']()));_0x355d22['removeMarker'](_0x12e18b['id']),this['_markers']['delete'](_0x12e18b['id']);}}if(_0x32c02f&&(zs(_0x355d22['batch']['operations']['slice'](_0xf7a0b),_0x32c02f),_0x232c8e)){for(const _0x4c858e of _0x232c8e['getSuggestions']())_0x2c763c['has'](_0x4c858e['id'])||_0x4c858e['setAttribute']('@ai',{'type':_0x32c02f});}});}}['rejectChange'](_0x1067ae){const _0x369591=this['_getMarkersDataForGroup'](_0x1067ae),_0x28d38d=new Map();for(const _0x396caa of _0x369591)_0x28d38d['has'](_0x396caa['editor'])||_0x28d38d['set'](_0x396caa['editor'],[]),_0x28d38d['get'](_0x396caa['editor'])['push'](_0x396caa);for(const [_0x333fa6,_0x3e0cba]of _0x28d38d)_0x333fa6['model']['change'](_0x53385e=>{for(const _0x261645 of _0x3e0cba)_0x53385e['removeMarker'](_0x261645['id']),this['_markers']['delete'](_0x261645['id']);});}['getEditor'](){return _s(this['context']);}['getEditors'](){return ds(this['context']);}['getEditorForChange'](_0x103545){return this['_getMarkersDataForGroup'](_0x103545)[0x0]?.['editor'];}['getMarkerElementForChange'](_0xd1fddd){const _0xe979f7=Array['from'](this['_markers']['values']())['filter'](_0x1789d8=>_0x1789d8['groupId']===_0xd1fddd);if(!_0xe979f7['length'])return null;const _0x2bd53e=0x1===_0xe979f7['length']?_0xe979f7[0x0]:this['_sortMarkers'](_0xe979f7)[0x0],_0x4692b1=_0x2bd53e['editor']['model']['markers']['get'](_0x2bd53e['id']);return _0x4692b1?{'modelRange':_0x4692b1['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2bd53e['id'])}:null;}['getContentElementForChange'](_0x525d2d){const _0x14b689=Array['from'](this['_markers']['values']())['filter'](_0x284e78=>_0x284e78['groupId']===_0x525d2d);if(!_0x14b689['length'])return null;const _0x5d19c0=0x1===_0x14b689['length']?_0x14b689[0x0]:this['_sortMarkers'](_0x14b689)[0x0],_0x2d3b80=_0x5d19c0['editor'],_0x298d0f=_0x2d3b80['model']['markers']['get'](_0x5d19c0['id']);if(!_0x298d0f)return null;const _0xa972d3=_0x298d0f['getRange'](),_0x4db3b1=_0x2d3b80['editing']['view']['getDomRoot'](_0xa972d3['root']['rootName'])||_0x2d3b80['editing']['view']['getDomRoot']();if(!_0x4db3b1||!_0xa972d3)return null;let _0x42f302=_0xa972d3['start']['parent'];for(;_0x42f302['parent']&&!_0x42f302['parent']['is']('rootElement');)_0x42f302=_0x42f302['parent'];if(!_0x42f302||!_0x42f302['name'])return null;const _0x3f7c0f=_0x4db3b1['querySelector']('[data-marker-id=\x22'+_0x5d19c0['id']+'\x22]');if(!_0x3f7c0f)return null;let _0x1f449c=null;_0x2d3b80['model']['change'](_0x500c69=>{_0x1f449c=_0x500c69['createDocumentFragment'](),_0x500c69['append'](_0x42f302['_clone'](!0x0),_0x1f449c);});const _0x56dda9=_0x2d3b80['data']['toView'](_0x1f449c)['getChild'](0x0);return _0x3f7c0f['closest'](_0x56dda9['name']);}['reactivateMarkers'](_0x4c4608){const _0x35e13f=this['_getMarkersDataForGroup'](_0x4c4608);if(!_0x35e13f['length'])return;const _0x5e5aaf=Array['from'](this['_activeMarkers'])['sort'](),_0x1f1535=Array['from'](new Set(_0x35e13f['map'](_0x13d935=>_0x13d935['id'])))['sort']();_0x5e5aaf['join']('|')!==_0x1f1535['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x4c4608));}['setMarkersInElementAsActive'](_0x21026a){const _0x3d500a=this['_getMarkersDataForGroup'](_0x21026a);if(!_0x3d500a['length'])return;const _0x42ef92=_0x3d500a[0x0]['editor'],_0x7a2e8f=new Set(_0x3d500a['map'](_0x2976c3=>_0x2976c3['id'])),_0x332144=Array['from'](_0x7a2e8f['values']())['map'](_0x337162=>_0x42ef92['model']['markers']['get'](_0x337162))['filter'](_0x4b3fca=>!!_0x4b3fca);_0x7a2e8f['forEach'](_0x333fba=>{this['_activeMarkers']['add'](_0x333fba);}),_0x42ef92['model']['change'](()=>{_0x332144['forEach'](_0x9c948=>{_0x42ef92['editing']['reconvertMarker'](_0x9c948);});});}['setAllMarkersAsInactive'](){const _0x345d35=Array['from'](this['_activeMarkers']);if(!_0x345d35['length'])return;this['_activeMarkers']['clear']();const _0x141f00=new Map();for(const _0x3d3c20 of _0x345d35){const _0x5242b6=this['_markers']['get'](_0x3d3c20);if(!_0x5242b6)continue;const _0x29c723=_0x5242b6['editor'],_0x34b6cf=_0x29c723['model']['markers']['get'](_0x3d3c20);_0x34b6cf&&(_0x141f00['has'](_0x29c723)||_0x141f00['set'](_0x29c723,[]),_0x141f00['get'](_0x29c723)['push'](_0x34b6cf));}for(const [_0x122d3a,_0x351648]of _0x141f00)_0x122d3a['model']['change'](()=>{_0x351648['forEach'](_0x56dd3b=>{_0x122d3a['editing']['reconvertMarker'](_0x56dd3b);});});}['_getPositionLimitingRange'](_0x12dd2f,_0x15442b,_0x26aaaa='outside'){if(!_0x12dd2f)return null;let _0x5ba95d=_0x12dd2f['parent'];for(;_0x5ba95d&&_0x5ba95d['parent']&&!_0x5ba95d['parent']['is']('rootElement')&&!_0x15442b['model']['schema']['isLimit'](_0x5ba95d)&&!_0x15442b['model']['schema']['isBlock'](_0x5ba95d);)_0x5ba95d=_0x5ba95d['parent'];if(!_0x5ba95d||!_0x5ba95d['name']||_0x5ba95d['is']('rootElement'))return null;let _0x2b8a08=null;return _0x15442b['model']['change'](_0x4d7c9c=>{_0x2b8a08='inside'===_0x26aaaa?_0x4d7c9c['createRangeIn'](_0x5ba95d):_0x4d7c9c['createRangeOn'](_0x5ba95d);}),_0x2b8a08;}['_validateMarkers'](_0x185a37,_0x4aea27){const _0x5a985e=Array['from'](this['_markers']['keys']()),_0x331a81=new Map();for(const _0x102af7 of _0x5a985e){const _0x1867f2=_0x185a37['model']['markers']['get'](_0x102af7);if(!_0x1867f2)continue;const _0x473ed1=_0x1867f2['getStart']()['root']['rootName']+':'+_0x1867f2['getStart']()['path'][0x0];_0x331a81['has'](_0x473ed1)||_0x331a81['set'](_0x473ed1,[]),_0x331a81['get'](_0x473ed1)['push'](_0x1867f2);}const _0x8b86a1=new Set();for(const _0x568f63 of _0x185a37['model']['document']['differ']['getChanges']()){let _0x26ded1='',_0x4d4c0a=null;if('insert'===_0x568f63['type'])_0x4d4c0a=new _0x223931(_0x568f63['position'],_0x568f63['position']['getShiftedBy'](_0x568f63['length'])),_0x26ded1=_0x568f63['position']['root']['rootName']+':'+_0x568f63['position']['path'][0x0];else{if('remove'!==_0x568f63['type'])continue;_0x4d4c0a=new _0x223931(_0x568f63['position']),_0x26ded1=_0x568f63['position']['root']['rootName']+':'+_0x568f63['position']['path'][0x0];}const _0x52a950=_0x331a81['get'](_0x26ded1)||[];if(_0x52a950['length']){for(const _0x41d2e2 of _0x52a950)if(_0x4d4c0a['root']['rootName']===_0x41d2e2['getRange']()['root']['rootName']&&('insert'!==_0x568f63['type']||!_0x4d4c0a['containsRange'](_0x41d2e2['getRange']()))&&(_0x4d4c0a['isIntersecting'](_0x41d2e2['getRange']())||_0x4d4c0a['start']['isTouching'](_0x41d2e2['getRange']()['end'])||_0x4d4c0a['end']['isTouching'](_0x41d2e2['getRange']()['start']))){const _0x2f9719=this['_parseMarkerName'](_0x41d2e2['name']);Array['from'](this['_markers']['values']())['filter'](_0x1dc72c=>_0x1dc72c['groupId']===_0x2f9719['groupId'])['forEach'](_0x272f03=>_0x8b86a1['add'](_0x272f03['id']));}}}if(_0x8b86a1['size']){for(const _0x2d7344 of _0x8b86a1)_0x4aea27['removeMarker'](_0x2d7344);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x5c3fb2){for(const {name:_0xb893b0,data:_0x55bd78}of _0x5c3fb2['model']['document']['differ']['getChangedMarkers']()){if(!_0xb893b0['startsWith'](rh))continue;const _0x200dd4=_0x55bd78['oldRange'],_0x4e2a9b=_0x55bd78['newRange'],_0x2f72d9=_0x200dd4&&'$graveyard'===_0x200dd4['root']['rootName'],_0x13db6b=_0x4e2a9b&&'$graveyard'===_0x4e2a9b['root']['rootName'];if(_0x2f72d9&&_0x13db6b)continue;const _0x2d3fda=this['_parseMarkerName'](_0xb893b0);this['_markers']['get'](_0xb893b0)&&(_0x13db6b||!_0x4e2a9b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0xb893b0,'changeId':_0x2d3fda['groupId']}):_0x2f72d9&&_0x4e2a9b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0xb893b0,'changeId':_0x2d3fda['groupId']}));}}['_parseMarkerName'](_0x4e9e52){const _0x1d8210=_0x4e9e52['split'](':'),_0x10de32=(_0x1d8210[0x1]||'')['split']('_');return{'prefix':_0x1d8210[0x0],'groupId':_0x10de32[0x0],'suffix':_0x10de32[0x1]};}['_translateOperationToEditorContent'](_0x22df76,_0x13b5e2,_0x53531b){if('insert'===_0x22df76['type']){const _0x54a952=_0x22df76;return new _0x496751(this['_changePosition'](_0x13b5e2['concat'](_0x54a952['position']['offset']),_0x53531b),_0x54a952['nodes'],_0x54a952['baseVersion']);}if('marker'===_0x22df76['type']&&_0x22df76['name']['startsWith']('$markedRemove')){const _0x182317=_0x22df76;return new _0x18b70c(_0x182317['name'],_0x182317['oldRange'],this['_changeRange'](_0x182317['newRange'],_0x13b5e2['concat'](_0x182317['newRange']['start']['offset']),_0x13b5e2['concat'](_0x182317['newRange']['end']['offset']),_0x53531b),_0x182317['_markers'],_0x182317['affectsData'],_0x182317['baseVersion']);}return _0x22df76;}['_groupAdjacentOperations'](_0x423c0d){if(!_0x423c0d['length'])return[];const _0x33698e=[];let _0x466a97=0x0,_0x1b46bc=0x0,_0x29944c=[];for(let _0x4d4040=0x0;_0x4d4040<=_0x423c0d['length'];_0x4d4040++){const _0x277347=_0x423c0d[_0x4d4040],_0x418a0a=_0x423c0d[_0x4d4040-0x1];!_0x277347||_0x418a0a&&!this['_getOperationEnd'](_0x418a0a)['isTouching'](this['_getOperationStart'](_0x277347))?(_0x33698e['push']({'operations':_0x29944c,'operationsIsolated':_0x29944c['map'](_0x50790a=>this['_shiftOperation'](_0x50790a['clone'](),-_0x1b46bc)),'groupOffset':_0x466a97}),_0x29944c=_0x277347?[_0x277347]:[],_0x1b46bc+=_0x466a97,_0x466a97=0x0):_0x29944c['push'](_0x277347),_0x277347&&'insert'===_0x277347['type']&&(_0x466a97+=_0x277347['howMany']);}return _0x33698e;}['_findAdjacentContextDistance'](_0xb20f8,_0x2469c1,_0x1792cf,_0x360317=0x1){const _0x437592=new _0x58b091({'startPosition':_0xb20f8,'direction':_0x2469c1});let _0x2c001b=0x0;for(let _0x46f8d4=0x0;_0x46f8d4<_0x360317;_0x46f8d4++){let _0x19ccbc=0x0,_0x2a1daf=!0x1,_0x57dda0='forward'===_0x2469c1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x385638}of _0x437592)if(_0x385638['is']('$textProxy')){const _0x13db56=_0x57dda0['exec'](_0x385638['data']);if(_0x13db56&&_0x13db56['length']){if(_0x19ccbc+='forward'===_0x2469c1?_0x13db56['index']+_0x13db56[0x0]['length']:_0x385638['data']['length']-_0x13db56['index'],_0x13db56[0x0]['length']!==_0x385638['data']['length'])break;_0x2a1daf=!0x0,_0x57dda0='forward'===_0x2469c1?/^\w+/:/\w+$/;}else{if(_0x2a1daf)break;_0x19ccbc+=_0x385638['offsetSize'];}}else{if(_0x385638['is']('element')){_0x1792cf['isInline'](_0x385638)&&!_0x2a1daf&&(_0x19ccbc+=0x1);break;}}_0x2c001b+=_0x19ccbc,_0x437592['jumpTo'](_0xb20f8['getShiftedBy']('forward'===_0x2469c1?_0x2c001b:-_0x2c001b));}return _0x2c001b;}['_getChangeContext'](_0x57b894,_0x4c9713,_0xb17cda){const _0x2a3e22=_0xb17cda['model']['schema'],_0xc17a8a=this['_findAdjacentContextDistance'](_0x57b894,'backward',_0x2a3e22,0x6),_0x364915=this['_findAdjacentContextDistance'](_0x4c9713,'forward',_0x2a3e22,0x6),_0x4477eb=_0x57b894['getShiftedBy'](-_0xc17a8a),_0x1c93f7=_0x4c9713['getShiftedBy'](_0x364915);return{'start':_0x4477eb,'end':_0x1c93f7,'hasContentBefore':!_0x4477eb['isAtStart'],'hasContentAfter':!_0x1c93f7['isAtEnd']};}['_insertMarkers'](_0x204e60,_0xfc47d0){const _0x20bf45=this['context']['plugins']['get']('AIEditing'),_0x3382f8=new Set();_0xfc47d0['model']['change'](_0x2be1a7=>{for(const _0xa27bef of _0x204e60){const _0x3bdf03=''+rh+_0xa27bef['type']+':'+_0xa27bef['groupId']+'_'+_0x20bf45['_nextDataId'](_0x3382f8);this['_markers']['set'](_0x3bdf03,{'id':_0x3bdf03,'groupId':_0xa27bef['groupId'],'type':_0xa27bef['type'],'content':_0xa27bef['content'],'editor':_0xfc47d0}),_0x2be1a7['addMarker'](_0x3bdf03,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2be1a7['createRange'](_0xa27bef['start'],_0xa27bef['end'])});}});}['_createGetContextFn'](_0x4dde54,_0x3f115b,_0x224d94){let _0x2a97c7='';return()=>{if(!_0x2a97c7){const _0x13f895=_0x3f115b['toView'](_0x4dde54,{'showSuggestionHighlights':!0x0});let _0x264111=_0x13f895['getChild'](0x0);if(_0x264111['is']('containerElement')||(_0x264111=_0x13f895),!_0x264111)return'';let _0xce632e=!0x1;const _0x487086=[];for(const _0x2f9b8b of _0x264111['getChildren']())_0x2f9b8b['is']('element','span')&&_0x2f9b8b['hasClass']('ck-ai_review-marker_context-end')&&(_0xce632e=!0x1),_0xce632e&&_0x487086['push'](_0x2f9b8b),_0x2f9b8b['is']('element','span')&&_0x2f9b8b['hasClass']('ck-ai_review-marker_context-start')&&(_0xce632e=!0x0);_0x264111['_removeChildren'](0x0,_0x264111['childCount']),_0x224d94?.['ellipsisBefore']&&_0x264111['_appendChild']('…'),_0x264111['_appendChild'](_0x487086),_0x224d94?.['ellipsisAfter']&&_0x264111['_appendChild']('…');const _0x47ea45=_0x3f115b['htmlProcessor']['domConverter']['viewToDom'](_0x13f895),_0x1d6703=_0x3f115b['htmlProcessor']['htmlWriter']['getHtml'](_0x47ea45);_0x2a97c7=this['_removeUnsupportedElements'](_0x1d6703);}return _0x2a97c7;};}['_createGetContentFn'](_0x5b0d38,_0x4211e5){let _0x6e4f9d='';return()=>(_0x6e4f9d||(_0x6e4f9d=this['_removeUnsupportedElements'](_0x4211e5['stringify'](_0x5b0d38,{'showSuggestionHighlights':!0x0}))),_0x6e4f9d);}['_createGetContentUsingDataIdFn'](_0x4175be,_0x1932d5,_0x590be5){let _0x3c26c4='';return()=>{if(!_0x3c26c4){const _0x337570=_0x590be5['toView'](new _0x4a5f18(_0x4175be));_0x3c26c4=_0x590be5['htmlProcessor']['domConverter']['viewToDom'](_0x337570)['querySelector']('[data-id=\x22'+_0x1932d5+'\x22]')?.['outerHTML']||'';}return _0x3c26c4;};}['_removeUnsupportedElements'](_0x842a42){if(!_0x842a42)return'';const _0x467aa4=ps(_0x842a42,{'decodeEntities':!0x1}),_0x2acb56=ws(_0x467aa4);if(!_0x2acb56['length'])return _0x842a42;for(const _0x46f8c6 of _0x2acb56)_0x3baafe(_0x46f8c6);return ms(_0x467aa4,{'encodeEntities':!0x1});}['_neutralizeChangesOnUnsupportedElements'](_0x2678a8,_0x5c711){const _0x283d2a=ps(_0x2678a8,{'decodeEntities':!0x1}),_0x17f716=ps(_0x5c711,{'decodeEntities':!0x1}),_0x24bb1b=ws(_0x283d2a),_0x509b4b=ws(_0x17f716);if(!_0x24bb1b['length']&&!_0x509b4b['length'])return{'contentInitial':_0x2678a8,'contentNew':_0x5c711};const _0x99d27f=new Map();for(const _0x330404 of _0x24bb1b)_0x99d27f['set'](fs(_0x330404,'data-id'),_0x330404);for(const _0x35a3b0 of _0x509b4b){const _0xa9fae3=fs(_0x35a3b0,'data-id'),_0x5b58ec=_0xa9fae3?_0x99d27f['get'](_0xa9fae3):void 0x0;_0x5b58ec?_0x5e68a2(_0x35a3b0,_0x5b768f(_0x5b58ec,!0x0)):_0x3baafe(_0x35a3b0);}return{'contentInitial':ms(_0x283d2a,{'encodeEntities':!0x1}),'contentNew':ms(_0x17f716,{'encodeEntities':!0x1})};}['_findMarkerElement'](_0x2c44d5,_0x32c2d6=0x5){let _0xab58b1=_0x2c44d5,_0x33b548=null;for(let _0x505063=0x0;_0x505063<_0x32c2d6&&_0xab58b1;_0x505063++)if(_0xab58b1['className']){if((''+_0xab58b1['className'])['includes']('ck-ai_review-marker_')){if(!_0xab58b1['getAttribute']('data-marker-id'))break;_0x33b548=_0xab58b1;break;}_0xab58b1=_0xab58b1['parentElement'];}else _0xab58b1=_0xab58b1['parentElement'];return _0x33b548;}['_findMarkerElementById'](_0x4b0e38){const _0x1dd9a7=this['_markers']['get'](_0x4b0e38);if(!_0x1dd9a7)return null;const _0x4dad55=_0x1dd9a7['editor']['model']['markers']['get'](_0x4b0e38);return _0x4dad55?_0x2a74c3(_0x1dd9a7['editor']['editing'],_0x4dad55):null;}['_getMarkersDataForGroup'](_0x49273f){return Array['from'](this['_markers']['values']())['filter'](_0x1d01cf=>_0x1d01cf['groupId']===_0x49273f);}['_getOperationStart'](_0x244d74){return'insert'===_0x244d74['type']?_0x244d74['position']:_0x244d74['newRange']['start'];}['_getOperationEnd'](_0x57602c,_0x27d861=!0x1){return'insert'===_0x57602c['type']?_0x27d861?_0x57602c['position']:_0x57602c['position']['getShiftedBy'](_0x57602c['howMany']):_0x57602c['newRange']['end'];}['_shiftOperation'](_0x4256f0,_0x360c7a){return'insert'===_0x4256f0['type']?_0x4256f0['position']=_0x4256f0['position']['getShiftedBy'](_0x360c7a):'marker'===_0x4256f0['type']&&_0x4256f0['newRange']&&(_0x4256f0['newRange']=new _0x223931(_0x4256f0['newRange']['start']['getShiftedBy'](_0x360c7a),_0x4256f0['newRange']['end']['getShiftedBy'](_0x360c7a))),_0x4256f0;}['_changeOperationOwnerDocument'](_0x3ccf6e,_0x1130bb){'insert'===_0x3ccf6e['type']?_0x3ccf6e['position']=this['_changePositionOwnerDocument'](_0x3ccf6e['position'],_0x1130bb):'marker'===_0x3ccf6e['type']&&_0x3ccf6e['newRange']&&(_0x3ccf6e['newRange']=this['_changeRangeOwnerDocument'](_0x3ccf6e['newRange'],_0x1130bb));}['_changePositionOwnerDocument'](_0xf43ffa,_0x286cd0){return new _0x35d72f(_0x286cd0,_0xf43ffa['path']);}['_changeRangeOwnerDocument'](_0x3de7c8,_0x5c2e0d){return new _0x223931(this['_changePositionOwnerDocument'](_0x3de7c8['start'],_0x5c2e0d),this['_changePositionOwnerDocument'](_0x3de7c8['end'],_0x5c2e0d));}['_changePosition'](_0x59ee15,_0x488003){return new _0x35d72f(_0x488003,[..._0x59ee15]);}['_changeRange'](_0x8da86f,_0x57db93,_0xbc28a6,_0x39b733){return new _0x223931(this['_changePosition'](_0x57db93,_0x39b733),this['_changePosition'](_0xbc28a6,_0x39b733));}['_sortMarkers'](_0x1c8b12){const _0x268d7b=_0x56f871=>{switch(_0x56f871){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1c8b12['sort']((_0x7d93a9,_0x2dc640)=>_0x268d7b(_0x7d93a9['type'])-_0x268d7b(_0x2dc640['type']));}['_hasSameTopLevelElement'](_0x17d167,_0x32b148){const _0x2619df=_0x17d167['getChild'](0x0),_0x44756b=_0x32b148['getChild'](0x0);return!(!_0x2619df||!_0x44756b)&&((!_0x2619df['is']('element')||!_0x44756b['is']('element')||_0x2619df['name']===_0x44756b['name'])&&!(_0x2619df['is']('element')&&!_0x44756b['is']('element')||!_0x2619df['is']('element')&&_0x44756b['is']('element')));}['_haveSingleTopLevelElement'](_0x542a82){return 0x1===_0x542a82['childCount'];}['_haveOnlyInlineContent'](_0xfaa606,_0x182e3f){for(const _0x5ac620 of _0xfaa606['getChildren']())if(_0x5ac620['is']('element')&&!_0x182e3f['isInline'](_0x5ac620))return!0x1;return!0x0;}['_upsertDataId'](_0x5eb8aa,_0x34201c){let _0x4dc4bd=_0x5eb8aa['getAttribute'](_0x308ef3);return _0x4dc4bd||(_0x4dc4bd=_0x34201c(),_0x5eb8aa['_setAttribute'](_0x308ef3,_0x4dc4bd)),_0x4dc4bd;}};const ch=/* #__PURE__ -- @preserve */
38
- ut();var lh=class extends ch{['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x46503a,contentNew:_0xa18c17,contentInitial:_0x40f6a6,documentVersion:_0x382bca}){super(),this['id']=_0x46503a,this['contentNew']=_0xa18c17,this['contentInitial']=_0x40f6a6,this['documentVersion']=_0x382bca;}};const uh=/* #__PURE__ -- @preserve */
39
- gt();var dh=class extends uh{['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x17d717,_0x39c624,_0x2737f9){super(),this['id']=_0x17d717,this['parent']=_0x2737f9,this['_data']=_0x39c624,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']['slice']();}get['operationsIsolated'](){return this['_data']['operationsIsolated']['slice']();}};const _h=/* #__PURE__ -- @preserve */
40
- gt();var gh=class extends _h{['id']=vt();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x9e5a52,_0x41a554,_0x171e8d,_0x251fe7,_0x2f5313){super(),this['_sourceCheck']=_0x41a554,this['_documentData']=_0x9e5a52,this['_aiConnector']=_0x171e8d,this['_reviewParams']=_0x251fe7,this['_reviewArgs']=_0x2f5313,this['on']('change:status',(_0x4a6074,_0x1acdff,_0x23bad7)=>{'aborted'==_0x23bad7&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x23bad7,'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'](_0x16fdfd=>'pending'===_0x16fdfd['status']);}get['currentError'](){return this['_currentError'];}get['results'](){return Array['from'](this['_results']['values']());}['updateDocumentData'](_0x203cac){this['_documentData']=_0x203cac;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x37c3bd=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0xfc6578 of _0x37c3bd)'unmodified'!==_0xfc6578['data']['operation']&&('error'!==_0xfc6578['data']['operation']?'review-metadata'!==_0xfc6578['event']?this['_addReviewCheckResult'](_0xfc6578['data']['dataId'],_0xfc6578['data']['textDelta']):this['callId']=_0xfc6578['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x4ad821){this['_currentError']=_0x4ad821,en(_0x4ad821)?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'](_0x5b2ec3,_0x80a842){const _0x8ca0aa=this['_results']['get'](_0x5b2ec3);if(!_0x8ca0aa)return;if(0x0===_0x80a842['length'])return;const _0x302215=[];_0x80a842['forEach']((_0x232e02,_0x5828d1)=>{const _0x5cba43=new dh(_0x8ca0aa['id']+'-'+_0x5828d1,_0x232e02,_0x8ca0aa);_0x5cba43['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5cba43,'status':_0x5cba43['status']});}),_0x5cba43['on']('change:isActivated',()=>{_0x5cba43['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5cba43}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5cba43});}),this['_changes']['push'](_0x5cba43),_0x302215['push'](_0x5cba43);}),this['fire']('reviewCheckResultReady',{'changes':_0x302215,'result':_0x8ca0aa,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x9a2a29){const _0x1f2926=this['_changes']['find'](_0x380f4d=>_0x380f4d['id']===_0x9a2a29);return!(!_0x1f2926||'pending'!==_0x1f2926['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x818c65=>!0x0===_0x818c65['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1d9b47=>'pending'===_0x1d9b47['status']);}['getChangeById'](_0x47ef1c){return this['_changes']['find'](_0x20e056=>_0x20e056['id']===_0x47ef1c);}['markAllChangesAsAccepted'](){for(const _0x1b79e8 of this['_changes'])'pending'===_0x1b79e8['status']&&(_0x1b79e8['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3c3b8a){const _0x574ccb=this['_changes']['find'](_0x8a92a1=>_0x8a92a1['id']===_0x3c3b8a);_0x574ccb&&'pending'===_0x574ccb['status']&&(_0x574ccb['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x51221c){const _0x5cc7e2=this['_changes']['find'](_0x47e66a=>_0x47e66a['id']===_0x51221c);_0x5cc7e2&&'pending'===_0x5cc7e2['status']&&(_0x5cc7e2['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x239da2){const _0x5e5c3a=this['_changes']['find'](_0x48c0cc=>_0x48c0cc['id']===_0x239da2);_0x5e5c3a&&'pending'===_0x5e5c3a['status']&&(_0x5e5c3a['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x119ca7){const _0x2f4aa3=this['_changes']['find'](_0x5849ef=>_0x5849ef['id']===_0x119ca7);_0x2f4aa3&&'outdated'===_0x2f4aa3['status']&&(_0x2f4aa3['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4c59d2){this['_changes']['filter'](_0x1bf25a=>_0x1bf25a['isActivated']&&_0x1bf25a['id']!==_0x4c59d2)['forEach'](_0xa4ed42=>{_0xa4ed42['isActivated']=!0x1;});const _0x398189=this['_changes']['find'](_0x3d1e4a=>_0x3d1e4a['id']===_0x4c59d2);_0x398189&&'pending'===_0x398189['status']&&(_0x398189['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x5ce3c3=>_0x5ce3c3['isActivated'])['forEach'](_0x3de6df=>{_0x3de6df['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1b2b1b){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x397ead;if(_0x1b2b1b){const _0x1ae9c7=this['_changes']['find'](_0x519ab7=>_0x519ab7['id']===_0x1b2b1b);if(_0x1ae9c7&&_0x1ae9c7['isRated'])return;_0x1ae9c7&&(_0x397ead=_0x1ae9c7['parent']['id'],_0x1ae9c7['isRated']=!0x0);}const _0x3c9601={'positiveCount':this['_changes']['filter'](_0x55ff16=>'accepted'===_0x55ff16['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3c9601,this['callId'],_0x397ead);}['_addReviewCheckResult'](_0x3e7cf6,_0x9bca74){const _0x109158=this['_documentData']['elements']['get'](_0x3e7cf6);if(!_0x109158)return;const _0x5450d5=_0x109158['getContent']();if(_0x5450d5===_0x9bca74)return;const _0x4ca687=new lh({'id':_0x3e7cf6,'contentInitial':_0x5450d5,'contentNew':_0x9bca74,'documentVersion':_0x109158['documentVersion']});this['_results']['set'](_0x4ca687['id'],_0x4ca687),this['fire']('reviewCheckResultAdded',{'result':_0x4ca687,'source':this,'editor':_0x109158['editor']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0x476ffc=>'pending'===_0x476ffc['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x45a8bf=>'pending'===_0x45a8bf['status'])['length']&&(this['status']='finished');}},Ah=class extends gh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x4ed5b6=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0xe09c6f=0x0;_0xe09c6f<this['_reviewParams']['length'];_0xe09c6f++){if(!this['_reviewParams'][_0xe09c6f]||!this['_sourceCheck']['options'][_0xe09c6f])continue;const _0x3d3bb5=this['_sourceCheck']['options'][_0xe09c6f]['data']?.['find'](_0x2b53df=>_0x2b53df['id']===this['_reviewParams'][_0xe09c6f]);_0x3d3bb5&&_0x4ed5b6['push'](_0x3d3bb5['label']);}return _0x4ed5b6['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x5788d5,_0x527a84,_0x42290b){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x527a84,_0x5788d5,_0x42290b);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Ih=class extends _0x11a14c{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_availableReviewChecks'];['_reporter'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async['_initAvailableReviewChecks'](){this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}['_initUIListeners'](){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x27ff6f,_0x349d7d)=>this['runCheck'](_0x349d7d)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0xd3a31a=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0xd3a31a['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0xd3a31a['map'](_0x43772a=>_0x43772a['id']),this['_aiSource']);const _0x420830=this['_currentReviewCheckRun'];_0x420830['markAllChangesAsAccepted'](),_0x420830['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1b849c,_0x1b3d29)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1b3d29['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x1b3d29['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1b3d29['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1b3d29['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x2fe35e,_0x272a1e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x272a1e['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x272a1e['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x272a1e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x272a1e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x42f0d8,_0x98624e)=>{this['_onActivateChange'](_0x98624e);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0xd6a4b3,_0x183600)=>{this['_onDeactivateChange'](_0x183600);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x4fd8f9,_0x222696)=>{this['_onChangeMarkerClicked'](_0x4fd8f9,_0x222696);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x34cb28,_0x4aa562)=>{this['_onChangeMarkerHovered'](_0x34cb28,_0x4aa562);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xf1cc16,_0x27f7b2)=>{this['_onChangeMarkerRemoved'](_0xf1cc16,_0x27f7b2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x2e21a5,_0x479435)=>{this['_onChangeMarkerRestored'](_0x2e21a5,_0x479435);});}async['runCheck'](_0x5ebcb9){if(!this['_availableReviewChecks'])return;const _0x34a3fb=this['_availableReviewChecks']['find'](_0x21283a=>_0x21283a['id']===_0x5ebcb9['id']);if(_0x34a3fb){this['_onReviewCheckRun'](_0x5ebcb9),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x5ebcb9,_0x34a3fb),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x510d74,_0x232a8)=>{switch(_0x232a8['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x232a8);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x232a8['status']&&'error-chunk'!==_0x232a8['status']&&'error-general'!==_0x232a8['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x272c4f,_0x5250b7)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x3c0ffb=this['_diffContent'](_0x5250b7['editor'],_0x5250b7['result']['contentInitial'],_0x5250b7['result']['contentNew']);_0x5250b7['source']['addResultChanges'](_0x5250b7['result']['id'],_0x3c0ffb);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xc8c100,_0x1b024a)=>{for(const _0x5d1120 of _0x1b024a['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x5d1120);this['_markChangePositionInEditorContent'](_0x1b024a['changes'],_0x1b024a['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0xca7f9,_0x3c27a4)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x3c27a4['change']['id'],_0x3c27a4['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x59f84d,_0x370863)=>{this['_onReviewCheckResultActivated'](_0x370863);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x32865c){if(en(_0x32865c))return;_0x32865c instanceof ht?this['_logError'](_0x32865c):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x32865c));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x5ebcb9['id']}));}['abort'](){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}['getAvailableChecks'](){return(this['_availableReviewChecks']??[])['slice']();}['getCurrentCheckRun'](){return this['_currentReviewCheckRun'];}['_createReviewCheckRun'](_0x33eebd,_0x4e5e52){return new Ah(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e5e52,this['_aiConnector'],_0x33eebd['params'],_0x33eebd['args']);}['_onChangeMarkerRemoved'](_0x2f9d00,_0x500da8){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x500da8['changeId']);}['_onChangeMarkerRestored'](_0x53529f,_0x157657){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x157657['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aireview');}['_onReviewRunLeave'](_0x54998c=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x54998c&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x8f2351 of this['_aiReviewCoreEditing']['getEditors']())_0x8f2351['editing']['view']['change'](_0x4bc433=>{for(const _0x58f723 of _0x8f2351['editing']['view']['document']['getRoots']())_0x4bc433['removeClass']('ck-ai_review-diff',_0x58f723),_0x4bc433['removeClass']('ck-ai_review-highlights',_0x58f723),_0x4bc433['removeClass']('ck-ai-translate-mode-content',_0x58f723);});}['_logError'](_0x862185){this['_reporter']['logError'](_0x862185),'ai-review-mode-models-unable-to-retrieve'===function(_0x340e9d){return _0x340e9d instanceof sn?_0x340e9d['code']:_0x340e9d instanceof Error?_0x340e9d['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x862185)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x1eb75b){if('content'===this['_changeActivationSource']){const _0x1512df=this['_aiReviewCoreUi']['getChangeElement'](_0x1eb75b);_0x1512df&&St(_0x1512df['closest']('.ck-ai_review__check-run-result')||_0x1512df);}else{if('panel'===this['_changeActivationSource']){const _0x151929=this['_getChangeContentElement'](_0x1eb75b);if(!_0x151929)return;Rt({'target':_0x151929,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}},ph=class extends gh{['_prompt'];['_model'];constructor(_0x17c474,_0x6a7cb2,_0x2840b5,_0x5292fe,_0x164aef){super(_0x2840b5,_0x5292fe,_0x164aef),this['_prompt']=_0x17c474,this['_model']=_0x6a7cb2;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x592784,_0x144476,_0x4d6646){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x144476,_0x592784,_0x4d6646);}},mh=class{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x126347){this['id']=_0x126347['id'],this['commandId']=_0x126347['commandId'],this['title']=_0x126347['title'],this['description']=_0x126347['description'],this['isParameterized']=_0x126347['isParameterized'],this['useArgs']=_0x126347['useArgs'],this['options']=_0x126347['options'],this['args']=_0x126347['args'];}},Eh=class extends mh{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x255638,_0x12c435,_0x279971){super(_0x255638),this['prompt']=_0x255638['prompt'],this['model']=_0x255638['model'],this['model']?this['_defaultModel']=_0x12c435['find'](_0x24ade6=>_0x24ade6['id']===this['model'])||null:this['_defaultModel']=_0x279971;}get['defaultModel'](){return this['_defaultModel'];}},Th=class extends ph{get['subTitle'](){return'';}set['prompt'](_0x548a1c){this['_prompt']=_0x548a1c;}set['model'](_0x644e44){this['_model']=_0x644e44;}},wh=class extends _0x11a14c{static get['requires'](){return[ls,nn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];['_reporter'];['init'](){this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aireview');}['getChecksList'](){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const Ch=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}],fh=/* #__PURE__ -- @preserve */
41
- gt();var bh=class extends fh{['_checks']=[];['setupChecks'](_0xdc6d58){this['_checks']=_0xdc6d58['map'](_0x70301e=>new mh(_0x70301e));}get['checks'](){return this['_checks']['slice']();}['getCheckById'](_0x7e4641){return this['checks']['find'](_0x404f75=>_0x404f75['id']===_0x7e4641);}['removeCheckById'](_0x5732d2){this['_checks']=this['_checks']['filter'](_0x2d8797=>_0x2d8797['id']!==_0x5732d2);}},Sh=class extends mh{['_models']=[];['_defaultModel']=null;constructor(_0x492bcb,_0x157c8d,_0x3cec41){super(_0x492bcb),this['_models']=_0x157c8d,this['_defaultModel']=_0x3cec41;}get['models'](){return this['_models']['slice']();}get['defaultModel'](){return this['_defaultModel'];}},Rh=class extends bh{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x130cf3,_0x32ea2b,_0xaac9b){super(),this['_allModels']=_0x130cf3,this['_recommendedModels']=_0x32ea2b,this['_defaultModel']=_0xaac9b;}get['allModels'](){return this['_allModels']['slice']();}['setupChecks'](_0x355e79){this['_checks']=_0x355e79['map'](_0xea7752=>!0x0===_0xea7752['isExtra']?new Eh(_0xea7752,this['_allModels'],this['_defaultModel']):'custom'===_0xea7752['id']?new Sh(_0xea7752,this['_recommendedModels'],this['_defaultModel']):new mh(_0xea7752));}},Oh=class extends wh{static get['pluginName'](){return'AIReviewModeCheckRegistry';}['_modelsLoadError']=null;constructor(_0x5ce092){super(_0x5ce092),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}['getExtraChecks'](){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0x5baa34=>({'id':_0x5baa34['id'],'commandId':_0x5baa34['id'],'title':_0x5baa34['label'],'description':_0x5baa34['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x5baa34['prompt'],'model':_0x5baa34['model']}));}async['_loadChecksList'](){const _0x4769ca=[...Ch,...this['getExtraChecks']()]['map'](_0xc8c33=>_0xc8c33['isExtra']?_0xc8c33:this['_translateReviewCheck'](_0xc8c33)),_0x5a081f=await this['_getModels'](),_0x468dc6=new Rh(_0x5a081f['all'],_0x5a081f['recommended'],_0x5a081f['default']);return _0x468dc6['setupChecks'](_0x4769ca),_0x468dc6;}async['_getModels'](){const _0x8189b1=this['context']['plugins']['get']('AIConnector');try{const _0x207672=new Qs({'connector':_0x8189b1,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),_0x33dd2d={'all':await _0x207672['getAll'](),'recommended':await _0x207672['getAvailableModels'](),'default':await _0x207672['getDefault']()};return this['_modelsLoadError']=null,_0x33dd2d;}catch(_0x3d3665){return this['_modelsLoadError']=new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3d3665),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x1e2fd1){const _0x2249fb='AI_REVIEW_CHECK_'+_0x1e2fd1['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x27ac82={..._0x1e2fd1,'title':this['_translate'](_0x2249fb+'_TITLE',_0x1e2fd1['title']),'description':this['_translate'](_0x2249fb+'_DESCRIPTION',_0x1e2fd1['description'])};return _0x1e2fd1['options']&&(_0x27ac82['options']=_0x1e2fd1['options']['map'](_0x5b979b=>({..._0x5b979b,'label':this['_translate'](_0x2249fb+'_OPTIONS_LABEL',_0x5b979b['label']||''),'data':_0x5b979b['data']?_0x5b979b['data']['map'](_0x3bf897=>({..._0x3bf897,'label':this['_translate'](_0x2249fb+'_OPTIONS_DATA_'+_0x3bf897['id']['toUpperCase'](),_0x3bf897['label'])})):void 0x0}))),_0x27ac82;}['_translate'](_0x163441,_0x454b55){const _0x535f2b=us(this['context']['locale'],_0x163441);return _0x535f2b===_0x163441?_0x454b55:_0x535f2b;}},vh=class extends Ih{static get['pluginName'](){return'AIReviewModeController';}static get['requires'](){return[nn,Oh];}get['_aiSource'](){return'review';}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0xc08e53){super(_0xc08e53),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',Ch['map'](_0x5d2c52=>_0x5d2c52['id']));}['init'](){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x2d5f8b,_0x57796a)=>{this['_isDiffOn']=_0x57796a['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3d0f4c,_0x5dca76){if(_0x3d0f4c['isCustom'])return new ph(_0x3d0f4c['args']['prompt'],_0x3d0f4c['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5dca76,this['_aiConnector']);if(_0x5dca76['isExtra']){const _0x2c0c01=_0x5dca76;return new Th(_0x3d0f4c['args']?.['prompt']??_0x2c0c01['prompt'],_0x3d0f4c['args']?.['model']??_0x2c0c01['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5dca76,this['_aiConnector']);}return new Ah(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5dca76,this['_aiConnector'],_0x3d0f4c['params'],_0x3d0f4c['args']);}['_onReviewCheckResultActivated'](_0x1de8b2){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1de8b2['change']['id']),this['_scrollToChange'](_0x1de8b2['change']['id']);const _0x14a513=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1de8b2['change']['id']);if(!_0x14a513)return;const _0x40a466=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1de8b2['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1de8b2['change'],()=>_0x14a513['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x40a466,_0x14a513['modelRange']['root']['rootName']),_0x40a466?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1de8b2['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x4def76){this['_currentReviewCheckRun']&&'click'===_0x4def76['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4def76['id']));}['_onDeactivateChange'](_0x14ea3a){this['_currentReviewCheckRun']&&'balloon'===_0x14ea3a['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1c447e,_0x5cd9c2){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5cd9c2['changeId']);const _0x33287b=this['_currentReviewCheckRun']['getChangeById'](_0x5cd9c2['changeId']);if(!_0x33287b)return;const _0x191e5c=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5cd9c2['changeId']),_0x3cf21e=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5cd9c2['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x33287b,_0x5cd9c2['markerElement'],_0x5cd9c2['domEvent'],'click',this['_getBalloonDomRoot'](_0x3cf21e,_0x191e5c?.['modelRange']['root']['rootName']),_0x3cf21e?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x5d1e57,_0x3e39a3){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x52bfc6=this['_currentReviewCheckRun']['getChangeById'](_0x3e39a3['changeId']);if(!_0x52bfc6)return;const _0x293bd3=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3e39a3['changeId']),_0x39f991=this['_aiReviewCoreEditing']['getEditorForChange'](_0x3e39a3['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x52bfc6,_0x3e39a3['markerElement'],_0x3e39a3['domEvent'],'hover',this['_getBalloonDomRoot'](_0x39f991,_0x293bd3?.['modelRange']['root']['rootName']),_0x39f991?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']());}['_getChangeContentElement'](_0x1010e7){const _0x1021ca=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1010e7);return _0x1021ca?_0x1021ca['getElement']():null;}['_markChangePositionInEditorContent'](_0x18b804,_0x55b0bd){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x18b804,_0x55b0bd);}['_diffContent'](_0x112d84,_0x477127,_0x48cee1){return this['_aiReviewCoreEditing']['diffContent'](_0x112d84,_0x477127,_0x48cee1,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x1632d8){_0x1632d8?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x4af774 of this['_aiReviewCoreEditing']['getEditors']())_0x4af774['editing']['view']['change'](_0x254917=>{for(const _0x449acb of _0x4af774['editing']['view']['document']['getRoots']()){for(const _0x44b283 of _0x449acb['getClassNames']())_0x44b283['startsWith']('ck-ai_review-')&&_0x254917['removeClass'](_0x44b283,_0x449acb);_0x254917['addClass'](_0x1632d8?'ck-ai_review-diff':'ck-ai_review-highlights',_0x449acb);}});}['_getBalloonDomRoot'](_0xd72b0b,_0x192204){const _0x5b476a=_0xd72b0b['editing']['view'];if(_0x192204){const _0x3d70b1=_0x5b476a['getDomRoot'](_0x192204);if(_0x3d70b1)return _0x3d70b1;}return _0x5b476a['getDomRoot']()??void 0x0;}async['_getReviewChecks'](){const _0x223c37=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x2aab87=await _0x223c37['getChecksList']();_0x223c37['modelsLoadError']&&this['_logError'](_0x223c37['modelsLoadError']);let _0x483e06=_0x2aab87['checks'];const _0x8edc02=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x8edc02,_0x483e06),this['_usesAvailableCommandsConfig']&&(_0x483e06=_0x8edc02['map'](_0x245416=>_0x483e06['find'](_0x38c414=>_0x38c414['id']===_0x245416))['filter'](_0x421bf4=>!!_0x421bf4)),this['_filterChecksWithMissingModel'](_0x483e06);}['_logWarningForNonExistentChecks'](_0x317a0a,_0x48eb96){const _0x27ba2b=_0x317a0a['filter'](_0x43c8ba=>!_0x48eb96['some'](_0x568a49=>_0x568a49['id']===_0x43c8ba));_0x27ba2b['length']&&this['_reporter']['logError'](new sn({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x27ba2b['join'](',\x20')}}));}['_filterChecksWithMissingModel'](_0x18db75){const _0x57eee4=[];return _0x18db75['forEach'](_0x48efc9=>{(_0x48efc9 instanceof Eh&&!_0x48efc9['defaultModel']||_0x48efc9 instanceof Sh&&!_0x48efc9['models']['length'])&&_0x57eee4['push'](_0x48efc9['id']);}),_0x57eee4['length']&&_0x57eee4['forEach'](_0x56fb3f=>{_0x18db75=_0x18db75['filter'](_0x472a41=>_0x472a41['id']!==_0x56fb3f),this['_reporter']['logError'](new sn({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x56fb3f}}));}),_0x18db75;}};function kh(_0x4ccdd6,_0x5dbb19,_0x13057c,_0xd7d545){return _0x4ccdd6 instanceof ht?_0x4ccdd6:new ht(_0x5dbb19,_0x13057c,_0xd7d545,_0x4ccdd6);}var Nh=class extends Js{['_affectedBlocks']=[];get['affectedBlocks'](){return this['_affectedBlocks']['slice']();}set['affectedBlocks'](_0x6a3ce){this['_affectedBlocks']=_0x6a3ce;}},yh=class extends _0x11a14c{static get['pluginName'](){return'AIReviewGateway';}static get['requires'](){return[hh,Oh,ls,Is,js];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAllCommands'](){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x4791c6=>{const _0x16dbfe={'id':_0x4791c6['id'],'title':_0x4791c6['title'],'description':_0x4791c6['description']};return'custom'!==_0x4791c6['id']&&_0x4791c6['options']?.['length']&&(_0x16dbfe['parameters']=_0x4791c6['options'][0x0]['data']['map'](_0x55e190=>({..._0x55e190}))),_0x16dbfe;});}async['getAvailableModels'](){return this['context']['plugins']['get']('AIGateway')['getAvailableModels']();}async['runReview'](_0x3ec41a,_0x31c5f2){return await this['_runReviewCheck'](_0x3ec41a,()=>this['_createReviewCheckRun'](_0x3ec41a,_0x31c5f2?.['parameterId']),_0x31c5f2?.['signal']);}async['runCustomReview'](_0x14f028,_0x4c0dd4){return await this['_runReviewCheck']('custom',()=>this['_createCustomReviewCheckRun']('custom',_0x14f028,_0x4c0dd4?.['model']),_0x4c0dd4?.['signal']);}['applyReview'](_0xee9e45,_0x7e3d05){this['context']['plugins']['get']('AIGateway')['apply'](_0xee9e45,{'applyMethod':_0x7e3d05,'aiSource':'review'});}async['_runReviewCheck'](_0x50665b,_0x2ae9f7,_0x216abc){const _0x7ce4db=_s(this['context']),_0x4ec2bd=new Nh({'editor':_0x7ce4db,'rootName':_0x7ce4db['model']['document']['getRootNames']()[0x0],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x7ce4db['plugins']['get']('AIEditing')['getSessionId'](_0x7ce4db)});let _0x5182a7,_0x2b9b75;if(_0x216abc){if(_0x216abc['aborted'])return _0x4ec2bd['abort'](),_0x4ec2bd;const _0x3e940e=()=>{_0x4ec2bd['error']||(_0x4ec2bd['abort'](),_0x5182a7&&_0x5182a7['abort']());};_0x216abc['addEventListener']('abort',_0x3e940e),_0x2b9b75=()=>_0x216abc['removeEventListener']('abort',_0x3e940e);}try{_0x5182a7=await _0x2ae9f7(),_0x4ec2bd['contentRawOld']=_0x5182a7['documentData']['content'],_0x4ec2bd['documentVersion']=Array['from'](_0x5182a7['documentData']['elements'])['find'](([,_0x2e9d65])=>_0x2e9d65['rootName']===_0x4ec2bd['rootName'])?.[0x1]['documentVersion']??0x1,_0x5182a7['on']('reviewCheckRunUpdated',(_0x3bdae1,_0x59321f)=>{'aborted'===_0x59321f['status']?_0x4ec2bd['abort']():'error-general'!==_0x59321f['status']&&'error-chunk'!==_0x59321f['status']||(_0x4ec2bd['error']=kh(_0x59321f['error'],'ai-reviewgateway-review-command-run-failed',this,{'checkId':_0x50665b}));}),'aborted'!==_0x4ec2bd['status']&&await _0x5182a7['start']();}catch(_0x2504b4){_0x4ec2bd['error']=kh(_0x2504b4,'ai-reviewgateway-review-command-run-failed',this,{'checkId':_0x50665b});}finally{_0x2b9b75&&_0x2b9b75();}if(!_0x5182a7||'aborted'===_0x4ec2bd['status']||'error'===_0x4ec2bd['status'])return _0x4ec2bd;_0x4ec2bd['affectedBlocks']=_0x5182a7['results']['map'](_0x5ee732=>({'id':_0x5ee732['id'],'content':_0x5ee732['contentNew']}));try{_0x4ec2bd['contentRawNew']=ms(this['context']['plugins']['get']('AIGateway')['mergeChangesIntoContent'](_0x4ec2bd['affectedBlocks'],_0x4ec2bd['contentRawOld'],_0x4ec2bd['editor']));}catch(_0x3318be){_0x4ec2bd['error']=kh(_0x3318be,'ai-reviewgateway-review-command-run-failed',this,{'checkId':_0x50665b});}return _0x4ec2bd;}async['_createReviewCheckRun'](_0x2e4250,_0x4e6601){const _0x57b028=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x1702fd=>_0x1702fd['id']===_0x2e4250);if(!_0x57b028)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x2e4250});if(_0x57b028 instanceof Sh)throw new ht('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x2e4250});const _0x433309=this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x2929ac=this['context']['plugins']['get']('AIConnector');if(_0x57b028 instanceof Eh){if(!_0x57b028['defaultModel']?.['id'])throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x2e4250});return new Th(_0x57b028['prompt'],_0x57b028['defaultModel']['id'],_0x433309,_0x57b028,_0x2929ac);}return new Ah(_0x433309,_0x57b028,_0x2929ac,_0x4e6601?[_0x4e6601]:void 0x0);}async['_createCustomReviewCheckRun'](_0x9a4c5d,_0x50c8f0,_0x5cb36e){const _0x449702=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x110f7e=>_0x110f7e['id']===_0x9a4c5d);if(!_0x449702)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x9a4c5d});if(!(_0x449702 instanceof Sh))throw new ht('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x9a4c5d});const _0x5cb260=_0x5cb36e??_0x449702['defaultModel']?.['id'];if(!_0x50c8f0)throw new ht('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x9a4c5d});if(!_0x5cb260)throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x9a4c5d});return new ph(_0x50c8f0,_0x5cb260,this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x449702,this['context']['plugins']['get']('AIConnector'));}},xh=class extends _0x11a14c{static get['requires'](){return[vh,nh,hh,yh];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['startReview'](_0x1e0ca3,_0xef3254){if(this['assertStartReviewPreconditions'](_0x1e0ca3)instanceof Sh)throw new ht('ai-reviewmode-not-a-system-command',this,{'commandId':_0x1e0ca3});ka(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x1e0ca3,'params':_0xef3254?.['parameterId']?[_0xef3254['parameterId']]:void 0x0});}async['startCustomReview'](_0x40d159,_0x1a7c66){if(!_0x40d159)throw new ht('ai-reviewmode-missing-custom-command-prompt',this);const _0x3e32ff=Ch['find'](_0x19d803=>'custom'===_0x19d803['commandId'])['id'],_0x530615=this['assertStartReviewPreconditions'](_0x3e32ff),_0x569945=_0x1a7c66?.['model']??_0x530615['defaultModel']?.['id'];if(!_0x569945)throw new ht('ai-reviewmode-missing-custom-command-model',this);ka(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x3e32ff,'isCustom':!0x0,'args':{'prompt':_0x40d159,'model':_0x569945}});}['getAvailableCommands'](){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x1f9e41=>{const _0x2a7835={'id':_0x1f9e41['id'],'title':_0x1f9e41['title'],'description':_0x1f9e41['description']};return'custom'!==_0x1f9e41['id']&&_0x1f9e41['options']?.['length']&&(_0x2a7835['parameters']=_0x1f9e41['options'][0x0]['data']['map'](_0x51f794=>({..._0x51f794}))),_0x2a7835;});}['assertStartReviewPreconditions'](_0x49c12c){const _0x2e8479=this['context']['plugins']['get']('AIReviewModeController');if(_0x2e8479['getCurrentCheckRun']())throw new ht('ai-reviewmode-review-already-running',this);const _0xc9adad=_0x2e8479['getAvailableChecks']()['find'](_0x196110=>_0x196110['id']===_0x49c12c);if(!_0xc9adad)throw new ht('ai-reviewmode-unknown-command',this,{'commandId':_0x49c12c});return _0xc9adad;}},Lh=class extends Ah{['_title'];constructor(_0x4f032f,_0x28b251,_0x1df903,_0x5c10c9,_0x1c65d8,_0x2c2332){super(_0x4f032f,_0x28b251,_0x1df903,_0x1c65d8,_0x2c2332),this['_title']=_0x5c10c9;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}},Dh=class extends mh{get['apiId'](){return'translate';}},Ph=class extends bh{['setupChecks'](_0x271491){this['_checks']=_0x271491['map'](_0x3bf58a=>new Dh(_0x3bf58a));}};const Hh=[{'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'}];var Mh=class extends wh{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x2e8002){super(_0x2e8002),this['context']['config']['define']('ai.translate.languages',Hh);}async['_loadChecksList'](){const _0x573252=[],_0x13e028=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x44f4a7 of _0x13e028)_0x573252['push']({'title':_0x44f4a7['label'],'id':_0x44f4a7['id'],'commandId':_0x44f4a7['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x44f4a7['id']}});const _0x580d4c=new Ph();return _0x580d4c['setupChecks'](this['_translateChecks'](_0x573252)),_0x580d4c;}['_translateChecks'](_0x3a879d){const _0x48ee9e=this['context']['locale'];return _0x3a879d['map'](_0x3812a5=>{const _0x57c00b='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x3812a5['title']['toUpperCase']()['replaceAll']('-','_'),_0xff94a4=us(_0x48ee9e,_0x57c00b);return{..._0x3812a5,'title':_0xff94a4===_0x57c00b?_0x3812a5['title']:_0xff94a4};});}},Vh=class extends Ih{static get['pluginName'](){return'AITranslateController';}static get['requires'](){return[nn,Mh];}get['_aiSource'](){return'translate';}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x1ca4d7,_0x330a57){return new Lh(this['_aiReviewCoreEditing']['getDocumentData'](),_0x330a57,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x1ca4d7['params'],_0x1ca4d7['args']);}['_onReviewCheckResultActivated'](_0x17a8cc){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x17a8cc['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x17a8cc['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x43dba0){this['_currentReviewCheckRun']&&('hover'===_0x43dba0['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x43dba0['id'])),'click'===_0x43dba0['uiInteraction']&&this['_scrollToChange'](_0x43dba0['id']));}['_onDeactivateChange'](_0x292885){this['_currentReviewCheckRun']&&'panel'===_0x292885['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x344a90,_0x2c8ffe){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2c8ffe['changeId']),this['_scrollToChange'](_0x2c8ffe['changeId']));}['_onChangeMarkerHovered'](_0x24fa0c,_0x435933){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x435933['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x435933['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x48cdec){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x48cdec);}['_markChangePositionInEditorContent'](_0x5b1925,_0x342400){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x5b1925,_0x342400);}['_diffContent'](_0x583d51,_0x3e2562,_0x5999ef){return this['_aiReviewCoreEditing']['diffContent'](_0x583d51,_0x3e2562,_0x5999ef,!0x0);}['_onReviewCheckRun'](){for(const _0x170cc5 of this['_aiReviewCoreEditing']['getEditors']())_0x170cc5['editing']['view']['change'](_0x1569b3=>{for(const _0x123687 of _0x170cc5['editing']['view']['document']['getRoots']())_0x1569b3['addClass']('ck-ai-translate-mode-content',_0x123687);});}async['_getReviewChecks'](){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},Uh=class extends Qa{constructor(_0x142d5d,_0x135337){super(_0x142d5d,_0x135337),this['on']('set:isLoading',(_0x2929c7,_0x263427,_0x5ae136)=>{_0x5ae136&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x448340,_0x218bad,_0x4a4056)=>{_0x4a4056&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x52b722=super['_createAcceptAllButtonView']();return _0x52b722['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x52b722;}['_createExitReviewButtonView'](){const _0x5c5a66=super['_createExitReviewButtonView']();return _0x5c5a66['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5c5a66;}},Bh=class extends sh{['_setupTemplate'](){const _0x14ba8e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x14ba8e['if']('isVisible','ck-hidden',_0x291c30=>!_0x291c30)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x14ba8e['if']('isVisible','ck-hidden',_0x157d15=>!_0x157d15)]},'children':this['_checkViews']}]});}},Gh=class extends Wa{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x539b5a=this['context']['plugins']['get']('AITabs'),_0x2c9837=this['context']['locale'],_0x3d5b5c=new Ho(_0x2c9837,{'label':us(_0x2c9837,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x3ce940,'class':'ck-ai-header_review-translate','showResizeButton':_0x539b5a['showResizeButton']});_0x3d5b5c['delegate']('resizeTabs')['to'](_0x539b5a),_0x3d5b5c['bind']('isMaximized')['to'](_0x539b5a['view'],'isMaximized',_0x980adb=>_0x980adb);const _0x2d9f75=new $a(_0x2c9837,{'header':_0x3d5b5c,'list':new Bh(_0x2c9837),'results':new Uh(_0x2c9837,{'generalErrorText':us(_0x2c9837,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Xa(_0x2c9837,{'headerText':us(_0x2c9837,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x2c9837,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x2c9837,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2d9f75['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2d9f75;}['registerTab'](){const _0x3c8612=this['context']['plugins']['get']('AITabs');_0x3c8612['view']['on']('activateTab',(_0x1384a8,{newTab:_0x195145,oldTab:_0x4b7fac})=>{'translate'===_0x195145?this['fire']('getReviewCheckList'):'translate'===_0x4b7fac&&this['fire']('leaveReview');}),_0x3c8612['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x3ce940,'order':0x0,'content':this['_mainView']});}},Fh=class extends Js{['_affectedBlocks']=[];get['affectedBlocks'](){return this['_affectedBlocks'];}set['affectedBlocks'](_0x229236){this['_affectedBlocks']=_0x229236;}},Kh=class extends _0x11a14c{static get['pluginName'](){return'AITranslateGateway';}static get['requires'](){return[hh,ls,Is,js];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['runTranslate'](_0x349b04,_0x3c2139){return await this['_runTranslateCheck'](_0x349b04,()=>this['_createTranslateCheckRun'](_0x349b04),_0x3c2139?.['signal']);}['applyTranslate'](_0x3277e2,_0x26b2e7){this['context']['plugins']['get']('AIGateway')['apply'](_0x3277e2,_0x26b2e7);}async['_runTranslateCheck'](_0x32c884,_0x215f57,_0x232863){const _0x56566f=_s(this['context']),_0x1af2a6=new Fh({'editor':_0x56566f,'rootName':_0x56566f['model']['document']['getRootNames']()[0x0],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x56566f['plugins']['get']('AIEditing')['getSessionId'](_0x56566f)});let _0x41f9fb,_0x175db0;if(_0x232863){if(_0x232863['aborted'])return _0x1af2a6['abort'](),_0x1af2a6;const _0x5a4a4e=()=>{_0x1af2a6['error']||(_0x1af2a6['abort'](),_0x41f9fb&&_0x41f9fb['abort']());};_0x232863['addEventListener']('abort',_0x5a4a4e),_0x175db0=()=>_0x232863['removeEventListener']('abort',_0x5a4a4e);}try{_0x41f9fb=await _0x215f57(),_0x1af2a6['contentRawOld']=_0x41f9fb['documentData']['content'],_0x1af2a6['documentVersion']=Array['from'](_0x41f9fb['documentData']['elements'])['find'](([,_0x3e1e80])=>_0x3e1e80['rootName']===_0x1af2a6['rootName'])?.[0x1]['documentVersion']??0x1,_0x41f9fb['on']('reviewCheckRunUpdated',(_0x41e405,_0x311eb5)=>{'aborted'===_0x311eb5['status']?_0x1af2a6['abort']():'error-general'!==_0x311eb5['status']&&'error-chunk'!==_0x311eb5['status']||(_0x1af2a6['error']=kh(_0x311eb5['error'],'ai-translategateway-translation-run-failed',this,{'language':_0x32c884}));}),'aborted'!==_0x1af2a6['status']&&await _0x41f9fb['start']();}catch(_0x37b943){_0x1af2a6['error']=kh(_0x37b943,'ai-translategateway-translation-run-failed',this,{'language':_0x32c884});}finally{_0x175db0&&_0x175db0();}if(!_0x41f9fb||'aborted'===_0x1af2a6['status']||'error'===_0x1af2a6['status'])return _0x1af2a6;_0x1af2a6['affectedBlocks']=_0x41f9fb['results']['map'](_0x507f2f=>({'id':_0x507f2f['id'],'content':_0x507f2f['contentNew']}));try{_0x1af2a6['contentRawNew']=ms(this['context']['plugins']['get']('AIGateway')['mergeChangesIntoContent'](_0x1af2a6['affectedBlocks'],_0x1af2a6['contentRawOld'],_0x1af2a6['editor']));}catch(_0x2fa30f){_0x1af2a6['error']=kh(_0x2fa30f,'ai-translategateway-translation-run-failed',this,{'language':_0x32c884});}return _0x1af2a6;}async['_createTranslateCheckRun'](_0x4e82d7){const _0x4e82f5=this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x7cb231=this['context']['plugins']['get']('AIConnector');return new Lh(_0x4e82f5,new Dh({'id':_0x4e82d7,'commandId':_0x4e82d7,'title':_0x4e82d7,'description':'','isParameterized':!0x1}),_0x7cb231,us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),void 0x0,{'language':_0x4e82d7});}},Wh=class extends _0x11a14c{static get['requires'](){return[Vh,Gh,hh,Kh];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['startTranslate'](_0x9990aa){const _0x30589a=this['assertStartTranslatePreconditions'](_0x9990aa);ka(this['context'],'translate'),await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x30589a['id'],'args':_0x30589a['useArgs']?_0x30589a['args']:void 0x0});}['getAvailableLanguages'](){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x407179=>({'id':_0x407179['id'],'label':_0x407179['title']}));}['assertStartTranslatePreconditions'](_0x38f0af){const _0x4a9f99=this['context']['plugins']['get']('AITranslateController');if(_0x4a9f99['getCurrentCheckRun']())throw new ht('ai-translate-translation-already-running',this);const _0x5e9d0b=_0x4a9f99['getAvailableChecks']()['find'](_0x3da05a=>_0x3da05a['id']===_0x38f0af);if(!_0x5e9d0b)throw new ht('ai-translate-unknown-language',this,{'languageId':_0x38f0af});return _0x5e9d0b;}};export{Ua as AIActions,vi as AIAdapter,Ji as AIAssistant,Xi as AIAssistantUI,la as AIBalloon,ta as AIChat,kn as AIChatController,Hr as AIChatFeedCustomElementView,Zo as AIChatHistory,Jo as AIChatHistoryController,qo as AIChatHistoryUI,fn as AIChatInteraction,na as AIChatShortcuts,Bo as AIChatUI,ls as AIConnector,sn as AICoreError,tn as AIDocumentProcessingGateway,Zs as AIDocumentProcessingRunResult,Is as AIEditing,Aa as AIEditorIntegration,rn as AIErrorReporter,nn as AIErrorSink,js as AIGateway,An as AIInteraction,Ba as AIQuickActions,Oa as AIQuickActionsUI,dn as AIReply,ki as AIRequestError,mh as AIReviewCheck,lh as AIReviewCheckResult,dh as AIReviewCheckResultChange,gh as AIReviewCheckRun,yh as AIReviewGateway,xh as AIReviewMode,Ih as AIReviewModeController,hh as AIReviewModeEditing,nh as AIReviewModeUI,Nh as AIReviewRunResult,Js as AIRunResult,cs as AITabs,hs as AITabsMainView,rs as AITabsView,ts as AITextAdapter,oa as AIToggleButtonUI,Wh as AITranslate,Vh as AITranslateController,Kh as AITranslateGateway,Fh as AITranslateRunResult,Gh as AITranslateUI,is as AWSTextAdapter,es as OpenAITextAdapter,yi as ShowAIAssistantCommand,ra as ToggleAICommand,cn as createResizeButton,Zi as getDefaultAICommands,zs as markOperationsAsAI};
23
+ import{Command as _0x23b7b0,ContextPlugin as _0x898608,Editor as _0x24cd6f,Plugin as _0x622916,rootAcceptsBlocks as _0x1bd984}from'@ckeditor/ckeditor5-core';import{IconAI as _0x522884,IconAIAdjustLength as _0x55d620,IconAIAskAI as _0x2eb0d7,IconAIChangeTone as _0x173850,IconAIChat as _0x19cce7,IconAIChatCommands as _0x3bbd8f,IconAIContinueWriting as _0x123cf3,IconAIGrammarCheck as _0x37ebe4,IconAIHistory as _0x4afa16,IconAIImproveWriting as _0x448b65,IconAIOther as _0x400907,IconAIQuickActions as _0x10bb99,IconAIReview as _0x510915,IconAITranslate as _0x370c5b,IconBoxWithCheck as _0x381a45,IconBoxWithCross as _0x194390,IconBoxWithMarker as _0xf32bda,IconBrowseFiles as _0x15107d,IconBulb as _0x1e95b5,IconCancel as _0x572ba4,IconCheck as _0x48b061,IconChevronDown as _0x4e351c,IconChevronRight as _0x2fee64,IconChevronUp as _0x582ecb,IconCopy as _0xaeff50,IconDocument as _0x2d99a5,IconDocumentOutline as _0x325a2b,IconDropdownArrow as _0x1193f0,IconError as _0x309d45,IconEye as _0x112882,IconEyeCrossedOut as _0x3bafdd,IconFileUpload as _0xd6ab36,IconImage as _0x1bf77b,IconInfo as _0x41da4b,IconLink as _0x3de4d0,IconLoupe as _0x4cf30b,IconMagicWand as _0xbfdde1,IconMaximize as _0x31ef04,IconMinimize as _0x2bee5e,IconNextArrow as _0x57e767,IconOutdated as _0x157ef8,IconPaperClip as _0x3ff1a2,IconPin as _0x5b153c,IconPlus as _0x3da945,IconPreviousArrow as _0xd78e92,IconRefresh as _0x184821,IconRevisionHistory as _0x14640e,IconRobotPencil as _0x59f1b5,IconSelection as tt,IconShowChangesOff as et,IconShowChangesOn as it,IconStop as st,IconSubmit as nt,IconThreeHorizontalDots as rt,IconThumbDown as ot,IconThumbUp as at,IconWeb as ht}from'@ckeditor/ckeditor5-icons';import{CKEditorError as ct,Collection as lt,DomEmitterMixin as ut,EmitterMixin as dt,FocusTracker as _t,KeystrokeHandler as gt,ObservableMixin as At,Rect as It,ResizeObserver as pt,_isMotionReduced as Et,first as mt,getConstrainedViewportRect as Tt,global as wt,insertToPriorityArray as Ct,isVisible as ft,logError as bt,logWarning as St,scrollAncestorsToShowTarget as Rt,scrollViewportToShowTarget as Ot,toArray as vt,uid as kt,version as yt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as Nt,BalloonPanelView as xt,BalloonToolbar as Lt,BodyCollection as Pt,ButtonLabelView as Dt,ButtonLabelWithHighlightView as Ht,ButtonView as Mt,Dialog as Ut,DialogViewPosition as Vt,DropdownMenuPanelPositioningFunctions as Bt,FileDialogButtonView as Gt,FocusCycler as Ft,FormHeaderView as Kt,FormRowView as Wt,HighlightedTextView as Yt,IconView as $t,InputTextView as qt,LabeledFieldView as Qt,ListItemButtonView as Xt,ListItemGroupView as zt,ListItemView as jt,ListView as Jt,MenuBarMenuListItemButtonView as Zt,MenuBarMenuListItemView as te,MenuBarMenuListView as _0x14eb7a,MenuBarMenuView as _0x1021d4,SearchTextView as _0xdb63d9,SpinnerView as _0x14cb96,Template as _0x24e6f7,TextareaView as _0x324c99,ToolbarView as _0x54b9b5,UIModel as _0x28f92e,View as _0x56a514,ViewCollection as _0x93f04d,addListToDropdown as _0x40e721,addMenuToDropdown as _0x1ce06a,clickOutsideHandler as _0x44d1a9,createDropdown as _0x48403c,createLabeledInputText as _0x4c7fdb,createLabeledTextarea as _0x3cc43c,submitHandler as _0x2801b9}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x6355f1,ClipboardPipeline as _0x5d9c9d}from'@ckeditor/ckeditor5-clipboard';import{InsertOperation as _0x52fe51,MarkerOperation as _0x5bbb57,Matcher as _0x34dbd2,ModelDocumentFragment as _0x28e306,ModelPosition as _0x4febba,ModelRange as _0x2827cc,ModelTreeWalker as _0x28cad7,ViewDataTransfer as _0x1fcb27,ViewDocumentDomEventData as _0x1b1d52,ViewDowncastWriter as _0x4ccf87,ViewUpcastWriter as _0x6705a7,_DetachOperation as _0x4f656c,_insertIntoModelNodeList as _0x3ab39d,_removeFromModelNodeList as _0x168f4f,transformOperationSets as _0x5dec67}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0xddedfa,debounce as _0x5f51ae,escape as _0x15f5d8,escapeRegExp as _0x3ff1f3,omit as _0x101a20,throttle as _0x20eb7b,unescape as _0x2d8c2d}from'es-toolkit/compat';import{createParser as _0x1314f1}from'eventsource-parser';import{CloudServices as _0x46601a}from'@ckeditor/ckeditor5-cloud-services';import{parseDocument as _0x502eab}from'htmlparser2';import{append as _0x23e0ae,appendChild as _0x380486,find as _0x370e5d,findAll as _0x4615bb,findOne as _0x228c3a,getChildren as _0x27f885,getParent as _0x12306c,isComment as _0x3e0c4f,isTag as _0x545292,prepend as ti,prependChild as _0x46b9cf,removeElement as _0x47cc1f,replaceElement as _0x452856,textContent as _0xa4b40a}from'domutils';import _0x35b927 from'dom-serializer';import{Document as _0x139fbf,Element as _0x21f244,NodeWithChildren as _0x71eb2,Text as _0xa7d61f,cloneNode as _0x2a3383,isDocument as _0x23e8cf,isText as _0x5273d9}from'domhandler';import{ConfirmMixin as _0x5a953b,DATA_ID_MODEL_ATTRIBUTE as _0x4fabc2,DATA_ID_VIEW_ATTRIBUTE as _0x322962,DocumentCompare as _0x45dea0,PillView as _0x5745ee,SuggestionsConversion as _0x34a1f4,fixElementSuggestionRange as _0x49575d,getAllMarkersDomElementsSorted as _0x42da8e,getMarkerDomElement as _0x497b83,isInvalidAttributeOperation as _0x9fd625}from'@ckeditor/ckeditor5-collaboration-core';import{MarkdownGfmMdToHtml as _0x20ae64,MarkdownGfmMdToHtmlDefaultPlugins as _0x29e337}from'@ckeditor/ckeditor5-markdown-gfm';import _0x23be32 from'rehype-sanitize';import _0x29a9e2 from'morphdom';import{diffArrays as _0x11f069}from'diff';const vi='_ungrouppedCommands';function ki(_0x1cd465,_0x41925f){const _0x314168=(0x0,_0x41925f['t'])('Other');return _0x1cd465['length']?'groupId'in _0x1cd465[0x0]?_0x1cd465:[{'groupId':vi,'groupLabel':_0x314168,'order':0x1/0x0,'commands':_0x1cd465}]:[{'groupId':vi,'groupLabel':_0x314168,'order':0x1/0x0,'commands':[]}];}const yi=globalThis['DataTransfer'],Ni='ai-ui';var xi=class extends _0x622916{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {editor:_0x1c092d}=this,_0x1bb2ca=['ck-fake-ai-selection'];_0x1c092d['config']['get']('ai.assistant.useTheme')&&_0x1bb2ca['push']('ck-ai-assistant-ui_theme'),_0x1c092d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ni,'view':{'classes':_0x1bb2ca,'priority':0xc}}),_0x1c092d['conversion']['for']('editingDowncast')['markerToElement']({'model':Ni,'view':(_0x5e0ed5,{writer:_0x226f9b})=>{if(!_0x5e0ed5['markerRange']['isCollapsed'])return null;const _0xdc7526=_0x226f9b['createUIElement']('span');return _0x226f9b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xdc7526),_0xdc7526;}});}afterInit(){!async function(_0xaf88be){const _0x34b69e='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0xd6831d=0x79128,_0x4b89cc=window['Date']['now'](),_0x3e0b68=_0xaf88be['editor'],_0x4a5594=new window['Promise'](_0x4ff2c0=>{_0x3e0b68['once']('ready',_0x4ff2c0);}),_0x15a13a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x39dc42=_0x3e0b68['config']['get']('licenseKey');async function _0x55a5a3(){let _0x41f1f5,_0x55e589=null,_0x145eee=null;try{return'GPL'==_0x39dc42?'NotAllowed':(_0x41f1f5=_0x40d265(),_0x41f1f5?(_0x41f1f5['usageEndpoint']&&(_0x145eee=_0x50da19(_0x41f1f5['usageEndpoint'],_0x41f1f5['jti'])),await _0x3c1492()?_0x37218a()?_0x26adcf()?'Expired':_0x422b61()?('evaluation'==_0x41f1f5['licenseType']&&(_0x55e589=_0xdb996a('EvaluationLimit')),await _0x7e414a()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x26adcf(){const _0x1e6f64=['evaluation','trial']['includes'](_0x41f1f5['licenseType'])?_0x4b89cc/0x3e8:0xe10*_0xd6831d;return _0x41f1f5['exp']<_0x1e6f64;}function _0x37218a(){const _0xcd0f02=_0x41f1f5['features'];return!!_0xcd0f02&&(!!_0xcd0f02['includes']('*')||!!_0xcd0f02['includes']('AI'));}function _0x422b61(){const _0x2715d7=_0x41f1f5['licensedHosts'];if(!_0x2715d7||0x0==_0x2715d7['length'])return!0x0;const {hostname:_0x64795a}=new URL(window['location']['href']);if(_0x2715d7['includes'](_0x64795a))return!0x0;const _0x259467=_0x64795a['split']('.');return _0x2715d7['filter'](_0x4f777a=>_0x4f777a['includes']('*'))['map'](_0x33a7ca=>_0x33a7ca['split']('.'))['filter'](_0x4e2ec4=>_0x4e2ec4['length']<=_0x259467['length'])['map'](_0x39f29d=>Array(_0x259467['length']-_0x39f29d['length'])['fill']('*'===_0x39f29d[0x0]?'*':'')['concat'](_0x39f29d))['some'](_0x997dcb=>_0x259467['every']((_0x22591f,_0x3037d2)=>_0x997dcb[_0x3037d2]===_0x22591f||'*'===_0x997dcb[_0x3037d2]));}function _0x7e414a(){return _0x55e589&&_0x145eee?new window['Promise']((_0x5677c8,_0x40f7f7)=>{_0x55e589['then'](_0x5677c8,_0x40f7f7),_0x145eee['then'](_0x4a4f76=>{'Valid'!=_0x4a4f76&&_0x5677c8(_0x4a4f76);},_0x40f7f7);}):_0x55e589||_0x145eee||'Valid';}}function _0x50da19(_0x1f4657,_0x1e9f3b){return new window['Promise'](_0xd8c662=>{if(_0x364547())return _0xd8c662('Valid');_0x2444b8(),_0x3e0b68['decorate']('_sendUsageRequest');let _0x6a4d0=!0x1;const _0x13f6f5=kt();function _0x26895d(_0xac47b5){return!!_0xac47b5&&('object'==typeof _0xac47b5||'function'==typeof _0xac47b5)&&'function'==typeof _0xac47b5['then']&&'function'==typeof _0xac47b5['catch'];}function _0x212971(_0x1f94e9){_0xb6bb3c(_0x1f94e9)['then'](_0x2b1c35=>_0x2b1c35&&'ok'==_0x2b1c35['status']?_0x48d266(_0x23196d(_0x13f6f5+_0x1e9f3b))!=_0x2b1c35['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x6b16dd=>(_0x391b49(),_0x6b16dd),()=>{const _0x3cd458=_0x5cf84b();return null==_0x3cd458?(_0x391b49(),'Valid'):_0x4b89cc-_0x3cd458>0x240c8400?'UsageLimit':'Valid';})['then'](_0xd8c662)['catch'](()=>{_0xd8c662('UsageLimit');});const _0x3aa19e=0x36ee80;function _0x391b49(){const _0x4c0546='llct-'+_0x48d266(_0x23196d(_0x1f4657)),_0x27ead3=_0x777390(_0x48d266(window['Math']['ceil'](_0x4b89cc/_0x3aa19e)));window['localStorage']['setItem'](_0x4c0546,_0x27ead3);}function _0x5cf84b(){const _0x1a6ebe='llct-'+_0x48d266(_0x23196d(_0x1f4657)),_0x3ed269=window['localStorage']['getItem'](_0x1a6ebe);return _0x3ed269?window['parseInt'](_0x777390(_0x3ed269),0x10)*_0x3aa19e:null;}function _0xb6bb3c(_0x49a50d){return new window['Promise']((_0x2df24f,_0x53db51)=>{_0x49a50d['then'](_0x2df24f,_0x53db51),window['setTimeout'](_0x53db51,0x1d4c0);});}}_0x3e0b68['on']('_sendUsageRequest',(_0x3b7ffa,_0x431e96)=>{if(_0x431e96[0x0]!=_0x1f4657)return _0xd8c662('UsageLimit');_0x431e96[0x1]={..._0x431e96[0x1],'requestId':_0x13f6f5};},{'priority':'high'}),_0x3e0b68['on']('_sendUsageRequest',_0x2f767f=>{_0x26895d(_0x2f767f['return'])&&(_0x6a4d0=!0x0,_0x212971(_0x2f767f['return']));},{'priority':'low'}),_0x4a5594['then'](()=>{_0x6a4d0||_0xd8c662('UsageLimit');});});function _0x364547(){return'auto'==_0x3e0b68['editing']['view']['_overlayModeHint'];}function _0x2444b8(){_0x3e0b68['editing']['view']['_overlayModeHint']='auto';}}function _0xdb996a(_0x3a5957){const _0x36a1e8=[new window['Promise'](_0x46f80c=>setTimeout(_0x46f80c,0x93ecc)),_0x4a5594['then'](()=>new window['Promise'](_0x2afb0b=>{let _0x519741=0x0;_0x3e0b68['model']['on']('applyOperation',(_0x4a836c,_0x457da0)=>{_0x457da0[0x0]['isDocumentOperation']&&_0x519741++,0x5e8==_0x519741&&(_0x2afb0b(),_0x4a836c['off']());});}))];return window['Promise']['race'](_0x36a1e8)['then'](()=>_0x3a5957);}async function _0x57e89a(){await _0x4a5594,_0x3e0b68['model']['change']=_0x269bba,_0x3e0b68['model']['enqueueChange']=_0x269bba,_0x3e0b68['enableReadOnlyMode']('model');}function _0x501143(_0x3e3733){const _0x11f0a6=_0x37c2d4();_0x3e0b68[_0x11f0a6]='aiLicenseKey'+_0x3e3733,'Valid'!=_0x3e3733&&_0x57e89a();}function _0x37c2d4(){const _0xce0751=window['String'](window['performance']['now']())['replace']('.','');let _0x37d483='n';for(let _0x5bb09b=0x0;_0x5bb09b<_0xce0751['length'];_0x5bb09b+=0x2){let _0x4317c5=window['parseInt'](_0xce0751['substring'](_0x5bb09b,_0x5bb09b+0x2));_0x4317c5>=0x3e&&(_0x4317c5-=0x3e),_0x37d483+=_0x34b69e[_0x4317c5];}return _0x37d483;}function _0x40d265(){const _0x4282b9=_0x39dc42['split']('.');if(0x3!=_0x4282b9['length'])return null;return _0x4409e4(_0x4282b9[0x1]);function _0x4409e4(_0x47dfb9){const _0x3230ea=_0x3a96dd(_0x47dfb9);return _0x3230ea&&_0x3b596b()?_0x3230ea:null;function _0x3b596b(){const _0xc67928=_0x3230ea['jti'],_0x1c8dbd=window['parseInt'](_0xc67928['substring'](_0xc67928['length']-0x8),0x10),_0xab01f8={..._0x3230ea,'jti':_0xc67928['substring'](0x0,_0xc67928['length']-0x8)};return delete _0xab01f8['vc'],_0x23196d(_0xab01f8)==_0x1c8dbd;}}}async function _0x3c1492(){let _0x2977cb=!0x0;try{const [_0x7462bd,_0xdaec0a,_0x310bca]=_0x39dc42['split']('.');return _0x361865(_0x7462bd),await _0x9783b1(_0x7462bd,_0xdaec0a,_0x310bca),_0x2977cb;}catch{return!0x1;}function _0x361865(_0x207248){const _0x4567e3=_0x3a96dd(_0x207248);_0x4567e3&&'ES256'==_0x4567e3['alg']||(_0x2977cb=!0x1);}async function _0x9783b1(_0x34571f,_0x2b8f15,_0x3b346d){const _0x2c4f1a=window['Uint8Array']['from'](_0x3b8dfe(_0x3b346d),_0x281687=>_0x281687['charCodeAt'](0x0)),_0xb0fb98=new window['TextEncoder']()['encode'](_0x34571f+'.'+_0x2b8f15),_0x418f0=window['crypto']['subtle'];if(!_0x418f0)return;const _0x475f0e=await _0x418f0['importKey']('jwk',_0x15a13a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x418f0['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x475f0e,_0x2c4f1a,_0xb0fb98)||(_0x2977cb=!0x1);}}function _0x3a96dd(_0x21c2c2){return _0x21c2c2['startsWith']('ey')?JSON['parse'](_0x3b8dfe(_0x21c2c2)):null;}function _0x3b8dfe(_0x4a381e){return window['atob'](_0x4a381e['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x23196d(_0x1134d3){let _0xaff9b8=0x1505;function _0x3fccca(_0x4d7391){for(let _0x5b7c5a=0x0;_0x5b7c5a<_0x4d7391['length'];_0x5b7c5a++){const _0x15042f=_0x4d7391['charCodeAt'](_0x5b7c5a);_0xaff9b8=(_0xaff9b8<<0x5)+_0xaff9b8+_0x15042f,_0xaff9b8&=_0xaff9b8;}}function _0x36dbd4(_0x2fced5){Array['isArray'](_0x2fced5)?_0x2fced5['forEach'](_0x36dbd4):_0x2fced5&&'object'==typeof _0x2fced5?Object['entries'](_0x2fced5)['sort']()['forEach'](([_0x576f6d,_0x2c21ca])=>{_0x3fccca(_0x576f6d),_0x36dbd4(_0x2c21ca);}):_0x3fccca(window['String'](_0x2fced5));}return _0x36dbd4(_0x1134d3),_0xaff9b8>>>0x0;}function _0x48d266(_0x2d736b){return _0x2d736b['toString'](0x10)['padStart'](0x8,'0');}function _0x777390(_0x2fca49){return _0x2fca49['split']('')['reverse']()['join']('');}function _0x269bba(){}_0x501143(await _0x55a5a3());}(this);}showFakeVisualSelection(){const _0x123c22=this['editor']['model'];_0x123c22['change'](_0x1be8f9=>{const _0x2068b8=_0x123c22['document']['selection']['getRanges']();let _0x34e66d=0x0;for(const _0x358e76 of _0x2068b8){const _0x27d2ee=Ni+':'+_0x34e66d;if(_0x123c22['markers']['has'](_0x27d2ee))_0x1be8f9['updateMarker'](_0x27d2ee,{'range':_0x358e76});else{if(_0x358e76['start']['isAtEnd']){const _0x3d4172=_0x358e76['start']['getLastMatchingPosition'](({item:_0x1c098a})=>!_0x123c22['schema']['isContent'](_0x1c098a),{'boundaries':_0x358e76});_0x1be8f9['addMarker'](_0x27d2ee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1be8f9['createRange'](_0x3d4172,_0x358e76['end'])});}else _0x1be8f9['addMarker'](_0x27d2ee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x358e76});}_0x34e66d++;}});}hideFakeVisualSelection(){const _0x53219c=this['editor']['model'],_0x17359a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Ni));_0x17359a['length']&&_0x53219c['change'](_0x270ead=>{_0x17359a['forEach'](_0x47fdd2=>{_0x270ead['removeMarker'](_0x47fdd2);});});}insertContent(_0x3dea1b,_0x2f43a8){const _0x3e355b=this['_getAISelection'](),_0x5714e1=_0x2f43a8||_0x3e355b['getFirstRange']();this['editor']['model']['canEditAt'](_0x5714e1)&&this['editor']['model']['change'](_0x1bcc82=>{this['hideFakeVisualSelection'](),_0x2f43a8||this['_resetContentOfSelectedTableCells'](_0x1bcc82,_0x3e355b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5714e1,'writer':_0x1bcc82,'html':_0x3dea1b});});}insertContentBelow(_0x4c7293){const {model:_0x84bc1b}=this['editor'],_0x530d7a=this['_getAISelection']();_0x84bc1b['change'](()=>{const _0x95a836=this['_prepareTableInsertBelowPosition'](_0x4c7293,_0x530d7a)||this['_getDefaultInsertBelowPosition'](_0x530d7a);this['insertContent'](_0x4c7293,_0x95a836);});}_getAISelection(){const _0x385db0=this['editor']['model'],_0x37bb3e=Array['from'](_0x385db0['markers']['getMarkersGroup'](Ni))['map'](_0x2354f7=>_0x2354f7['getRange']());return _0x385db0['createSelection'](_0x37bb3e);}_pasteHTMLUsingClipboard({writer:_0x4bc4d0,html:_0x16d9b7,insertAt:_0x143e6a}){const {view:_0x35b83d}=this['editor']['editing'],_0x17f20c=this['editor']['plugins']['get'](_0x5d9c9d),_0x34f9bd=new yi();_0x34f9bd['setData']('text/html',_0x16d9b7);const _0x2d3a8b=new _0x1b1d52(_0x35b83d,new ClipboardEvent('paste',{'clipboardData':_0x34f9bd}),{'dataTransfer':new _0x1fcb27(_0x34f9bd)});_0x4bc4d0['setSelection'](_0x143e6a);const _0x19f77b=(_0x25f1c6,_0x1309e6)=>{_0x1309e6['resultRange']&&_0x4bc4d0['setSelection'](_0x1309e6['resultRange']);};_0x17f20c['once']('contentInsertion',_0x19f77b,{'priority':'lowest'}),_0x35b83d['document']['fire']('paste',_0x2d3a8b),_0x17f20c['off']('contentInsertion',_0x19f77b);}_getDefaultInsertBelowPosition(_0x316959){const {model:_0x8c74db}=this['editor'],_0x4f794a=Array['from'](_0x316959['getSelectedBlocks']());return _0x4f794a['length']?_0x8c74db['createPositionAfter'](_0x4f794a['pop']()):_0x316959['getLastPosition']();}_prepareTableInsertBelowPosition(_0x3a53b4,_0x42ce17){const {model:_0x11e4f9,plugins:_0x1bc29b}=this['editor'];if(_0x1bc29b['has']('TableUtils')){const _0x413328=_0x1bc29b['get']('TableUtils')['getSelectedTableCells'](_0x42ce17);if(_0x413328['length']){const _0x53a046=this['_getTableRowCountFromContent'](_0x3a53b4),_0x1c64c3=this['_createEmptyTableRows'](_0x413328,_0x53a046);return _0x11e4f9['createPositionAt'](_0x1c64c3,0x0);}}return null;}_getTableRowCountFromContent(_0x7a02b9){const _0x49dcd1=this['editor']['plugins']['get']('TableUtils'),_0x4af66a=this['editor']['data']['parse'](_0x7a02b9,'$documentFragment'),_0x5a4a5a=Array['from'](_0x4af66a['getChildren']())['filter'](_0x4363df=>_0x4363df['is']('element','table'));let _0xd45ac1=0x0;return _0x5a4a5a['forEach'](_0x387363=>{_0xd45ac1+=_0x49dcd1['getRows'](_0x387363);}),_0xd45ac1;}_createEmptyTableRows(_0x4356ba,_0x13badc){const _0x3b3625=this['editor']['plugins']['get']('TableUtils'),_0x4aa3e8=_0x3b3625['getRowIndexes'](_0x4356ba),_0xb466d2=_0x3b3625['getColumnIndexes'](_0x4356ba),_0x1a333c=_0x4aa3e8['last']+0x1,_0x4e3391=_0xb466d2['first'],_0x2ddb7f=_0x4356ba[0x0]['findAncestor']('table');for(let _0x4f340b=0x0;_0x4f340b<_0x13badc;_0x4f340b++)_0x3b3625['insertRows'](_0x2ddb7f,{'at':_0x1a333c});return _0x2ddb7f['getChild'](_0x1a333c)['getChild'](_0x4e3391);}_resetContentOfSelectedTableCells(_0x39cadb,_0xa73fc0){const {plugins:_0xeeec50}=this['editor'],{model:_0x3b9fd5}=_0x39cadb;_0xeeec50['has']('TableUtils')&&_0xeeec50['get']('TableUtils')['getSelectedTableCells'](_0xa73fc0)['length']&&_0x3b9fd5['deleteContent'](_0xa73fc0);}},Li=class extends _0x622916{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){if(!this['textAdapter'])throw new ct('aiadapter-text-adapter-not-set',null);}},Pi=class extends Error{constructor(_0x38fff2){super(_0x38fff2),this['name']='AIRequestError';}};function Di(_0x4eea9f,_0x403531,_0x3ec55b){const t=_0x4eea9f['t'];switch(_0x403531){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',_0x3ec55b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3ec55b);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'},_0x3ec55b);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x403531;}}var Hi=class extends _0x23b7b0{_commandDefinitions;constructor(_0x50f2d9,_0x4b43d7){super(_0x50f2d9),this['_commandDefinitions']=_0x4b43d7,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1ee660,_0x2c82f8,_0x505fe6)=>{this['isEnabled']&&(this['enabledCommandsIds']=Mi(this['_commandDefinitions'],_0x505fe6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xbf2e47,_0x55816b,_0x3b3254)=>{this['enabledCommandsIds']=_0x3b3254?Mi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x39531b=this['editor']['model'];this['_hasContext']=function(_0x34a53b){const _0x5df24b=_0x34a53b['document']['selection'];return _0x5df24b['isCollapsed']?0x0!==[..._0x5df24b['getSelectedBlocks']()]['length']&&![..._0x5df24b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x34a53b['hasContent'](_0x5df24b['getFirstRange']());}(_0x39531b);const _0x8ca639=_0x39531b['document']['selection'],_0x359de4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1e9e3e of _0x8ca639['getRanges']())for(const _0x808fc8 of _0x1e9e3e['getItems']())if(_0x808fc8['is']('element')&&_0x359de4['includes'](_0x808fc8['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}execute(_0x32c514='',_0x37d1ec='',_0x4ecdce='custom'){this['editor']['plugins']['get'](ts)['showUI'](_0x32c514,_0x37d1ec,_0x4ecdce);}};function Mi(_0x5259d4,_0x15ff99){const _0x1b002a=new Set();for(const _0x5cf883 of _0x5259d4['values']())(_0x15ff99||!0x1===_0x5cf883['requiresContent'])&&_0x1b002a['add'](_0x5cf883['id']);return Array['from'](_0x1b002a);}const Ui=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Vi=/* #__PURE__ -- @preserve */
24
+ At();var Bi=class extends Vi{editor;textAdapter;['view'];_sanitizationContainer;['_domParser'];['_xmlSerializer'];constructor(_0x48c6a5,_0x42dd7e,_0x1ca583){super(),this['editor']=_0x48c6a5,this['textAdapter']=_0x42dd7e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1ca583,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x26112c,_0x4fc689,_0x502ced)=>{this['view']['value']=this['_sanitizeHTML'](_0x502ced);}),this['listenTo'](this['view'],'submitPrompt',(_0x356616,_0xa6f168)=>{const _0x1aced=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xa6f168,_0x1aced,'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:_0x4c22db,query:_0x43672,htmlContent:_0x1ce343,label:_0x250d4d,mainActionLabel:_0x4695c2}){this['view']['prompt']=_0x250d4d,this['view']['mainAction']=_0x4695c2,this['initialContext']=_0x1ce343,_0x43672&&(this['view']['isRendered']?this['_handleQuery'](_0x43672,_0x1ce343,_0x4c22db,_0x250d4d):this['view']['once']('render',()=>{this['_handleQuery'](_0x43672,_0x1ce343,_0x4c22db,_0x250d4d);}));}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'](_0x256f66,_0x43cc47,_0x445cdd,_0x29946d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x43cc47,this['previousQuery']=_0x256f66,this['previousLabel']=_0x29946d||_0x256f66,this['previousActionId']=_0x445cdd,new Promise(_0x1c5bf6=>{this['textAdapter']['makeRequest']({'query':_0x256f66,'context':_0x43cc47,'onData':_0x8f23c9=>{this['currentResponse']=_0x8f23c9,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x445cdd})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x417d14=>{_0x417d14 instanceof Pi?this['view']['handleError'](_0x417d14['message']):this['view']['handleError'](),_0x1c5bf6();})['finally'](()=>{this['stopProcessing'](),_0x1c5bf6();});});}_parseAndNormalizeContent(_0x446bbe,_0xcf91c8=!0x1){const _0x273b58=Ui['exec'](_0x446bbe);_0x446bbe=_0x273b58?_0x446bbe['substring'](_0x273b58[0x1]['length']):_0x446bbe['length']<0x64&&!_0xcf91c8?'':this['_stripMarkdownSyntax'](_0x446bbe);const _0x109fc5=this['_domParser']['parseFromString'](_0x446bbe,'text/html');if(_0x273b58){const _0x22a971=Array['from'](_0x109fc5['body']['childNodes']);_0x22a971['reverse']();for(const _0xf4c7b4 of _0x22a971){if(_0xf4c7b4['nodeType']==Node['ELEMENT_NODE'])break;_0xf4c7b4['remove']();}}const _0x12ee43=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x109fc5['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12ee43);const _0x385f0e=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4f2cf8=this['editor']['data']['toModel'](_0x12ee43);return _0x385f0e||_0x4f2cf8['markers']['clear'](),this['editor']['data']['stringify'](_0x4f2cf8);}['_normalizeResponseHeadings'](_0x11c1f7){const _0x48b193=new _0x6705a7(this['editor']['editing']['view']['document']),_0x491b37=new _0x34dbd2({'name':/^h[1-5]$/}),_0x4e4340=[];let _0x5ef88b=!0x1;for(const _0x2f7d1b of _0x11c1f7)_0x2f7d1b['is']('element')&&_0x491b37['match'](_0x2f7d1b)&&(_0x4e4340['push'](_0x2f7d1b),'h1'==_0x2f7d1b['name']&&(_0x5ef88b=!0x0));if(_0x5ef88b){for(const _0x2f7aa2 of _0x4e4340)_0x48b193['rename']('h'+(parseInt(_0x2f7aa2['name'][0x1])+0x1),_0x2f7aa2);}}_isH1TagSupportEnabled(){const {data:_0x58b0a0,editing:_0x337585}=this['editor'],_0x5d9f1d=_0x58b0a0['htmlProcessor']['toView']('<h1></h1>'),_0x5cc3dd=_0x58b0a0['toView'](_0x58b0a0['toModel'](_0x5d9f1d));return!!_0x337585['view']['domConverter']['viewToDom'](_0x5cc3dd)['querySelector']('h1');}_sanitizeHTML(_0x38d14d){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x38d14d),this['_sanitizationContainer']['innerHTML'];}_stripMarkdownSyntax(_0x36e024){const _0x30add2=_0x36e024['trim']();return _0x30add2['startsWith']('```html')?_0x30add2['endsWith']('```')?_0x30add2['substring'](0x7,_0x30add2['length']-0x3):_0x30add2['substring'](0x7):_0x36e024;}};const Gi={'REPLACE':'replace','INSERT':'insert'};var Fi=class extends _0x54b9b5{constructor(_0x336386){super(_0x336386),this['set']('isVisible',!0x1),this['set']('mainAction',Gi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2e5b91=>Di(_0x336386,'AI_'+_0x2e5b91['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Di(_0x336386,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Di(_0x336386,'Try\x20again')),this['stopButton']=this['_createButton'](Di(_0x336386,'Stop'));const _0x41d6db=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x41d6db['if']('isVisible','ck-hidden',_0x57d4d0=>!_0x57d4d0)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}_createButton(_0x36cd26,_0x49e9ca){const _0xb00106=new Mt(this['locale']);return _0xb00106['set']({'label':_0x36cd26,'class':_0x49e9ca||'','isVisible':!0x0,'withText':!0x0}),_0xb00106;}},Ki=class extends _0x56a514{contentFieldView;copyButtonView;constructor(_0x5101df,_0x5f2ba0=''){super(_0x5101df),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5b374a=this['bindTemplate'];this['contentFieldView']=new Wi(_0x5101df,_0x5f2ba0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5b374a['if']('isVisible','ck-hidden',_0x597fe5=>!_0x597fe5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5b374a['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 _0x115e35=!0x1;this['on']('change:value',(_0x5b53ac,_0x426fac,_0xc14bd2)=>{const _0x3ffecb=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xc14bd2),this['isProcessing']&&_0x3ffecb&&!_0x115e35&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1bba47,_0xa6e97,_0x1c9453)=>{_0x115e35=!0x1,_0x1c9453?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x115e35=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x115e35=!0x0;});}['focus'](){this['element']['focus']();}_createCopyButton(){const _0x5f2871=this['locale'],_0x2a0207=new Mt(this['locale']),_0x4b76f2='ck-ai-form__copy-button';return _0x2a0207['set']({'label':Di(_0x5f2871,'Copy'),'icon':_0xaeff50,'class':_0x4b76f2,'tooltip':!0x0}),_0x2a0207['bind']('isVisible')['to'](this,'value',_0x512687=>!!_0x512687),_0x2a0207['bind']('isEnabled')['to'](this,'isProcessing',_0xd7b9e0=>!_0xd7b9e0),_0x2a0207['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2a0207['icon']=_0x48b061,_0x2a0207['class']=_0x4b76f2+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2a0207['icon']=_0xaeff50,_0x2a0207['class']=_0x4b76f2;},0x3e8);}),_0x2a0207;}['_copyHTMLToClipboard'](_0x5e987b){const {window:_0x732931,document:_0x3bf52e}=wt;if(_0x732931['ClipboardItem']){const {Blob:_0x333312,ClipboardItem:_0x1c9124}=_0x732931,_0x40f60f=[new _0x1c9124({'text/html':new _0x333312([_0x5e987b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x333312([_0x5e987b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x40f60f);}else{const _0x43a484=_0x3bf52e['createElement']('div');_0x43a484['style']['position']='absolute',_0x43a484['style']['left']='-9999px',_0x43a484['innerHTML']='<span>[</span>'+_0x5e987b['innerHTML']+'<span>]</span>',_0x3bf52e['body']['appendChild'](_0x43a484);const _0x2fdddb=_0x3bf52e['createRange']();_0x2fdddb['setStartAfter'](_0x43a484['firstElementChild']),_0x2fdddb['setEndBefore'](_0x43a484['lastElementChild']);const _0x55a5e9=_0x732931['getSelection']();_0x55a5e9['removeAllRanges'](),_0x55a5e9['addRange'](_0x2fdddb),_0x3bf52e['execCommand']('copy'),_0x43a484['remove']();}}},Wi=class extends _0x56a514{constructor(_0x2aaae3,_0x58bd6d=''){super(_0x2aaae3),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x58bd6d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}setContent(_0x194c37){this['element']['innerHTML']=_0x194c37;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}_createLoader(){const _0x100a46=new _0x56a514(),_0xf4be68=this['locale'],_0x5bd59d=new _0x14cb96();return _0x5bd59d['isVisible']=!0x0,_0x100a46['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5bd59d,{'text':Di(_0xf4be68,'AI\x20is\x20writing...')}]}),_0x100a46['render'](),_0x100a46;}},Yi=class extends _0x56a514{constructor(_0x63dfb0,_0x4b78a8=''){super(_0x63dfb0);const _0x4c826f=new $t(),_0xc66040=this['bindTemplate'];this['set']('text',_0x4b78a8),_0x4c826f['content']=_0x309d45,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4c826f,{'text':_0xc66040['to']('text')}]});}},$i=class extends Nt{submitButtonView;showHistoryButtonView;constructor(_0xb76363,_0x22a3e3){super(_0xb76363,_0x22a3e3),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',(_0x45d53d,_0x425368)=>{_0x45d53d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x425368());});}_createSubmitButton(){const _0x1e9bfc=new Mt(this['locale']),_0x737da2=this['locale'];return _0x1e9bfc['set']({'icon':nt,'label':Di(_0x737da2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1e9bfc['on']('execute',()=>{this['submit']();}),_0x1e9bfc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x481a5f,_0x35aad2)=>!_0x481a5f&&_0x35aad2),_0x1e9bfc;}_createShowHistoryButton(){const _0x100f78=new Mt(this['locale']),_0x5ccbec=this['resultsView'],_0x1792f7=this['locale'];_0x100f78['set']({'label':Di(_0x1792f7,'History'),'withText':!0x1,'icon':_0x4afa16,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x100f78['bind']('isOn')['to'](_0x5ccbec,'isVisible'),_0x100f78['bind']('isEnabled')['to'](this,'isEnabled'),_0x100f78['on']('execute',()=>{_0x5ccbec['isVisible']=!_0x5ccbec['isVisible'],_0x5ccbec['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2a43dc=()=>{wt['window']['requestAnimationFrame'](()=>{if(ft(this['element'])){const _0x42fab4=new It(this['queryView']['fieldView']['element']),_0x9e5265=_0x42fab4['width'],_0x3f243e='rtl'===_0x1792f7['uiLanguageDirection']?'left':'right';_0x42fab4['excludeScrollbarsAndBorders'](),_0x100f78['element']['style'][_0x3f243e]=_0x9e5265-_0x42fab4['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2a43dc),this['on']('render',_0x2a43dc),_0x100f78;}submit(){const _0x1feb42=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1feb42);}['focus'](_0x4411c1){-0x1===_0x4411c1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},qi=class extends Jt{historyGroupView;clearHistoryButton;constructor(_0x64065d){super(_0x64065d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new zt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Di(_0x64065d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}filter(){let _0x27ed6e=0x0;for(const _0x34ceca of this['items'])_0x27ed6e+=_0x34ceca['items']['length'];return{'resultsCount':_0x27ed6e,'totalItemsCount':_0x27ed6e};}_createClearHistoryButton(){const _0x18f424=this['locale'],_0x4fce27=new Mt(this['locale']);return _0x4fce27['set']({'label':'('+Di(_0x18f424,'Clear')+')','withText':!0x0}),_0x4fce27['on']('execute',()=>this['fire']('clearHistory')),_0x4fce27;}},Qi=class extends jt{constructor(_0x2a8d6a){super();const _0x3a1e34=new Dt(),_0x53cb00=new Mt(this['locale'],_0x3a1e34);this['children']['add'](_0x53cb00),_0x53cb00['set']({'label':_0x2a8d6a['prompt'],'withText':!0x0}),_0x53cb00['on']('execute',()=>{this['fire']('execute',{'value':_0x2d8c2d(_0x2a8d6a['prompt'])});});}};const Xi='CKEditor/AIFormView/PromptHistory';var zi=class extends lt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x51c9df,_0x10524a)=>{const _0x23592b=ji(_0x10524a['prompt']);for(const _0x3df424 of this)if(_0x3df424!=_0x10524a&&ji(_0x3df424['prompt'])===_0x23592b){this['remove'](_0x3df424);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}_loadFromSessionStorage(){const _0x3a972f=sessionStorage['getItem'](Xi)||'[]';this['addMany'](JSON['parse'](_0x3a972f));}_saveToSessionStorage(){sessionStorage['setItem'](Xi,JSON['stringify'](this['map'](_0x317e32=>_0x317e32)));}};function ji(_0x2cf010){return _0x2cf010['toLowerCase']()['trim']();}var Ji=class extends _0x56a514{['focusTracker'];keystrokes;contentArea;toolbar;promptView;['errorView'];['_focusables'];['focusCycler'];_promptHistory;constructor(_0x5b57c7,_0x4428fa,_0x42ac1e=''){super(_0x5b57c7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Gi['REPLACE']),this['_promptHistory']=new zi(),this['errorView']=new Yi(_0x5b57c7),this['contentArea']=new Ki(_0x5b57c7,_0x42ac1e),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 _t(),this['keystrokes']=new gt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ft({'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 _0x533760=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4428fa],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x533760['if']('isError','ck-hidden',_0x50694e=>!_0x50694e)]},'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'](_0x21ec59=0x1){-0x1===_0x21ec59?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 _0x11724c=this['locale'],_0x4af930=new $i(_0x11724c,{'queryView':{'label':Di(_0x11724c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3cc43c,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Di(_0x11724c,'Empty\x20history'),'secondary':Di(_0x11724c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4af930['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x20487a,_0x2f049c)=>_0x20487a&&!_0x2f049c),this['listenTo'](_0x4af930,'submit',(_0xf72583,_0xa6d069)=>{this['prompt']=_0xa6d069;const _0x3a2160=_0x15f5d8(_0xa6d069);this['fire']('submitPrompt',_0x3a2160),_0xa6d069['trim']()&&this['_promptHistory']['add']({'prompt':_0x3a2160},0x0);},{'priority':'high'}),_0x4af930;}_createHistoryView(){const _0x154967=new qi(this['locale']);return _0x154967['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Qi),_0x154967['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x154967;}_createToolbar(){const _0x1d6a30=new Fi(this['locale']);return _0x1d6a30['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x381d1a,_0x52af40,_0x40bdff)=>_0x381d1a&&!_0x52af40&&!!_0x40bdff),_0x1d6a30['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1d6a30['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x178959,_0xee9e29,_0xacf4af)=>_0x178959&&!_0xee9e29&&!!_0xacf4af),_0x1d6a30['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1d6a30['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x111e02,_0x338eb3)=>_0x111e02&&!_0x338eb3),_0x1d6a30['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1d6a30['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1d6a30['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1d6a30;}startProcessing(){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x460af4=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Di(_0x460af4,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x99371){const _0x53dc14=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x99371||Di(_0x53dc14,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const Zi=globalThis['DataTransfer'];var ts=class extends _0x622916{['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[_0x6355f1,xi,Li,Ut];}constructor(_0x2d5ef6){super(_0x2d5ef6),_0x2d5ef6['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2d5ef6['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2d5ef6['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2d5ef6['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}init(){const {editor:_0x277b5a}=this;this['_aiAdapter']=_0x277b5a['plugins']['get'](Li),this['_dialog']=_0x277b5a['plugins']['get'](Ut),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x244854=new Hi(_0x277b5a,Array['from'](this['_commandDefinitions']['values']()));_0x277b5a['commands']['add']('showAIAssistant',_0x244854),_0x277b5a['ui']['componentFactory']['add']('aiCommands',_0x358f45=>{const _0x155991=_0x48403c(_0x358f45);return _0x155991['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x155991['buttonView']['set']({'label':Di(_0x358f45,'AI\x20Commands'),'icon':_0xbfdde1,'tooltip':!0x0}),_0x155991['on']('execute',_0x1ef60b=>this['_onExecute'](_0x1ef60b['source']['id'])),_0x1ce06a(_0x155991,_0x277b5a['ui']['view']['body'],function(_0x5e0adc){const _0x480ed6=is(_0x5e0adc,ki(_0x5e0adc['config']['get']('ai.assistant.commands'),_0x5e0adc['locale']))['filter'](_0x57bd2b=>_0x57bd2b['commands']['length']);return 0x1===_0x480ed6['length']?is(_0x5e0adc,_0x480ed6[0x0]['commands'])['map'](_0x5a475c=>({'id':_0x5a475c['id'],'label':_0x5a475c['label']})):_0x480ed6['map'](_0x2a8156=>{const {groupId:_0x20c51d,groupLabel:_0x1e24c6,commands:_0x1de4c7}=_0x2a8156,_0x12473d=is(_0x5e0adc,_0x1de4c7)['map'](_0x1fdc0d=>({'id':_0x1fdc0d['id'],'label':_0x1fdc0d['label']}));return{'id':_0x20c51d,'menu':_0x1e24c6||_0x20c51d,'children':_0x12473d};});}(_0x277b5a),{'ariaLabel':Di(_0x358f45,'AI\x20Commands')}),_0x155991['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x244854['on']('change:enabledCommandsIds',_0x198215),_0x155991['menuView']['once']('render',_0x198215),_0x155991;function _0x198215(){_0x155991['isEnabled']=_0x244854['enabledCommandsIds']['length']>0x0;for(const _0x46d3f1 of _0x155991['menuView']['buttons'])_0x46d3f1['isEnabled']=_0x244854['enabledCommandsIds']['includes'](_0x46d3f1['id']);}}),_0x277b5a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x23642a=>{const _0x31e2b9=new _0x1021d4(_0x23642a);_0x31e2b9['buttonView']['set']({'label':Di(_0x23642a,'AI\x20Commands'),'icon':_0xbfdde1}),_0x31e2b9['bind']('isEnabled')['to'](_0x244854,'enabledCommandsIds',_0x4c76e0=>_0x4c76e0['length']>0x0);const _0xf52869=ki(_0x277b5a['config']['get']('ai.assistant.commands'),_0x23642a);return this['_populateMenuBarMenu'](_0x244854,_0x31e2b9,_0xf52869,_0x11c549=>this['_onExecute'](_0x11c549)),_0x31e2b9;}),_0x277b5a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1d31bb=this['_createAIAssistantUIButton'](Mt);return _0x1d31bb['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1d31bb;}),_0x277b5a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x30d559=this['_createAIAssistantUIButton'](Zt);return _0x30d559['set']({'role':'menuitemcheckbox'}),_0x30d559;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x44e4cf=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x307fc4;for(const _0x441914 in _0x44e4cf){const _0x542d06=_0x441914,_0x55633e=_0x44e4cf[_0x542d06];if('aiLicenseKeyValid'==_0x55633e||'aiLicenseKeyInvalid'==_0x55633e||'aiLicenseKeyExpired'==_0x55633e||'aiLicenseKeyDomainLimit'==_0x55633e||'aiLicenseKeyNotAllowed'==_0x55633e||'aiLicenseKeyEvaluationLimit'==_0x55633e||'aiLicenseKeyUsageLimit'==_0x55633e){delete _0x44e4cf[_0x542d06],_0x307fc4=_0x55633e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x307fc4&&_0x44e4cf['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x307fc4&&_0x44e4cf['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x307fc4&&_0x44e4cf['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x307fc4&&_0x44e4cf['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x307fc4&&_0x44e4cf['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x307fc4&&_0x44e4cf['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3a9d79='',_0x556bc5='',_0xf76049='custom'){const _0x1745cc=this['editor'],_0x7871a7=_0x1745cc['editing']['view'],_0x34fea3=_0x1745cc['plugins']['get'](xi),_0x33886d=_0x1745cc['plugins']['get'](_0x6355f1);_0x34fea3['showFakeVisualSelection']();const _0x4369b6=new Zi(),_0x3489f2=new ClipboardEvent('copy',{'clipboardData':_0x4369b6}),_0x2fc607=new _0x1fcb27(_0x4369b6),_0x3aca91=new _0x1b1d52(_0x7871a7,_0x3489f2,{'dataTransfer':_0x2fc607});_0x33886d['_forceMarkersCopy']('comment',()=>{_0x7871a7['document']['fire']('copy',_0x3aca91);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Bi(_0x1745cc,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2076a2=_0x2fc607['getData']('text/html');const _0x1428f5=_0x1745cc['model']['document']['selection'],_0x21d2f6=Array['from'](_0x1428f5['getRanges']());0x1===_0x21d2f6['length']&&_0x21d2f6[0x0]['isFlat']&&!_0x1428f5['getSelectedElement']()&&''!==_0x2076a2['replace'](/&nbsp;/g,'')['trim']()&&(_0x2076a2='<p>'+_0x2076a2+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xf76049,'query':_0x3a9d79,'htmlContent':_0x2076a2,'label':_0x556bc5,'mainActionLabel':Gi[_0x1745cc['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x59f1b5,'title':Di(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Vt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x34fea3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}_getResolvedCommandsDefinitions(){const _0x498104=new Map(),_0x11821c=ki(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4baf2b of _0x11821c)for(const _0x35b36c of _0x4baf2b['commands'])_0x498104['set'](_0x35b36c['id'],{..._0x35b36c,'groupId':_0x4baf2b['groupId'],'groupLabel':_0x4baf2b['groupLabel']||_0x4baf2b['groupId']});return _0x498104;}_createAIAssistantUIButton(_0x26d95c){const _0x1ff665=this['editor'],_0x329ef9=_0x1ff665['commands']['get']('showAIAssistant'),_0x5507cc=new _0x26d95c(_0x1ff665['locale']);return _0x5507cc['set']({'label':Di(_0x1ff665['locale'],'AI\x20Assistant'),'icon':_0x59f1b5,'isToggleable':!0x0}),_0x5507cc['bind']('isEnabled')['to'](_0x329ef9),_0x5507cc['bind']('isOn')['to'](this['_dialog'],'id',_0x1afb8f=>'aiAssistant'===_0x1afb8f),this['listenTo'](_0x5507cc,'execute',()=>{_0x5507cc['isOn']?this['hideUI']():_0x329ef9['execute']();}),_0x5507cc;}_initView(){const _0x1a8af6=this['editor']['plugins']['get'](xi);this['_formView']=new Ji(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',()=>{_0x1a8af6['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1a8af6['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}_initAriaAiStatusChangeAnnouncements(){const {locale:_0xd7df55,ui:{ariaLiveAnnouncer:_0x57cad7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x66121d,_0x215ea3,_0xdf0581)=>{const _0x439a3c=this['_aiAssistantController']['currentContext'];_0xdf0581?_0x57cad7['announce'](Di(_0xd7df55,'AI\x20is\x20writing')):_0x439a3c&&_0x57cad7['announce'](Di(_0xd7df55,'Generated\x20content:\x20%0',_0x439a3c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x6ef677,_0x31d24f,_0x38bd08)=>{if(_0x38bd08){const _0x3d3676=this['_formView']['errorView']['text'];_0x57cad7['announce'](Di(_0xd7df55,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3d3676));}});}_onExecute(_0x56df7c){const _0x4ea633=this['_commandDefinitions']['get'](_0x56df7c),_0x1e3a08=this['editor'],_0x1a9bdd=_0x1e3a08['model']['document']['selection'],_0x1a655b=_0x1e3a08['commands']['get']('showAIAssistant'),_0x10faee=_0x1e3a08['plugins']['get'](xi),_0x541024=''+('_ungrouppedCommands'!==_0x4ea633['groupId']?_0x4ea633['groupLabel']+':\x20':'')+_0x4ea633['label'];if(!0x1!==_0x4ea633['requiresContent']&&_0x1a9bdd['isCollapsed']){const _0x571b2f=mt(_0x1a9bdd['getSelectedBlocks']())||_0x1e3a08['model']['schema']['getLimitElement'](_0x1a9bdd);_0x1e3a08['model']['change'](_0x1e6be0=>{_0x1e6be0['setSelection'](_0x571b2f,'in');});}_0x10faee['showFakeVisualSelection'](),_0x1a655b['execute'](_0x4ea633['prompt'],_0x541024,'command:'+_0x56df7c);}_populateMenuBarMenu(_0x17d081,_0x42a0d9,_0x5cf087,_0xbc39f){const _0x148d68=this['editor'],_0x1627ad=_0x148d68['locale'],_0x3a9112=new _0x14eb7a(_0x1627ad),_0x261025=is(_0x148d68,_0x5cf087)['filter'](_0x198c71=>_0x198c71['commands']['length']);0x1===_0x261025['length']?this['_getMenuBarGroupButtons']({'command':_0x17d081,'commands':_0x261025[0x0]['commands'],'parentMenuView':_0x42a0d9,'onExecute':_0xbc39f})['forEach'](_0xdab92=>_0x3a9112['items']['add'](_0xdab92)):_0x261025['forEach'](({groupId:_0x489ac2,groupLabel:_0x5ec660,commands:_0x3adbc6})=>{const _0x3f7219=new te(_0x1627ad,_0x42a0d9),_0x37d3db=new _0x1021d4(_0x1627ad),_0x42fc78=new _0x14eb7a(_0x1627ad),_0x478306=this['_getMenuBarGroupButtons']({'command':_0x17d081,'commands':_0x3adbc6,'parentMenuView':_0x37d3db,'onExecute':_0xbc39f});_0x37d3db['buttonView']['set']({'label':_0x5ec660||_0x489ac2}),_0x37d3db['delegate']('execute')['to'](_0x42a0d9),_0x42fc78['items']['addMany'](_0x478306),_0x37d3db['panelView']['children']['add'](_0x42fc78),_0x3f7219['children']['add'](_0x37d3db),_0x3a9112['items']['add'](_0x3f7219);}),_0x42a0d9['panelView']['children']['add'](_0x3a9112);}_getMenuBarGroupButtons({command:_0x411e75,commands:_0x4b0a49,parentMenuView:_0x5036a1,onExecute:_0x540759}){const _0xc9a926=this['editor'],_0x1ea0c4=_0xc9a926['locale'];return is(_0xc9a926,_0x4b0a49)['map'](_0x3f94e9=>{const _0x276f31=new te(_0x1ea0c4,_0x5036a1),_0x4e75f7=new Zt(_0x1ea0c4);return _0x4e75f7['set']({'label':_0x3f94e9['label']}),_0x4e75f7['delegate']('execute')['to'](_0x5036a1),_0x4e75f7['on']('execute',()=>_0x540759(_0x3f94e9['id'])),_0x4e75f7['bind']('isEnabled')['to'](_0x411e75,'enabledCommandsIds',_0x1956af=>_0x1956af['includes'](_0x3f94e9['id'])),_0x276f31['children']['add'](_0x4e75f7),_0x276f31;});}};function es(_0x4fc6dd,_0x304a9a){return void 0x0!==_0x4fc6dd['order']&&void 0x0===_0x304a9a['order']?0x1:void 0x0===_0x4fc6dd['order']&&void 0x0!==_0x304a9a['order']?-0x1:void 0x0!==_0x4fc6dd['order']&&void 0x0!==_0x304a9a['order']?_0x4fc6dd['order']-_0x304a9a['order']:0x0;}function is(_0x114844,_0x23dd36){_0x23dd36['sort'](es);const _0x3d2ad1={},_0x2e0095=[];for(const _0x3332f6 of _0x23dd36)if(void 0x0!==_0x3332f6['order']){if(_0x3332f6['order']in _0x3d2ad1)throw new ct('ai-commands-config-order-collision',_0x114844,{'conflictingDefinitions':[_0x3332f6,_0x3d2ad1[_0x3332f6['order']]]});_0x3d2ad1[_0x3332f6['order']]=_0x3332f6,_0x2e0095['splice'](_0x3332f6['order'],0x0,_0x3332f6);}else _0x2e0095['push'](_0x3332f6);return _0x2e0095;}var ss=class extends _0x622916{static get requires(){return[ts,xi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ba2ee){super(_0x2ba2ee);const _0x599a95=_0x2ba2ee['config'],_0xaf74e0=_0x2ba2ee['locale'];_0x599a95['define']('ai.assistant.preserveComments',!0x0),_0x599a95['define']('ai.assistant.commands',ns(_0xaf74e0)),_0x599a95['define']('ai.assistant.extraCommandGroups',[]),_0x599a95['define']('ai.assistant.removeCommands',[]);let _0x4437be=ki(_0x599a95['get']('ai.assistant.commands'),_0xaf74e0);const _0x393b5d=_0x599a95['get']('ai.assistant.extraCommandGroups'),_0xc712dd=_0x599a95['get']('ai.assistant.removeCommands');_0x393b5d['forEach'](_0x1d852f=>{const _0x1ba354=_0x4437be['find'](_0x51c901=>_0x51c901['groupId']===_0x1d852f['groupId']);_0x1ba354?_0x1ba354['commands']=_0x1ba354['commands']['concat'](_0x1d852f['commands']):_0x4437be['push'](_0x1d852f);}),_0x4437be=_0x4437be['filter'](_0x25d2c3=>!_0xc712dd['includes'](_0x25d2c3['groupId'])),_0x4437be['forEach'](_0x1bd396=>{_0x1bd396['commands']=_0x1bd396['commands']['filter'](_0xd3be7d=>!_0xc712dd['includes'](_0xd3be7d['id']));}),_0x599a95['set']('ai.assistant.commands',_0x4437be);}};function ns(_0x1d5d19){return[{'groupId':'editOrReview','groupLabel':Di(_0x1d5d19,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Di(_0x1d5d19,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Di(_0x1d5d19,'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':Di(_0x1d5d19,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Di(_0x1d5d19,'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':Di(_0x1d5d19,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Di(_0x1d5d19,'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':Di(_0x1d5d19,'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':Di(_0x1d5d19,'Change\x20tone'),'commands':[{'id':'professional','label':Di(_0x1d5d19,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Di(_0x1d5d19,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Di(_0x1d5d19,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Di(_0x1d5d19,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Di(_0x1d5d19,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Di(_0x1d5d19,'Change\x20style'),'commands':[{'id':'business','label':Di(_0x1d5d19,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Di(_0x1d5d19,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Di(_0x1d5d19,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Di(_0x1d5d19,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Di(_0x1d5d19,'Translate'),'commands':[{'id':'translateEnglish','label':Di(_0x1d5d19,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Di(_0x1d5d19,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Di(_0x1d5d19,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Di(_0x1d5d19,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Di(_0x1d5d19,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Di(_0x1d5d19,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Di(_0x1d5d19,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Di(_0x1d5d19,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var rs=class extends _0x622916{abortController;static get requires(){return[Li];}constructor(_0x187d9f){super(_0x187d9f),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(_0x511660){return this['sendRequest'](_0x511660)['catch'](_0x84b449=>{if(_0x84b449 instanceof Pi)return Promise['reject'](_0x84b449);if('AbortError'==_0x84b449['name'])return Promise['resolve']();throw console['error'](_0x84b449),new ct('aitextadapter-send-request-failed',null);});}async _prepareRequestHeaders(_0x410bfe,_0x4bd1b9){const _0x3e0ead=this['editor']['locale'],_0x17dfef={'Content-Type':'application/json'};if('object'==typeof _0x410bfe)Object['assign'](_0x17dfef,_0x410bfe);else{if(_0x410bfe)try{const _0x5a58f1=await _0x410bfe(_0x4bd1b9);Object['assign'](_0x17dfef,_0x5a58f1);}catch{return Promise['reject'](new Pi(Di(_0x3e0ead,'AI_ERROR_GET_HEADERS')));}}return _0x17dfef;}async _prepareRequestParameters(_0x31ff3b,_0x135bed){const _0x4732c6=this['editor']['locale'];if('object'==typeof _0x31ff3b)return _0x31ff3b;try{return await _0x31ff3b(_0x135bed);}catch{return Promise['reject'](new Pi(Di(_0x4732c6,'AI_ERROR_GET_PARAMETERS')));}}},os=class extends rs{['_apiUrl'];_requestHeaders;_requestParameters;static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x7e265a){super(_0x7e265a),_0x7e265a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x7e265a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x7e265a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x7e265a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x7e265a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x7e265a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async sendRequest({query:_0xbcb2b4,context:_0x12d72e,onData:_0x1ab670,actionId:_0x4588a7}){const _0x4bedef=this['editor']['locale'],_0x2997ca=await this['prepareMessages'](_0xbcb2b4,_0x12d72e,_0x4588a7),_0x11d985=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4588a7),_0x42b278=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4588a7),_0x44f6f6={'messages':_0x2997ca,..._0x42b278},_0x2686dc={'method':'POST','headers':_0x11d985,'body':JSON['stringify'](_0x44f6f6),'signal':this['abortController']['signal']},_0x1d2846=await fetch(this['_apiUrl'],_0x2686dc);if(_0x1d2846['ok'])return _0x42b278['stream']?await this['_readStreamableResponse'](_0x1d2846,_0x1ab670):await this['_readStaticResponse'](_0x1d2846,_0x1ab670),Promise['resolve']();{const _0x33ce59=await _0x1d2846['text']();return _0x33ce59['includes']('context_length_exceeded')?Promise['reject'](new Pi(Di(_0x4bedef,'AI_ERROR_CONTEXT_LENGTH'))):_0x33ce59['includes']('Moderation')?Promise['reject'](new Pi(Di(_0x4bedef,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x33ce59));}}async['prepareMessages'](_0x2ed1b3,_0x276f8e,_0x187940){let _0x228395,_0x4d669b;return _0x276f8e?(_0x228395='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.',_0x4d669b='Instruction:\x0a'+_0x2ed1b3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x276f8e):(_0x228395='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.',_0x4d669b=_0x2ed1b3),[{'role':'system','content':_0x228395},{'role':'user','content':_0x4d669b}];}async _readStreamableResponse(_0x28a17d,_0x220cbe){const _0x48c8e9=_0x28a17d['body']['getReader'](),_0x5baf24=new TextDecoder();let _0x3aa9ed='',_0x103ff7='',_0x5c6af5='',_0x4b1964=!0x1;for(;!_0x4b1964;){const {done:_0x83346f,value:_0x5a5ee2}=await _0x48c8e9['read'](),_0x5841d3=_0x3aa9ed+_0x5baf24['decode'](_0x5a5ee2);let _0x2f7922;_0x4b1964=_0x83346f;try{_0x2f7922=this['_cleanUpData'](_0x5841d3),_0x3aa9ed='';}catch{_0x3aa9ed=_0x5841d3;continue;}_0x103ff7+=_0x2f7922,!_0x4b1964&&this['_isBufferIncomplete'](_0x103ff7)||_0x103ff7&&(_0x5c6af5+=_0x103ff7,_0x103ff7='',_0x220cbe(_0x5c6af5));}return Promise['resolve']();}async _readStaticResponse(_0x4dc338,_0x46f849){return _0x46f849((await _0x4dc338['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}_isBufferIncomplete(_0x9a53b0){const _0x458344=_0x9a53b0['split']('<')['length']!==_0x9a53b0['split']('>')['length'],_0xfa86e0=_0x9a53b0['length']<0x1e;return _0x458344&&_0xfa86e0;}_cleanUpData(_0x2b958f){return _0x2b958f['split'](/\n(?![^{]*\})/g)['map'](_0x172d40=>_0x172d40['replace']('data:\x20',''))['filter'](_0x4bed1c=>_0x4bed1c&&_0x4bed1c['length']>0x0&&'[DONE]'!==_0x4bed1c)['map'](_0x44e0e4=>{const {choices:_0xb5c825}=JSON['parse'](_0x44e0e4);if(_0xb5c825[0x0]?.['delta']?.['content'])return _0xb5c825[0x0]['delta']['content'];})['filter'](_0x54e123=>_0x54e123)['join']('');}},as=class extends rs{static get['pluginName'](){return'AWSTextAdapter';}init(){super['init'](),St('ai-aws-adapter-not-supported');}async sendRequest(_0x5ac51e){throw bt('ai-aws-adapter-not-supported'),new Pi(Di(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},hs=class extends Mt{constructor(_0xba2d52,_0x52a175={}){super(_0xba2d52),this['isToggleable']=!0x0,this['set']('side',_0x52a175['side']||'top');const _0xd729b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...vt(_0x52a175['class']||[]),_0xd729b['to']('side',_0x50ba2e=>'ck-tab-button_'+_0x50ba2e),_0xd729b['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},cs=class extends _0x56a514{['children'];constructor(_0x786fd,_0xf29f83={}){super(_0x786fd);const _0x13e12c=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...vt(_0xf29f83['class']||[]),_0x13e12c['to']('class'),_0x13e12c['if']('isVisible','ck-hidden',_0x52b618=>!_0x52b618)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},ls=class extends _0x56a514{buttonViews=this['createCollection']();['panelViews']=this['createCollection']();_tabs=new Map();constructor(_0x2fab01,_0xd6c61={}){super(_0x2fab01),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xd6c61['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xd6c61['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0x44a734,_0x434e74)=>_0x44a734&&!_0x434e74);const _0x5dc6b2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...vt(_0xd6c61['class']||[]),_0x5dc6b2['to']('side',_0x534e87=>'ck-tabs_'+_0x534e87),_0x5dc6b2['to']('class'),_0x5dc6b2['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x5dc6b2['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5dc6b2['to']('side',_0x353db4=>'ck-tabs__buttons-container_'+_0x353db4)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5dc6b2['to']('side',_0x16241d=>'ck-tabs__panels-container_'+_0x16241d)]},'children':this['panelViews']},...vt(_0xd6c61['children']||[])]});}getTabIds(){return[...this['_tabs']['keys']()];}getTab(_0x553ef3){const _0x2fd200=this['_tabs']['get'](_0x553ef3);return _0x2fd200||null;}['addTab'](_0x1d6687){const _0x2e0da2=this['_setupButton']({'id':_0x1d6687['id'],'label':_0x1d6687['buttonLabel'],'icon':_0x1d6687['buttonIcon'],'order':_0x1d6687['order']}),_0x228bf8=new cs(this['locale']);return _0x228bf8['render'](),_0x1d6687['content']&&_0x228bf8['children']['add'](_0x1d6687['content']),this['panelViews']['add'](_0x228bf8),this['_tabs']['set'](_0x1d6687['id'],{'button':_0x2e0da2,'panel':_0x228bf8,'order':void 0x0!==_0x1d6687['order']?_0x1d6687['order']:null}),this['fire']('addTab:'+_0x1d6687['id'],{'id':_0x1d6687['id'],'button':_0x2e0da2,'panel':_0x228bf8}),null===this['activeTab']?this['activateTab'](_0x1d6687['id']):this['_hidePanel'](_0x1d6687['id']),{'button':_0x2e0da2,'panel':_0x228bf8};}activateTab(_0x3320f6){if(null!==_0x3320f6&&!this['getTab'](_0x3320f6))throw new ct('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3320f6});if(this['isCollapsed']=!0x1,this['activeTab']===_0x3320f6)return;const _0x127c30=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3320f6,_0x3320f6&&this['_showPanel'](_0x3320f6),this['fire']('activateTab:'+_0x3320f6,{'newTab':_0x3320f6,'oldTab':_0x127c30});}toggleTabPanel(_0x56c8f3){this['activeTab']===_0x56c8f3?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x56c8f3);}['showTab'](_0x4f2bdd){if(!this['getTab'](_0x4f2bdd))throw new ct('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4f2bdd});this['_showPanel'](_0x4f2bdd),this['_showButton'](_0x4f2bdd),this['fire']('show:'+_0x4f2bdd,_0x4f2bdd);}['hideTab'](_0xc0f9ae){if(!this['getTab'](_0xc0f9ae))throw new ct('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xc0f9ae});const _0x2d4cc6=this['activeTab'];this['_hidePanel'](_0xc0f9ae),this['_hideButton'](_0xc0f9ae);const _0x96b789=this['getTabIds']();_0x2d4cc6===_0xc0f9ae&&_0x96b789['length']>0x1&&this['activateTab'](_0x96b789['find'](_0x751e6f=>_0x751e6f!==_0xc0f9ae)),this['fire']('hide:'+_0xc0f9ae,_0xc0f9ae);}_getPanel(_0x3f4c90){const _0x1f9878=this['_tabs']['get'](_0x3f4c90);return _0x1f9878?_0x1f9878['panel']:null;}['_showPanel'](_0x324d0b){null!==this['activeTab']&&this['activeTab']!==_0x324d0b||this['_getPanel'](_0x324d0b)['show']();}['_hidePanel'](_0xe13c4f){const _0x346ec8=this['_getPanel'](_0xe13c4f);_0x346ec8['isVisible']&&(this['activeTab']===_0xe13c4f&&(this['activeTab']=null),_0x346ec8['hide']());}_getButton(_0x32f3ca){const _0x5b321a=this['_tabs']['get'](_0x32f3ca);return _0x5b321a?_0x5b321a['button']:null;}_showButton(_0x9e4e0a){this['_getButton'](_0x9e4e0a)['show']();}_hideButton(_0x2ae12c){this['_getButton'](_0x2ae12c)['hide']();}_setupButton(_0x2f3ef3){const _0x59f0f9=new hs(this['locale'],{'side':this['side']}),_0x483d02=this['buttonViews'];if(_0x59f0f9['set']({'label':_0x2f3ef3['label'],'icon':_0x2f3ef3['icon'],'tooltip':!0x0,'withText':!0x0}),_0x59f0f9['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x1f697a,_0x4fd928)=>_0x1f697a===_0x2f3ef3['id']&&!_0x4fd928),_0x59f0f9['bind']('side')['to'](this,'side'),_0x2f3ef3['order']){const _0x54ea1b=[...this['_tabs']]['reduce']((_0x180cdf,_0x1ab333)=>{const _0xa31bf=_0x1ab333[0x0],{order:_0x243e76}=_0x1ab333[0x1];return!_0x243e76||_0x243e76>_0x2f3ef3['order']?_0x180cdf:_0x243e76>=_0x180cdf['order']?{'id':_0xa31bf,'order':_0x243e76}:_0x180cdf;},{'id':'','order':0x0}),_0x5a5639=_0x483d02['getIndex'](this['_getButton'](_0x54ea1b['id']));_0x483d02['add'](_0x59f0f9,_0x5a5639+0x1);}else _0x483d02['add'](_0x59f0f9);return _0x59f0f9['on']('execute',()=>{this['toggleTabPanel'](_0x2f3ef3['id']);}),_0x59f0f9;}};const us=['overlay','sidebar','custom'],ds=['left','right'];var _s=class extends ls{constructor(_0x303c6f,_0x35f570={}){super(_0x303c6f,_0x35f570),this['set']('type',_0x35f570['type']||'sidebar'),this['set']('side',_0x35f570['side']||'right'),this['set']('isVisible',_0x35f570['visibleByDefault']??!0x0);const _0x49910f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x49910f['if']('type','ck-ai-tabs__overlay',_0xb01292=>'overlay'===_0xb01292),_0x49910f['if']('type','ck-ai-tabs__sidebar',_0x15ae8c=>'sidebar'===_0x15ae8c),_0x49910f['if']('isVisible','ck-hidden',_0x1e307f=>!_0x1e307f)]}}),this['buttonViews']['on']('add',(_0x1ddd99,_0xe328a3)=>{_0xe328a3['set']('withText',!0x1);});}},gs=class extends _0x898608{['view'];container=null;showResizeButton=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2cbe50){if(super(_0x2cbe50),!this['context']['config']['get']('ai.container'))throw new ct('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x5ee929=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x5ee929['showResizeButton']&&(this['showResizeButton']=_0x5ee929['showResizeButton']),'sidebar'!==_0x5ee929['type']&&'overlay'!==_0x5ee929['type']||_0x5ee929['side']&&(this['side']=_0x5ee929['side']),'sidebar'===_0x5ee929['type']){if(this['container']=_0x5ee929['element'],this['set']('type','sidebar'),!this['container'])throw new ct('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5ee929['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new _s(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x5ee929['visibleByDefault'],'collapsible':_0x5ee929['collapsible']}),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 _0x24cd6f&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}switchType(_0x4d7c90){if(_0x4d7c90&&this['type']!==_0x4d7c90){if(!us['includes'](_0x4d7c90))throw new ct('ai-tabs-unsupported-ui-type');this['type']=_0x4d7c90;}}switchSide(_0x22b23b){if(_0x22b23b&&this['side']!==_0x22b23b){if(!ds['includes'](_0x22b23b))throw new ct('ai-tabs-unsupported-ui-side');this['side']=_0x22b23b;}}destroy(){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}};function As(_0x4eb4f9){return{..._0x4eb4f9,'type':'context'};}var Is=class extends _0x898608{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}_token;['_decoder'];static get requires(){return[_0x46601a];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x229ea9){if(super(_0x229ea9),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new ct('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder();}init(){const _0x508468=this['context']['plugins']['get'](_0x46601a);if(!_0x508468['token'])throw new ct('ai-missing-token',this);this['_token']=_0x508468['token'];}_getExtraHttpHeaders(){const _0x5d86f4=this['context']['config']['get']('ai.extraHttpHeaders'),_0x553dc5='function'==typeof _0x5d86f4?_0x5d86f4():_0x5d86f4;if(Array['isArray'](_0x553dc5)&&_0x553dc5['length'])return Object['fromEntries'](_0x553dc5['map'](({domain:_0x3bf43,headers:_0x3540f8})=>[_0x3bf43,_0x3540f8]));}startConversation(_0x4e0544,_0x15ade5){const _0x33e21e=this['_sendApiRequest']('/conversations','POST',{'id':_0x4e0544,'group':_0x15ade5});return{'getConversation':async()=>(await _0x33e21e['request'])['json'](),'abortController':_0x33e21e['abortController']};}queryAssistant({message:_0x33f89a,conversationId:_0x2596f9,parts:_0xa61e67,capabilities:_0x5ba9bd,model:_0x480c07,attributes:_0x13323c}){const _0x5e400e=this['_getExtraHttpHeaders'](),_0x168767={..._0x33f89a&&{'prompt':_0x33f89a},'content':_0xa61e67,'model':_0x480c07,..._0x5ba9bd&&{'capabilities':_0x5ba9bd},..._0x13323c&&{'attributes':_0x13323c},..._0x5e400e&&{'extraHttpHeaders':_0x5e400e}},_0xd9880f=this['_sendApiRequest']('/conversations/'+_0x2596f9+'/messages','POST',_0x168767,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x242fc9=(await _0xd9880f['request'])['body'];return this['_getStreamReader'](_0x242fc9);},'abortController':_0xd9880f['abortController']};}executeCustomAction({content:_0x15d659,message:_0x25c80c,model:_0x57605d,outputFormat:_0x6a6e91,contexts:_0x142c9a}){const _0x24b300={'content':[{'type':'text','content':_0x15d659}],..._0x25c80c&&{'prompt':_0x25c80c},'model':_0x57605d,'outputFormat':_0x6a6e91,...ps(_0x142c9a)},_0x5d047b=this['_sendApiRequest']('/actions/custom/calls','POST',_0x24b300);return{'getStream':async()=>{const _0x43895f=(await _0x5d047b['request'])['body'];return this['_getStreamReader'](_0x43895f);},'abortController':_0x5d047b['abortController']};}executeAction({actionName:_0x275347,content:_0x5c8c63,args:_0xeb1c25,contexts:_0x2775ae}){const _0xc28de8={'content':[{'type':'text','content':_0x5c8c63}],'args':_0xeb1c25,...ps(_0x2775ae)},_0x5609e4=this['_sendApiRequest']('/actions/system/'+_0x275347+'/calls','POST',_0xc28de8);return{'getStream':async()=>{const _0x4cb0da=(await _0x5609e4['request'])['body'];return this['_getStreamReader'](_0x4cb0da);},'abortController':_0x5609e4['abortController']};}['uploadFile'](_0x3e055a,_0x233a0c,_0x1454dc){const _0x151403=new FormData();_0x151403['append']('file',_0x233a0c,_0x233a0c['name']),_0x1454dc&&_0x151403['append']('attributes',JSON['stringify'](_0x1454dc));const _0x2ca5eb=this['_sendApiRequest']('/conversations/'+_0x3e055a+'/files','POST',_0x151403);return{'getId':async()=>(await _0x2ca5eb['request'])['json'](),'abortController':_0x2ca5eb['abortController']};}uploadDocuments(_0x38d68c,_0x4c1391){const _0x55a90e={'documents':_0x4c1391['map'](_0x139169=>({'content':_0x139169['content'],'attributes':{'version':_0x139169['version'],'sessionId':_0x139169['sessionId'],'channelId':_0x139169['channelId'],'rootName':_0x139169['rootName'],'selections':_0x139169['selections']},...void 0x0!==_0x139169['name']?{'name':_0x139169['name']}:{},...void 0x0!==_0x139169['description']?{'description':_0x139169['description']}:{}}))},_0x347348=this['_sendApiRequest']('/conversations/'+_0x38d68c+'/documents/batch','POST',_0x55a90e);return{'getIds':async()=>(await _0x347348['request'])['json'](),'abortController':_0x347348['abortController']};}fetchDocuments(_0x1cc8d6,_0x52ebcf){const _0x5a7c6a=new URLSearchParams();_0x5a7c6a['append']('documentIds',_0x52ebcf['join'](','));const _0x2412ff=this['_sendApiRequest']('/conversations/'+_0x1cc8d6+'/documents/batch?'+_0x5a7c6a['toString'](),'GET');return{'getDocuments':async()=>(await _0x2412ff['request'])['json'](),'abortController':_0x2412ff['abortController']};}fetchConversations(_0x50db09,_0x53f7f2={}){const _0x4c292a=new URLSearchParams();_0x4c292a['append']('group',_0x50db09),_0x4c292a['append']('excludeEmpty',!0x1!==_0x53f7f2['excludeEmpty']?'true':'false'),_0x4c292a['append']('limit',_0x53f7f2['limit']?_0x53f7f2['limit']['toString']():0x64['toString']()),_0x4c292a['append']('sortBy',_0x53f7f2['sortBy']?_0x53f7f2['sortBy']:'createdAt'),_0x4c292a['append']('order',_0x53f7f2['order']?_0x53f7f2['order']:'desc');const _0x55bcc9=this['_sendApiRequest']('/conversations?'+_0x4c292a['toString'](),'GET');return{'getConversations':async()=>(await(await _0x55bcc9['request'])['json']())['items'],'abortController':_0x55bcc9['abortController']};}deleteConversation(_0x241be0){const _0xccd1d3=this['_sendApiRequest']('/conversations/'+_0x241be0,'DELETE');return{'execute':async()=>{await _0xccd1d3['request'];},'abortController':_0xccd1d3['abortController']};}updateConversation(_0x1bbb4d,_0x1331af){const _0x36abac=this['_sendApiRequest']('/conversations/'+_0x1bbb4d,'PATCH',_0x1331af);return{'getResult':async()=>(await _0x36abac['request'],_0x1331af),'abortController':_0x36abac['abortController']};}fetchConversation(_0x48a966){const _0x1c42da=this['_sendApiRequest']('/conversations/'+_0x48a966,'GET');return{'getConversation':async()=>(await _0x1c42da['request'])['json'](),'abortController':_0x1c42da['abortController']};}fetchConversationMessages(_0x36db98){const _0x133da4=this['_sendApiRequest']('/conversations/'+_0x36db98+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x133da4['request'])['json']())['items'],'abortController':_0x133da4['abortController']};}['uploadUrl'](_0x2aa50e,_0x2dad3f,_0x3dffa9){const _0x1af3b9=this['_sendApiRequest']('/conversations/'+_0x2aa50e+'/web-resources','POST',{'url':_0x2dad3f,'attributes':_0x3dffa9});return{'getId':async()=>(await _0x1af3b9['request'])['json'](),'abortController':_0x1af3b9['abortController']};}getModels(_0x24cb50='en'){const _0xa6189c=new URLSearchParams();_0xa6189c['append']('language',_0x24cb50);const _0x5349f4='/models/1?'+_0xa6189c['toString'](),_0x107717=this['_sendApiRequest'](_0x5349f4,'GET');return{'list':async()=>await(await _0x107717['request'])['json'](),'abortController':_0x107717['abortController']};}listContexts(_0x2de156={}){const _0xa5d6b3=new URLSearchParams();_0xa5d6b3['append']('limit',_0x2de156['limit']?_0x2de156['limit']['toString']():0x64['toString']()),_0x2de156['cursor']&&_0xa5d6b3['append']('cursor',_0x2de156['cursor']),_0x2de156['order']&&_0xa5d6b3['append']('order',_0x2de156['order']);const _0xc84ac8=this['_sendApiRequest']('/contexts?'+_0xa5d6b3['toString'](),'GET');return{'getContexts':async()=>(await(await _0xc84ac8['request'])['json']())['items'],'abortController':_0xc84ac8['abortController']};}deleteFile(_0x33b09d,_0x43f438){const _0x30e115=this['_sendApiRequest']('/conversations/'+_0x33b09d+'/files/'+_0x43f438,'DELETE');return{'execute':async()=>{await _0x30e115['request'];},'abortController':_0x30e115['abortController']};}deleteDocument(_0x55d5ba,_0x47f52e){const _0x33f80e=this['_sendApiRequest']('/conversations/'+_0x55d5ba+'/documents/'+_0x47f52e,'DELETE');return{'execute':async()=>{await _0x33f80e['request'];},'abortController':_0x33f80e['abortController']};}deleteWebResource(_0x25d536,_0x10ca05){const _0x26c4e6=this['_sendApiRequest']('/conversations/'+_0x25d536+'/web-resources/'+_0x10ca05,'DELETE');return{'execute':async()=>{await _0x26c4e6['request'];},'abortController':_0x26c4e6['abortController']};}cancelStream(_0x2f0c5f,_0x3403f8){const _0x259bf2=this['_sendApiRequest']('/conversations/'+_0x2f0c5f+'/messages/'+_0x3403f8+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x259bf2['request'];},'abortController':_0x259bf2['abortController']};}resumeStream(_0x36be45,_0xe098b4,_0x198747='0-0'){const _0x27363f=new URLSearchParams({'lastEventId':_0x198747}),_0x1271e8=this['_sendApiRequest']('/conversations/'+_0x36be45+'/messages/'+_0xe098b4+'/stream?'+_0x27363f['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x39f62e=await _0x1271e8['request'];return this['_getStreamReader'](_0x39f62e['body']);},'abortController':_0x1271e8['abortController']};}callSystemReview({reviewName:_0x17a793,content:_0x46771a,args:_0x2d0271,contexts:_0x4f4cd9}){const _0x347cc2=this['_sendApiRequest']('/reviews/system/'+_0x17a793+'/calls','POST',{'content':[{'type':'text','content':_0x46771a}],'args':_0x2d0271,...ps(_0x4f4cd9)});return{'getStream':async()=>{const _0x3ac0b1=(await _0x347cc2['request'])['body'];return this['_getStreamReader'](_0x3ac0b1);},'abortController':_0x347cc2['abortController']};}processDocument({content:_0x1287e0,prompt:_0x29271a,model:_0x4935ed,capabilities:_0x37fc40,contexts:_0x255f47}){const _0x4570fb=this['_getExtraHttpHeaders'](),_0x2fd54a=this['_sendApiRequest']('/documents/process','POST',{'content':_0x1287e0,'prompt':_0x29271a,'model':_0x4935ed,..._0x37fc40&&{'capabilities':_0x37fc40},...ps(_0x255f47),..._0x4570fb&&{'extraHttpHeaders':_0x4570fb}});return{'getResult':async()=>(await _0x2fd54a['request'])['json'](),'abortController':_0x2fd54a['abortController']};}callCustomReview({content:_0x12893d,prompt:_0xdbba5c,model:_0x1d8e01,contexts:_0x2ab678}){const _0x1c1810=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x12893d}],..._0xdbba5c&&{'prompt':_0xdbba5c},'model':_0x1d8e01,...ps(_0x2ab678)});return{'getStream':async()=>{const _0x19a278=(await _0x1c1810['request'])['body'];return this['_getStreamReader'](_0x19a278);},'abortController':_0x1c1810['abortController']};}upsertAIChatRating(_0x4d9481,_0xef8581,_0x5467df){const _0x5460c2=this['_sendApiRequest']('/conversations/'+_0x4d9481+'/messages/'+_0xef8581+'/ratings','PUT',{'positiveCount':_0x5467df['positiveCount'],'totalCount':_0x5467df['totalCount'],'modificationId':_0x5467df['modificationId']});return{'execute':async()=>{await _0x5460c2['request'];},'abortController':_0x5460c2['abortController']};}upsertAIActionRating(_0x226a7d,_0x302948,_0x3abe64){const _0x589e46=this['_sendApiRequest']('/actions/system/'+_0x226a7d+'/calls/'+_0x302948+'/ratings','PUT',{'positiveCount':_0x3abe64['positiveCount'],'totalCount':_0x3abe64['totalCount']});return{'execute':async()=>{await _0x589e46['request'];},'abortController':_0x589e46['abortController']};}upsertCustomAIActionRating(_0xa876c6,_0x541bae){const _0x3b6f42=this['_sendApiRequest']('/actions/custom/calls/'+_0xa876c6+'/ratings','PUT',{'positiveCount':_0x541bae['positiveCount'],'totalCount':_0x541bae['totalCount']});return{'execute':async()=>{await _0x3b6f42['request'];},'abortController':_0x3b6f42['abortController']};}upsertAIReviewRating(_0xb27856,_0x31b7fc,_0x475f50,_0x3dce56){const _0x3a20dd=this['_sendApiRequest']('/reviews/system/'+_0xb27856+'/calls/'+_0x31b7fc+'/ratings','PUT',{'positiveCount':_0x475f50['positiveCount'],'totalCount':_0x475f50['totalCount'],'dataId':_0x3dce56});return{'execute':async()=>{await _0x3a20dd['request'];},'abortController':_0x3a20dd['abortController']};}upsertCustomAIReviewRating(_0x3809b8,_0x275fb1,_0x347db0){const _0x24d730=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3809b8+'/ratings','PUT',{'positiveCount':_0x275fb1['positiveCount'],'totalCount':_0x275fb1['totalCount'],'dataId':_0x347db0});return{'execute':async()=>{await _0x24d730['request'];},'abortController':_0x24d730['abortController']};}_sendApiRequest(_0x54150c,_0x3f0661,_0x24b12e,_0x25acad={}){const {apiUrl:_0x3f30c2=this['_apiUrl']}=_0x25acad,_0xefd31c=new AbortController(),_0x1d95bd=_0x24b12e instanceof FormData,_0x295487={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':yt};_0x24b12e&&!_0x1d95bd&&(_0x295487['Content-Type']='application/json');const _0x3b8c69={'method':_0x3f0661,'headers':_0x295487,'signal':_0xefd31c['signal']};return _0x24b12e&&(_0x3b8c69['body']=_0x1d95bd?_0x24b12e:JSON['stringify'](_0x24b12e)),{'request':fetch(''+_0x3f30c2+_0x54150c,_0x3b8c69)['catch'](_0xddc4f9=>{this['_handleError'](_0xddc4f9);})['then'](_0x2f7a0c=>_0x2f7a0c['ok']?_0x2f7a0c:_0x2f7a0c['json']()['then'](_0x57bbc7=>{throw{'url':_0x3f30c2,'path':_0x54150c,'method':_0x3f0661,'body':_0x24b12e,'status':(_0x2f7a0c||{})['status'],'statusText':(_0x2f7a0c||{})['statusText'],'code':_0x57bbc7['code'],'message':_0x57bbc7['message'],'traceId':_0x57bbc7['traceId'],'data':_0x57bbc7['data']};})),'abortController':_0xefd31c};}async *_getStreamReader(_0x2473d1){const _0x2461f0=[],_0x488396=_0x2473d1['getReader'](),_0x18cf6e=_0x1314f1({'onError':_0x202308=>{this['_handleError'](_0x202308);},'onEvent':_0x4247d1=>{_0x4247d1['data']=JSON['parse'](_0x4247d1['data']),_0x2461f0['push'](_0x4247d1);}});try{let _0x2b6913=!0x1;for(;!_0x2b6913;){const {done:_0x2ca7e2,value:_0x2267a8}=await _0x488396['read']();_0x2ca7e2&&(_0x2b6913=!0x0),_0x18cf6e['feed'](this['_decoder']['decode'](_0x2267a8,{'stream':!0x0})),yield*_0x2461f0,_0x2461f0['length']=0x0;}}catch(_0x486948){this['_handleError'](_0x486948);}finally{_0x488396['releaseLock'](),_0x18cf6e['reset']();}}['_handleError'](_0x352fb5){if(_0x352fb5 instanceof ct)throw _0x352fb5;if(_0x352fb5 instanceof Error&&'AbortError'===_0x352fb5['name'])throw new ct('ai-request-aborted',this,{'originalError':_0x352fb5});throw new ct('ai-request-failed',this,{'originalError':_0x352fb5});}};function ps(_0x31a936){return _0x31a936?.['length']?{'contexts':_0x31a936['map'](As)}:{};}function Es(_0x3e70c0,_0x1f686b,_0x1b6940){const t=_0x3e70c0['t'];switch(_0x1f686b){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'},_0x1b6940);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'Response\x20stopped.'});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.'},_0x1b6940);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});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.'},_0x1b6940);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_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});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_LIBRARY_LABEL':return t({'id':'AI_CHAT_CONTEXT_LIBRARY_LABEL','string':'Context\x20library'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x1b6940);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x1b6940);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x1b6940);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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'},_0x1b6940);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x1b6940);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});default:return _0x1f686b;}}const ms=/* #__PURE__ -- @preserve */
25
+ dt();var Ts=class extends ms{_connector;['_config'];['_locale'];_modelList=[];_modelsRequest=null;constructor({connector:_0x790b0a,config:_0x295374,locale:_0x1e0cc9}){super(),this['_connector']=_0x790b0a,this['_config']=_0x295374,this['_locale']=_0x1e0cc9;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get _defaultModelId(){return this['_config']?.['defaultModelId'];}async getAllModels(){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()['catch'](_0x17ec90=>{throw this['_modelsRequest']=null,_0x17ec90;})),this['_modelsRequest'];}async getAvailableModels(){const _0x39b277=await this['getAllModels']();let _0x39e771;return _0x39e771=this['_availableModels']?this['_filterModels'](_0x39b277,this['_availableModels']):_0x39b277['filter'](_0x1f0120=>_0x1f0120['recommended']),_0x39e771;}async['resolveModel'](_0x4c7789){const _0x33700d=await this['getAllModels']();if(!_0x33700d['length'])return null;if(_0x4c7789){const _0x3627f2=this['_getModelById'](_0x33700d,_0x4c7789);if(_0x3627f2)return _0x3627f2;St('ai-chat-model-id-unrecognized',{'modelId':_0x4c7789,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async getDefault(){const _0x2fd308=await this['getAvailableModels']();if(!_0x2fd308['length'])return null;if(this['_defaultModelId']){const _0x36b070=this['_getModelById'](_0x2fd308,this['_defaultModelId']);if(_0x36b070)return _0x36b070;St('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2fd308[0x0]['id']});}return _0x2fd308[0x0];}async['isAvailable'](_0x3eba40){return(await this['getAvailableModels']())['some'](_0x3ec966=>_0x3ec966['name']===_0x3eba40['name']&&_0x3ec966['provider']===_0x3eba40['provider']);}async getModel(_0x659ff8){const _0x93d23f=await this['getAllModels']();return this['_getModelById'](_0x93d23f,_0x659ff8)||null;}async _retrieveModels(){if(!this['_modelList']['length']){const _0x232ea9=this['_locale']['uiLanguage']||'en',_0x1124bc=await this['_connector']['getModels'](_0x232ea9)['list']();this['_modelList']=_0x1124bc['items']['map'](_0x25253d=>ws(_0x25253d)?{..._0x25253d,'name':Es(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x25253d);}return[...this['_modelList']];}_filterModels(_0x5d45c3,_0x4c630a){let _0x327493;if(_0x4c630a){_0x327493=[];const _0x3f79fc=new Set(),_0x3b1f1e='string'==typeof _0x4c630a?[_0x4c630a['toLocaleLowerCase']()]:_0x4c630a['map'](_0x1b8e96=>_0x1b8e96['toLocaleLowerCase']());for(const _0x47b547 of _0x3b1f1e)for(const _0x479e9a of _0x5d45c3)!_0x3f79fc['has'](_0x479e9a['id'])&&this['_isMatchingFilter'](_0x479e9a,_0x47b547)&&(_0x327493['push'](_0x479e9a),_0x3f79fc['add'](_0x479e9a['id']));}else _0x327493=_0x5d45c3;return _0x327493;}_isMatchingFilter(_0x3599b7,_0x5adba5){const _0x29a4c1=_0x3599b7['id']['toLocaleLowerCase'](),_0x17689f=_0x3599b7['name']['toLocaleLowerCase'](),_0x4ac97c=_0x3599b7['provider']['toLocaleLowerCase']();return _0x29a4c1===_0x5adba5||_0x17689f===_0x5adba5||ws(_0x3599b7)&&'auto'===_0x5adba5||_0x4ac97c===_0x5adba5||_0x29a4c1['startsWith'](_0x5adba5);}_getModelById(_0x22a9c5,_0xf7cf14){return _0x22a9c5['find'](_0x265949=>ws(_0x265949)&&'auto'===_0xf7cf14?_0x265949:_0x265949['id']===_0xf7cf14)||null;}};function ws(_0x36dc1b){return _0x36dc1b['id']['startsWith']('agent');}var Cs=class{_connector;_defaultContext;_contextsRequest=null;constructor({connector:_0x10cf57,defaultContext:_0x3474aa}){this['_connector']=_0x10cf57,this['_defaultContext']=_0x3474aa;}async getAllContexts(){return this['_contextsRequest']||(this['_contextsRequest']=this['_connector']['listContexts']()['getContexts']()['catch'](_0x41f7f9=>{throw this['_contextsRequest']=null,_0x41f7f9;})),[...await this['_contextsRequest']];}async getAvailableContexts(){const _0x1e34be=await this['getAllContexts'](),_0x3eb7f7=new Set((this['_defaultContext']??[])['map'](_0x244d8a=>_0x244d8a['id']));return _0x1e34be['filter'](_0x3ae0ce=>!_0x3eb7f7['has'](_0x3ae0ce['id']));}resolveContext({feature:_0x3ac522,ids:_0x47cce6=[],extraContexts:_0x4c9656=[],idScopedOnly:_0x2a26f6=!0x1,context:_0x5e93a2}){const _0x570112=this['_resolveDefaultContext'](_0x3ac522,_0x47cce6,_0x2a26f6);return _0x5e93a2['addDefaultContext']([..._0x570112,..._0x4c9656]),_0x5e93a2;}_resolveDefaultContext(_0x15ba5a,_0x637427,_0x51a5ca=!0x1){if(!this['_defaultContext'])return[];const _0x1dacbb=[];for(const _0x208f0e of this['_defaultContext'])this['_entryAppliesToFeature'](_0x208f0e['features'],_0x15ba5a,_0x637427)&&(_0x51a5ca&&this['_entryAppliesToFeature'](_0x208f0e['features'],_0x15ba5a,[])||_0x1dacbb['push'](this['_toContextRef'](_0x208f0e)));return _0x1dacbb;}_toContextRef(_0x37b93b){return'promptId'in _0x37b93b?{'id':_0x37b93b['id'],'promptId':_0x37b93b['promptId']}:'fileId'in _0x37b93b?{'id':_0x37b93b['id'],'fileId':_0x37b93b['fileId']}:{'id':_0x37b93b['id']};}_entryAppliesToFeature(_0x3eba2f,_0x26f47d,_0x2815d4){if(!_0x3eba2f)return!0x0;const _0x49428c=_0x3eba2f[_0x26f47d];return!!_0x49428c&&(!0x0===_0x49428c||_0x2815d4['some'](_0x131ea3=>_0x49428c['test'](_0x131ea3)));}},fs=class extends _0x898608{['models'];contextLibrary;static get['pluginName'](){return'AICore';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Is];}init(){const _0x5de535=this['context']['plugins']['get'](Is);this['models']=new Ts({'connector':_0x5de535,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),this['contextLibrary']=new Cs({'connector':_0x5de535,'defaultContext':this['context']['config']['get']('ai.defaultContext')});}};function bs(_0x51d01b){return _0x51d01b?_0x51d01b instanceof _0x24cd6f?[_0x51d01b]:_0x51d01b['editors']&&0x0!==_0x51d01b['editors']['length']?Array['from'](_0x51d01b['editors']):[]:[];}function Ss(_0x425479){const _0x336836=bs(_0x425479);if(!_0x336836['length'])throw new ct('ai-get-editor-from-context-no-editor');if(0x1===_0x336836['length'])return _0x336836[0x0];const _0x59f870=_0x336836['find'](_0x590b7c=>_0x590b7c['ui']?.['focusTracker']?.['isFocused']);if(_0x59f870)return _0x59f870;const _0x3c803a=function(_0x4cbd6a){if(_0x4cbd6a instanceof _0x24cd6f)return;const _0x3da939=_0x4cbd6a;if(!_0x3da939['plugins']||!_0x3da939['plugins']['has']('AIEditing'))return;return _0x3da939['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x425479);return _0x3c803a&&_0x336836['includes'](_0x3c803a)?_0x3c803a:_0x336836[0x0];}function Rs(_0xd45bb3,_0x4bd7e4){return _0x502eab(_0xd45bb3,_0x4bd7e4);}function Os(_0x24535f,_0x19b621){return _0x35b927(_0x24535f,_0x19b621);}function vs(_0x4a2aa3,_0x2d796c,_0x1459e2){const _0xde0c63=null!==_0x2d796c?_0x171372=>_0x171372['attribs'][_0x4a2aa3]===_0x2d796c:_0x599d4a=>Boolean(_0x599d4a['attribs'][_0x4a2aa3]);return _0x228c3a(_0x5529c3=>_0x545292(_0x5529c3)&&_0xde0c63(_0x5529c3),_0x1459e2);}function ks(_0x1bd137,_0x53f075,_0x221e7c){const _0x48b2a7=null!==_0x53f075?_0x1c7815=>_0x1c7815['attribs'][_0x1bd137]===_0x53f075:_0x25ee82=>Boolean(_0x25ee82['attribs'][_0x1bd137]);return _0x4615bb(_0x2d5ad8=>_0x545292(_0x2d5ad8)&&_0x48b2a7(_0x2d5ad8),_0x221e7c);}function ys(_0x414102){return _0x4615bb(_0x1ed3d1=>_0x545292(_0x1ed3d1)&&function(_0x7851e6){const _0xb4f664=_0x7851e6['toLowerCase']();return'script'===_0xb4f664||'style'===_0xb4f664||_0xb4f664['includes']('-');}(_0x1ed3d1['name']),_0x414102);}const Ns=['comment-start','comment-end','suggestion-start','suggestion-end'];function xs(_0x12149b){return _0x545292(_0x12149b)&&Ns['includes'](_0x12149b['name']['toLowerCase']());}function Ls(_0x38a861){return _0x370e5d(_0x27b255=>_0x3e0c4f(_0x27b255),_0x38a861,!0x0,0x1/0x0);}function Ps(_0x3523b0,_0x75ef21){return _0x3523b0&&_0x545292(_0x3523b0)?_0x3523b0['attribs'][_0x75ef21]:null;}function Ds(_0x26defd,_0x5351aa,_0x337fd8){_0x545292(_0x26defd)&&(null===_0x337fd8?delete _0x26defd['attribs'][_0x5351aa]:_0x26defd['attribs'][_0x5351aa]=_0x337fd8);}function Hs(_0x4c7aae,_0x4d35a5,_0x33a99e){const _0x35232c=_0x4d35a5['cloneNode'](!0x0);'beforebegin'===_0x33a99e?ti(_0x4c7aae,_0x35232c):'afterbegin'===_0x33a99e?_0x46b9cf(_0x4c7aae,_0x35232c):'beforeend'===_0x33a99e?_0x380486(_0x4c7aae,_0x35232c):'afterend'===_0x33a99e&&_0x23e0ae(_0x4c7aae,_0x35232c);}function Ms(_0xe63906){const _0x5f2a7c=[];let _0x24ba1e=_0xe63906;for(;_0x24ba1e;)_0x24ba1e=_0x12306c(_0x24ba1e),_0x24ba1e&&_0x5f2a7c['push'](_0x24ba1e);return _0x5f2a7c;}function Us(_0x64d6b5){return _0x64d6b5['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Vs(_0x454db2){let _0x1fb746=0x0;for(;_0x454db2['parentNode'];)_0x454db2=_0x454db2['parentNode'],_0x1fb746++;return _0x1fb746;}function Bs(_0x520595){const _0x5543b8=[];let _0x4ee482=_0x520595['nextSibling'];for(;_0x4ee482;)_0x5543b8['push'](_0x4ee482),_0x4ee482=_0x4ee482['nextSibling'];_0x5543b8['forEach'](_0x2de34a=>{_0x47cc1f(_0x2de34a);});}function Gs(_0xa381b0,_0x4cd01){return!!_0xa381b0['model']['document']['getRoot'](_0x4cd01)&&!_0x1bd984(_0xa381b0,_0x4cd01);}function Fs(_0x147efd,_0x505389){return'<p\x20data-id=\x22'+_0x505389+'\x22>'+_0x147efd+'</p>';}function Ks(_0xe66854){return'p'===_0xe66854['name']['toLowerCase']()&&Boolean(_0xe66854['attribs']['data-id']);}function Ws(_0x1f1fb9){const _0x21ddc5=Rs(_0x1f1fb9)['children']['filter'](_0x545292);return 0x1===_0x21ddc5['length']&&Ks(_0x21ddc5[0x0])?_0x21ddc5[0x0]['children']['map'](_0x15500f=>Os(_0x15500f))['join'](''):_0x1f1fb9;}function Ys(_0x4659c8,_0x23d9de){const _0x462e14=function(_0x212f6d){const _0x5292d4=_0x212f6d['children']['filter'](_0x545292);return 0x1===_0x5292d4['length']&&Ks(_0x5292d4[0x0])?_0x5292d4[0x0]['children']:_0x212f6d['children'];}(_0x23d9de),{blockElements:_0x588b2c}=_0x4659c8['editing']['view']['domConverter'],_0x3c4b03=_0x25b08d=>_0x25b08d['some'](_0x43db6e=>_0x545292(_0x43db6e)&&('p'!==_0x43db6e['name']['toLowerCase']()&&_0x588b2c['includes'](_0x43db6e['name']['toLowerCase']())||_0x3c4b03(_0x43db6e['children'])));if(_0x3c4b03(_0x462e14))return!0x1;const _0x42dc66=_0x462e14['map'](_0x3b4bac=>Os(_0x3b4bac))['join'](''),_0x1b2727=_0x4659c8['data']['parse'](_0x42dc66,'$root'),{schema:_0xa0b907}=_0x4659c8['model'];let _0x2f9de7=0x0;for(const {item:_0x53e5cf}of _0x4659c8['model']['createRangeIn'](_0x1b2727))if(_0x53e5cf['is']('element')&&_0xa0b907['isBlock'](_0x53e5cf)&&(++_0x2f9de7>0x1||'paragraph'!==_0x53e5cf['name']))return!0x1;return!0x0;}function $s(_0xaf34dd,_0x2d8a39){const _0x2151a2=_0x2d8a39['filter'](_0x30bd6f=>'new'!=_0x30bd6f['type'])['map'](_0x13b3c1=>vs('data-id',_0x13b3c1['id'],_0xaf34dd))['filter'](_0x1d97ab=>null!==_0x1d97ab),_0x1101a3=_0x2d8a39['filter'](_0xf589de=>'removed'!=_0xf589de['type'])['map'](_0x5dc01c=>_0x5dc01c['node']['cloneNode'](!0x0));let _0x2f7a3d=null;if(_0x2151a2['length']){_0x2f7a3d=_0x2151a2[0x0]['previousSibling'];for(let _0x5a9559=0x0;_0x5a9559<_0x2151a2['length'];_0x5a9559++)_0x47cc1f(_0x2151a2[_0x5a9559]);}if(_0x1101a3['length']){_0x2f7a3d||(_0x2d8a39[0x0]['anchorId']?_0x2f7a3d=vs('data-id',_0x2d8a39[0x0]['anchorId'],_0xaf34dd):(_0x2f7a3d=_0x1101a3['shift'](),_0x46b9cf(_0xaf34dd,_0x2f7a3d)));for(let _0x5a129e=0x0;_0x5a129e<_0x1101a3['length'];_0x5a129e++)_0x23e0ae(_0x2f7a3d,_0x1101a3[_0x5a129e]),_0x2f7a3d=_0x1101a3[_0x5a129e];}}function qs(_0x4f57e1,_0x340ff3){const _0x3f6e3d=new Set();for(const _0x59f4c6 of _0x4f57e1){if(!_0x59f4c6['editor']||'destroyed'===_0x59f4c6['editor']['state']||!Gs(_0x59f4c6['editor'],_0x59f4c6['rootName']))continue;const _0x136e1f=_0x340ff3['get'](_0x59f4c6['documentId']);let _0x2956a0;_0x136e1f?(_0x2956a0=_0x136e1f['cloneNode'](!0x0),$s(_0x2956a0,_0x59f4c6['changes'])):_0x2956a0=new _0x139fbf(_0x59f4c6['changes']['filter'](_0x46bd7a=>'removed'!=_0x46bd7a['type'])['map'](_0x2a3dda=>_0x2a3dda['node']['cloneNode'](!0x0))),Ys(_0x59f4c6['editor'],_0x2956a0)||_0x3f6e3d['add'](_0x59f4c6['index']);}return _0x3f6e3d;}function Qs(_0x8ed199,_0x6828eb,_0x2ec0f7,_0x2edf8c){return Gs(_0x8ed199,_0x6828eb)?Ys(_0x8ed199,Rs(_0x2edf8c))?{'before':Ws(_0x2ec0f7),'after':Ws(_0x2edf8c)}:null:{'before':_0x2ec0f7,'after':_0x2edf8c};}function Xs(_0x2aacfe,_0x5b36d1){return _0x101a20(_0x2aacfe,_0x5b36d1);}function zs(_0x4a8c33,_0x3dc2b1){return _0x4a8c33['map'](_0x41c24e=>null!==_0x41c24e&&'object'==typeof _0x41c24e?Xs(_0x41c24e,_0x3dc2b1):_0x41c24e);}const js=[['BlockQuoteEditing','blockQuote'],['BoldEditing','bold'],['BookmarkEditing','bookmark'],['CodeEditing','code'],['HorizontalLineEditing','horizontalLine'],['HtmlEmbedEditing','htmlEmbed'],['ItalicEditing','italic'],['MathType','math'],['PageBreakEditing','pageBreak'],['Paragraph','paragraph'],['StandardEditingModeEditing','restrictedEditing'],['StrikethroughEditing','strikethrough'],['SubscriptEditing','subscript'],['SuperscriptEditing','superscript'],['TableOfContentsEditing','tableOfContents'],['Title','title'],['TodoListEditing','todoList'],['UnderlineEditing','underline']],Js='ai-selection',Zs=['br'];var tn=class extends _0x898608{constructor(_0x49d679){super(_0x49d679),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}_outputDataProcessor;_fakeSelections=[];_sessionIdByEditor=new WeakMap();_editorsToConfigs=new WeakMap();_lastContentFocusedEditor;static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}getLastContentFocusedEditor(){return this['_lastContentFocusedEditor'];}getSessionId(_0x20b8a2){let _0x1e726d=this['_sessionIdByEditor']['get'](_0x20b8a2);return _0x1e726d||(_0x1e726d=_0x20b8a2['plugins']['has']('RealTimeCollaborationClient')&&_0x20b8a2['plugins']['get']('RealTimeCollaborationClient')['sessionId']||kt(),this['_sessionIdByEditor']['set'](_0x20b8a2,_0x1e726d)),_0x1e726d;}async getDocumentData(_0x32b485){const _0x45fe2e=bs(this['context']),_0x460477=[],_0x408173=new Set();for(const _0x1c44ca of _0x45fe2e){if(_0x32b485&&!_0x32b485['has'](_0x1c44ca['config']['get']('collaboration.channelId')))continue;const _0x2bb2e7=_0x1c44ca['config']['get']('roots')||{},_0x1e30e3=this['_getEditorSelectionSignature'](_0x1c44ca),_0x1c6b01=_0x1c44ca['config']['get']('collaboration.channelId'),_0x24bec6=this['getSessionId'](_0x1c44ca);for(const _0xb62c0a of _0x1c44ca['model']['document']['getRoots']()){if('$graveyard'===_0xb62c0a['rootName'])continue;const _0x1fd09d=await this['_getDocumentDataForEditorRoot'](_0x1c44ca,_0xb62c0a,_0x408173),_0xdfaebb=_0x2bb2e7[_0xb62c0a['rootName']],_0x52ff99=_0xb62c0a['getAttribute']('$description')??_0xdfaebb?.['description'];let _0x4e9d9e=_0xb62c0a['getAttribute']('$title')??_0xdfaebb?.['title'];_0x4e9d9e||(_0x4e9d9e=_0xb62c0a['getAttribute']('$rootEditableOptions')?.['label']??_0xdfaebb?.['label']),_0x4e9d9e||(St('ai-document-root-missing-title',{'editor':_0x1c44ca,'rootName':_0xb62c0a['rootName']}),_0x4e9d9e=_0xb62c0a['rootName']),_0x460477['push']({'editor':_0x1c44ca,'rootName':_0xb62c0a['rootName'],'content':_0x1fd09d['content'],'version':_0x1fd09d['version'],'sessionId':_0x24bec6,'channelId':_0x1c6b01,'selections':_0x1fd09d['selections'],'selectionSignature':_0x1e30e3,'editorConfig':this['_getEditorConfig'](_0x1c44ca),'name':_0x4e9d9e,'description':_0x52ff99});}}return _0x460477;}getEditorsVersions(){const _0x22b5a1=bs(this['context']),_0x4a3dbb=new Map();for(const _0x569504 of _0x22b5a1){const _0x214bbd=_0x569504['config']['get']('collaboration.channelId');_0x4a3dbb['set'](_0x214bbd,_0x569504['model']['document']['version']);}return _0x4a3dbb;}getEditorsSelections(){const _0x315898=bs(this['context']),_0x5cd052=new Map();for(const _0x44104c of _0x315898){const _0x5e226c=_0x44104c['config']['get']('collaboration.channelId'),_0x38542a=this['_getEditorSelectionSignature'](_0x44104c);_0x5cd052['set'](_0x5e226c,_0x38542a);}return _0x5cd052;}_getEditorSelectionSignature(_0x2f9442){return this['_getMarkersInDocumentOrder'](_0x2f9442)['map'](_0x2931ad=>{const _0x2d524a=_0x2931ad['getRange']();return _0x2d524a['root']['rootName']+':'+_0x2d524a['start']['path']['join']('.')+'-'+_0x2d524a['end']['path']['join']('.');})['join']('|');}async _getDocumentDataForEditorRoot(_0x19874c,_0x3cb8b4,_0x576f5e){const _0x35417b=_0x19874c['data']['toView'](_0x3cb8b4,{'convertAiChatSelectionMarker':!0x0}),_0x4ba6c3=new _0x4ccf87(_0x19874c['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x35417b,_0x4ba6c3,_0x576f5e);let _0x453bf4=await this['_getDocumentDataStringFromView'](_0x35417b,_0x19874c);Gs(_0x19874c,_0x3cb8b4['rootName'])&&(_0x453bf4=Fs(_0x453bf4,this['_nextDataId'](_0x576f5e)));const _0x26a620=this['_getMarkersInDocumentOrder'](_0x19874c,_0x3cb8b4),_0x2e4419=[];for(const _0x17d272 of _0x26a620){const _0x5a61ca='<'+_0x17d272['name']+':start></'+_0x17d272['name']+':start>',_0x1a4c38=_0x453bf4['indexOf'](_0x5a61ca);_0x453bf4=_0x453bf4['substring'](0x0,_0x1a4c38)+_0x453bf4['substring'](_0x1a4c38+_0x5a61ca['length']);const _0x3333d4='<'+_0x17d272['name']+':end></'+_0x17d272['name']+':end>',_0x30250c=_0x453bf4['indexOf'](_0x3333d4);_0x453bf4=_0x453bf4['substring'](0x0,_0x30250c)+_0x453bf4['substring'](_0x30250c+_0x3333d4['length']),_0x2e4419['push']({'markerName':_0x17d272['name'],'start':_0x1a4c38,'end':_0x30250c,'htmlFragment':_0x453bf4['substring'](_0x1a4c38,_0x30250c)});}return{'content':_0x453bf4,'version':_0x19874c['model']['document']['version'],'selections':_0x2e4419};}afterInit(){this['context']instanceof _0x24cd6f?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1bb1f5,_0x3bf181)=>{_0x3bf181['on']('ready',()=>{this['_integrateEditor'](_0x3bf181);});});}_setOutputDataProcessor(_0x24866e){this['_outputDataProcessor']=_0x24866e;}async _getDocumentDataStringFromView(_0x2ab877,_0x3fb2f0){let _0x50fbf3;if(this['_outputDataProcessor']){const _0x3c9f7d=_0x3fb2f0['data']['processor']['domConverter']['viewToDom'](_0x2ab877),_0x569e18=await this['_outputDataProcessor'](_0x3c9f7d);_0x50fbf3=_0x3fb2f0['data']['processor']['htmlWriter']['getHtml'](_0x569e18);}else _0x50fbf3=_0x3fb2f0['data']['processor']['toData'](_0x2ab877);return _0x50fbf3;}_integrateEditor(_0x3d0bea){if(!_0x3d0bea['config']['get']('collaboration.channelId'))throw new ct('ai-missing-channel-id',_0x3d0bea);_0x3d0bea['ui']['focusTracker']['on']('change:isFocused',(_0x88ba49,_0x527a8f,_0x28ef2b)=>{_0x28ef2b&&(this['_lastContentFocusedEditor']=_0x3d0bea);}),_0x3d0bea['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x3d0bea&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x3d0bea['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Js,'view':({markerName:_0x2f104e})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x2f104e['split'](':')[0x1]],'priority':0xc})}),_0x3d0bea['conversion']['for']('dataDowncast')['markerToElement']({'model':Js+':context','view':(_0xeaf1b1,{writer:_0x252369,options:_0x13edee})=>_0x13edee['convertAiChatSelectionMarker']?_0x252369['createUIElement'](_0xeaf1b1['markerName']+':'+(_0xeaf1b1['isOpening']?'start':'end')):null});}showFakeVisualSelection(_0x40e75f){const _0x4a3172=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x40e75f);const _0x3cef77=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x4a3172,_0x3cef77);}hideFakeVisualSelection(_0x5483d6){const _0x365397=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x5483d6);const _0x157e4e=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x365397,_0x157e4e);}async modelToDataWithIds(_0x285e59,_0x12ea16,_0x15b78d){const _0x472227=_0x12ea16['data']['toView'](_0x285e59),_0xad9227=new _0x4ccf87(_0x12ea16['editing']['view']['document']),_0x215d50=new Set();this['_setDataIdsOnChildren'](_0x472227,_0xad9227,_0x215d50);const _0x25a492=await this['_getDocumentDataStringFromView'](_0x472227,_0x12ea16);return _0x15b78d&&Gs(_0x12ea16,_0x15b78d)?Fs(_0x25a492,this['_nextDataId'](_0x215d50)):_0x25a492;}_setDataIdsOnChildren(_0x5ae896,_0x1254eb,_0x55c215=new Set()){let _0x3c9a6b=!0x1;for(const _0x14a296 of _0x5ae896['getChildren']()){if(!_0x14a296['is']('view:element')||Zs['includes'](_0x14a296['name']))continue;const _0x50e2cc=_0x14a296['is']('view:containerElement'),_0x2f4320=_0x14a296['is']('view:emptyElement'),_0x2cf9be=_0x14a296['is']('view:rawElement'),_0x3811ba=this['_setDataIdsOnChildren'](_0x14a296,_0x1254eb,_0x55c215);_0x14a296['hasAttribute']('data-id')?(_0x3c9a6b=!0x0,_0x55c215['add'](_0x14a296['getAttribute']('data-id'))):(_0x50e2cc||_0x2f4320||_0x2cf9be||_0x3811ba)&&(_0x1254eb['setAttribute']('data-id',this['_nextDataId'](_0x55c215),_0x14a296),_0x3c9a6b=!0x0);}return _0x3c9a6b;}_nextDataId(_0x118339){let _0xd79087;do{_0xd79087='';for(let _0x2777c8=0x0;_0x2777c8<0x4;_0x2777c8++)_0xd79087+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x118339['has'](_0xd79087));return _0x118339['add'](_0xd79087),_0xd79087;}getSelectionText(_0x5086f2){const _0x5250b0=(_0x5086f2?_0x5086f2['model']:Ss(this['context'])['model'])['document']['selection'],_0xe9d008=[],_0x3fa6e5=Array['from'](_0x5250b0['getRanges']());_0x3fa6e5['sort']((_0x137f6b,_0x527fcc)=>_0x137f6b['start']['isBefore'](_0x527fcc['start'])?-0x1:0x1);for(const _0x5ddf56 of _0x3fa6e5)for(const _0xe04abd of _0x5ddf56['getItems']())_0xe04abd['is']('$textProxy')?_0xe9d008['push'](_0xe04abd['data']):_0xe04abd['is']('element')&&_0xe9d008['length']>0x0&&'\x20'!==_0xe9d008[_0xe9d008['length']-0x1]&&_0xe9d008['push']('\x20');return _0xe9d008['length']?'\x22'+_0xe9d008['join']('')['trim']()+'\x22':Es(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}_removeFakeSelectionById(_0x4186b6){for(let _0x15c34c=0x0;_0x15c34c<this['_fakeSelections']['length'];_0x15c34c++)if(this['_fakeSelections'][_0x15c34c]['id']==_0x4186b6)return void this['_fakeSelections']['splice'](_0x15c34c,0x1);}_addFakeSelection(_0x4c5cbf){this['_removeFakeSelectionById'](_0x4c5cbf['id']),Ct(this['_fakeSelections'],_0x4c5cbf);}_refreshFakeSelection(_0xde735f,_0x1dac2a){if(_0xde735f==_0x1dac2a)return;const _0x222ed2=_0xde735f?_0xde735f['editor']:null,_0x5ddad0=_0x1dac2a?_0x1dac2a['editor']:null,_0x7fa280=(_0x167f5c,_0xaffbed)=>{const _0x2088c0=_0xaffbed['model']['markers']['getMarkersGroup'](Js);for(const _0x3ab600 of _0x2088c0)_0x167f5c['removeMarker'](_0x3ab600);},_0x55a792=(_0x5830ca,_0x384d2d,_0xba4974)=>{const _0x264590=_0x384d2d['model'];for(let _0x449f93=0x0;_0x449f93<_0xba4974['ranges']['length'];_0x449f93++){let _0x534f70=_0xba4974['ranges'][_0x449f93];const _0x552b71=Js+':'+_0xba4974['id']+':'+_0x449f93;if(_0x534f70['start']['isAtEnd']){const _0x19dc3d=_0x534f70['start']['getLastMatchingPosition'](({item:_0x2b9a53})=>!_0x264590['schema']['isContent'](_0x2b9a53),{'boundaries':_0x534f70});_0x534f70=_0x5830ca['createRange'](_0x19dc3d,_0x534f70['end']);}_0x5830ca['addMarker'](_0x552b71,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x534f70});}};_0x222ed2&&_0x5ddad0&&_0x222ed2===_0x5ddad0&&_0x1dac2a?_0x222ed2['model']['change'](_0x219ccb=>{_0x7fa280(_0x219ccb,_0x222ed2),_0x55a792(_0x219ccb,_0x5ddad0,_0x1dac2a);}):(_0x222ed2&&_0x222ed2['model']['change'](_0x564b0f=>_0x7fa280(_0x564b0f,_0x222ed2)),_0x5ddad0&&_0x1dac2a&&_0x5ddad0['model']['change'](_0x508375=>_0x55a792(_0x508375,_0x5ddad0,_0x1dac2a)));}_getMarkersInDocumentOrder(_0x503257,_0x362bcd){const _0x458dfa=Array['from'](_0x503257['model']['markers']['getMarkersGroup'](Js+':context'));return(_0x362bcd?_0x458dfa['filter'](_0x2c0d37=>{const _0xf7e1d1=_0x2c0d37['getRange']();return _0xf7e1d1&&_0xf7e1d1['root']['rootName']===_0x362bcd['rootName'];}):_0x458dfa)['sort']((_0x5bfc42,_0x170f04)=>_0x5bfc42['getStart']()['isBefore'](_0x170f04['getStart']())?-0x1:_0x5bfc42['getStart']()['isAfter'](_0x170f04['getStart']())?0x1:0x0);}_getEditorConfig(_0x1d9a5d){let _0x15fe37=this['_editorsToConfigs']['get'](_0x1d9a5d);return _0x15fe37||(_0x15fe37=function(_0x48296d){const _0x5117cd={};if(_0x48296d['plugins']['has']('AlignmentEditing')&&(_0x5117cd['alignment']=_0x48296d['config']['get']('alignment')),_0x48296d['plugins']['has']('CodeBlockEditing')&&(_0x5117cd['codeBlock']=_0x48296d['config']['get']('codeBlock')),_0x48296d['plugins']['has']('FontBackgroundColorEditing')&&(_0x5117cd['fontBackgroundColor']=Xs(_0x48296d['config']['get']('fontBackgroundColor'),['documentColors','columns','colorPicker'])),_0x48296d['plugins']['has']('FontColorEditing')&&(_0x5117cd['fontColor']=Xs(_0x48296d['config']['get']('fontColor'),['documentColors','columns','colorPicker'])),_0x48296d['plugins']['has']('FontFamilyEditing')&&(_0x5117cd['fontFamily']=_0x48296d['config']['get']('fontFamily'),_0x5117cd['fontFamily']&&_0x5117cd['fontFamily']['options']&&(_0x5117cd['fontFamily']['options']=zs(_0x5117cd['fontFamily']['options'],['model','upcastAlso']))),_0x48296d['plugins']['has']('FontSizeEditing')&&(_0x5117cd['fontSize']=_0x48296d['config']['get']('fontSize'),_0x5117cd['fontSize']&&_0x5117cd['fontSize']['options']&&(_0x5117cd['fontSize']['options']=zs(_0x5117cd['fontSize']['options'],['upcastAlso']))),_0x48296d['plugins']['has']('FootnotesEditing')){const _0x398146=_0x48296d['config']['get']('footnotes')??{};_0x398146['footnotesProperties']&&'object'==typeof _0x398146['footnotesProperties']&&(_0x398146['footnotesProperties']=Xs(_0x398146['footnotesProperties'],['toolbar','listStyles'])),_0x5117cd['footnotes']=_0x398146;}if(_0x48296d['plugins']['has']('HeadingEditing')&&(_0x5117cd['heading']=_0x48296d['config']['get']('heading'),_0x5117cd['heading']&&_0x5117cd['heading']['options']&&(_0x5117cd['heading']['options']=zs(_0x5117cd['heading']['options'],['model','icon','class','converterPriority','upcastAlso']))),_0x48296d['plugins']['has']('HighlightEditing')&&(_0x5117cd['highlight']=_0x48296d['config']['get']('highlight'),_0x5117cd['highlight']&&_0x5117cd['highlight']['options']&&(_0x5117cd['highlight']['options']=zs(_0x5117cd['highlight']['options'],['model','color']))),_0x48296d['plugins']['has']('ImageBlockEditing')||_0x48296d['plugins']['has']('ImageInlineEditing')){const _0x360437=Xs(_0x48296d['config']['get']('image'),['toolbar','upload','insert','resizeOptions']);_0x48296d['plugins']['has']('ImageResizeEditing')||delete _0x360437['resizeUnit'],_0x48296d['plugins']['has']('ImageStyleEditing')?_0x360437['styles']?.['options']&&(_0x360437['styles']['options']=zs(_0x360437['styles']['options'],['icon'])):delete _0x360437['styles'],_0x5117cd['image']=_0x360437;}if(_0x48296d['plugins']['has']('IndentBlock')&&(_0x5117cd['indentBlock']=_0x48296d['config']['get']('indentBlock')),_0x48296d['plugins']['has']('LineHeightEditing')&&(_0x5117cd['lineHeight']=_0x48296d['config']['get']('lineHeight'),_0x5117cd['lineHeight']&&(delete _0x5117cd['lineHeight']['supportAllValues'],_0x5117cd['lineHeight']['options']&&(_0x5117cd['lineHeight']['options']=zs(_0x5117cd['lineHeight']['options'],['model'])))),_0x48296d['plugins']['has']('LinkEditing')&&(_0x5117cd['link']=Xs(_0x48296d['config']['get']('link'),['toolbar'])),_0x48296d['plugins']['has']('ListEditing')){const _0x2fbbdb=_0x48296d['config']['get']('list')??{};delete _0x2fbbdb['enableListItemMarkerFormatting'],_0x48296d['plugins']['has']('ListPropertiesEditing')?_0x2fbbdb['properties']&&_0x2fbbdb['properties']['styles']&&'object'==typeof _0x2fbbdb['properties']['styles']&&(_0x2fbbdb['properties']['styles']=Xs(_0x2fbbdb['properties']['styles'],['listStyleTypes'])):delete _0x2fbbdb['properties'],_0x5117cd['list']=_0x2fbbdb;}if(_0x48296d['plugins']['has']('MediaEmbedEditing')&&(_0x5117cd['mediaEmbed']=_0x48296d['config']['get']('mediaEmbed'),_0x5117cd['mediaEmbed']&&(delete _0x5117cd['mediaEmbed']['toolbar'],_0x48296d['plugins']['has']('MediaEmbedResizeEditing')?_0x5117cd['mediaEmbed']['resizeOptions']&&(_0x5117cd['mediaEmbed']['resizeOptions']=_0x5117cd['mediaEmbed']['resizeOptions']['map'](_0x6b6c9=>Xs(_0x6b6c9,['icon','label']))):delete _0x5117cd['mediaEmbed']['resizeOptions'],_0x48296d['plugins']['has']('MediaEmbedStyleEditing')?_0x5117cd['mediaEmbed']['styles']&&_0x5117cd['mediaEmbed']['styles']['options']&&(_0x5117cd['mediaEmbed']['styles']['options']=zs(_0x5117cd['mediaEmbed']['styles']['options'],['icon','title'])):delete _0x5117cd['mediaEmbed']['styles'])),_0x48296d['plugins']['has']('MultiLevelListEditing')&&(_0x5117cd['listMultiLevel']=_0x48296d['config']['get']('listMultiLevel')??{}),_0x48296d['plugins']['has']('MentionEditing')){const _0x40de9a=Xs(_0x48296d['config']['get']('mention'),['commitKeys','dropdownLimit']);_0x40de9a['feeds']&&(_0x40de9a['feeds']=_0x40de9a['feeds']['map'](_0x58d13e=>Xs(_0x58d13e,['minimumCharacters','itemRenderer','dropdownLimit']))),_0x5117cd['mention']=_0x40de9a;}if(_0x48296d['plugins']['has']('MergeFieldsEditing')){const _0x5b67d6=Xs(_0x48296d['config']['get']('mergeFields'),['previewModes','initialPreviewMode','previewHtmlValues','sanitizeHtml']);Array['isArray'](_0x5b67d6['definitions'])&&(_0x5b67d6['definitions']=_0x5b67d6['definitions']['map'](_0x4ccc1a=>'groupId'in _0x4ccc1a?(Array['isArray'](_0x4ccc1a['definitions'])&&(_0x4ccc1a['definitions']=_0x4ccc1a['definitions']['map'](_0x43c693=>Xs(_0x43c693,['defaultValue']))),_0x4ccc1a):Xs(_0x4ccc1a,['defaultValue']))),_0x5117cd['mergeFields']=_0x5b67d6;}if(_0x48296d['plugins']['has']('StyleEditing')&&(_0x5117cd['style']=_0x48296d['config']['get']('style')),_0x48296d['plugins']['has']('TableEditing')){const _0x871754=Xs(_0x48296d['config']['get']('table'),['contentToolbar','tableToolbar','showHiddenBorders']);_0x48296d['plugins']['has']('TablePropertiesEditing')?_0x871754['tableProperties']&&'object'==typeof _0x871754['tableProperties']&&(_0x871754['tableProperties']=Xs(_0x871754['tableProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x871754['tableProperties'],_0x48296d['plugins']['has']('TableCellPropertiesEditing')?_0x871754['tableCellProperties']&&'object'==typeof _0x871754['tableCellProperties']&&(_0x871754['tableCellProperties']=Xs(_0x871754['tableCellProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x871754['tableCellProperties'],_0x48296d['plugins']['has']('TableLayoutEditing')?_0x871754['tableLayout']||(_0x871754['tableLayout']={}):delete _0x871754['tableLayout'],_0x48296d['plugins']['has']('TableCaptionEditing')?_0x871754['tableCaption']||(_0x871754['tableCaption']={}):delete _0x871754['tableCaption'],_0x5117cd['table']=_0x871754;}_0x48296d['plugins']['has']('TextPartLanguageEditing')&&(_0x5117cd['textPartLanguage']=_0x48296d['config']['get']('language.textPartLanguage'));for(const [_0x4650ea,_0x182c08]of js)_0x48296d['plugins']['has'](_0x4650ea)&&(_0x5117cd[_0x182c08]={});return _0x5117cd;}(_0x1d9a5d),this['_editorsToConfigs']['set'](_0x1d9a5d,_0x15fe37)),_0x15fe37;}};const en=/* #__PURE__ -- @preserve */
26
+ At();var sn=class extends en{_generateUid;_uidCounter=0x0;_touchedNodesState={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};_existingDataIds=new Set();_referencedExistingIds=new Set();constructor(_0x181696){super(),this['_generateUid']=_0x181696||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x5197c7,_0x1d349b,_0x28381f){this['_uidCounter']=0x0;const _0x4653ec=_0x5197c7['cloneNode'](!0x0);on(_0x1d349b,_0x4653ec);const _0x21588d=_0x4653ec['childNodes'],_0x5bd5ad=Array['from'](_0x21588d)['filter'](_0x7d1a7f=>!(0x3===_0x7d1a7f['nodeType']&&''===Os(_0x7d1a7f)['trim']())),_0x3a0fc8=_0x5bd5ad['length'];this['_existingDataIds']=new Set(ks('data-id',null,_0x1d349b)['map'](_0x1be790=>Ps(_0x1be790,'data-id'))['filter'](_0x5e8e7f=>!!_0x5e8e7f));for(const _0x2168ea of _0x5bd5ad)_0x2168ea&&_0x545292(_0x2168ea)&&void 0x0===_0x2168ea['attribs']['data-id']&&Ds(_0x2168ea,'data-id','new-element');if(ks('data-id',null,_0x4653ec)['forEach'](_0x1f5b62=>{const _0x149abb=Ps(_0x1f5b62,'data-id');'new-element'===_0x149abb||this['_existingDataIds']['has'](_0x149abb)||Ds(_0x1f5b62,'data-id','new-element');}),0x0===_0x1d349b['childNodes']['length']){const _0x4df206=[];return ks('data-id','new-element',_0x4653ec)['forEach'](_0x2570bb=>{const _0x5173fc=this['_generateUid']();Ds(_0x2570bb,'data-id',_0x5173fc),_0x4df206['push'](_0x5173fc);}),this['_removeSpecialComments'](_0x4653ec),{'parsedContent':_0x4653ec,'newNodeIds':_0x4df206,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set();let _0x2664c8=-0x1,_0x196e11=!0x1;for(let _0x3dae0a=0x0;_0x3dae0a<_0x3a0fc8;_0x3dae0a++){const _0x2e820d=_0x5bd5ad[_0x3dae0a],_0x1ec398=_0x5bd5ad[_0x3dae0a+0x1];if(this['_isNewNode'](_0x2e820d)){if(-0x1===_0x2664c8&&(_0x2664c8=_0x3dae0a),this['_markWrappedElements'](_0x2e820d),!this['_isNewNode'](_0x1ec398)){const [_0x3aaf0d,_0xe3a23e]=this['_findReferenceNode'](_0x2e820d,_0x196e11,_0x1d349b);if(_0x3aaf0d){const _0x1ea02b=Array['from'](_0x5bd5ad)['slice'](_0x2664c8,_0x3dae0a+0x1);this['_insertNodes'](_0x3aaf0d,_0x1ea02b,_0xe3a23e),_0x2664c8=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2e820d))_0x196e11=!0x0;else{if(this['_isExistingNode'](_0x2e820d)){const _0x4a4cf9=Ps(_0x2e820d,'data-id');if(_0x4a4cf9&&this['_existingDataIds']['has'](_0x4a4cf9)){this['_referencedExistingIds']['add'](_0x4a4cf9);const _0x5907fb=vs('data-id',_0x4a4cf9,_0x1d349b);this['_replaceNode'](_0x5907fb,_0x2e820d);}}else{if(nn(_0x2e820d)){const _0x512371=rn(_0x2e820d);vs('data-id',_0x512371,_0x4653ec)||this['_touchedNodesState']['removedIds']['push'](_0x512371);}}}}}for(const _0x31bd2b of this['_touchedNodesState']['removedIds']){const _0x53f32e=vs('data-id',_0x31bd2b,_0x1d349b);_0x53f32e&&(this['_rescueUnwrappedElements'](_0x53f32e),this['_removeNode'](_0x53f32e,_0x31bd2b,_0x28381f));}if(ks('data-id','new-element',_0x1d349b)['forEach'](_0x56e382=>{const _0x4ce31d=this['_getUid'](_0x56e382);Ds(_0x56e382,'data-id',_0x4ce31d),this['_touchedNodesState']['newIds']['push'](_0x4ce31d);}),this['_removeSpecialComments'](_0x1d349b),_0x28381f&&_0x28381f['cutAfterUnstable']){const _0x278dcf=this['_findLastConfirmationPoint'](_0x5bd5ad),_0x1b920a=this['_getLastStableElement'](_0x1d349b,_0x278dcf);this['_markUnstableElements'](_0x1d349b,_0x1b920a);}if(this['_processWrappedElements'](_0x1d349b,_0x28381f),_0x28381f&&_0x28381f['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x5b162f=ks('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1d349b);let _0x290c73=_0x5b162f[_0x5b162f['length']-0x1];for(;_0x290c73;)Bs(_0x290c73),_0x290c73=_0x290c73['parentNode'];}return{'parsedContent':_0x1d349b,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}_insertNodes(_0x53eae1,_0x2fa6de,_0x211aaa){for(const _0x23f702 of _0x2fa6de){const _0x4b0315=this['_getUid'](_0x23f702);Ds(_0x23f702,'data-id',_0x4b0315),this['_touchedNodesState']['newIds']['push'](_0x4b0315),this['_touchedNodesState']['lastTouchedId']=_0x4b0315;}const _0x3207f9='afterbegin'===_0x211aaa||'afterend'===_0x211aaa?_0x2fa6de['reverse']():_0x2fa6de;for(const _0x295e07 of _0x3207f9)Hs(_0x53eae1,_0x295e07,_0x211aaa);}['_replaceNode'](_0x5cd68a,_0x1c0138){if(!_0x5cd68a)return;if(_0x20c40=_0x1c0138,Us(Os(_0x5cd68a))===Us(Os(_0x20c40)))return;var _0x20c40;const _0x19923c=Ps(_0x5cd68a,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x19923c),this['_touchedNodesState']['lastTouchedId']=_0x19923c,_0x452856(_0x5cd68a,_0x1c0138['cloneNode'](!0x0));}['_removeNode'](_0x21cba9,_0x1cce13,_0xf56178){if(_0xf56178&&_0xf56178['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1cce13;const _0xcf3ca1=_0xf56178['replaceRemovedWith']['cloneNode'](!0x0);Ds(_0xcf3ca1,'data-id',_0x1cce13),Ds(_0xcf3ca1,'data-removed','true'),_0x452856(_0x21cba9,_0xcf3ca1);}else _0x47cc1f(_0x21cba9);}['_findReferenceNode'](_0x11ca29,_0x1b0a1a,_0x26ac20){const _0x34d201=this['_findPrevElementWithDataId'](_0x11ca29,!0x1);if(_0x34d201){const _0x843686=rn(_0x34d201),_0x31decb=vs('data-id',_0x843686,_0x26ac20);if(_0x31decb)return[_0x31decb,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x843686);}const _0x4c0315=this['_findNextElementWithDataId'](_0x11ca29,!0x1);if(_0x4c0315){const _0x1a2115=rn(_0x4c0315),_0x52c0dc=vs('data-id',_0x1a2115,_0x26ac20);if(_0x52c0dc)return[_0x52c0dc,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x1a2115);}return _0x1b0a1a?_0x11ca29['nextSibling']?this['_findFallbackReferenceNode'](_0x11ca29,_0x26ac20):[_0x26ac20['childNodes'][_0x26ac20['childNodes']['length']-0x1],'afterend']:[_0x26ac20['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5dcf59,_0x1e8caf){const _0x1545b0=[],_0x56ccfe=this['_findPrevElementWithDataId'](_0x5dcf59,!0x0);if(_0x56ccfe){const _0x2425ea=vs('data-id',rn(_0x56ccfe),_0x1e8caf);_0x2425ea&&_0x1545b0['push']([_0x2425ea,'afterend']);}const _0x3386ba=this['_findNextElementWithDataId'](_0x5dcf59,!0x0);if(_0x3386ba){const _0x8f639e=vs('data-id',rn(_0x3386ba),_0x1e8caf);_0x8f639e&&_0x1545b0['push']([_0x8f639e,'beforebegin']);}return _0x1545b0['length']>0x1?Vs(_0x1545b0[0x0][0x0])<=Vs(_0x1545b0[0x1][0x0])?_0x1545b0[0x0]:_0x1545b0[0x1]:0x1===_0x1545b0['length']?_0x1545b0[0x0]:[_0x1e8caf['lastChild'],'afterend'];}_findNextElementWithDataId(_0x28bcfe,_0x54206a){let _0x29067d=_0x28bcfe['nextSibling'],_0x22dffb=null,_0x57133b=!0x1;for(;_0x29067d;){if(_0x3e0c4f(_0x29067d)){if(nn(_0x29067d)&&(_0x22dffb=_0x29067d),this['_isExistingContentComment'](_0x29067d)&&_0x54206a&&!_0x57133b){_0x57133b=!0x0,_0x29067d=_0x29067d['nextSibling'];continue;}break;}const _0x5123ac=Ps(_0x29067d,'data-id');if(_0x5123ac&&'new-element'!==_0x5123ac&&this['_existingDataIds']['has'](_0x5123ac)){_0x22dffb=_0x29067d;break;}_0x29067d=_0x29067d['nextSibling'];}return _0x22dffb;}_findPrevElementWithDataId(_0x304bed,_0x2315c3){let _0x3f8c74=_0x304bed['previousSibling'],_0x53a679=null,_0x3bdf50=!0x1;for(;_0x3f8c74;){if(_0x3e0c4f(_0x3f8c74)){if(nn(_0x3f8c74)&&(_0x53a679=_0x3f8c74),this['_isExistingContentComment'](_0x3f8c74)&&_0x2315c3&&!_0x3bdf50){_0x3bdf50=!0x0,_0x3f8c74=_0x3f8c74['previousSibling'];continue;}break;}const _0x128976=Ps(_0x3f8c74,'data-id');if(_0x128976&&'new-element'!==_0x128976&&this['_existingDataIds']['has'](_0x128976)){_0x53a679=_0x3f8c74;break;}_0x3f8c74=_0x3f8c74['previousSibling'];}return _0x53a679;}_markWrappedElements(_0x26e4a9){_0x545292(_0x26e4a9)&&ks('data-id',null,_0x26e4a9)['forEach'](_0x3a6fdc=>{this['_isExistingNode'](_0x3a6fdc)&&(Ds(_0x3a6fdc,'data-wrapped-id',Ps(_0x3a6fdc,'data-id')),Ds(_0x3a6fdc,'data-id',null));});}_processWrappedElements(_0x25aae6,_0x116edb){ks('data-wrapped-id',null,_0x25aae6)['forEach'](_0x1dbb3a=>{const _0x2b749d=Ps(_0x1dbb3a,'data-wrapped-id');if(this['_hasUnstableParent'](_0x1dbb3a))return;const _0x21a8d7=vs('data-id',_0x2b749d,_0x25aae6);Ds(_0x1dbb3a,'data-id',_0x2b749d),_0x21a8d7&&(this['_removeNode'](_0x21a8d7,_0x2b749d,_0x116edb),this['_touchedNodesState']['removedIds']['push'](_0x2b749d),this['_touchedNodesState']['lastTouchedId']=_0x2b749d);});}_hasUnstableParent(_0x43a23f){let _0x5df5fe=_0x43a23f['parentNode'];for(;_0x5df5fe;){if(Ps(_0x5df5fe,'data-unstable'))return!0x0;_0x5df5fe=_0x5df5fe['parentNode'];}return!0x1;}_rescueUnwrappedElements(_0x54bd5a){const _0x2c23dc=new Set(this['_touchedNodesState']['removedIds']),_0x531263=new Set(this['_touchedNodesState']['newIds']);ks('data-id',null,_0x54bd5a)['forEach'](_0x460465=>{const _0x2d7697=Ps(_0x460465,'data-id'),_0x59fbe4=!!_0x2d7697&&this['_referencedExistingIds']['has'](_0x2d7697),_0x490d1d=!!_0x2d7697&&_0x531263['has'](_0x2d7697);if(!_0x2d7697||!_0x59fbe4&&!_0x490d1d)return;if(_0x2c23dc['has'](_0x2d7697))return;let _0xb0718d=_0x460465['parentNode'],_0x210b73=!0x1;for(;_0xb0718d;){if(_0xb0718d===_0x54bd5a){_0x210b73=!0x0;break;}const _0x3e0d40=Ps(_0xb0718d,'data-id');if(_0x3e0d40&&(this['_referencedExistingIds']['has'](_0x3e0d40)||_0x531263['has'](_0x3e0d40)))return;_0xb0718d=_0xb0718d['parentNode'];}if(_0x210b73){if(ti(_0x54bd5a,_0x460465),_0x59fbe4){const _0x23b9bb=this['_generateUid'](),_0x5c17fb=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x2d7697);-0x1!==_0x5c17fb&&this['_touchedNodesState']['modifiedIds']['splice'](_0x5c17fb,0x1),Ds(_0x460465,'data-unwrapped-id',_0x2d7697),Ds(_0x460465,'data-id',_0x23b9bb),this['_touchedNodesState']['newIds']['push'](_0x23b9bb),this['_touchedNodesState']['rescuedNewIds']['add'](_0x23b9bb),this['_touchedNodesState']['lastTouchedId']=_0x23b9bb;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x2d7697),this['_touchedNodesState']['lastTouchedId']=_0x2d7697;}});}_getUid(_0x5e7c44){return this['_isExistingNode'](_0x5e7c44)?Ps(_0x5e7c44,'data-id'):this['_generateUid']();}_removeSpecialComments(_0x550478){Ls(_0x550478)['filter'](_0x539592=>nn(_0x539592)||this['_isExistingContentComment'](_0x539592))['forEach'](_0x4b8fba=>{_0x47cc1f(_0x4b8fba);});}_findLastConfirmationPoint(_0x409f86){let _0x319acc=null,_0x3e5b61=null,_0x3cb578=null,_0x36e281=null;const _0x4ce549=_0x30fd6b=>{_0x30fd6b&&(_0x319acc=_0x30fd6b),_0x3cb578=null,_0x36e281=null;};for(let _0x3fcec4=0x0;_0x3fcec4<_0x409f86['length'];_0x3fcec4++){const _0x352c72=_0x409f86[_0x3fcec4];if(this['_isExistingContentComment'](_0x352c72)){_0x4ce549(_0x3e5b61);continue;}if(_0x545292(_0x352c72)){const _0x20a181=Ps(_0x352c72,'data-id'),_0x3c8ef8=_0x3fcec4===_0x409f86['length']-0x1;if(_0x20a181&&'new-element'!==_0x20a181&&this['_touchedNodesState']['modifiedIds']['includes'](_0x20a181)&&!_0x3c8ef8){_0x4ce549(_0x20a181),_0x3e5b61=_0x20a181;continue;}}let _0x159984;const _0x285021=rn(_0x352c72);if(_0x285021&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x285021))_0x3e5b61=_0x285021;else{if(_0x285021&&this['_touchedNodesState']['newIds']['includes'](_0x285021))_0x159984='N';else{if(!nn(_0x352c72))continue;_0x159984='R';}_0x159984===_0x36e281||null===_0x36e281?_0x36e281=_0x159984:null!==_0x3cb578?(_0x4ce549(_0x3e5b61),_0x36e281=_0x159984):(_0x3cb578=_0x36e281,_0x36e281=_0x159984),_0x3e5b61=_0x285021;}}const _0x24cf15=_0x409f86[_0x409f86['length']-0x1];return _0x24cf15&&!_0x545292(_0x24cf15)&&!nn(_0x24cf15)&&_0x3e5b61&&_0x4ce549(_0x3e5b61),_0x319acc;}_getLastStableElement(_0x3c11ea,_0x1b5158){if(!_0x1b5158)return null;const _0x588cc7=vs('data-id',_0x1b5158,_0x3c11ea);if(!_0x588cc7)return null;const _0x2aed6e=[_0x588cc7,...Ms(_0x588cc7)]['at'](-0x2);if(_0x2aed6e===_0x588cc7)return _0x588cc7;let _0x21dc70=_0x2aed6e['previousSibling'];for(;_0x21dc70&&!_0x545292(_0x21dc70);)_0x21dc70=_0x21dc70['previousSibling'];return _0x21dc70;}_markUnstableElements(_0x3977bd,_0x2f89fb){const _0x9b3b7c=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x5c8273=_0x2f89fb?_0x2f89fb['nextSibling']:_0x3977bd['firstChild'];for(;_0x5c8273;)_0x545292(_0x5c8273)&&(_0x9b3b7c['has'](Ps(_0x5c8273,'data-id'))||ks('data-id',null,_0x5c8273)['some'](_0x23c45f=>_0x9b3b7c['has'](Ps(_0x23c45f,'data-id'))))&&Ds(_0x5c8273,'data-unstable','true'),_0x5c8273=_0x5c8273['nextSibling'];}['_isNewNode'](_0x33e3dc){return Boolean('new-element'===Ps(_0x33e3dc,'data-id'));}_isExistingNode(_0x2d8f91){return Boolean((Ps(_0x2d8f91,'data-id')||'')['length']>0x0&&'new-element'!==Ps(_0x2d8f91,'data-id'));}_isExistingContentComment(_0x22603a){return Boolean(_0x3e0c4f(_0x22603a)&&Os(_0x22603a)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function nn(_0x1223cc){return!!_0x1223cc&&Boolean(_0x3e0c4f(_0x1223cc)&&Os(_0x1223cc)['match'](/removed[\s*-]data-id="[^"]+"/));}function rn(_0x46893b){if(!_0x46893b)return null;if(_0x545292(_0x46893b))return Ps(_0x46893b,'data-id')??null;if(_0x3e0c4f(_0x46893b)){const _0x3472d9=Os(_0x46893b)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x3472d9&&_0x3472d9[0x1])return _0x3472d9[0x1];}return null;}function on(_0x32db79,_0x415ba2){const _0x12641f=new Map();for(const _0x4d4b51 of ys(_0x32db79))xs(_0x4d4b51)||_0x12641f['set'](Ps(_0x4d4b51,'data-id'),_0x4d4b51);const _0x363438=new Set();for(const _0x1c62c7 of ys(_0x415ba2)){if(xs(_0x1c62c7))continue;const _0x241e3e=Ps(_0x1c62c7,'data-id'),_0x5c00b6=_0x241e3e?_0x12641f['get'](_0x241e3e):void 0x0;_0x5c00b6?(_0x452856(_0x1c62c7,_0x2a3383(_0x5c00b6,!0x0)),_0x363438['add'](_0x241e3e)):_0x47cc1f(_0x1c62c7);}for(const _0x35e3d1 of Ls(_0x415ba2))nn(_0x35e3d1)&&_0x12641f['has'](rn(_0x35e3d1))&&_0x47cc1f(_0x35e3d1);const _0x2fc96e=new Set(ks('data-id',null,_0x415ba2)['map'](_0x4b0375=>Ps(_0x4b0375,'data-id')));for(const [_0x491266,_0x44e37c]of _0x12641f){if(_0x363438['has'](_0x491266))continue;let _0x5c8b73=_0x44e37c['parent'],_0x262046=null;for(;_0x5c8b73&&_0x545292(_0x5c8b73);){const _0x392b78=Ps(_0x5c8b73,'data-id');if(_0x392b78&&_0x2fc96e['has'](_0x392b78)){_0x262046=_0x392b78;break;}_0x5c8b73=_0x5c8b73['parent'];}if(!_0x262046)continue;const _0x10a1aa=vs('data-id',_0x262046,_0x415ba2);_0x10a1aa&&_0x380486(_0x10a1aa,_0x2a3383(_0x44e37c,!0x0));}}const an=/* #__PURE__ -- @preserve */
27
+ At();var hn=class extends an{_m2html;constructor(){super();const _0x1bd40d=Object['entries'](_0x29e337),_0x2fe280=_0x1bd40d['findIndex'](([_0x330500])=>'rehypeDomRaw'===_0x330500);if(-0x1===_0x2fe280)throw new ct('ai-response-parser-unable-to-set-up-parser');_0x1bd40d['splice'](_0x2fe280+0x1,0x0,['rehypeSanitize',_0x23be32]),this['_m2html']=new _0x20ae64({'plugins':Object['fromEntries'](_0x1bd40d)});}convertMarkdownToHTML(_0x21991e){const _0xdeeef6=this['_m2html']['parse'](_0x21991e);return this['parseAndNormalizeHTML'](_0xdeeef6);}['parseAndNormalizeHTML'](_0x25c425){return this['_parseHTML'](_0x25c425);}['_parseHTML'](_0x2b5fb2){const _0x558ba3=Rs('<dummy>'+_0x2b5fb2['replace'](/<[^>]*?$/g,'')+'</dummy>');return cn(_0x558ba3),_0x558ba3['children']=_0x558ba3['children'][0x0]['children'],_0x558ba3;}};function cn(_0x3ca56a){for(const _0x42a28f of _0x3ca56a['children'])_0x545292(_0x42a28f)?'pre'!==_0x42a28f['name']&&cn(_0x42a28f):_0x5273d9(_0x42a28f)&&(_0x42a28f['data']=_0x42a28f['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function ln({changeGroups:_0x3cc61c,documentContextContent:_0x436a70,showDiff:_0x479bdf,trimUnchanged:_0x43ac77=!0x0}){const _0x22f279=qs(_0x3cc61c,_0x436a70);return _0x3cc61c['map'](_0x3787c0=>{if(!_0x3787c0['editor']||'destroyed'===_0x3787c0['editor']['state'])return null;const _0x5c70a1=Gs(_0x3787c0['editor'],_0x3787c0['rootName']),_0x5bdd53=new _0x139fbf([]),_0x5380f7=new _0x139fbf([]),_0x551a54=new Set();for(const _0x355050 of _0x3787c0['changes'])'new'==_0x355050['type']&&ks('data-id',null,_0x355050['node'])['forEach'](_0x29d8d9=>{_0x551a54['add'](Ps(_0x29d8d9,'data-id'));});for(const _0x502c68 of _0x3787c0['changes'])if('removed'!=_0x502c68['type']?_0x5380f7['children']['push'](_0x502c68['node']['cloneNode'](!0x0)):_0x479bdf||_0x551a54['has'](_0x502c68['id'])||_0x5380f7['children']['push'](_0x502c68['node']['cloneNode'](!0x0)),'new'!=_0x502c68['type']&&(_0x479bdf||'removed'!=_0x502c68['type'])){const _0x3a7bb1=_0x228c3a(_0x28c7a5=>Ps(_0x28c7a5,'data-id')==_0x502c68['id'],_0x436a70['get'](_0x3787c0['documentId']),!0x0);_0x3a7bb1&&_0x5bdd53['children']['push'](_0x3a7bb1['cloneNode'](!0x0));}if(_0x5c70a1&&_0x22f279['has'](_0x3787c0['index']))return{'type':_0x3787c0['changes'][0x0]['type'],'index':_0x3787c0['index'],'state':_0x3787c0['state'],'outdatedReason':_0x3787c0['outdatedReason'],'content':new _0x139fbf([]),'hasChanges':!0x1};let _0x2da23c,_0xc4f37,_0x5722e3;try{({content:_0x2da23c,hasChanges:_0xc4f37}=un(_0x3787c0['editor'],_0x5bdd53,_0x5380f7,_0x479bdf,_0x43ac77));}catch{return{'type':_0x3787c0['changes'][0x0]['type'],'index':_0x3787c0['index'],'state':_0x3787c0['state'],'outdatedReason':_0x3787c0['outdatedReason'],'content':new _0x139fbf([]),'hasChanges':!0x1};}if(_0x5c70a1){_0x5722e3=_0x3787c0['editor']['ui']['getEditableElement'](_0x3787c0['rootName'])?.['tagName']['toLowerCase']();const _0x533cdb=_0x2da23c['children']['filter'](_0x545292);0x1===_0x533cdb['length']&&(_0x2da23c=new _0x139fbf(_0x533cdb[0x0]['children']));}return{'type':_0x3787c0['changes'][0x0]['type'],'index':_0x3787c0['index'],'state':_0x3787c0['state'],'outdatedReason':_0x3787c0['outdatedReason'],'content':_0x2da23c,'hasChanges':_0xc4f37,'wrapperTag':_0x5722e3};})['filter'](_0x4e761a=>null!==_0x4e761a);}function un(_0x4a0c26,_0x514b6e,_0x497c40,_0x47de6d,_0x562f38=!0x0){const _0x3b450a=_0x4a0c26['plugins']['get']('DocumentCompare'),_0x1a4b69=Os(_0x514b6e),_0x54e3d4=Os(_0x497c40),_0x21be71=_0x4a0c26['data']['parse'](_0x1a4b69,'$root'),_0xe43f5e=_0x4a0c26['model']['createPositionAt'](_0x21be71,0x0),_0x3fdc25=_0x3b450a['getDiff'](_0x1a4b69,_0x54e3d4,{'anchor':_0xe43f5e,'markDeletions':_0x47de6d,'targetEditor':_0x4a0c26})['getOperations']();if(0x0==_0x3fdc25['length'])return{'content':_0x514b6e['cloneNode'](!0x0),'hasChanges':!0x1};if(_0x47de6d?function(_0x252798,_0x1992de,_0x282c7b){if(0x0==_0x252798['length'])return;const _0x5e568b=_0x282c7b['plugins']['get']('DocumentCompare'),_0x17e025=_0x282c7b['plugins']['get']('SuggestionsConversion');_0x282c7b['model']['change'](_0x370611=>{const _0x103c9c=new Set();for(let _0xa1f884=0x0;_0xa1f884<_0x252798['length'];_0xa1f884++){const _0x260c38=_0x252798[_0xa1f884];if(_0x260c38['baseVersion']=null,_0x260c38['isDocumentOperation']=!0x1,!_0x9fd625(_0x260c38)){if(_0x5e568b['isMarkedRemoveOperation'](_0x260c38)){const _0x1897ad=_0x49575d(_0x260c38['newRange'],_0x282c7b['model']),_0x528c63='suggestion:deletion:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x528c63,_0x1897ad);}else switch(_0x260c38['type']){case'rename':{if(_0x260c38['oldName']==_0x260c38['newName'])break;_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38);const _0xaa4a08='$elementName',_0x1de101=_0x260c38['position'],_0x2303b6=_0x282c7b['model']['createRange'](_0x1de101,_0x282c7b['model']['createPositionAt'](_0x1de101['nodeAfter'],'end')),_0x1b5264='suggestion:attribute:'+_0xaa4a08+':'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x1b5264,_0x2303b6);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x260c38['oldValue']==_0x260c38['newValue'])break;_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38);const _0x236ab0=_0x260c38['key'];if(!_0x17e025['isRegisteredAttribute'](_0x236ab0))break;const _0x49c81b=_0x49575d(_0x260c38['range'],_0x282c7b['model']),_0x4299a1='suggestion:attribute:'+_0x236ab0+':'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x4299a1,_0x49c81b);break;}case'insert':{if(_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38),dn(_0x1992de,_0x260c38),_0x252798[_0xa1f884+0x1]&&'move'==_0x252798[_0xa1f884+0x1]['type'])break;const _0x15727f=_0x260c38['position'],_0x440302=_0x260c38['howMany'],_0xdd7dc8=_0x49575d(_0x282c7b['model']['createRange'](_0x15727f,_0x15727f['getShiftedBy'](_0x440302)),_0x282c7b['model']),_0x3c0dce='suggestion:insertion:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x3c0dce,_0xdd7dc8);break;}case'split':{_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38),dn(_0x1992de,_0x260c38);const _0x5e76b2=_0x260c38['splitPosition'],_0x228101=_0x260c38['moveTargetPosition'],_0x29eb28=_0x282c7b['model']['createRange'](_0x5e76b2,_0x228101),_0x458aec='suggestion:insertion:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x458aec,_0x29eb28);break;}case'move':{_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38),dn(_0x1992de,_0x260c38);const _0x53f1c1=_0x260c38['getMovedRangeStart'](),_0x2b28f6=_0x260c38['howMany'];for(let _0x45b025=0x0;_0x45b025<_0x2b28f6;_0x45b025++){const _0x2122a6=_0x53f1c1['getShiftedBy'](_0x45b025)['nodeAfter'];_0x103c9c['add'](_0x2122a6);}break;}case'remove':{const _0x7d0a7d=_0x260c38['sourcePosition'],_0x1218c0=_0x260c38['howMany'],_0x381ebc=new _0x4f656c(_0x7d0a7d,_0x1218c0);_0x370611['batch']['addOperation'](_0x381ebc),_0x282c7b['model']['applyOperation'](_0x381ebc),dn(_0x1992de,_0x260c38);break;}}}}for(const _0x4cac2d of _0x103c9c){const _0x47f5a2=_0x282c7b['model']['createRangeOn'](_0x4cac2d),_0x4aa8f7='suggestion:formatBlock:$fakeWrap:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x4aa8f7,_0x49575d(_0x47f5a2,_0x282c7b['model']));}});}(_0x3fdc25,_0x21be71,_0x4a0c26):_0x4a0c26['model']['change'](_0x2f060b=>{for(const _0x43157a of _0x3fdc25)if(!_0x9fd625(_0x43157a)){if('remove'==_0x43157a['type']){const _0x72bf9d=_0x43157a['sourcePosition'],_0x8e3aed=_0x43157a['howMany'],_0x4f721a=new _0x4f656c(_0x72bf9d,_0x8e3aed);_0x2f060b['batch']['addOperation'](_0x4f721a),_0x4a0c26['model']['applyOperation'](_0x4f721a),dn(_0x21be71,_0x43157a);}else{if('marker'==_0x43157a['type']){const _0x20a6bd=_0x43157a['name'],_0x3c1711=_0x43157a['newRange'];null!==_0x3c1711?_0x21be71['markers']['set'](_0x20a6bd,_0x3c1711):_0x21be71['markers']['delete'](_0x20a6bd);}else _0x43157a['baseVersion']=null,_0x43157a['isDocumentOperation']=!0x1,_0x2f060b['batch']['addOperation'](_0x43157a),_0x4a0c26['model']['applyOperation'](_0x43157a),dn(_0x21be71,_0x43157a);}}}),_0x562f38){const _0x37dd75=_n(_0x4a0c26,_0x3fdc25,_0x21be71);An(_0x4a0c26['model'],_0x37dd75),function(_0x131cb2,_0x4c024b){const _0xbb2e6b=_0x4c024b['getFirstRange']()['start'];let _0x4a8a66=_0x4c024b['getFirstRange']()['end'];const _0x17f909=_0xbb2e6b['root'];(_0x4a8a66['textNode']||_0x4a8a66['nodeAfter']&&_0x4a8a66['nodeAfter']['is']('$text'))&&(_0x3ab39d(_0x4a8a66,'...'),En(_0x17f909,_0x4a8a66,0x3),_0x4a8a66=_0x4a8a66['getShiftedBy'](0x3)),(_0xbb2e6b['textNode']||_0xbb2e6b['nodeBefore']&&_0xbb2e6b['nodeBefore']['is']('$text'))&&(_0x3ab39d(_0xbb2e6b,'...'),En(_0x17f909,_0xbb2e6b,0x3),_0xbb2e6b['parent']==_0x4a8a66['parent']&&(_0x4a8a66=_0x4a8a66['getShiftedBy'](0x3)));const _0x3894a5=_0x131cb2['createRange'](_0x131cb2['createPositionAt'](_0x17f909,0x0),_0xbb2e6b),_0x216ec0=_0x131cb2['createRange'](_0x4a8a66,_0x131cb2['createPositionAt'](_0x17f909,'end')),_0x447dec=[..._0x3894a5['getMinimalFlatRanges'](),..._0x216ec0['getMinimalFlatRanges']()];_0x447dec['reverse']();for(const _0x4e0e3a of _0x447dec)_0x168f4f(_0x4e0e3a),pn(_0x17f909,_0x4e0e3a);}(_0x4a0c26['model'],_0x37dd75);}return{'content':Rs(_0x4a0c26['data']['stringify'](_0x21be71,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}function dn(_0x35d6e1,_0x461d78){for(const [_0x18c66c,_0x5c4d97]of _0x35d6e1['markers']){const _0x4c864a=_0x2827cc['_createFromRanges'](_0x5c4d97['getTransformedByOperation'](_0x461d78));_0x4c864a['root']==_0x35d6e1?_0x35d6e1['markers']['set'](_0x18c66c,_0x4c864a):_0x35d6e1['markers']['delete'](_0x18c66c);}}function _n(_0x12e206,_0xabc462,_0x4a97b5){const _0x744aa1=_0x12e206['plugins']['get']('DocumentCompare');let _0x10d31d=_0x12e206['model']['createPositionAt'](_0x4a97b5,Number['POSITIVE_INFINITY']),_0x45a39c=_0x12e206['model']['createPositionAt'](_0x4a97b5,0x0);for(const _0x5ef5d3 of _0xabc462){let _0x4f92e3,_0x2e5bb5;if(_0x744aa1['isMarkedRemoveOperation'](_0x5ef5d3))_0x4f92e3=_0x5ef5d3['newRange']['start'],_0x2e5bb5=_0x5ef5d3['newRange']['end'];else switch(_0x10d31d=gn(_0x10d31d,_0x5ef5d3),_0x45a39c=gn(_0x45a39c,_0x5ef5d3),_0x5ef5d3['type']){case'rename':_0x4f92e3=_0x5ef5d3['position'],_0x2e5bb5=_0x4f92e3['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4f92e3=_0x5ef5d3['range']['start'],_0x2e5bb5=_0x5ef5d3['range']['end'];break;case'insert':_0x4f92e3=_0x5ef5d3['position'],_0x2e5bb5=_0x4f92e3['getShiftedBy'](_0x5ef5d3['howMany']);break;case'split':_0x4f92e3=_0x5ef5d3['splitPosition'],_0x2e5bb5=_0x5ef5d3['moveTargetPosition'];break;case'merge':{const _0x5f3c3d=_0x5ef5d3['targetPosition']['path']['slice'](0x0,-0x1);_0x4f92e3=_0x12e206['model']['createPositionFromPath'](_0x4a97b5,_0x5f3c3d),_0x2e5bb5=_0x4f92e3['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x2bb9aa=_0x5ef5d3['howMany'],_0x5aebce=_0x5ef5d3['sourcePosition']['_getTransformedByInsertion'](_0x5ef5d3['targetPosition'],_0x2bb9aa),_0x6edf14=_0x5ef5d3['getMovedRangeStart']();'remove'==_0x5ef5d3['type']?(_0x4f92e3=_0x5aebce,_0x2e5bb5=_0x5aebce):(_0x4f92e3=_0x6edf14,_0x2e5bb5=_0x6edf14['getShiftedBy'](_0x2bb9aa));break;}}_0x4f92e3&&_0x4f92e3['isBefore'](_0x10d31d)&&(_0x10d31d=_0x4f92e3['clone'](),_0x10d31d['stickiness']='toNone'),_0x2e5bb5&&_0x2e5bb5['isAfter'](_0x45a39c)&&(_0x45a39c=_0x2e5bb5['clone'](),_0x45a39c['stickiness']='toNone');}return _0x12e206['model']['createSelection'](_0x12e206['model']['createRange'](_0x10d31d,_0x45a39c));}function gn(_0x1342af,_0x34441c){return'move'!=_0x34441c['type']&&'remove'!=_0x34441c['type']||_0x34441c['sourceRange']['containsPosition'](_0x1342af)&&((_0x1342af=_0x34441c['sourcePosition']['clone']())['stickiness']='toNone'),_0x1342af['getTransformedByOperation'](_0x34441c);}function An(_0x2f9f1d,_0x558987){In(_0x2f9f1d,_0x558987,'forward');const _0x2f9ba6=_0x558987['getFirstRange']();_0x558987['setTo']([]),_0x558987['setTo'](_0x2f9ba6,{'backward':!0x0}),In(_0x2f9f1d,_0x558987,'backward');}function In(_0x47e1e7,_0x5dd06d,_0x3f98d7){let _0x3d8aaf=0x14;for(;_0x3d8aaf;){_0x47e1e7['modifySelection'](_0x5dd06d,{'unit':'word','direction':_0x3f98d7}),_0x3d8aaf--;const _0x322d12=_0x5dd06d['focus']['forward'==_0x3f98d7?'nodeBefore':'nodeAfter'];if(_0x322d12&&_0x322d12['is']('element')&&_0x47e1e7['schema']['isBlock'](_0x322d12)&&_0x47e1e7['schema']['isObject'](_0x322d12))break;}}function pn(_0x15b2a4,_0x413d2d){for(const [_0x3437fb,_0x473383]of _0x15b2a4['markers']){const _0x16f908=_0x473383['_getTransformedByDeletion'](_0x413d2d['start'],_0x413d2d['end']['offset']-_0x413d2d['start']['offset']);null!=_0x16f908?_0x15b2a4['markers']['set'](_0x3437fb,_0x16f908):_0x15b2a4['markers']['delete'](_0x3437fb);}}function En(_0x3a93cc,_0x2d4310,_0x1d53c9){for(let [_0x2202cf,_0x106ca9]of _0x3a93cc['markers'])_0x106ca9=_0x106ca9['_getTransformedByInsertion'](_0x2d4310,_0x1d53c9,!0x1)[0x0],_0x3a93cc['markers']['set'](_0x2202cf,_0x106ca9);}function mn(_0x2abdc1,_0x3bedec){for(const _0x43a735 of _0x2abdc1)'noop'!==_0x43a735['type']&&(_0x43a735['_aiSource']=_0x3bedec);}var Tn=class extends _0x898608{static get['pluginName'](){return'AIGateway';}static get requires(){return[_0x45dea0,fs];}get['models'](){return this['context']['plugins']['get'](fs)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x17acba,_0x55976c){const {applyMethod:_0x1adbf9,roots:_0x15a931}=_0x55976c,_0x1dd475='suggest'===_0x1adbf9;if(_0x17acba['error']||!_0x17acba['results']['length'])throw new ct('ai-gateway-apply-invalid-status',this,{'status':_0x17acba['status']});if(_0x15a931){if(0x0===_0x15a931['length'])throw new ct('ai-gateway-apply-empty-roots',this);for(const {channelId:_0x1427bf,rootName:_0xea00e1}of _0x15a931)if(!_0x17acba['results']['some'](_0x39dd95=>_0x39dd95['channelId']===_0x1427bf&&_0x39dd95['rootName']===_0xea00e1))throw new ct('ai-gateway-apply-root-not-found',this,{'channelId':_0x1427bf,'rootName':_0xea00e1});}const _0x47cd46=_0x17acba['results']['reduce']((_0x100f58,_0x3c03e5)=>{if(_0x15a931&&!_0x15a931['some'](_0x488668=>_0x488668['channelId']===_0x3c03e5['channelId']&&_0x488668['rootName']===_0x3c03e5['rootName']))return _0x100f58;if('completed'!==_0x3c03e5['status'])throw new ct('ai-gateway-apply-invalid-status',this,{'status':_0x3c03e5['status'],'channelId':_0x3c03e5['channelId'],'rootName':_0x3c03e5['rootName']});if(_0x1dd475&&!_0x3c03e5['editor']['plugins']['has']('TrackChanges'))throw new ct('ai-no-track-changes',this,{'channelId':_0x3c03e5['channelId'],'rootName':_0x3c03e5['rootName']});let _0x5bd1df=_0x100f58['get'](_0x3c03e5['editor']);return _0x5bd1df||(_0x5bd1df=[],_0x100f58['set'](_0x3c03e5['editor'],_0x5bd1df)),_0x5bd1df['push'](_0x3c03e5),_0x100f58;},new Map()),_0x5144a1=this['context']['plugins']['get'](_0x45dea0);for(const [_0x6e903c,_0x928b9e]of _0x47cd46){const _0x36b8e6=_0x928b9e['map'](_0x1d92f6=>{const _0x4d791d=_0x6e903c['model']['createPositionAt'](_0x6e903c['model']['document']['getRoot'](_0x1d92f6['rootName']),0x0),_0x274a12=Qs(_0x6e903c,_0x1d92f6['rootName'],_0x1d92f6['contentRawOld'],_0x1d92f6['contentRawNew']);if(!_0x274a12)return _0x1d92f6['droppedUnsupportedInlineChange']=!0x0,null;const _0x2c64e2=_0x5144a1['getDiff'](_0x274a12['before'],_0x274a12['after'],{'anchor':_0x4d791d,'markDeletions':_0x1dd475,'targetEditor':_0x6e903c}),_0x2b7e24=_0x6e903c['model']['document']['history']['getOperations'](_0x1d92f6['documentVersion']),_0x2ad030={'document':_0x6e903c['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1b0202=_0x5dec67(_0x2c64e2['getOperations'](),_0x2b7e24,_0x2ad030)['operationsA'];return mn(_0x1b0202,_0x55976c['aiSource']??'api'),_0x1b0202;});_0x6e903c['model']['change'](_0x2cb144=>{for(const _0x505ab5 of _0x36b8e6)_0x505ab5&&(_0x1dd475?_0x6e903c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x505ab5):_0x5144a1['applyOperations'](_0x2cb144,_0x505ab5));});}}mergeChangesIntoContent(_0x117148,_0x49ed10,_0x11c3b1){const _0x214f75=new hn(),_0x43956e=new sn();let _0x1f0296=_0x214f75['parseAndNormalizeHTML'](_0x49ed10);for(const _0x4174df of _0x117148)try{const _0x5e2a91=_0x214f75['parseAndNormalizeHTML'](_0x4174df['content']);_0x1f0296=_0x43956e['merge'](_0x5e2a91,_0x1f0296,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x3b5ed1){throw new ct('ai-gateway-merge-failed',this,{..._0x4174df},_0x3b5ed1);}return un(_0x11c3b1,_0x214f75['parseAndNormalizeHTML'](_0x49ed10),_0x1f0296,!0x1,!0x1)['content'];}};const wn=/* #__PURE__ -- @preserve */
28
+ dt(),Cn=['capabilitiesUpdated'];var fn=class extends wn{['_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(_0x1d4827){const _0x4b3a32={};if(!_0x1d4827)return _0x4b3a32;('isWebSearchEnabled'in _0x1d4827?_0x1d4827['isWebSearchEnabled']:_0x1d4827['webSearch'])&&(_0x4b3a32['webSearch']={});const _0x34f9c1='isReasoningEnabled'in _0x1d4827?_0x1d4827['isReasoningEnabled']:_0x1d4827['reasoning'];return _0x34f9c1&&(_0x4b3a32['reasoning']='string'==typeof _0x34f9c1?{'level':_0x34f9c1}:{}),_0x4b3a32;}toggleWebSearch(){this['setWebSearch'](!this['_isWebSearchEnabled']);}toggleReasoning(){this['setReasoning'](!this['_isReasoningEnabled']);}setWebSearch(_0x4f8e23){_0x4f8e23!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4f8e23,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}setReasoning(_0x5e62e5){_0x5e62e5!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5e62e5,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}};function bn(_0x3a1d0b,_0x4c7c08,_0x26d796,_0x589450){if(_0x3a1d0b instanceof ct)return _0x3a1d0b;const _0x268edd=_0x3a1d0b?.['data'];return new ct(_0x4c7c08,_0x26d796,void 0x0!==_0x268edd?{..._0x589450,'backendData':_0x268edd}:_0x589450,_0x3a1d0b);}var Sn=class{_editor;_rootName;['_channelId'];['_sessionId'];_documentVersion;_contentRawOld;_contentRawNew;['_error'];_isAborted=!0x1;_droppedUnsupportedInlineChange=!0x1;constructor(_0x2b4254){this['_editor']=_0x2b4254['editor'],this['_rootName']=_0x2b4254['rootName'],this['_channelId']=_0x2b4254['channelId'],this['_sessionId']=_0x2b4254['sessionId'];}get status(){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get editor(){return this['_editor'];}get rootName(){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get documentVersion(){return this['_documentVersion'];}set documentVersion(_0x36cbca){this['_documentVersion']=_0x36cbca;}get contentRawOld(){return this['_contentRawOld'];}set contentRawOld(_0x3560bd){this['_contentRawOld']=_0x3560bd;}get contentRawNew(){return this['_contentRawNew'];}set contentRawNew(_0x30a663){this['_contentRawNew']=_0x30a663;}get contentOld(){return this['_dropDataIds'](this['_contentRawOld']||'');}get contentNew(){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x263222){this['_error']=_0x263222;}get droppedUnsupportedInlineChange(){return this['_droppedUnsupportedInlineChange'];}set droppedUnsupportedInlineChange(_0x3f2720){this['_droppedUnsupportedInlineChange']=_0x3f2720;}abort(){this['_isAborted']=!0x0;}_dropDataIds(_0xcab047){return _0xcab047['replace'](/ data-id="[a-z0-9]+"/g,'');}},Rn=class extends Sn{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x4f104f){this['_summary']=_0x4f104f;}},On=class{_results;constructor(_0x2bef03=[]){this['_results']=_0x2bef03;}_status='initialized';['_error'];abort(){'error'!==this['_status']&&(this['_status']='aborted');}get status(){return this['_status'];}set status(_0x51c582){this['_status']=_0x51c582;}get['error'](){return this['_error'];}set['error'](_0x1493c3){this['_status']='error',this['_error']=_0x1493c3;}get results(){return this['_results'];}addResult(..._0x36539f){this['_results']['push'](..._0x36539f);}},vn=class extends _0x898608{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get requires(){return[Is,tn,Tn,fs];}get['models'](){return this['context']['plugins']['get'](fs)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async processDocument(_0x181d06,_0x92dfc8){if(!_0x181d06)throw new ct('ai-documentprocessinggateway-missing-prompt',this);const _0x422936=await this['context']['plugins']['get'](tn)['getDocumentData'](),_0x24dfc5=_0x92dfc8['roots'];if(0x0===(_0x24dfc5??_0x422936)['length'])throw new ct('ai-documentprocessinggateway-empty-roots',this);if(_0x24dfc5){for(const _0x11b5ed of _0x24dfc5)if(!_0x422936['some'](_0x467c12=>_0x467c12['rootName']===_0x11b5ed['rootName']&&_0x467c12['channelId']===_0x11b5ed['channelId']))throw new ct('ai-documentprocessinggateway-root-not-found',this,{'channelId':_0x11b5ed['channelId'],'rootName':_0x11b5ed['rootName']});}const _0xef00d3=_0x24dfc5?_0x422936['filter'](_0x2c8e56=>_0x24dfc5['some'](_0xafe64=>_0xafe64['rootName']===_0x2c8e56['rootName']&&_0xafe64['channelId']===_0x2c8e56['channelId'])):_0x422936,_0x333bb1=[],_0x7f4a1c=[];for(const _0x74d35d of _0xef00d3){const _0x538401={'editor':_0x74d35d['editor'],'rootName':_0x74d35d['rootName'],'sessionId':_0x74d35d['sessionId'],'channelId':_0x74d35d['channelId'],'contentRawOld':_0x74d35d['content'],'documentVersion':_0x74d35d['version']};_0x333bb1['push'](_0x538401),_0x7f4a1c['push']({'type':'document','content':_0x538401['contentRawOld']});}const _0x2baf04=this['context']['plugins']['get']('AIConnector')['processDocument']({'content':_0x7f4a1c,'prompt':_0x181d06,'model':_0x92dfc8['model'],'capabilities':fn['getCapabilitiesRequestData'](_0x92dfc8['capabilities']),'contexts':_0x92dfc8['contexts']});let _0x9931e0;if(_0x92dfc8?.['signal']){_0x92dfc8['signal']['aborted']&&_0x2baf04['abortController']['abort']();const _0x25382b=_0x92dfc8['signal'],_0x425b37=()=>_0x2baf04['abortController']['abort']();_0x25382b['addEventListener']('abort',_0x425b37),_0x9931e0=()=>_0x25382b['removeEventListener']('abort',_0x425b37);}const _0x399ce5=new On();let _0x38900c=[];try{if(_0x38900c=(await _0x2baf04['getResult']())['documents'],!(_0x38900c&&_0x38900c['length']>0x0))throw new ct('ai-documentprocessinggateway-empty-reply',this);if(_0x38900c['length']!==_0x7f4a1c['length'])throw new ct('ai-documentprocessinggateway-reply-count-mismatch',this,{'expected':_0x7f4a1c['length'],'received':_0x38900c['length']});const _0x5d8351=_0x38900c['findIndex'](({document:_0x168642})=>!_0x168642['length']);if(-0x1!==_0x5d8351){const _0x3ea685=_0x333bb1[_0x5d8351];throw new ct('ai-documentprocessinggateway-empty-root-content',this,{'channelId':_0x3ea685['channelId'],'rootName':_0x3ea685['rootName']});}_0x399ce5['status']='completed';}catch(_0x56f7ab){_0x56f7ab instanceof Error&&_0x56f7ab['message']['includes']('ai-request-aborted')?_0x399ce5['abort']():_0x399ce5['error']=bn(_0x56f7ab,'ai-documentprocessinggateway-run-failed',this);}finally{_0x9931e0&&_0x9931e0();}if('completed'===_0x399ce5['status'])for(const [_0x3a4b20,_0xdb6339]of _0x333bb1['entries']()){const {channelId:_0x2b8e45,contentRawOld:_0x5f4cff,documentVersion:_0x214810,editor:_0x453da8,rootName:_0xee4377,sessionId:_0x87bca}=_0xdb6339,_0x2b337c=new Rn({'channelId':_0x2b8e45,'editor':_0x453da8,'rootName':_0xee4377,'sessionId':_0x87bca});_0x2b337c['contentRawOld']=_0x5f4cff,_0x2b337c['documentVersion']=_0x214810,_0x2b337c['contentRawNew']=_0x38900c[_0x3a4b20]['document'],_0x2b337c['summary']=_0x38900c[_0x3a4b20]['summary'],_0x399ce5['addResult'](_0x2b337c);}return _0x399ce5;}applyResult(_0x3bebcb,_0x47bf52){this['context']['plugins']['get']('AIGateway')['apply'](_0x3bebcb,_0x47bf52);}};function kn(_0x2e5977){return _0x2e5977 instanceof Error&&('AbortError'===_0x2e5977['name']||('AICoreError'===_0x2e5977['name']?!0x0===_0x2e5977['isAbort']:_0x2e5977['message']['startsWith']('ai-request-aborted')));}var yn=class extends Error{['code'];severity;type;context;isAbort;constructor(_0x1e3113){super(_0x1e3113['code'],_0x1e3113['cause']instanceof Error?{'cause':_0x1e3113['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x1e3113['code'],this['severity']=_0x1e3113['severity']??'error',this['type']=_0x1e3113['type']??'system',this['context']=_0x1e3113['context'],this['isAbort']=_0x1e3113['isAbort']??kn(_0x1e3113['cause']);}},Nn=class extends _0x898608{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}createReporter(_0x12aaa6){return new xn(this,_0x12aaa6);}},xn=class{['_sink'];_component;constructor(_0xf6615a,_0x3333a0){this['_sink']=_0xf6615a,this['_component']=_0x3333a0;}['logError'](_0x365767,_0x25dabc={}){this['_emit'](_0x365767,_0x25dabc),this['_defaultLog'](_0x365767);}reportError(_0x2a8c6b,_0xd05760={}){this['_emit'](_0x2a8c6b,_0xd05760);}_emit(_0x3183c0,_0x2794ee){kn(_0x3183c0)||this['_sink']['fire']('error',{'error':_0x3183c0,'component':this['_component'],'context':_0x2794ee['context']});}_defaultLog(_0x18f37c){if(!kn(_0x18f37c)){if(_0x18f37c instanceof yn){if('user'===_0x18f37c['type']||'network'===_0x18f37c['type'])return;if('warning'===_0x18f37c['severity'])return void console['warn'](this['_component'],_0x18f37c);}console['error'](this['_component'],_0x18f37c);}}};const Ln='ck-ai-button-primary',Pn='ck-ai-button-secondary',Dn='ck-ai-button-tertiary';function Hn(_0x242f1c,_0x594b01){const _0x183cb6=new Mt(_0x242f1c),_0xdaa14e=Es(_0x242f1c,'AI_TABS_LABEL_MINIMIZE'),_0x18b2c2=Es(_0x242f1c,'AI_TABS_LABEL_MAXIMIZE');return _0x183cb6['set']({'withText':!0x1,'icon':_0x31ef04,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Dn}),_0x183cb6['bind']('label')['to'](_0x594b01,'isMaximized',_0x1ff179=>_0x1ff179?_0xdaa14e:_0x18b2c2),_0x183cb6['bind']('icon')['to'](_0x594b01,'isMaximized',_0x50c8b9=>_0x50c8b9?_0x2bee5e:_0x31ef04),_0x183cb6['bind']('isOn')['to'](_0x594b01,'isMaximized'),_0x183cb6['on']('execute',()=>{_0x594b01['fire']('resizeTabs');}),_0x183cb6;}function Mn(_0x8c8a){const _0x4d9c3e=new Pt(_0x8c8a);return _0x4d9c3e['attachToDom'](),_0x4d9c3e['bodyCollectionContainer']['classList']['add']('ck-ai-body'),_0x4d9c3e;}const Un=/* #__PURE__ -- @preserve */
29
+ At();var Vn=class extends Un{['id'];interactionId;type;content=new Map();['sources']=[];parsedContent=new Map();parsedMergedContent=new Map();['changeGroups']=[];areActionsDisabled=!0x1;_outdatedReasonByDocumentId;isFromHistory=!0x1;documentContextContent;_documentIdToSource=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];cachedSuggestionContentParts={'withDiff':[],'withoutDiff':[]};constructor({type:_0x7c4c86,isDone:_0x46bf03=!0x1,isComplete:_0xb7b493,interactionId:_0x1305ce,areActionsDisabled:_0x35e0a2,outdatedReasonByDocumentId:_0x32184e,isFromHistory:_0x58cd9c=!0x1,documentContextContent:_0x4ad0f5,locale:_0x513948,id:_0x2b5eea,channelsToEditors:_0xe82527}){super(),this['id']=_0x2b5eea||kt(),this['interactionId']=_0x1305ce,this['type']=_0x7c4c86,this['areActionsDisabled']=!!_0x35e0a2,this['_outdatedReasonByDocumentId']=_0x32184e,this['isFromHistory']=_0x58cd9c,this['locale']=_0x513948,this['aiResponseParser']=new hn(),this['aiResponseApplier']=new sn(),this['documentContextContent']=new Map(_0x4ad0f5?.['map'](_0x396d2c=>[_0x396d2c['id'],Rs(_0x396d2c['content'])])||[]),this['_documentIdToSource']=new Map(_0x4ad0f5?.['map'](_0x20757c=>[_0x20757c['id'],{'editor':_0xe82527['get'](_0x20757c['channelId']),'rootName':_0x20757c['rootName']}])||[]),this['set']('isDone',_0x46bf03),this['set']('isComplete',_0xb7b493??_0x46bf03),'text'===this['type']&&this['content']['set']('text','');}appendContent(_0x44df14,_0x4a79c7){const _0xfeaed2='text'===this['type']?'text':_0x4a79c7;this['content']['has'](_0xfeaed2)||this['content']['set'](_0xfeaed2,''),this['content']['set'](_0xfeaed2,this['content']['get'](_0xfeaed2)+_0x44df14),this['onContentChange'](_0xfeaed2);}['done'](_0x569c04=!0x0){this['isComplete']=_0x569c04,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}destroy(){this['stopListening']();}setChangeGroupState(_0x2bdf01,_0x59eab9,_0xad1984){this['changeGroups'][_0x2bdf01]['state']=_0x59eab9,this['changeGroups'][_0x2bdf01]['outdatedReason']=_0xad1984,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2bdf01,'state':_0x59eab9,'outdatedReason':_0xad1984});}getContentParts({showDiff:_0x524c53,groupIndex:_0x38a6d3}){const _0x76ba3b=this['_getCachedContentParts'](_0x524c53,_0x38a6d3);if(_0x76ba3b)return _0x76ba3b;let _0x436912;if(void 0x0===_0x38a6d3)_0x436912=this['changeGroups'];else{const _0xc0502c=this['changeGroups']['find'](({index:_0x4381c3})=>_0x4381c3===_0x38a6d3);if(!_0xc0502c)throw new ct('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x38a6d3});_0x436912=[_0xc0502c];}const _0x240ce9=ln({'showDiff':_0x524c53,'changeGroups':_0x436912,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x524c53,_0x240ce9),_0x240ce9;}_getCachedContentParts(_0x36cb6c,_0x3c59d9){const _0x31c39f=_0x36cb6c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x31c39f]['length'])return null;const _0x42278a=this['cachedSuggestionContentParts'][_0x31c39f];if(void 0x0===_0x3c59d9)return _0x42278a['length']>0x0&&_0x42278a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x36cb6c,null),null):_0xddedfa(_0x42278a);{const _0x2f18b7=_0x42278a['find'](({index:_0xffcdd5})=>_0xffcdd5===_0x3c59d9);if(_0x2f18b7)return[_0xddedfa(_0x2f18b7)];}return null;}_setCachedContentParts(_0x4e8a23,_0x10fd7a){const _0x346fc6=_0x4e8a23?'withDiff':'withoutDiff';_0x10fd7a?_0x10fd7a['forEach'](_0x3cfcb7=>{const _0x173efd=this['cachedSuggestionContentParts'][_0x346fc6],_0x235c00=_0x173efd['find'](({index:_0x24494e})=>_0x24494e===_0x3cfcb7['index']);if(_0x235c00){const _0x335a03=_0x173efd['indexOf'](_0x235c00);_0x173efd['splice'](_0x335a03,0x1,_0x3cfcb7);}else _0x173efd['push'](_0x3cfcb7);}):this['cachedSuggestionContentParts'][_0x346fc6]['length']=0x0;}onContentChange(_0x2dcb4f){if('modification'===this['type']){if(_0x2dcb4f)this['parsedContent']['set'](_0x2dcb4f,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x2dcb4f)));else{for(const [_0x14931c,_0x28a710]of this['content'])this['parsedContent']['set'](_0x14931c,this['aiResponseParser']['parseAndNormalizeHTML'](_0x28a710));}const _0x370a2c=this['changeGroups'];for(const _0x390521 of this['content']['keys']())this['updateChangeGroups'](_0x390521);const _0x3f2d27=this['_getDifferentChangeGroups'](_0x370a2c,this['changeGroups']);(_0x3f2d27['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3f2d27),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}_getDifferentChangeGroups(_0x3c238e,_0x4b9f1e){const _0x408606=[];for(const _0x481f33 of _0x4b9f1e){const _0x58675e=_0x3c238e[_0x481f33['index']];_0x58675e?_0x58675e['changes']['length']!==_0x481f33['changes']['length']?_0x408606['push'](_0x481f33):_0x58675e['changes']['forEach']((_0x13262f,_0x3e2a34)=>{const _0x524434=_0x481f33['changes'][_0x3e2a34];_0x13262f['id']!==_0x524434['id']&&_0x408606['push'](_0x481f33);}):_0x408606['push'](_0x481f33);}return _0x408606;}updateChangeGroups(_0x5e0ed0){const _0x2de792=this['documentContextContent']['get'](_0x5e0ed0),_0x2a7710=this['parsedContent']['get'](_0x5e0ed0);if(!_0x2de792||!_0x2a7710)return;const _0x20fc05=new _0x21f244('p',{},[new _0x21f244('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xa7d61f(Es(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x573755=this['aiResponseApplier']['merge'](_0x2a7710,_0x2de792['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x20fc05});this['parsedMergedContent']['set'](_0x5e0ed0,_0x573755['parsedContent']);let _0x14bd36=[];if(_0x4615bb(_0x48f1ca=>{const _0x294098=Ps(_0x48f1ca,'data-id');if(!_0x294098||!_0x47588f(_0x294098))return!0x1;const _0x98048b=[_0x48f1ca,...Ms(_0x48f1ca)]['at'](-0x2);if(_0x48f1ca!=_0x98048b){const _0x389e8e=Ps(_0x98048b,'data-id');_0x47588f(_0x389e8e)||(_0x14bd36['push']({'node':_0x98048b,'id':_0x389e8e,'type':'modified'}),_0x573755['modifiedNodeIds']['push'](_0x389e8e));}else _0x573755['modifiedNodeIds']['includes'](_0x294098)?_0x14bd36['push']({'node':_0x48f1ca,'type':'modified','id':_0x294098}):_0x573755['newNodeIds']['includes'](_0x294098)?_0x14bd36['push']({'node':_0x48f1ca,'type':'new','id':_0x294098,'anchorId':Ps(_0x48f1ca['previousSibling'],'data-id')}):_0x14bd36['push']({'node':_0x48f1ca,'type':'removed','id':_0x294098});return!0x0;},this['parsedMergedContent']['get'](_0x5e0ed0)),_0x14bd36=_0x14bd36['filter'](({node:_0x4042ad})=>[...Ms(_0x4042ad),_0x4042ad]['every'](_0x140546=>!Ps(_0x140546,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0x365057=>_0x365057['documentId']!==_0x5e0ed0),0x0==_0x14bd36['length'])return;const _0x4f6f7a=[[_0x14bd36[0x0]]];for(let _0x39cb08=0x1;_0x39cb08<_0x14bd36['length'];_0x39cb08++){const _0x312cb5=_0x4f6f7a[_0x4f6f7a['length']-0x1],_0x39ce96=_0x312cb5[_0x312cb5['length']-0x1];_0x14bd36[_0x39cb08]['node']['previousSibling']==_0x39ce96['node']&&'modified'!=_0x14bd36[_0x39cb08]['type']&&'modified'!=_0x39ce96['type']?_0x312cb5['push'](_0x14bd36[_0x39cb08]):_0x4f6f7a['push']([_0x14bd36[_0x39cb08]]);}for(const _0x3be299 of _0x4f6f7a){const _0x3f1a58=_0x3be299[0x0],_0x55a5ce=_0x3be299[_0x3be299['length']-0x1],_0x2079e4=_0xe8a246(_0x3f1a58['node']['previousSibling']);_0x2079e4&&_0x3be299['unshift'](_0x2079e4);const _0x33b8ba=_0xe8a246(_0x55a5ce['node']['nextSibling']);_0x33b8ba&&_0x3be299['push'](_0x33b8ba);}ks('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x5e0ed0))['forEach'](_0xf36ba8=>{Ds(_0xf36ba8,'data-wrapped-id',null);});const _0x32d231=new Map();ks('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x5e0ed0))['forEach'](_0x247f58=>{const _0x4ef4ae=Ps(_0x247f58,'data-unwrapped-id'),_0x348ac6=Ps(_0x247f58,'data-id');_0x32d231['set'](_0x348ac6,_0x4ef4ae),Ds(_0x247f58,'data-id',_0x4ef4ae),Ds(_0x247f58,'data-unwrapped-id',null);});for(const _0x32fa3c of _0x14bd36){const _0x120d59=_0x32d231['get'](_0x32fa3c['id']);_0x120d59&&(_0x32fa3c['id']=_0x120d59);}this['changeGroups']['push'](..._0x4f6f7a['map']((_0x2974db,_0x19af39)=>{const _0x51de91=this['_documentIdToSource']['get'](_0x5e0ed0),_0x44a423=this['_outdatedReasonByDocumentId']?.['get'](_0x5e0ed0),_0x17fa95=this['areActionsDisabled']||void 0x0!==_0x44a423;return{'changes':_0x2974db,'state':_0x17fa95?'outdated':'pending','outdatedReason':_0x17fa95?_0x44a423:void 0x0,'index':_0x19af39,'editor':_0x51de91['editor'],'rootName':_0x51de91['rootName'],'documentId':_0x5e0ed0};}));const _0x535d8f=Array['from'](this['documentContextContent']['keys']());function _0x47588f(_0x3c30c7){return _0x573755['modifiedNodeIds']['includes'](_0x3c30c7)||_0x573755['newNodeIds']['includes'](_0x3c30c7)||_0x573755['removedNodeIds']['includes'](_0x3c30c7);}function _0xe8a246(_0x2bd29f){if(_0x2bd29f&&Ps(_0x2bd29f,'data-id')&&!Ps(_0x2bd29f,'data-unstable')){const _0x147ba5=Ps(_0x2bd29f,'data-id');if(!_0x47588f(_0x147ba5))return{'node':_0x2bd29f,'type':'context','id':_0x147ba5};}return null;}this['changeGroups']['sort']((_0x382ba9,_0x4d1b8d)=>_0x535d8f['indexOf'](_0x382ba9['documentId'])-_0x535d8f['indexOf'](_0x4d1b8d['documentId'])),this['changeGroups']['forEach']((_0x2da6fb,_0x16188a)=>{_0x2da6fb['index']=_0x16188a;});}};const Bn=/* #__PURE__ -- @preserve */
30
+ dt(),Gn=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var Fn=class extends Bn{['id'];['replies']=[];currentReply;['messageId'];actionCallId;currentRequest;connector;isStopped=!0x1;isDestroyed=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;_channelsToEditors;constructor({connector:_0x5a4236,locale:_0x2b21b8,channelsToEditors:_0x3ea344}){super(),this['id']=kt(),this['connector']=_0x5a4236,this['isStopped']=!0x0,this['locale']=_0x2b21b8,this['_channelsToEditors']=_0x3ea344||new Map();}async start(){await this['_run']();}async['resume'](_0x49cbec){await this['_run'](_0x49cbec);}async['_run'](_0x5ef480){const _0x39b9dd=[];let _0x25cb86,_0x52d3db,_0x4d7255,_0x4297d1=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x5ef480||this['sendRequest'](),this['fire']('interactionStarted',this);const _0xb343d1=await this['currentRequest']['getStream']();for await(const _0x43882d of _0xb343d1){if(this['isStopped'])return;if('error'==_0x43882d['event'])return void this['fire']('error',{'error':new ct('ai-chat-interaction-error',this)});switch(_0x43882d['event']){case'message-metadata':this['messageId']=_0x43882d['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x43882d['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x43882d['data']['conversationTitle'],!0x0);break;case'source':_0x39b9dd['push'](_0x43882d['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x25cb86='modification-delta'==_0x43882d['event']?'modification':'text',_0x52d3db='modification-delta'==_0x43882d['event']?_0x43882d['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x25cb86&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x25cb86,'interactionId':this['id'],'id':_0x52d3db,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x43882d['event']&&{'documentId':_0x43882d['data']['documentId']}}),'modification'==_0x25cb86&&(this['currentReply']['sources']=_0x39b9dd['splice'](0x0))),this['currentReply']['appendContent'](_0x43882d['data']['textDelta'],_0x43882d['data']['documentId']);break;case'mcp-tool-result':_0x4d7255=JSON['parse'](_0x43882d['data']['result']),this['_handleToolResultData']({'toolName':_0x43882d['data']['toolName'],'data':_0x4d7255['data'],'attributes':_0x4d7255['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x43882d['data']['toolName'],'data':_0x43882d['data']['data']});}}_0x4297d1=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x39b9dd['length']>0x0&&(this['currentReply']['sources']=_0x39b9dd['splice'](0x0)),this['_finalizeInteraction'](_0x4297d1),this['fire']('interactionFinished',this));}}stop(){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}getReply(_0x30117e){return this['replies']['find'](_0x4d703b=>_0x4d703b['id']===_0x30117e);}destroy(){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x27cc73=>_0x27cc73['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}createReply(_0x46f1df){const _0x54196b=this['getDocumentContext'](),_0x14afd6=new Vn({'locale':this['locale'],'documentContextContent':_0x54196b?.['documents'],..._0x46f1df});return this['replies']['push'](_0x14afd6),_0x14afd6['delegate'](...Gn)['to'](this),this['fire']('replyCreated',_0x14afd6),_0x14afd6;}setConversationTitle(_0x56645e,_0x53e3b2=!0x1){this['fire']('setConversationTitle',_0x56645e,_0x53e3b2);}resetWebSearchState(){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}resetReasoningState(){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}_handleToolResultData(_0x112462){this['fire']('toolDataReceived',{'type':'result','toolName':_0x112462['toolName'],'data':structuredClone(_0x112462['data']||{}),'attributes':structuredClone(_0x112462['attributes']||{})},this);}_handleToolNotificationData(_0x14f6d4){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x14f6d4['toolName'],'data':structuredClone(_0x14f6d4['data'])},this);}_finalizeInteraction(_0x3112a4=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x3112a4),this['currentRequest']=this['currentReply']=void 0x0;}};const Kn='defaultContextIds',Wn=/* #__PURE__ -- @preserve */
31
+ At();var Yn=class AIContext extends Wn{['_refs'];constructor(_0x3a2ea3=[]){super(),this['_refs']=[..._0x3a2ea3];}get['refs'](){return[...this['_refs']];}get isEmpty(){return 0x0===this['_refs']['length'];}cloneWith(..._0x5c72c5){return new AIContext([...this['_refs'],..._0x5c72c5]);}addDefaultContext(_0x218b94){this['_refs']=[...this['_refs'],..._0x218b94];}toRequestParts(_0x1fafdc=[]){return[...this['_refs']['map'](As),..._0x1fafdc];}toMessageAttributes(_0x12f2a6){return this['isEmpty']?_0x12f2a6:{..._0x12f2a6,[Kn]:[...new Set(this['_refs']['map'](_0xfd784b=>_0xfd784b['id']))]};}static getDefaultContextIds(_0x5b5156){const _0x579a05=_0x5b5156&&_0x5b5156[Kn];return new Set(Array['isArray'](_0x579a05)?_0x579a05:[]);}};const $n=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']]),qn=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var Qn=class AIChatContext extends Yn{_connector;['_config'];['_ownerId'];constructor({connector:_0x191874,config:_0x9996be,ownerId:_0x250acd}){super(),this['_connector']=_0x191874,this['_config']=_0x9996be,this['_ownerId']=_0x250acd;}init(){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}getPendingContextItems(){return new Map(this['_pendingContextItems']);}async populateFromMessage(_0x4e0a96,_0x2cb000,_0x2ef506=new Set()){const _0x37ac9d=new Map(),{contextItem:_0x568271,unmatchedDocumentIds:_0x1ff2b4}=await this['_populateDocumentContextItem'](_0x4e0a96,_0x2cb000);_0x568271&&_0x37ac9d['set'](_0x568271['id'],_0x568271);for(const _0xcdb3b1 of _0x4e0a96){if('document'===_0xcdb3b1['type'])continue;const _0x3ef856=await this['_createContextItemFromContent'](_0xcdb3b1,_0x2ef506);'context'!==_0x3ef856['type']&&this['_addToConversationContextItem'](_0x3ef856),_0x37ac9d['set'](_0x3ef856['id'],_0x3ef856);}return{'contextItems':_0x37ac9d,'hasUnmatched':_0x1ff2b4['size']>0x0,'unmatchedDocumentIds':_0x1ff2b4};}async _populateDocumentContextItem(_0x1eee3a,_0x47ebe8){const _0x5e99eb=_0x1eee3a['filter'](_0x6ba114=>'document'===_0x6ba114['type']);if(0x0===_0x5e99eb['length'])return{'unmatchedDocumentIds':new Set()};const _0x279343=_0x5e99eb['map'](_0x1274a1=>_0x1274a1['id']),_0x17d85c=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x279343)['getDocuments'](),_0x457243=new Map(_0x17d85c['map'](_0x5ad35d=>[_0x5ad35d['id'],_0x5ad35d])),_0x3edc2b=[],_0x5eef2a=new Set();for(const _0x329973 of _0x5e99eb){const _0x1add1c=_0x457243['get'](_0x329973['id']);_0x1add1c&&(this['_matchDocumentToRoot'](_0x1add1c,_0x47ebe8)||_0x5eef2a['add'](_0x1add1c['id']),_0x3edc2b['push']({'id':_0x1add1c['id'],'content':_0x1add1c['content'],'version':_0x1add1c['attributes']?.['version']??0x0,'sessionId':_0x1add1c['attributes']?.['sessionId']??null,'selection':[],'selectionSignature':'','channelId':_0x1add1c['attributes']?.['channelId']??_0x47ebe8[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x1add1c['attributes']?.['rootName']??_0x47ebe8[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??'','editorConfig':_0x329973['editorConfig']}));}const _0x3f806f={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x3edc2b};return this['_addToConversationContextItem'](_0x3f806f),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x3f806f,'unmatchedDocumentIds':_0x5eef2a};}_matchDocumentToRoot(_0x473db0,_0x57363c){const _0x5d76b1=_0x473db0['attributes']?.['channelId'],_0x4c2d7e=_0x473db0['attributes']?.['rootName'];if(_0x5d76b1&&_0x4c2d7e){for(const _0x188469 of _0x57363c)if(_0x188469['config']['get']('collaboration.channelId')===_0x5d76b1){for(const _0x574148 of _0x188469['model']['document']['getRoots']())if('$graveyard'!==_0x574148['rootName']&&_0x574148['rootName']===_0x4c2d7e)return{'editor':_0x188469,'rootName':_0x574148['rootName']};}}}async _createContextItemFromContent(_0x1ad126,_0x1b2476=new Set()){return'mcp-tool-context'===_0x1ad126['type']?{'id':_0x1ad126['id'],'uiId':_0x1ad126['id'],'label':_0x1ad126['data']?.['label']||_0x1ad126['id'],'type':'mcp-tool-context','mcpServerName':_0x1ad126['mcpServerName'],'toolName':_0x1ad126['toolName'],'data':_0x1ad126['data']||{}}:{'id':_0x1ad126['id'],'uiId':_0x1ad126['id'],'label':_0x1ad126['attributes']?.['label']||_0x1ad126['name']||_0x1ad126['url']||_0x1ad126['id'],'type':_0x1ad126['type'],..._0x1ad126?.['attributes']?.['resourceId']?{'resourceId':_0x1ad126['attributes']?.['resourceId']}:{},...'context'===_0x1ad126['type']&&_0x1b2476['has'](_0x1ad126['id'])?{'hidden':!0x0}:{}};}getSentContextItems(){return new Map(this['_conversationContextItems']);}removeFromContext(_0x3d3569){this['_pendingContextItems']['get'](_0x3d3569)?.['isReadOnly']||this['_removeContextItem'](_0x3d3569);}clearPendingContextItems(){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xcc81eb of this['_pendingContextItems']['values']())'context'!==_0xcc81eb['type']&&this['_removeContextItem'](_0xcc81eb['uiId']);const _0x3638e2=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3638e2&&this['_addContextItem']({..._0x3638e2,'isReadOnly':!0x0,'hidden':!0x0});}addToConversationContext(_0x541e0f){for(const _0xe55aae of _0x541e0f['values']())'context'!==_0xe55aae['type']&&this['_addToConversationContextItem'](_0xe55aae);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(_0x41f93f){return Array['from'](_0x41f93f['values']())['flatMap'](_0x1179f2=>this['_mapContextItemToRequestData'](_0x1179f2));}async addFilesToContext(_0x5b3ab1,_0x2c7626,_0x2e5b28='file'){const _0x35670f='files-'+kt();this['_startUploadOperation'](_0x35670f);try{await Promise['all'](_0x5b3ab1['map'](async _0x577e00=>{const _0x4766d4='file-'+kt(),_0x31f684=_0x15f5d8(_0x577e00['name']),_0x4616ea='file'===_0x2e5b28&&_0x577e00['type']['startsWith']('image/')?'image':_0x2e5b28;try{this['_addContextItem']({'type':_0x4616ea,'label':_0x2c7626?.['label']||_0x31f684,'uiId':_0x4766d4,'resourceId':_0x2c7626?.['resourceId']},!0x0);const _0x39900b=this['_connector']['uploadFile'](this['_ownerId'],_0x577e00,_0x2c7626);this['_ongoingUploads']['set'](_0x4766d4,_0x39900b['abortController']);const {id:_0x396be6}=await _0x39900b['getId']();this['_ongoingUploads']['delete'](_0x4766d4),this['_finishContextItemLoading']({'type':_0x4616ea,'id':_0x396be6,'label':_0x2c7626?.['label']||_0x31f684,'uiId':_0x4766d4,'resourceId':_0x2c7626?.['resourceId']},!0x1);}catch(_0x5d5751){if(this['_ongoingUploads']['delete'](_0x4766d4),!kn(_0x5d5751)){const _0x51cafc=new yn({'code':$n['get'](_0x5d5751['code'])||'ai-chat-file-upload-failed','cause':_0x5d5751,'context':{'fileName':_0x31f684}});this['fire']('error',{'error':_0x51cafc});}this['_removeContextItem'](_0x4766d4);}}));}finally{this['_finishUploadOperation'](_0x35670f);}}addCurrentDocumentToContext(_0x2b02c9){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3e1533={'type':'document','uiId':'current-document','label':_0x2b02c9,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3e1533);}getCurrentDocumentContext(){return this['_pendingContextItems']['get']('current-document');}async updateCurrentDocuments(_0x57a962,_0x4f5de2){const _0xcd437d=this['getCurrentDocumentContext']();if(!_0xcd437d)return;_0x57a962['length']>0x1&&_0x57a962['some'](_0x367443=>!_0x367443['description'])&&St('ai-chat-documents-missing-description');try{const _0x5f2d40=(_0xcd437d['documents']||[])['filter'](_0x3d2379=>_0x4f5de2['has'](_0x3d2379['channelId']));if(!_0x57a962['length'])return void(_0xcd437d['documents']=_0x5f2d40);const _0x1e2c37=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x57a962)['getIds']();if(_0x1e2c37['length']!==_0x57a962['length']||_0x1e2c37['some'](_0x28567b=>!_0x28567b?.['id'])){const _0x24e165=new ct('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x24e165});}const _0x122e6f=_0x57a962['map']((_0x43ae9d,_0x1b34d5)=>{return{'id':_0x1e2c37[_0x1b34d5]['id'],'content':_0x43ae9d['content'],'version':_0x43ae9d['version'],'sessionId':_0x43ae9d['sessionId'],'selection':(_0x59b8f8=_0x43ae9d['selections'],_0x59b8f8?_0x59b8f8['map'](_0x902607=>({'start':_0x902607['start'],'end':_0x902607['end']})):[]),'selectionSignature':_0x43ae9d['selectionSignature'],'channelId':_0x43ae9d['channelId'],'rootName':_0x43ae9d['rootName'],'editorConfig':_0x43ae9d['editorConfig']};var _0x59b8f8;});_0xcd437d['documents']=[..._0x5f2d40,..._0x122e6f];}catch(_0x6c7b67){throw new yn({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x6c7b67});}}addSelectionToContext(_0x3c77d9){this['_addContextItem']({'type':'selection','label':_0x3c77d9,'uiId':'selection','content':_0x3c77d9});}removeSelectionFromContext(){this['_removeContextItem']('selection');}async addUrlToContext(_0x54e75a,_0x36d1f7){const _0x350c72='url-'+kt();this['_startUploadOperation'](_0x350c72);const _0x5751a0='url-'+kt();try{this['_addContextItem']({'type':'web-resource','label':_0x36d1f7?.['label']||_0x54e75a,'uiId':_0x5751a0,'resourceId':_0x36d1f7?.['resourceId']},!0x0);const _0x4b323d=this['_connector']['uploadUrl'](this['_ownerId'],_0x54e75a,_0x36d1f7);this['_ongoingUploads']['set'](_0x5751a0,_0x4b323d['abortController']);const {id:_0x17995c}=await _0x4b323d['getId']();this['_ongoingUploads']['delete'](_0x5751a0),this['_finishContextItemLoading']({'type':'web-resource','id':_0x17995c,'label':_0x36d1f7?.['label']||_0x54e75a,'uiId':_0x5751a0,'resourceId':_0x36d1f7?.['resourceId']},!0x1);}catch(_0x260348){this['_ongoingUploads']['delete'](_0x5751a0),kn(_0x260348)||this['fire']('error',{'error':new ct('ai-chat-url-upload-failed',this,{'url':_0x54e75a,'originalError':_0x260348}),'url':_0x54e75a}),this['_removeContextItem'](_0x5751a0);}finally{this['_finishUploadOperation'](_0x350c72);}}addToolItemToContext(_0x4ac5b5){_0x4ac5b5['id']=_0x4ac5b5['id']??kt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x4ac5b5['uiId'],_0x4ac5b5),this['fire']('contextItemAdded',{'contextItem':_0x4ac5b5,'isLoading':!0x1});}async['loadSourceResources'](_0x1faaec,_0x172114,_0x32b03f){const _0x460f00=this['_addContextOptionsState']['sources']['find'](_0x1bbc23=>_0x1bbc23['id']===_0x1faaec);if(!_0x460f00)return this['fire']('error',{'error':new ct('ai-chat-source-not-found',this,{'sourceId':_0x1faaec}),'sourceId':_0x1faaec}),[];try{const _0x14b40d=(await _0x460f00['getResources'](_0x172114))['map'](_0x2ae798=>{const _0x357332=this['_isResourceInContext'](_0x2ae798['id']);return{..._0x2ae798,'isInContext':_0x357332};});return _0x460f00['resources']=_0x14b40d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1faaec,'source':_0x460f00,'resources':_0x14b40d,'uid':_0x32b03f}),_0x14b40d;}catch(_0x1e9e09){return this['fire']('error',{'error':new ct('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1faaec,'originalError':_0x1e9e09}),'sourceId':_0x1faaec,'sourceLabel':_0x460f00['label']}),[];}}async addResourceToContext(_0x3b295b,_0x3b3384){if(this['_isResourceInContext'](_0x3b3384['id']))return;if('context'===_0x3b3384['type'])return void this['_addContextItem']({'type':'context','id':_0x3b3384['id'],'label':_0x3b3384['label'],'uiId':'context-'+kt(),'resourceId':_0x3b3384['id']});let _0x42075c=_0x3b3384['data'];if(!_0x42075c&&_0x3b295b['getData'])try{_0x42075c=await _0x3b295b['getData'](_0x3b3384['id']);}catch(_0x2e7996){return void this['fire']('error',{'error':new ct('ai-chat-resource-load-failed',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'originalError':_0x2e7996}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});}if(_0x42075c)switch(_0x3b3384['type']){case'web-resource':if('string'!=typeof _0x42075c)return void this['fire']('error',{'error':new ct('ai-chat-context-invalid-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'expectedType':'string','actualType':typeof _0x42075c}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});await this['addUrlToContext'](_0x42075c,{'label':_0x3b3384['label'],'resourceId':_0x3b3384['id']});break;case'file':if(!(_0x42075c instanceof File))return void this['fire']('error',{'error':new ct('ai-chat-context-invalid-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'expectedType':'File','actualType':typeof _0x42075c}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});await this['addFilesToContext']([_0x42075c],{'label':_0x3b3384['label'],'resourceId':_0x3b3384['id']});break;case'text':if('object'!=typeof _0x42075c||!('content'in _0x42075c)||!('type'in _0x42075c))return void this['fire']('error',{'error':new ct('ai-chat-context-invalid-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x42075c}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});_0x42075c=AIChatContext['_convertTextResourceToFile'](_0x42075c,_0x3b3384['label']),await this['addFilesToContext']([_0x42075c],{'label':_0x3b3384['label'],'resourceId':_0x3b3384['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ct('ai-chat-context-unsupported-type',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'resourceType':_0x3b3384['type']}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});}else this['fire']('error',{'error':new ct('ai-chat-resource-no-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});}addContextSource(_0x5343ab){this['_addContextOptionsState']['sources']['some'](_0x253d22=>_0x253d22['id']===_0x5343ab['id'])||(this['_addContextOptionsState']['sources']['push']({..._0x5343ab,'resources':[]}),this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']}));}toggleAddCurrentDocumentOptionVisibility(_0x1f8aa4){if(void 0x0!==_0x1f8aa4)this['_addContextOptionsState']['document']['isHidden']=!_0x1f8aa4;else{const _0x194fb0=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x194fb0;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static _convertTextResourceToFile(_0x2a92fb,_0x35fa7c){switch(_0x2a92fb['type']){case'markdown':return new File([_0x2a92fb['content']],_0x35fa7c,{'type':'text/markdown'});case'html':return new File([_0x2a92fb['content']],_0x35fa7c,{'type':'text/html'});default:return new File([_0x2a92fb['content']],_0x35fa7c,{'type':'text/plain'});}}static _mapContextItemToRequestData(_0x579ce8){switch(_0x579ce8['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x579ce8['id']}];case'web-resource':return[{'type':'web-resource','id':_0x579ce8['id']}];case'context':return[{'type':'context','id':_0x579ce8['id']}];case'document':return _0x579ce8['documents']?.['length']?_0x579ce8['documents']['map'](({id:_0x399f93,editorConfig:_0x4018b6,selection:_0x5f1bca})=>({'type':'document','id':_0x399f93,..._0x4018b6&&{'editorConfig':_0x4018b6},..._0x5f1bca?.['length']&&{'selection':_0x5f1bca}})):[];case'mcp-tool-context':{const _0x5ba773=_0x579ce8;return[{'type':'mcp-tool-context','mcpServerName':_0x5ba773['mcpServerName'],'toolName':_0x5ba773['toolName'],'data':{..._0x5ba773['data'],'label':_0x5ba773['label']||_0x5ba773['data']?.['label']||_0x5ba773['id']},'id':_0x5ba773['id']}];}default:return[];}}_addContextItem(_0x542e06,_0x3a3895=!0x1){if(this['_pendingContextItems']['set'](_0x542e06['uiId'],_0x542e06),_0x542e06['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x542e06,'isLoading':_0x3a3895}),'current-document'===_0x542e06['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x542e06['resourceId']){const _0x553b52=this['_findSourceIdsByResourceId'](_0x542e06['resourceId']);_0x553b52&&_0x553b52['forEach'](_0x154b3c=>{this['_updateResourceInContextState'](_0x154b3c,_0x542e06['resourceId'],!0x0);});}}_removeContextItem(_0x4fb561){const _0x2094cd=this['_pendingContextItems']['get'](_0x4fb561),_0xa63775=this['_ongoingUploads']['get'](_0x4fb561);if(_0xa63775&&(_0xa63775['abort'](),this['_ongoingUploads']['delete'](_0x4fb561)),_0x2094cd?.['resourceId']){const _0x48c394=this['_findSourceIdsByResourceId'](_0x2094cd['resourceId']);_0x48c394&&_0x48c394['forEach'](_0x5b45c0=>{this['_updateResourceInContextState'](_0x5b45c0,_0x2094cd['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4fb561),this['fire']('contextItemRemoved',{'uiId':_0x4fb561,'type':_0x2094cd?.['type']}),'current-document'===_0x4fb561&&this['toggleAddCurrentDocumentOptionVisibility']();}_finishContextItemLoading(_0x57fce0,_0x23beff){if(this['_pendingContextItems']['has'](_0x57fce0['uiId'])&&(this['_pendingContextItems']['set'](_0x57fce0['uiId'],_0x57fce0),this['fire']('contextItemLoadingEnded',{'contextItem':_0x57fce0,'isLoading':_0x23beff}),_0x57fce0['resourceId'])){const _0xb94abf=this['_findSourceIdsByResourceId'](_0x57fce0['resourceId']);_0xb94abf&&_0xb94abf['forEach'](_0x5caea5=>{this['_updateResourceInContextState'](_0x5caea5,_0x57fce0['resourceId'],!0x0);});}}_addToConversationContextItem(_0x4bb44d){this['_conversationContextItems']['set'](_0x4bb44d['uiId'],_0x4bb44d);}_setAddContextOptionsDefaultState(){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x5853db=>({..._0x5853db,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}_getCustomSourcesInitialState(){return this['_config']?.['sources']?.['map'](_0x3a0626=>({..._0x3a0626,'resources':[]}))??[];}_isResourceInContext(_0x442e2b){for(const _0x3251c2 of this['_pendingContextItems']['values']())if(_0x3251c2['resourceId']===_0x442e2b)return!0x0;for(const _0xeb47c0 of this['_conversationContextItems']['values']())if(_0xeb47c0['resourceId']===_0x442e2b)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3035d9){const _0x5e73cb=[];for(const _0xcfc41d of this['_addContextOptionsState']['sources'])_0xcfc41d['resources']['find'](_0x1e2eb2=>_0x1e2eb2['id']===_0x3035d9)&&_0x5e73cb['push'](_0xcfc41d['id']);return 0x0===_0x5e73cb['length']?null:_0x5e73cb;}_updateResourceInContextState(_0x73fa1a,_0x51e575,_0x3419fe){const _0x11c2ac=this['_addContextOptionsState']['sources']['find'](_0x247ad5=>_0x247ad5['id']===_0x73fa1a);if(!_0x11c2ac)return;const _0x487369=_0x11c2ac['resources']['find'](_0x46f177=>_0x46f177['id']===_0x51e575);_0x487369&&(_0x487369['isInContext']=_0x3419fe,this['fire']('resourceStateChanged',{'sourceId':_0x73fa1a,'resourceId':_0x51e575,'isInContext':_0x3419fe}));}_startUploadOperation(_0x10f10e){this['_ongoingUploadOperations']['set'](_0x10f10e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}_finishUploadOperation(_0x49d78b){this['_ongoingUploadOperations']['delete'](_0x49d78b),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}},Xn=class extends Fn{['userMessage'];conversationId;contextItems=new Map();capabilities;['model'];attributes;context;constructor(_0x45a621){super(_0x45a621),this['conversationId']=_0x45a621['conversationId'],this['contextItems']=_0x45a621['contextItems'],this['capabilities']=_0x45a621['capabilities'],this['userMessage']=_0x45a621['userMessage'],this['model']=_0x45a621['model'],this['attributes']=_0x45a621['attributes'],this['context']=_0x45a621['context']??new Yn();}sendRequest(){const _0x54c732=Qn['mapContextItemsToRequestData'](this['contextItems']),_0x52b99d=this['context']['toRequestParts'](_0x54c732);return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':_0x52b99d,'capabilities':fn['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['context']['toMessageAttributes'](this['attributes'])});}getDocumentContext(){return this['contextItems']['get']('current-document');}};const zn=/* #__PURE__ -- @preserve */
32
+ dt();var jn=class extends zn{['id'];isStarted=!0x1;isFromHistory;interactions=[];currentInteraction;selectedModel;connector;options;_abortReject;_channelsToEditors;_getSessionId;constructor(_0x52151b){super(),this['options']=_0x52151b,this['connector']=_0x52151b['connector'],this['chatModels']=_0x52151b['chatModels'],this['id']=_0x52151b['conversationId'],this['isFromHistory']=_0x52151b['isFromHistory'],this['_channelsToEditors']=_0x52151b['channelsToEditors'],this['_getSessionId']=_0x52151b['getSessionId'];}async init(_0x3e3b84){try{this['chatContext']=new Qn({'connector':this['connector'],'config':_0x3e3b84,'ownerId':this['id']}),this['chatContext']['delegate'](...qn)['to'](this),this['chatContext']['init'](),this['options']['contextLibrary']?.['resolveContext']({'feature':'chat','extraContexts':this['options']['extraContexts'],'context':this['chatContext']}),this['chatCapabilities']=new fn(),this['chatCapabilities']['delegate'](...Cn)['to'](this),this['chatCapabilities']['init']();const _0x5b322a=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5b322a});const _0x1a15ef=await this['chatModels']['resolveModel'](this['options']['selectedModelId']);_0x1a15ef&&await this['setModel'](_0x1a15ef);}catch(_0xbd9289){const _0x52ae2f=new yn({'code':'ai-chat-conversation-init-failed','cause':_0xbd9289,'type':'network'});this['fire']('error',{'error':_0x52ae2f});}}async start(){if(this['isStarted'])throw new ct('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ct('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x22fe9a}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x22fe9a,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x162452){const _0x1e64ee=new yn({'code':'ai-chat-conversation-start-failed','cause':_0x162452,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0x1e64ee}),_0x1e64ee;}}async['load'](_0x1e6dc9){try{const _0x379a14=await this['connector']['fetchConversation'](_0x1e6dc9)['getConversation'](),_0x39c9ef=await this['connector']['fetchConversationMessages'](_0x1e6dc9)['getMessages'](),_0x3a0477=_0x39c9ef[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x379a14['id'],'title'in _0x379a14?this['fire']('setConversationTitle',_0x379a14['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']),this['selectedModel']=await this['chatModels']['getModel'](_0x3a0477)??void 0x0,this['fire']('modelSelected',{'selectedModel':this['selectedModel'],'isDisabled':!0x0});const {streamingMessageId:_0x27a2f5}=await this['_processMessagesToInteractions'](_0x39c9ef,_0x3a0477);return _0x27a2f5&&this['currentInteraction']?this['_resumeStream'](_0x27a2f5):this['currentInteraction']=void 0x0,this;}catch(_0x1cbf81){const _0x42a80b=new yn({'code':'ai-chat-conversation-init-from-id-failed','cause':_0x1cbf81,'type':'network','context':{'conversationId':_0x1e6dc9}});throw this['fire']('error',{'error':_0x42a80b}),_0x42a80b;}}async _processMessagesToInteractions(_0x5bbec0,_0x263de1){let _0x1a9fa0,_0x309544,_0x4433b7=new Set();for(const _0x46266d of _0x5bbec0)if('user'===_0x46266d['role']){const {contextItems:_0x3aeede,unmatchedDocumentIds:_0x4ab49c}=await this['_extractContextItems'](_0x46266d);_0x4433b7=_0x4ab49c;const _0x598212={'isReasoningEnabled':Object['hasOwn'](_0x46266d['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x46266d['capabilities'],'webSearch')};_0x1a9fa0=this['createInteraction']({'userMessage':_0x46266d['prompt'],'contextItems':_0x3aeede,'capabilities':_0x598212,'modelId':_0x263de1,'attributes':_0x46266d['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x1a9fa0,_0x309544=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x46266d['role']&&_0x1a9fa0){if('streaming'===_0x46266d['status']){_0x309544=_0x46266d['id'];continue;}if('error'===_0x46266d['status'])continue;const _0x24a0a0=[];for(const _0x4cacf0 of _0x46266d['content'])switch(_0x4cacf0['type']){case'text':case'modification':{const _0x5cd779=_0x1a9fa0['getDocumentContext'](),_0x4bdab0=this['_getOutdatedReasonsByDocumentId'](_0x5cd779,_0x4433b7),_0x2fe738=_0x5cd779?.['documents']??[],_0x155ffd=_0x2fe738['length']>0x0&&_0x2fe738['every'](_0x1690ae=>_0x4bdab0['has'](_0x1690ae['id']));_0x1a9fa0['currentReply']?.['type']!==_0x4cacf0['type']&&(_0x1a9fa0['currentReply']=_0x1a9fa0['createReply']({'type':_0x4cacf0['type'],'isDone':!0x0,'interactionId':_0x1a9fa0['id'],'areActionsDisabled':_0x155ffd,'outdatedReasonByDocumentId':_0x4bdab0,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x24a0a0['length']>0x0&&(_0x1a9fa0['currentReply']['sources']=_0x24a0a0['splice'](0x0))),_0x1a9fa0['currentReply']['appendContent'](_0x4cacf0['content'],_0x4cacf0['documentId']);break;}case'url':_0x24a0a0['push'](_0x4cacf0);break;case'mcp-tool-result':{const {data:_0x1a6451,attributes:_0x268702}=JSON['parse'](_0x4cacf0['content']);_0x1a9fa0['_handleToolResultData']({'toolName':_0x4cacf0['toolName'],'data':_0x1a6451,'attributes':_0x268702});break;}}'cancelled'===_0x46266d['status']&&this['fire']('error',{'interactionId':_0x1a9fa0['id'],'error':new ct('ai-request-aborted',this)});}}return{'streamingMessageId':_0x309544};}async _resumeStream(_0x2fa41d){if(this['currentInteraction'])try{const _0xa216ee=this['connector']['resumeStream'](this['id'],_0x2fa41d);await this['currentInteraction']['resume'](_0xa216ee);}catch(_0x389337){_0x389337 instanceof ct&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x389337});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async _extractContextItems(_0x12c9b9){return _0x12c9b9['content']?this['chatContext']['populateFromMessage'](_0x12c9b9['content'],Array['from'](this['_channelsToEditors']['values']()),Yn['getDefaultContextIds'](_0x12c9b9['attributes'])):{'contextItems':new Map(),'unmatchedDocumentIds':new Set()};}async handleUserInteraction({userMessage:_0x3116d1,attributes:_0x520ce2}){if(!this['isStarted'])throw new ct('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ct('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x41856a=new Map(this['getPendingContextItems']()),_0x1ea16a=this['chatCapabilities']['getCapabilitiesConfig'](),_0x2835cc=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3116d1,'contextItems':_0x41856a,'capabilities':_0x1ea16a,'modelId':_0x2835cc,'attributes':_0x520ce2,'channelsToEditors':this['_channelsToEditors']}),await this['updateCurrentDocumentsInContext'](),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x290b6b){if(_0x290b6b instanceof ct)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x290b6b});else{const _0x3e51bd=$n['get'](_0x290b6b['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ct(_0x3e51bd,null,{'error':_0x290b6b})});}}finally{this['stopProcessing']();}}stopProcessing(){this['_abortReject']&&(this['_abortReject'](),this['_abortReject']=void 0x0),this['currentInteraction']&&(this['currentInteraction']['stop'](),this['currentInteraction']=void 0x0);}createInteraction({userMessage:_0x5096b6,contextItems:_0x47d227,capabilities:_0x45f574,modelId:_0x9d3617,attributes:_0x4259c3,channelsToEditors:_0x2440b0}){const _0xea3bc5=new Xn({'userMessage':_0x5096b6,'contextItems':_0x47d227,'capabilities':_0x45f574,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x9d3617,'attributes':_0x4259c3,'channelsToEditors':_0x2440b0,'context':this['chatContext']['isEmpty']?void 0x0:new Yn(this['chatContext']['refs'])});return _0xea3bc5['delegate'](...Gn)['to'](this),this['interactions']['push'](_0xea3bc5),this['fire']('interactionCreated',_0xea3bc5),_0xea3bc5;}getInteraction(_0x238d7a){return this['interactions']['find'](_0x1ab65f=>_0x1ab65f['id']===_0x238d7a);}removeInteraction(_0x45156e){const _0x57b98c=this['getInteraction'](_0x45156e);_0x57b98c&&(_0x57b98c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x57b98c),0x1));}get lastInteraction(){return this['interactions'][this['interactions']['length']-0x1];}cancelLastInteractionStream(){const _0x2fdc5d=this['lastInteraction'];_0x2fdc5d?.['conversationId']&&_0x2fdc5d['messageId']&&this['connector']['cancelStream'](_0x2fdc5d['conversationId'],_0x2fdc5d['messageId'])['execute']()['catch'](()=>{});}addCurrentDocumentToContext(_0x2ffb53){this['chatContext']['addCurrentDocumentToContext'](_0x2ffb53);}async updateCurrentDocumentsInContext(){if(!this['isCurrentDocumentInContext']())return;const {changedIds:_0x35cfc5,unchangedIds:_0x5ebe64}=this['_compareEditorStateWithDocumentContext'](),_0x3b316c=new Promise((_0x3df4fb,_0x477987)=>{this['_abortReject']=()=>_0x477987(new ct('ai-request-aborted',this));}),_0x1d634a=await Promise['race']([this['options']['aiEditing']['getDocumentData'](_0x35cfc5),_0x3b316c]);await Promise['race']([this['chatContext']['updateCurrentDocuments'](_0x1d634a,_0x5ebe64),_0x3b316c]);}_compareEditorStateWithDocumentContext(){const _0x288f0b=new Set(),_0xeb5383=new Set(),_0xee5f68=this['options']['aiEditing']['getEditorsVersions'](),_0x263d5f=this['options']['aiEditing']['getEditorsSelections'](),_0x572b69=this['chatContext']['getCurrentDocumentContext']()['documents']||[],_0x1cf0b4=new Map(_0x572b69['map'](({channelId:_0x588485,version:_0x55cd99})=>[_0x588485,_0x55cd99])),_0x76025a=new Map(_0x572b69['map'](({channelId:_0x58b5b9,selectionSignature:_0x46c59c})=>[_0x58b5b9,_0x46c59c]));for(const [_0xed63d4,_0x55820a]of _0xee5f68){const _0x2bdbec=_0x263d5f['get'](_0xed63d4);_0x1cf0b4['get'](_0xed63d4)!=_0x55820a||_0x76025a['get'](_0xed63d4)!=_0x2bdbec?_0x288f0b['add'](_0xed63d4):_0x1cf0b4['has'](_0xed63d4)&&_0xeb5383['add'](_0xed63d4);}return{'changedIds':_0x288f0b,'unchangedIds':_0xeb5383};}toggleAddCurrentDocumentOptionVisibility(_0x311711){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x311711);}_getOutdatedReasonsByDocumentId(_0x3ac247,_0xaadc14){const _0x242a07=new Map();if(!_0x3ac247||!_0x3ac247['documents'])return _0x242a07;for(const _0x1416f1 of _0x3ac247['documents']){const _0x21c538=this['_channelsToEditors']['get'](_0x1416f1['channelId']);_0x21c538&&'destroyed'!==_0x21c538['state']?_0x1416f1['sessionId']!==this['_getSessionId'](_0x21c538)?_0x242a07['set'](_0x1416f1['id'],'session-changed'):_0xaadc14['has'](_0x1416f1['id'])&&_0x242a07['set'](_0x1416f1['id'],'content-removed'):_0x242a07['set'](_0x1416f1['id'],'editor-removed');}return _0x242a07;}addSelectionToContext(_0x7386b3){this['chatContext']['addSelectionToContext'](_0x7386b3);}removeSelectionFromContext(){this['chatContext']['removeSelectionFromContext']();}addFilesToContext(_0x460b2f){this['chatContext']['addFilesToContext'](_0x460b2f);}addUrlToContext(_0x43cd00){this['chatContext']['addUrlToContext'](_0x43cd00);}addToolItemToContext(_0x2673a5){this['chatContext']['addToolItemToContext'](_0x2673a5);}addResourceToContext(_0x59c306,_0x35e54e){this['chatContext']['addResourceToContext'](_0x59c306,_0x35e54e);}['loadSourceResources'](_0x19372f,_0x2105c5,_0x357455){return this['chatContext']['loadSourceResources'](_0x19372f,_0x2105c5,_0x357455);}removeFromContext(_0x26019c){this['chatContext']['removeFromContext'](_0x26019c);}setWebSearch(_0x1e75a6){this['chatCapabilities']['setWebSearch'](_0x1e75a6);}toggleWebSearch(){this['chatCapabilities']['toggleWebSearch']();}setReasoning(_0x134cd0){this['chatCapabilities']['setReasoning'](_0x134cd0);}toggleReasoning(){this['chatCapabilities']['toggleReasoning']();}isCurrentDocumentInContext(){return this['chatContext']['isCurrentDocumentInContext']();}isCurrentDocumentInConversation(){return this['chatContext']['isCurrentDocumentInConversation']();}isSelectionInContext(){return this['chatContext']['isSelectionInContext']();}getPendingContextItems(){return this['chatContext']['getPendingContextItems']();}addDefaultContext(_0x2f897e){_0x2f897e['length']&&this['chatContext']['addDefaultContext'](_0x2f897e);}async setModel(_0x618945){_0x618945?!0x1===await this['chatModels']['isAvailable'](_0x618945)&&(St('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x618945}),_0x618945=(await this['chatModels']['getAvailableModels']())[0x0]):(St('ai-chat-conversation-set-model-null',{'conversation':this}),_0x618945=(await this['chatModels']['getAvailableModels']())[0x0]),_0x618945['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x618945,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x618945}));}};function Jn({documentSuggestions:_0x5cf516,transform:_0x11a1e0,documentCompare:_0x3ebe35,documentCompareOptions:_0x1a7d2f}){const _0x1784ca=new Map();for(const [_0x82ecc2,{groups:_0x4c6dfd,documentContext:_0x3542fe,documentContent:_0x1f4733,editor:_0x436cf8}]of _0x5cf516){const _0x345bd2=_0x3542fe['content'],_0x5e5791=_0x3542fe['version'],_0x1ab539=_0x1f4733['cloneNode'](!0x0);for(const {changes:_0x2b5eae}of _0x4c6dfd)$s(_0x1ab539,_0x2b5eae);const _0x28656e=Os(_0x1ab539),_0x4f8fe4=Qs(_0x436cf8,_0x3542fe['rootName'],_0x345bd2,_0x28656e);if(!_0x4f8fe4)continue;const _0x28a523=_0x3ebe35['getDiff'](_0x4f8fe4['before'],_0x4f8fe4['after'],{'targetEditor':_0x436cf8,'anchor':_0x3542fe['rootName'],..._0x1a7d2f})['getOperations']();if(_0x11a1e0){const _0x575c89=_0x436cf8['model']['document']['history']['getOperations'](_0x5e5791),_0x57c627={'document':_0x436cf8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x1784ca['set'](_0x82ecc2,_0x5dec67(_0x28a523,_0x575c89,_0x57c627)['operationsA']);}else _0x1784ca['set'](_0x82ecc2,_0x28a523);}return _0x1784ca;}function Zn({groups:_0x119723,documentContextContent:_0x2dcc57,documents:_0x1feef1}){const _0x5e8caa=new Map();for(const _0x444173 of _0x119723){const {documentId:_0x52798e}=_0x444173,_0x398070=_0x5e8caa['get'](_0x52798e);if(_0x398070)_0x398070['groups']['push'](_0x444173),_0x398070['indexes']['push'](_0x444173['index']);else{const _0x42c375=_0x1feef1['find'](_0x290d9a=>_0x290d9a['id']===_0x52798e),_0x49552d=_0x2dcc57['get'](_0x52798e);if(!_0x42c375||!_0x49552d)continue;_0x5e8caa['set'](_0x52798e,{'groups':[_0x444173],'documentContext':_0x42c375,'documentContent':_0x49552d,'editor':_0x444173['editor'],'indexes':[_0x444173['index']]});}}return _0x5e8caa;}function tr(_0x355ec0,_0x5856a1){const _0x3407da=_0x355ec0['files']['length']>0x0&&_0x355ec0['files']['every'](_0x44f99a=>_0x44f99a['type']['startsWith']('image/')),_0x18a146=_0x355ec0['plainText']['trim']()['length']>0x0;if(_0x355ec0['files']['length']>0x0&&_0x5856a1['filesEnabled']&&(!_0x3407da||!_0x18a146)){const _0x3be054=_0x355ec0['files']['filter'](_0x190c0f=>_0x190c0f['name']);return _0x3be054['length']>0x0?{'type':'file','files':_0x3be054}:null;}if(_0x5856a1['urlsEnabled']){const _0x1fbd0b=function(_0x5a2200){const _0x1a8403=_0x5a2200['trim']();if(/\s/['test'](_0x1a8403))return null;try{const _0x5850a7=new URL(_0x1a8403);return'http:'!==_0x5850a7['protocol']&&'https:'!==_0x5850a7['protocol']?null:_0x5850a7['toString']();}catch{return null;}}(_0x355ec0['plainText']);if(_0x1fbd0b)return{'type':'url','url':_0x1fbd0b};}const _0x431d4e=_0x355ec0['forceTextAttachment']?0x1:_0x5856a1['longTextThreshold']??0x1/0x0;if(_0x355ec0['plainText']['length']>=Math['max'](_0x431d4e,0x1)&&_0x5856a1['filesEnabled']){const _0x4fc6d0=_0x5856a1['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x355ec0['plainText']],_0x4fc6d0,{'type':'text/plain'})]};}return null;}var er=class extends _0x898608{activeConversation;_aiEditing;_aiConnector;_aiChatUi;['_aiModels'];_aiContextLibrary;_contextLibrarySource=null;_hasAIChatBalloon=!0x1;_activeBalloon;_reporter;_batchToChanges=new Map();_currentPreviewedChangeGroup=null;_bodyCollection;_channelsToEditors=new Map();static get requires(){return[Is,Nn,_0x45dea0,fs];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']('isConversationReady',!0x1),this['_bodyCollection']=Mn(this['context']['locale']),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aichat'),this['_aiModels']=this['context']['plugins']['get'](fs)['models'],this['_aiContextLibrary']=this['context']['plugins']['get'](fs)['contextLibrary'];const _0x390c1d=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1c078a,_0x4c7ff2)=>{this['sendMessage']({'message':_0x4c7ff2});}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',()=>{this['activeConversation']?.['stopProcessing']();}),this['listenTo'](_0x390c1d['view'],'change:activeTab',(_0x3654db,_0x10d56a,_0x4be490)=>{'chat'!==_0x4be490&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x242695,_0x385aaa)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x385aaa));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x23e2fc,_0x36d811)=>{this['activeConversation']?.['addUrlToContext'](_0x36d811);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x2b1672,_0x595704)=>{const _0xbb2ed1=this['activeConversation'];if(!_0xbb2ed1)return;_0x595704['hasDirectory']&&(_0x595704['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+kt()}));const _0x38f672=tr(_0x595704,{'pastedTextLabel':Es(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x38f672&&(_0x595704['preventDefault'](),'url'===_0x38f672['type']?_0xbb2ed1['addUrlToContext'](_0x38f672['url']):_0xbb2ed1['chatContext']['addFilesToContext'](_0x38f672['files'],void 0x0,_0x38f672['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x5ec078,_0xac78b0)=>{_0xac78b0['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x17bd65,_0x5d3ccf)=>{this['activeConversation']?.['addResourceToContext'](_0x5d3ccf['source'],_0x5d3ccf['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x3f41f0,_0x145b2e)=>{this['_removeFromContext'](_0x145b2e);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x35357b,_0x248cdb)=>{this['activeConversation']?.['loadSourceResources'](_0x248cdb['sourceId'],_0x248cdb['query'],_0x248cdb['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x20e6de,_0x4030a9)=>{this['activeConversation']?.['setModel'](_0x4030a9);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3f0c40,{replyId:_0x1e5064})=>{console['log']('Liked\x20response',_0x1e5064);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2621df,{replyId:_0x199c19})=>{console['log']('Disliked\x20response',_0x199c19);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xd615b2,_0x51e511)=>{this['_insertSuggestion'](_0x51e511);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x2da1a3,{replyId:_0x243ae5,partIndex:_0x1517f7})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x243ae5,_0x1517f7);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3ab93a,{replyId:_0x45fe58,partIndex:_0x2955a6})=>{const _0x4fb5d0=this['_getDocumentRangeForReplyChanges'](_0x45fe58,_0x2955a6);if(!_0x4fb5d0)return;const {reply:_0x4eeaef}=this['getInteractionAndReplyById'](_0x45fe58);'$graveyard'!=_0x4fb5d0['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x4eeaef['changeGroups'][_0x2955a6]['editor'],'ranges':[_0x4fb5d0['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5c0f25,_0x3e09ad)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3e09ad);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x8403f6,{replyId:_0x5a2678,showDiff:_0x2be8b5})=>{const {interaction:_0xfec765,reply:_0x2217d9}=this['getInteractionAndReplyById'](_0x5a2678),_0x1256c8=_0x2217d9['getContentParts']({'showDiff':_0x2be8b5});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xfec765['id']+':'+_0x2217d9['id'],'parts':_0x1256c8});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x1afdf9,{replyId:_0x2d81a9,partIndex:_0x13986f})=>{this['_rejectSuggestion']({'replyId':_0x2d81a9,'partIndex':_0x13986f}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x516fe5,_0x257ab0)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x257ab0);}),this['on']('replyCreated',(_0x83a8b6,_0x1e0f1a)=>{this['_addFeedItemReply'](_0x1e0f1a);});}afterInit(){this['context']instanceof _0x24cd6f?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2483b0,_0x252324)=>{_0x252324['on']('ready',()=>{this['_integrateEditor'](_0x252324);});}),this['context']['config']['get']('ai.chat.context')?.['contextLibrary']?.['enabled']&&this['_setUpContextLibrarySource'](),this['_initConversation']();}async _initConversation(){const _0x52fce7=this['context']['config']['get']('ai.chat.initialConversation');let _0x1384b4=_0x52fce7;('lastCreated'!=_0x52fce7||(_0x1384b4=await this['_getLastCreatedConversationId'](),_0x1384b4))&&('new'==_0x1384b4?await this['_startConversationSafely']():await this['loadConversation'](_0x1384b4));}async destroy(){return this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async loadConversation(_0x289994){this['_closeActiveBalloon'](),this['context']['plugins']['get'](gs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),this['_detachFromActiveConversation'](),this['_stopLastInteraction'](),this['_aiChatUi']['toggleConversationLoading'](!0x0);try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x289994)['getConversation'](),await this['_startConversationSafely']({'id':_0x289994}),await this['activeConversation']['load'](_0x289994),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext'](),this['set']('isConversationReady',!0x0),this['activeConversation']?.['currentInteraction']?this['_aiChatUi']['enableControls']():this['_aiChatUi']['toggleConversationLoading'](!0x1);}catch(_0x3f555e){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x289994}),this['_reporter']['logError'](new ct('ai-chat-conversation-not-found',this,void 0x0,_0x3f555e),{'context':{'operation':'load-conversation'}}),await this['_stopLastInteraction'](),this['_aiChatUi']['disableControls'](),this['set']('isConversationReady',!0x1),this['_aiChatUi']['resetChatBusyStateToIdle'](),this['activeConversation']?.['cancelLastInteractionStream']();}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}registerToolDataCallback(_0x5959da){let _0x1d4e32=null,_0x432505=null;this['on']('toolDataReceived',(_0x1d3c28,_0x44d047,_0xfefbfb)=>{_0xfefbfb['id']!==_0x1d4e32&&(_0x1d4e32=_0xfefbfb['id'],_0x432505=this['_getAIChatFeedAPI'](_0xfefbfb)),_0x5959da(_0x44d047,_0x432505);});}addCurrentDocumentToChatContext(){bs(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](Es(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async addSelectionToChatContext(_0x33e40c){const _0x44c443=this['_aiEditing']['getSelectionText'](_0x33e40c);this['activeConversation']?.['addSelectionToContext'](_0x44c443),this['addCurrentDocumentToChatContext']();}removeSelectionFromChatContext(){this['activeConversation']?.['removeSelectionFromContext']();}focusPromptInput(){this['_aiChatUi']['focusPromptInput']();}async startConversation(_0x258683){await this['_startConversationSafely']({'modelId':_0x258683?.['modelId'],'contexts':_0x258683?.['contexts']});}async['sendMessage']({message:_0xbcf82f,attributes:_0x1c52ea}){if(!this['activeConversation'])throw new ct('ai-chat-controller-no-active-conversation');this['activeConversation']['id']&&this['activeConversation']['isStarted']&&(this['_aiChatUi']['startInteraction'](),await this['activeConversation']['handleUserInteraction']({'userMessage':_0xbcf82f,'attributes':_0x1c52ea}));}getGroupId(){const _0x1f9c0e=this['context']['config']['get']('collaboration.channelId');if(!_0x1f9c0e)throw new ct('ai-missing-channel-id',this);return _0x1f9c0e;}_handleRemovedConversation(_0x5810fc){this['activeConversation']['id']===_0x5810fc&&this['_startConversationSafely']();}['_isGroupReadOnly'](_0x141838){return!(!_0x141838['editor']||'destroyed'===_0x141838['editor']['state']||!_0x141838['editor']['isReadOnly']);}_isGroupWriteable(_0x49661e){return!(!_0x49661e['editor']||'destroyed'===_0x49661e['editor']['state']||_0x49661e['editor']['isReadOnly']);}_computeSuggestionGating(_0x221090){const _0x5b5cc4=new Map();for(const _0x3363e9 of _0x221090['changeGroups'])_0x5b5cc4['set'](_0x3363e9['index'],this['_isGroupReadOnly'](_0x3363e9));const _0x439057=new Set(_0x221090['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']})['filter'](_0x499f95=>_0x499f95['hasChanges'])['map'](_0x35862c=>_0x35862c['index']));return{'readOnlyByIndex':_0x5b5cc4,'isAcceptAllEnabled':_0x221090['changeGroups']['some'](_0x7bb290=>'pending'===_0x7bb290['state']&&this['_isGroupWriteable'](_0x7bb290)&&_0x439057['has'](_0x7bb290['index']))};}_refreshSuggestionGating(){if(this['activeConversation']){for(const _0x29998f of this['activeConversation']['interactions'])for(const _0x2746f5 of _0x29998f['replies'])'modification'===_0x2746f5['type']&&this['_aiChatUi']['hasFeedItem'](_0x2746f5['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x2746f5['id'],this['_computeSuggestionGating'](_0x2746f5));}if(this['_activeBalloon']&&this['_currentPreviewedChangeGroup']){const {reply:_0x327603}=this['getInteractionAndReplyById'](this['_currentPreviewedChangeGroup']['replyId']),_0x28518d=_0x327603['changeGroups']['find'](_0x4added=>_0x4added['index']===this['_currentPreviewedChangeGroup']['partIndex']);_0x28518d&&this['_activeBalloon']['setTargetReadOnly'](this['_isGroupReadOnly'](_0x28518d));}}_prepareDocumentSuggestions(_0x103a70){const {reply:_0x242d8b,interaction:_0x14ed69}=this['getInteractionAndReplyById'](_0x103a70['replyId']),_0x1435e2=void 0x0!==_0x103a70['partIndex']?[_0x242d8b['changeGroups'][_0x103a70['partIndex']]]:_0x242d8b['changeGroups']['filter'](_0x4f3d4d=>'pending'===_0x4f3d4d['state']&&!this['_isGroupReadOnly'](_0x4f3d4d)),_0x3e6c20=_0x1435e2['map'](_0x128d1b=>_0x242d8b['changeGroups']['indexOf'](_0x128d1b)),_0x4eabc7=qs(_0x242d8b['changeGroups'],_0x242d8b['documentContextContent']);return _0x3e6c20['forEach'](_0xea218f=>{if(_0x4eabc7['has'](_0xea218f))return;const _0x20dc16=this['_getDocumentRangeForReplyChanges'](_0x103a70['replyId'],_0xea218f);_0x20dc16&&'$graveyard'!=_0x20dc16['range']['root']['rootName']?(_0x242d8b['setChangeGroupState'](_0xea218f,'accepted'),void 0x0!==_0x103a70['partIndex']&&this['_scrollToSuggestionRange'](_0x20dc16['range'],!0x1,_0x20dc16['targetEditor'])):_0x242d8b['setChangeGroupState'](_0xea218f,'outdated',this['_getOutdatedReason'](_0x242d8b['changeGroups'][_0xea218f]));}),Zn({'groups':_0x1435e2['filter'](_0x75ba1c=>'accepted'===_0x75ba1c['state']),'documentContextContent':_0x242d8b['documentContextContent'],'documents':_0x14ed69['getDocumentContext']()?.['documents']??[]});}_insertSuggestion(_0x25edda){const _0x417a3d=this['context']['plugins']['get'](_0x45dea0),{reply:_0x5ad4d1,interaction:_0x32e087}=this['getInteractionAndReplyById'](_0x25edda['replyId']),_0x43c1b5=this['_prepareDocumentSuggestions'](_0x25edda),_0x1b47cf=Jn({'documentSuggestions':_0x43c1b5,'transform':!0x0,'documentCompare':_0x417a3d,'documentCompareOptions':{'markDeletions':!0x0}});for(const [_0x13082c,_0x53afb7]of _0x1b47cf){const {editor:_0x74ffe7,indexes:_0x5a4a60}=_0x43c1b5['get'](_0x13082c);if(!_0x74ffe7['plugins']['has']('TrackChanges')){St('ai-no-track-changes',{'editor':_0x74ffe7});continue;}let _0x133b9f;mn(_0x53afb7,'chat'),_0x74ffe7['model']['change'](_0x1e753a=>{_0x133b9f=_0x1e753a['batch'],_0x74ffe7['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x53afb7),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x133b9f,{'interactionId':_0x32e087['id'],'replyId':_0x5ad4d1['id'],'indexes':_0x5a4a60});}this['_updateRatings'](_0x5ad4d1);}_applySuggestion(_0x338ca0){const _0x2ae70e=this['context']['plugins']['get'](_0x45dea0),{reply:_0x296e06,interaction:_0x5bd006}=this['getInteractionAndReplyById'](_0x338ca0['replyId']),_0x2215da=this['_prepareDocumentSuggestions'](_0x338ca0),_0x2fa797=Jn({'documentSuggestions':_0x2215da,'transform':!0x0,'documentCompare':_0x2ae70e,'documentCompareOptions':{'markDeletions':!0x1}});for(const [_0x5e2dd2,_0x5db22d]of _0x2fa797){const {editor:_0x29524f,indexes:_0x4ba2e4}=_0x2215da['get'](_0x5e2dd2);let _0x3c0d13;mn(_0x5db22d,'chat');try{_0x29524f['model']['change'](_0x3689f3=>{_0x3c0d13=_0x3689f3['batch'],_0x2ae70e['applyOperations'](_0x3689f3,_0x5db22d);}),this['_batchToChanges']['set'](_0x3c0d13,{'interactionId':_0x5bd006['id'],'replyId':_0x296e06['id'],'indexes':_0x4ba2e4});}catch(_0x14764a){throw this['_reporter']['logError'](new yn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x14764a})),_0x14764a;}}this['_updateRatings'](_0x296e06);}_rejectSuggestion(_0x9b063c){const {reply:_0x12678a}=this['getInteractionAndReplyById'](_0x9b063c['replyId']);_0x12678a['setChangeGroupState'](_0x9b063c['partIndex'],'rejected');}['_openBalloonFor'](_0x55ccc,_0x425262){if(!this['_hasAIChatBalloon'])return;const {reply:_0x3dce05}=this['getInteractionAndReplyById'](_0x55ccc),_0x574563=_0x3dce05['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x574563['length'])return;let _0xd8b8a4,_0x148fc6;if(void 0x0!==_0x425262?(_0x148fc6=_0x574563['find'](_0x5277b6=>_0x5277b6['index']==_0x425262),_0xd8b8a4=_0x148fc6?.['index']):(_0x148fc6=_0x574563[0x0],_0xd8b8a4=_0x148fc6['index']),!_0x148fc6)return void _0x3dce05['setChangeGroupState'](_0x425262??0x0,'outdated','editor-removed');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x55ccc&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xd8b8a4)return;const _0x258600=this['_getUserPresentableContentPartDocumentRange'](_0x55ccc,_0x3dce05,_0x148fc6),_0x5a52c6=_0x3dce05['changeGroups']['find'](_0x2f534a=>_0x2f534a['index']==_0xd8b8a4),_0x51d79e=_0x5a52c6['editor'],_0x3e33fd=_0x51d79e['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x3e33fd&&this['_activeBalloon']['close'](),!_0x258600)return _0x3e33fd['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x3e33fd,this['_currentPreviewedChangeGroup']={'replyId':_0x55ccc,'partIndex':_0xd8b8a4},this['_scrollToSuggestionRange'](_0x258600,!0x0,_0x51d79e);const _0x2bd328=this['_getPresentableSiblingContentPartIndex'](_0x55ccc,_0xd8b8a4,'next');_0x3e33fd['clearContent'](),_0x3e33fd['updateContent']({'part':_0x148fc6,'renderingStrategy':'static'}),_0x3e33fd['open']({'index':_0xd8b8a4,'title':Es(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xd8b8a4+0x1)['toString']()),'showRotator':null!==_0x2bd328,'ranges':[_0x258600],'areActionsDisabled':_0x3dce05['areActionsDisabled'],'targetEditor':_0x51d79e,'isTargetReadOnly':this['_isGroupReadOnly'](_0x5a52c6)}),_0x3e33fd['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x55ccc,_0xd8b8a4),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x55ccc,'index':_0xd8b8a4,'isActive':!0x0});}_closeActiveBalloon(){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}_getPresentableSiblingContentPartIndex(_0xff3018,_0x3443cf,_0xaf50a6){const {reply:_0x36cdd1}=this['getInteractionAndReplyById'](_0xff3018),_0x21a591=_0x36cdd1['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x21a591['length'])return null;const _0x58a799='next'==_0xaf50a6?0x1:-0x1;function _0x1b54e5(_0x24052a){const _0x39c3fc=(_0x24052a+_0x58a799+_0x21a591['length'])%_0x21a591['length'];return{'siblingIndex':_0x39c3fc,'siblingPart':_0x21a591[_0x39c3fc]};}const _0x5ce040=_0x21a591['findIndex'](_0x3fb182=>_0x3fb182['index']==_0x3443cf);let {siblingIndex:_0x1b23e8,siblingPart:_0x35d7d5}=_0x1b54e5(_0x5ce040);for(;!this['_getUserPresentableContentPartDocumentRange'](_0xff3018,_0x36cdd1,_0x35d7d5);)if({siblingIndex:_0x1b23e8,siblingPart:_0x35d7d5}=_0x1b54e5(_0x1b23e8),_0x1b23e8===_0x5ce040)return null;return _0x35d7d5['index'];}_getOutdatedReason(_0x2c714e){return _0x2c714e?.['editor']&&'destroyed'!==_0x2c714e['editor']['state']?'content-removed':'editor-removed';}_getUserPresentableContentPartDocumentRange(_0x2df3ba,_0x563a00,_0x3b4305){const _0x4658ec=_0x563a00['changeGroups'];if(!_0x3b4305['hasChanges'])return null;const _0xc0ca00=_0x4658ec['find'](_0x5e735e=>_0x5e735e['index']==_0x3b4305['index']);if('pending'!==_0xc0ca00?.['state'])return null;if(!_0xc0ca00?.['editor']||'destroyed'===_0xc0ca00['editor']['state'])return _0x563a00['setChangeGroupState'](_0x3b4305['index'],'outdated',this['_getOutdatedReason'](_0xc0ca00)),null;const _0x2a6ff2=this['_getDocumentRangeForReplyChanges'](_0x2df3ba,_0x3b4305['index']);if(!_0x2a6ff2)return _0x563a00['setChangeGroupState'](_0x3b4305['index'],'outdated',this['_getOutdatedReason'](_0xc0ca00)),null;const {range:_0x1bb23d,currentIndex:_0x3bd90d}=_0x2a6ff2;return'$graveyard'==_0x1bb23d['root']['rootName']?(_0x563a00['setChangeGroupState'](_0x3bd90d,'outdated',this['_getOutdatedReason'](_0xc0ca00)),null):_0x2a6ff2['range'];}_getDocumentRangeForReplyChanges(_0x5b8463,_0x34c77a){const {reply:_0x318106,interaction:_0xb712bb}=this['getInteractionAndReplyById'](_0x5b8463),_0x284877=_0x318106['changeGroups']['filter'](_0x56e8a7=>'pending'==_0x56e8a7['state']),_0x42c4b1=_0x284877['map'](_0x38a605=>_0x318106['changeGroups']['indexOf'](_0x38a605));void 0x0===_0x34c77a&&(_0x34c77a=_0x42c4b1[0x0]);const _0x20392d=_0x42c4b1['indexOf'](_0x34c77a);if(-0x1==_0x20392d)return null;const _0x4cb7a8=_0x284877[_0x20392d],_0x22ccc6=_0x4cb7a8['editor'];if(!_0x22ccc6||'destroyed'===_0x22ccc6['state'])return null;const _0x40c8b4=Gs(_0x22ccc6,_0x4cb7a8['rootName']),_0x502656=_0x318106['documentContextContent']['get'](_0x4cb7a8['documentId']),_0x3e2343=new _0x139fbf([]),_0x187511=new _0x139fbf([]);for(const _0x909f6b of _0x4cb7a8['changes'])if('removed'!=_0x909f6b['type']&&_0x187511['children']['push'](_0x909f6b['node']['cloneNode'](!0x0)),'new'!=_0x909f6b['type']){const _0x1eec3a=_0x228c3a(_0x3d13b0=>Ps(_0x3d13b0,'data-id')==_0x909f6b['id'],_0x502656,!0x0);_0x3e2343['children']['push'](_0x1eec3a['cloneNode'](!0x0));}if(0x0==_0x3e2343['children']['length']){if(_0x4cb7a8['changes'][0x0]['anchorId']){const _0x5ae39f=vs('data-id',_0x4cb7a8['changes'][0x0]['anchorId'],_0x502656);_0x3e2343['children']['unshift'](_0x5ae39f['cloneNode'](!0x0)),_0x187511['children']['unshift'](_0x5ae39f['cloneNode'](!0x0)),_0x5ae39f['nextSibling']&&(_0x3e2343['children']['push'](_0x5ae39f['nextSibling']['cloneNode'](!0x0)),_0x187511['children']['push'](_0x5ae39f['nextSibling']['cloneNode'](!0x0)));}else{const _0x5b419e=_0x502656['children'][0x0];if(!_0x5b419e)return null;_0x3e2343['children']['push'](_0x5b419e['cloneNode'](!0x0)),_0x187511['children']['push'](_0x5b419e['cloneNode'](!0x0));}}if(_0x40c8b4&&qs(_0x318106['changeGroups'],_0x318106['documentContextContent'])['has'](_0x4cb7a8['index']))return null;const _0x2d4323=_0xb712bb['getDocumentContext'](),_0x2aec6f=_0x2d4323['documents']['find'](_0x1a5c3c=>_0x1a5c3c['id']==_0x4cb7a8['documentId'])['content'],_0x4ba32d=_0x22ccc6['model']['document']['getRoot'](_0x4cb7a8['rootName']),_0x5def9d=_0x22ccc6['data']['parse'](_0x2aec6f,_0x4ba32d),_0x47abbe=_0x40c8b4?Ws(Os(_0x3e2343)):Os(_0x3e2343),_0x14284f=_0x22ccc6['data']['parse'](_0x47abbe,_0x4ba32d),_0x29d628=_0x22ccc6['data']['parse'](_0x47abbe,_0x4ba32d),_0x2bd9b2=_0x22ccc6['model']['createPositionAt'](_0x14284f,0x0),_0x487f94=_0x40c8b4?Ws(Os(_0x187511)):Os(_0x187511),_0x75ebb={'targetEditor':_0x22ccc6,'anchor':_0x2bd9b2,'markDeletions':!0x1};let _0x19e658;try{_0x19e658=_0x22ccc6['plugins']['get'](_0x45dea0)['getDiff'](_0x47abbe,_0x487f94,_0x75ebb)['getOperations']();}catch(_0x31d39e){return this['_reporter']['reportError'](new yn({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0x31d39e,'context':{'replyId':_0x5b8463,'partIndex':_0x34c77a}})),null;}if(!_0x19e658['length'])return null;_0x22ccc6['model']['change'](_0x4f778e=>{for(const _0x482a3e of _0x19e658)if(!_0x9fd625(_0x482a3e)){if('remove'==_0x482a3e['type']){const _0x409d4d=_0x482a3e['sourcePosition'],_0x2bd69b=_0x482a3e['howMany'],_0x51cc2d=new _0x4f656c(_0x409d4d,_0x2bd69b);_0x4f778e['batch']['addOperation'](_0x51cc2d),_0x22ccc6['model']['applyOperation'](_0x51cc2d);}else'marker'!==_0x482a3e['type']&&(_0x482a3e['baseVersion']=null,_0x482a3e['isDocumentOperation']=!0x1,_0x4f778e['batch']['addOperation'](_0x482a3e),_0x22ccc6['model']['applyOperation'](_0x482a3e));}});const _0x3dd35e=_n(_0x22ccc6,_0x19e658,_0x14284f);An(_0x22ccc6['model'],_0x3dd35e);const _0x1eee3e=_0x3dd35e['getFirstRange']()['start']['path']['slice'](),_0xcbdeac=_0x3dd35e['getFirstRange']()['end']['path']['slice'](),_0x57a4ee=[];let _0x415ed6=_0x14284f,_0x1daa15=_0x29d628;for(let _0x4d4a67=0x0;_0x4d4a67<_0xcbdeac['length'];_0x4d4a67++){const _0x1373e4=_0x415ed6['maxOffset']-_0xcbdeac[_0x4d4a67];_0x57a4ee[_0x4d4a67]=_0x1daa15['maxOffset']-_0x1373e4,_0x415ed6=_0x415ed6['getChildAtOffset'](_0xcbdeac[_0x4d4a67]),_0x1daa15=_0x1daa15['getChildAtOffset'](_0x57a4ee[_0x4d4a67]);}const _0x1e782c=_0x22ccc6['model']['createRange'](_0x22ccc6['model']['createPositionFromPath'](_0x29d628,_0x1eee3e),_0x22ccc6['model']['createPositionFromPath'](_0x29d628,_0x57a4ee)),_0x24c415=_0x1e782c['start']['path']['slice'](),_0x3103df=_0x1e782c['end']['path']['slice']();if(!_0x40c8b4){const _0x3299c9=_0x29d628['getChild'](0x0)['getAttribute'](_0x4fabc2),_0x535f8f=Array['from'](_0x5def9d['getChildren']())['find'](_0x36ecc5=>_0x36ecc5['getAttribute'](_0x4fabc2)==_0x3299c9)['getPath']();_0x24c415[0x0]=_0x535f8f[0x0]+_0x24c415[0x0],_0x3103df[0x0]=_0x535f8f[0x0]+_0x3103df[0x0];}let _0x5707e9=_0x22ccc6['model']['createRange'](_0x22ccc6['model']['createPositionFromPath'](_0x22ccc6['model']['document']['getRoot'](_0x4cb7a8['rootName']),_0x24c415),_0x22ccc6['model']['createPositionFromPath'](_0x22ccc6['model']['document']['getRoot'](_0x4cb7a8['rootName']),_0x3103df));const _0x34c40b=_0x2d4323['documents']['find'](_0x536fde=>_0x536fde['id']==_0x4cb7a8['documentId'])['version'],_0x5b56c1=_0x22ccc6['model']['document']['history']['getOperations'](_0x34c40b);for(const _0x4d5761 of _0x5b56c1)_0x5707e9=_0x2827cc['_createFromRanges'](_0x5707e9['getTransformedByOperation'](_0x4d5761));return{'range':_0x5707e9,'currentIndex':_0x34c77a,'targetEditor':_0x22ccc6};}_integrateEditorBalloon(_0x3dcfbb){if(!_0x3dcfbb['plugins']['has']('AIChatBalloon'))return;const _0x2caab3=_0x3dcfbb['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x2caab3['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x2caab3,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x520da7,partIndex:_0x9bb9dc}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x168d21}=this['getInteractionAndReplyById'](_0x520da7),_0x428c55=_0x168d21['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x9bb9dc});_0x2caab3['updateContent']({'part':_0x428c55[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x2caab3,'applySuggestion',()=>{const {replyId:_0xeddb07,partIndex:_0x2d1989}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xeddb07,'partIndex':_0x2d1989}),_0x2caab3['setState']('accepted');}),this['listenTo'](_0x2caab3,'insertSuggestion',()=>{const {replyId:_0x39878f,partIndex:_0x3c0d3f}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x39878f,'partIndex':_0x3c0d3f}),_0x2caab3['setState']('accepted');}),this['listenTo'](_0x2caab3,'rejectSuggestion',()=>{const {replyId:_0x20443b,partIndex:_0x3c7006}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x20443b,'partIndex':_0x3c7006}),_0x2caab3['setState']('rejected');}),this['listenTo'](_0x2caab3,'showNext',()=>{const {replyId:_0xfc2b02,partIndex:_0x20c3c1}=this['_currentPreviewedChangeGroup'],_0x23e074=this['_getPresentableSiblingContentPartIndex'](_0xfc2b02,_0x20c3c1,'next');null!==_0x23e074&&this['_openBalloonFor'](_0xfc2b02,_0x23e074);}),this['listenTo'](_0x2caab3,'showPrevious',()=>{const {replyId:_0x1c8062,partIndex:_0x4de369}=this['_currentPreviewedChangeGroup'],_0x44b7c3=this['_getPresentableSiblingContentPartIndex'](_0x1c8062,_0x4de369,'previous');null!==_0x44b7c3&&this['_openBalloonFor'](_0x1c8062,_0x44b7c3);}),this['listenTo'](_0x2caab3,'dialogClosed',(_0x118ab,{id:_0x1be75b})=>{if('aiChatBalloon'!==_0x1be75b)return;const {replyId:_0x5a86a0,partIndex:_0x5078fc}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5a86a0,'index':_0x5078fc,'isActive':!0x1}),this['_activeBalloon']===_0x2caab3&&(this['_activeBalloon']=void 0x0);});}_integrateEditor(_0x5944ef){if(this['_channelsToEditors']['set'](_0x5944ef['config']['get']('collaboration.channelId'),_0x5944ef),this['_integrateEditorBalloon'](_0x5944ef),this['addCurrentDocumentToChatContext'](),this['listenTo'](_0x5944ef,'change:isReadOnly',()=>this['_refreshSuggestionGating']()),_0x5944ef['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x5944ef['plugins']['has']('Undo')){const _0x52422e=_0x5944ef['commands']['get']('undo'),_0x52e0ec=_0x5944ef['commands']['get']('redo');this['listenTo'](_0x52422e,'revert',(_0x18ce9b,_0xab2b8c,_0x2093c8)=>{const _0x3d0556=this['_batchToChanges']['get'](_0xab2b8c);if(!_0x3d0556)return;const _0x27f76a=this['activeConversation']['getInteraction'](_0x3d0556['interactionId']),_0x101e93=_0x27f76a?.['getReply'](_0x3d0556['replyId']);this['_batchToChanges']['delete'](_0xab2b8c),_0x27f76a&&_0x101e93&&(_0x3d0556['indexes']['forEach'](_0x29ebf3=>_0x101e93['setChangeGroupState'](_0x29ebf3,'pending')),this['_batchToChanges']['set'](_0x2093c8,_0x3d0556));}),this['listenTo'](_0x52e0ec,'revert',(_0x49fa21,_0x26c5ef,_0x5f2021)=>{const _0x4be27f=this['_batchToChanges']['get'](_0x26c5ef);if(!_0x4be27f)return;const _0x451526=this['activeConversation']['getInteraction'](_0x4be27f['interactionId']),_0x5e6640=_0x451526?.['getReply'](_0x4be27f['replyId']);this['_batchToChanges']['delete'](_0x26c5ef),_0x451526&&_0x5e6640&&(_0x4be27f['indexes']['forEach'](_0x1d3028=>_0x5e6640['setChangeGroupState'](_0x1d3028,'accepted')),this['_batchToChanges']['set'](_0x5f2021,_0x4be27f));});}const _0x4bdabc=_0x5944ef['config']['get']('ai.chat.context');_0x4bdabc['alwaysAddSelection']&&_0x4bdabc['document']['enabled']&&this['listenTo'](_0x5944ef['model']['document']['selection'],'change:range',(_0x3a5934,_0x3ed177)=>{_0x3ed177['directChange']&&'chat'===_0x5944ef['plugins']['get']('AITabs')['view']['activeTab']&&(_0x5944ef['model']['hasContent'](_0x5944ef['model']['document']['selection'])?this['addSelectionToChatContext'](_0x5944ef):this['removeSelectionFromChatContext']());});}async _getLastCreatedConversationId(){const _0x4fc653=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1cf989=await _0x4fc653['getConversations']();return _0x1cf989['length']?_0x1cf989[0x0]['id']:'new';}catch(_0x265f67){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':kt()}),this['_reporter']['logError'](new ct('ai-chat-conversation-init-failed',this,{'error':_0x265f67})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async _startConversationSafely(_0x4707c8={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x4707c8),_0x4707c8['id']||this['set']('isConversationReady',!0x0);}catch(_0x2ea3d4){this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4707c8['id']||kt()}),this['_reporter']['logError'](_0x2ea3d4),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}_detachFromActiveConversation(){this['_aiChatUi']['setIsUploadInProgress'](!0x1),this['activeConversation']&&this['stopListening'](this['activeConversation']);}async _handleStartConversation({id:_0x5368b1,modelId:_0x3ef69b,contexts:_0x52e02f}={}){this['_detachFromActiveConversation'](),this['_closeActiveBalloon']();let _0x255f8e=_0x3ef69b;_0x255f8e||(_0x5368b1||!this['activeConversation']?_0x255f8e=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x255f8e=this['activeConversation']['selectedModel']?.['id'])),this['_stopLastInteraction']();const _0x3fc30c=this['getGroupId'](),_0x16b78e=_0x5368b1||kt(),_0x3cd90e=await this['_aiModels']['getAvailableModels']();let _0x5dacb3;this['activeConversation']=new jn({'connector':this['_aiConnector'],'chatModels':this['_aiModels'],'selectedModelId':_0x255f8e,'conversationId':_0x16b78e,'group':_0x3fc30c,'locale':this['context']['locale'],'isFromHistory':!!_0x5368b1,'channelsToEditors':this['_channelsToEditors'],'contextLibrary':this['_aiContextLibrary'],'extraContexts':_0x52e02f,'getSessionId':_0x247e7d=>this['_aiEditing']['getSessionId'](_0x247e7d),'aiEditing':this['_aiEditing']}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',()=>{this['_aiChatUi']['createConversation']({'availableModels':_0x3cd90e}),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5368b1||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x19cedd,_0xf69230)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xf69230['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x337786=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x337786);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0xe21202=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0xe21202);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0xbbc132,_0x5d4e8f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5d4e8f,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x33c8e6,_0x44e473)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x44e473,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x185692,_0xdc11a4)=>{this['_aiChatUi']['removeFeedInteraction'](_0xdc11a4['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x5a7f62,_0x1ccf93,_0x180197)=>{this['_updateConversationTitle'](_0x1ccf93,_0x180197);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x4a5097,_0x22b68d)=>{void 0x0!==_0x5dacb3&&_0x5dacb3!==_0x22b68d['id']&&this['_updateReplyContentThrottled']['flush'](),_0x5dacb3=_0x22b68d['id'],_0x22b68d['isFromHistory']?await this['_updateReplyContent']({'reply':_0x22b68d}):await this['_updateReplyContentThrottled']({'reply':_0x22b68d});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x22effc,{reply:_0x188927,index:_0x2168ec,state:_0x4d1163,outdatedReason:_0x325627})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x188927['id'],'index':_0x2168ec,'state':_0x4d1163,'outdatedReason':_0x325627}),this['_aiChatUi']['hasFeedItem'](_0x188927['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x188927['id'],this['_computeSuggestionGating'](_0x188927)),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x188927['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x2168ec&&this['_activeBalloon']?.['setState'](_0x4d1163,_0x325627);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x4b407f,_0x3153ad)=>{if(this['_aiChatUi']['addContextItem'](_0x3153ad['contextItem'],_0x3153ad['isLoading']),'selection'===_0x3153ad['contextItem']['type']){const _0x5b907f=Ss(this['context']),_0x4a6d0b=[..._0x5b907f['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x5b907f,'ranges':_0x4a6d0b,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0xbee8e8,_0x30f979)=>{this['_aiChatUi']['removeContextItem'](_0x30f979['uiId']),'current-document'==_0x30f979['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x30f979['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x4eaf60,_0x133f72)=>{this['_aiChatUi']['setContextItemLoading'](_0x133f72['contextItem']['uiId'],_0x133f72['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x52f418,_0x4b56ba)=>{this['_aiChatUi']['setConversationContext'](_0x4b56ba['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x4e907d,_0x4e539d)=>{this['_aiChatUi']['setAddContextOptions'](_0x4e539d['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x37df21,_0x4e7c3b)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4e7c3b['sourceId'],_0x4e7c3b['source'],_0x4e7c3b['resources'],_0x4e7c3b['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x3c114c,_0x1d1827)=>{this['_aiChatUi']['updateResourceState'](_0x1d1827['sourceId'],_0x1d1827['resourceId'],_0x1d1827['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x2a2aa4,_0x2ec8b8)=>{this['_aiChatUi']['updateCapabilities'](_0x2ec8b8);}),this['listenTo'](this['activeConversation'],'modelSelected',(_0x203198,_0x31f351)=>{this['_aiChatUi']['setSelectedModel'](_0x31f351['selectedModel']??null,_0x31f351['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',async(_0x111822,{error:_0x521780,interactionId:_0xd1ae7f,fileName:_0x3d50a9,url:_0x238608,sourceId:_0x5e203b,sourceLabel:_0x28ed1f})=>{let _0x49a5c9;const _0x1b6995=_0xd1ae7f?_0xd1ae7f+':'+kt():kt();this['_reporter']['reportError'](_0x521780),this['_aiChatUi']['startAutoScroll'](),_0x521780['message']['startsWith']('ai-request-aborted')?(this['_cancelProcessing'](),this['activeConversation']?.['cancelLastInteractionStream'](),_0x49a5c9=this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Es(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1b6995})):_0x521780['message']['startsWith']('ai-chat-conversation-init-failed')||_0x521780['message']['startsWith']('ai-chat-conversation-start-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-file-upload-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x3d50a9),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-url-upload-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x238608),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-invalid-data')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-unsupported-type')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5e203b&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5e203b),_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x28ed1f||'source'),'id':_0x1b6995})):_0x521780['message']['startsWith']('ai-chat-resource-load-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-invalid-request')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-unsupported-file-type')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-file-too-large')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-file-too-many-pages')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x1b6995}):(this['_cancelProcessing'](),_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1b6995}));try{await Promise['race']([_0x49a5c9,this['_aiChatUi']['idleUiPromise']]);}finally{this['_aiChatUi']['isBusy']||this['_aiChatUi']['stopAutoScroll']();}}),await this['activeConversation']['init'](this['_buildConversationContextConfig']()),_0x5368b1||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']());}_buildConversationContextConfig(){const _0x1082ff=this['context']['config']['get']('ai.chat.context');return this['_contextLibrarySource']?{..._0x1082ff,'sources':[..._0x1082ff?.['sources']??[],this['_contextLibrarySource']]}:_0x1082ff;}async _setUpContextLibrarySource(){const _0x13f048=await this['_createContextLibrarySource']();_0x13f048&&(this['_contextLibrarySource']=_0x13f048,this['activeConversation']&&this['activeConversation']['chatContext']['addContextSource'](_0x13f048));}async _createContextLibrarySource(){let _0x615578;try{_0x615578=await this['_aiContextLibrary']['getAvailableContexts']();}catch{return null;}if(!_0x615578['length'])return null;const _0x362950=_0x615578['map'](_0xa74260=>({'id':_0xa74260['id'],'type':'context','label':_0xa74260['name']||_0xa74260['id']}));return{'id':'ck-ai-context-library','label':Es(this['context']['locale'],'AI_CHAT_CONTEXT_LIBRARY_LABEL'),'useDefaultFiltering':!0x0,'getResources':()=>Promise['resolve'](_0x362950)};}_removeFromContext(_0xcd111){this['activeConversation']?.['removeFromContext'](_0xcd111);}_toggleWebSearch(){this['activeConversation']?.['toggleWebSearch']();}_toggleReasoning(){this['activeConversation']?.['toggleReasoning']();}getInteractionAndReplyById(_0x3bd05e){const [_0x146227,_0xdf96cd]=_0x3bd05e['split'](':'),_0x3511de=this['activeConversation']['getInteraction'](_0x146227);return{'interaction':_0x3511de,'reply':_0x3511de['getReply'](_0xdf96cd)};}_scrollToSuggestionRange(_0x5e22a3,_0x5ede53=!0x1,_0x33610e){const _0xe3e5b3={'target':_0x33610e['editing']['view']['domConverter']['viewRangeToDom'](_0x33610e['editing']['mapper']['toViewRange'](_0x5e22a3)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x5ede53};_0x5ede53&&(_0xe3e5b3['alignToTop']=!0x0),Ot(_0xe3e5b3);}_updateConversationTitle(_0x45226f,_0x18a40e=!0x1){this['_aiChatUi']['setConversationTitle'](_0x45226f||Es(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x18a40e);}_addFeedItemReply(_0x56e78f){'text'===_0x56e78f['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x56e78f):this['_aiChatUi']['addFeedItemAISuggestion'](_0x56e78f);}async _updateReplyContent({reply:_0x36e4d6,renderingStrategy:_0x423662}){const {id:_0x5cd4f9,interactionId:_0x238559,isDone:_0x25d06b,type:_0x1443e9,parsedContent:_0x55e12c}=_0x36e4d6,_0x3ee65f=_0x238559+':'+_0x5cd4f9;if('modification'===_0x1443e9){const _0x565f2e=_0x36e4d6['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3ee65f,'parts':_0x565f2e,'isDone':_0x25d06b,'skipLoadingEffects':_0x36e4d6['isFromHistory']}),this['_aiChatUi']['hasFeedItem'](_0x36e4d6['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x36e4d6['id'],this['_computeSuggestionGating'](_0x36e4d6));}else'text'===_0x1443e9&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3ee65f,'parsedContent':_0x55e12c['get']('text'),'renderingStrategy':_0x423662,'isDone':_0x25d06b});_0x25d06b&&_0x36e4d6['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3ee65f,_0x36e4d6['sources']);}_updateReplyContentThrottled=_0x20eb7b(this['_updateReplyContent']['bind'](this),0xc8);_stopLastInteraction(){this['activeConversation']?.['stopProcessing'](),this['_aiChatUi']['stopInteraction'](this['activeConversation']?.['lastInteraction']),this['_updateReplyContentThrottled']['cancel']();}async _flushLastInteractionUI(){const _0x40b76c=this['activeConversation']?.['lastInteraction'];if(_0x40b76c){for await(const _0x4f6123 of _0x40b76c['replies'])this['_aiChatUi']['hasFeedItem'](_0x4f6123['id'])||this['_addFeedItemReply'](_0x4f6123),await this['_updateReplyContent']({'reply':_0x4f6123,'renderingStrategy':'static'});}}async['_cancelProcessing'](){this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}_updateRatings(_0xe7583f){const _0x56f2d3={'positiveCount':_0xe7583f['changeGroups']['filter'](_0x5a70c4=>'accepted'===_0x5a70c4['state'])['length'],'totalCount':_0xe7583f['changeGroups']['length'],'modificationId':_0xe7583f['id']},_0x357b48=this['activeConversation']['getInteraction'](_0xe7583f['interactionId'])['messageId'];_0x357b48&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x357b48,_0x56f2d3);}_getAIChatFeedAPI(_0x16cf4e){const _0xeb845d=this['_aiChatUi'],_0x9819a8=()=>{_0x16cf4e['resetWebSearchState'](),_0x16cf4e['resetReasoningState'](),_0xeb845d['clearLoadingMessage']();},_0x3671c4=()=>{_0x16cf4e['currentReply']&&(_0x16cf4e['currentReply']['done'](),_0x16cf4e['currentReply']=void 0x0);};return{'insertTextReply':(_0xe9fc7c,_0x32c49a)=>{_0x3671c4(),_0x9819a8();const _0x143ef1=_0x16cf4e['currentReply']=_0x16cf4e['createReply']({'type':'text','interactionId':_0x16cf4e['id'],'id':_0x32c49a||kt(),'channelsToEditors':this['_channelsToEditors']});return _0x143ef1['appendContent'](_0xe9fc7c),_0x3671c4(),_0x143ef1;},'insertCustomElement':async(_0x505339,_0x257902)=>(_0x3671c4(),_0x9819a8(),_0xeb845d['addFeedItemCustomElement'](_0x505339,_0x257902||kt())),'setLoadingMessage':_0x129910=>{_0xeb845d['setLoadingMessage'](_0x129910);},'clearLoadingMessage':()=>{_0xeb845d['clearLoadingMessage']();}};}_checkRemoveCurrentDocumentFromChatContext(){bs(this['context'])['find'](_0x110a7c=>'destroyed'!==_0x110a7c['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const ir=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],sr=[...ir,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function nr(_0x59f52f){const _0x464e05=new AbortController();return{'promise':new Promise((_0x220c87,_0x4044ec)=>{const _0x27f822=setTimeout(_0x220c87,_0x59f52f);_0x464e05['signal']['addEventListener']('abort',()=>{clearTimeout(_0x27f822),_0x4044ec();});}),'abortController':_0x464e05};}var rr=class{options;isStreaming=!0x1;document=null;nodesList=[];currentIndex=0x0;timeoutAbortController=null;lastUpdateTime=0x0;constructor(_0x517388){this['options']={'delay':_0x517388?.['delay']??0xa,'textNodeStyle':_0x517388?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async stream({document:_0x29020d,targetElement:_0x5e849b,abortSignal:_0x48904f}){this['isStreaming']&&this['stop'](),_0x48904f?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2a3383(_0x29020d,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x332971=0x0;_0x332971<this['currentIndex'];_0x332971++)this['nodesList'][_0x332971]['shouldBeStreamed']=!0x0;do{const _0x517263=Date['now'](),_0xdd34d6=this['nodesList'][this['currentIndex']],_0x3f1a53=_0x517263-this['lastUpdateTime'];if(_0xdd34d6){_0xdd34d6['shouldBeStreamed']=!0x0;let _0x2eb281=_0xdd34d6['parent'];for(;_0x2eb281;)_0x2eb281['shouldBeStreamed']=!0x0,_0x2eb281=_0x2eb281['parent'];}if(_0x3f1a53<this['options']['delay'])try{const {promise:_0x2bb616,abortController:_0x4a1aa5}=nr(this['options']['delay']-_0x3f1a53);this['timeoutAbortController']=_0x4a1aa5,await _0x2bb616;}catch(_0x21480b){return;}_0x29a9e2(_0x5e849b,'<'+_0x5e849b['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x5e849b['tagName']+'>',{'childrenOnly':!0x0}),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}reset(){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}cleanUpAnimations({targetElement:_0x2b1728}){Array['from'](_0x2b1728['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x36f588=>{_0x36f588['replaceWith'](_0x36f588['childNodes'][0x0]);});}stop(){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x5b54af){let _0x101036='';if(function(_0x59febc){return _0x23e8cf(_0x59febc);}(_0x5b54af)){for(const _0x4aa4cc of _0x5b54af['children'])_0x101036+=this['renderNode'](_0x4aa4cc);}else{if(hr(_0x5b54af)){if(!_0x5b54af['shouldBeStreamed'])return'';const _0x4db63a=_0x5b54af,_0x3b1d71=Object['entries'](_0x4db63a['attribs'])['map'](([_0x1c4d33,_0x5f2c67])=>_0x1c4d33+'=\x22'+_0x5f2c67+'\x22')['join']('\x20');_0x101036+='<'+_0x4db63a['tagName']+(_0x3b1d71?'\x20'+_0x3b1d71:'')+'>';for(const _0x5a7ecc of _0x27f885(_0x4db63a))_0x101036+=this['renderNode'](_0x5a7ecc);_0x101036+='</'+_0x4db63a['tagName']+'>';}else{if(!ar(_0x5b54af))return'';if(!_0x5b54af['shouldBeStreamed'])return'';!function(_0x65da16){return!(!_0x65da16['parent']||!hr(_0x65da16['parent']))&&(!!or['includes'](_0x65da16['parent']['tagName'])&&!_0xa4b40a(_0x65da16)['match'](/^\s*[<>]\s*$/));}(_0x5b54af)?_0x101036+=_0x35b927(_0x5b54af):_0x101036+=_0x35b927(new _0x21f244('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x5b54af]));}}return _0x101036;}getParsedDocumentNodeList(){const _0x4b0bbf=[];return function(_0x57b045,_0x14868a){const _0x347cff=_0x295060=>{if(_0x14868a(_0x295060),_0x295060 instanceof _0x71eb2)for(let _0x248413=0x0;_0x248413<_0x295060['children']['length'];_0x248413++){const _0x9e68a1=_0x295060['children'][_0x248413];_0x347cff(_0x9e68a1);}};for(let _0x3ee8ab=0x0;_0x3ee8ab<_0x57b045['children']['length'];_0x3ee8ab++)_0x347cff(_0x57b045['children'][_0x3ee8ab]);}(this['document'],_0xc98e0c=>{if(ar(_0xc98e0c)){const _0x1cd437=this['splitTextNodeIntoWordNodes'](_0xc98e0c);_0x1cd437['length']&&_0x4b0bbf['push'](..._0x1cd437);}_0xc98e0c['isWordSplitSource']||_0xc98e0c['isWordSplitResult']||_0x4b0bbf['push'](_0xc98e0c);}),_0x4b0bbf;}splitTextNodeIntoWordNodes(_0x1fa537){if(_0x1fa537['isWordSplitSource']||_0x1fa537['isWordSplitResult'])return[];const _0x3a6aee=_0xa4b40a(_0x1fa537)['match'](/(?:\s*\S+\s*)/g),_0x4f6957=[];if(_0x3a6aee&&_0x3a6aee['length']>0x1){for(const _0x2e322f of _0x3a6aee){const _0x38d0b9=new _0xa7d61f(_0x2e322f);_0x38d0b9['isWordSplitResult']=!0x0,ti(_0x1fa537,_0x38d0b9),_0x4f6957['push'](_0x38d0b9);}_0x1fa537['isWordSplitSource']=!0x0,_0x47cc1f(_0x1fa537);}return _0x4f6957;}};const or=['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(_0x4ec4cb){return _0x5273d9(_0x4ec4cb);}function hr(_0x1bb94d){return _0x545292(_0x1bb94d);}function cr(_0x1712df,_0x506edd){_0x1712df['cleanUpAnimations']({'targetElement':_0x506edd}),_0x506edd['querySelectorAll']('[data-id]')['forEach'](_0x13cacb=>{_0x13cacb['removeAttribute']('data-id');});}var lr=class extends _0x56a514{options;content='';htmlStreamer;['children'];constructor(_0x1ac921){super();const _0x3cab86=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new rr(),this['options']=_0x1ac921,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3cab86['if']('isDone','ck-ai-chat__feed__item_done'),_0x3cab86['if']('isVisible','ck-hidden',_0x5c3140=>!_0x5c3140),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){cr(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async streamIntoElement(_0xc6cfcd,_0x4813f4,_0xa0e1f2){await this['htmlStreamer']['stream']({'document':_0xc6cfcd,'targetElement':_0x4813f4,'abortSignal':_0xa0e1f2});}},ur=class extends _0x56a514{['showChangesToggleView'];constructor(_0x2ac414,_0x150d7c){super(_0x2ac414),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new dr(_0x2ac414),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Dn,'label':Es(_0x2ac414,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x150d7c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x43791b=>_0x43791b?it:et),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x139d71=new $t();_0x139d71['content']=_0x2d99a5,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x150d7c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x139d71,{'tag':'span','children':[Es(_0x2ac414,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}},dr=class extends Mt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}};const _r={'accepted':_0x48b061,'rejected':_0x572ba4,'outdated':_0x14640e};var gr=class extends _0x56a514{statePillView;constructor(_0x900831){super(_0x900831);const _0x37d075=this['bindTemplate'];this['set']('state','accepted'),this['set']('outdatedReason',void 0x0),this['set']('isVisible',!0x0),this['statePillView']=new _0x5745ee(_0x900831),this['statePillView']['bind']('label')['to'](this,'state',_0x2d1c17=>function(_0x52a3b8,_0x38fbb8){return Es(_0x52a3b8,'AI_SUGGESTION_CONTENT_PART_STATE_'+_0x38fbb8['toUpperCase']());}(_0x900831,_0x2d1c17)),this['statePillView']['bind']('icon')['to'](this,'state',_0x259228=>_r[_0x259228]),this['statePillView']['bind']('class')['to'](this,'state',_0x2bd4e9=>'ck-pill_'+_0x2bd4e9),this['statePillView']['bind']('tooltip')['to'](this,'state',this,'outdatedReason',(_0x43d16f,_0x3bca71)=>function(_0x2663e5,_0x1d19d4,_0x5c77e0){if('outdated'!==_0x1d19d4)return;return Es(_0x2663e5,_0x5c77e0?Ar[_0x5c77e0]:'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP');}(_0x900831,_0x43d16f,_0x3bca71)),this['statePillView']['tooltipPosition']='s',this['statePillView']['tooltipClass']='ck-tooltip_multi-line',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x37d075['if']('isVisible','ck-hidden',_0x1489c6=>!_0x1489c6)]},'children':[this['statePillView']]});}setState(_0x34240e,_0x2a444f){this['state']=_0x34240e,this['outdatedReason']='outdated'===_0x34240e?_0x2a444f:void 0x0;}};const Ar={'content-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','editor-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','session-changed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP'};var Ir=class extends _0x54b9b5{_applyButton;_suggestButton;constructor(_0x3f177b,_0x6d6273,_0x4f5719){super(_0x3f177b);const _0x4a1cda=Boolean(_0x4f5719);this['set']('isEnabled',!_0x4a1cda),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x230722=[];if(!_0x4a1cda){_0x6d6273['includes']('applySuggestion')&&(this['_applyButton']=new Mt(_0x3f177b),this['_applyButton']['set']({'label':Es(_0x3f177b,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x381a45}),this['_applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x45df4a,_0x390ac7)=>_0x45df4a&&!_0x390ac7),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',_0x320f2a=>!_0x320f2a),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x230722['push'](this['_applyButton'])),_0x6d6273['includes']('insertSuggestion')&&(this['_suggestButton']=new Mt(_0x3f177b),this['_suggestButton']['set']({'label':Es(_0x3f177b,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xf32bda}),this['_suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x54c970,_0x2bad00)=>_0x54c970&&!_0x2bad00),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x230722['push'](this['_suggestButton']));const _0x45ab4d=new Mt(_0x3f177b);_0x45ab4d['set']({'label':Es(_0x3f177b,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x194390}),_0x45ab4d['bind']('isEnabled')['to'](this),_0x45ab4d['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x230722['push'](_0x45ab4d);}this['items']['addMany'](_0x230722);const _0x349ee3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x349ee3['if']('isVisible','ck-hidden',_0x15783a=>!_0x15783a)]}});}setButtonsVisibility({showApplyButton:_0x29ecbe,showSuggestButton:_0x14fe69}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x29ecbe),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x14fe69);}},pr=class extends _0x56a514{toolbarView;stateView;titleLabelView;['children'];constructor(_0x3f90a5,{part:_0xe9aaf8,uiIndex:_0x33b32f,availableActions:_0x12c310,areActionsDisabled:_0x5b0f09}){super(_0x3f90a5),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['toolbarView']=new Ir(_0x3f90a5,_0x12c310,_0x5b0f09),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0xe9aaf8['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0xe9aaf8['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0xe9aaf8['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn','isTargetReadOnly')['to'](this),this['stateView']=new gr(_0x3f90a5),this['titleLabelView']=new Er(_0x3f90a5,_0x33b32f),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x459055,_0x3b861f,_0x1e2880,_0x5e7e56)=>{'pending'===_0x5e7e56?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x1e2880?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x1e2880,this['outdatedReason']),this['children']['add'](this['stateView']));});}},Er=class extends _0x56a514{constructor(_0x4f28ae,_0x2e9261){super(_0x4f28ae),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Es(_0x4f28ae,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x2e9261['toString']())]});}},mr=class extends _0x56a514{htmlStreamer;constructor(_0xfae6f0){super(_0xfae6f0),this['htmlStreamer']=new rr(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async update({part:_0x2d9a50,renderingStrategy:_0x589126,abortSignal:_0x4fa5bd}){this['_ensureHostElementTag'](_0x2d9a50['wrapperTag']||'div');const _0x460246=_0x2a3383(_0x2d9a50['content'],!0x0);for(const _0x491934 of ys(_0x460246))_0x47cc1f(_0x491934);'streaming'===_0x589126?await this['htmlStreamer']['stream']({'document':_0x460246,'targetElement':this['element'],'abortSignal':_0x4fa5bd}):_0x29a9e2(this['element'],'<'+this['element']['tagName']+'>'+Os(_0x460246)+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='',this['element']['scrollTop']=0x0;}cleanUpStreamingArtifacts(){cr(this['htmlStreamer'],this['element']);}_ensureHostElementTag(_0x3c476d){if(!this['element']||this['element']['tagName']['toLowerCase']()===_0x3c476d)return;const _0x2178ea=new _0x24e6f7({'tag':_0x3c476d,'attributes':{'class':this['element']['className']}})['render']();this['element']['replaceWith'](_0x2178ea),this['element']=_0x2178ea;}},Tr=class extends _0x56a514{['_children'];['_headerView'];_streamableContentView;constructor(_0x5d7ea8,{part:_0x5df6a5,uiIndex:_0xe771ce,areActionsDisabled:_0x1d9ed8,availableActions:_0x509541}){super(_0x5d7ea8);const _0x4cbe4d=this['bindTemplate'];this['set']('state',_0x5df6a5['state']),this['set']('outdatedReason',_0x5df6a5['outdatedReason']),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1);const _0xd1df75=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1d9ed8;};this['on']('change:state',_0xd1df75),this['on']('change:isDone',_0xd1df75),_0xd1df75(),this['_children']=this['createCollection'](),this['_headerView']=new pr(_0x5d7ea8,{'part':_0x5df6a5,'uiIndex':_0xe771ce,'availableActions':_0x509541,'areActionsDisabled':_0x1d9ed8}),this['_headerView']['bind']('isEnabled','outdatedReason','state','isTrackChangesOn','isTargetReadOnly')['to'](this),this['_headerView']['delegate'](...ir)['to'](this),this['_streamableContentView']=new mr(_0x5d7ea8),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4cbe4d['to']('state',_0x4a29ee=>'ck-ai-suggestion__body__content-part_'+_0x4a29ee),_0x4cbe4d['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4cbe4d['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4cbe4d['if']('isVisible','ck-hidden',_0x5853fd=>!_0x5853fd)]},'children':this['_children'],'on':{'mouseenter':_0x4cbe4d['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x5df6a5['index']});}),'mouseleave':_0x4cbe4d['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x5df6a5['index']});}),'click':_0x4cbe4d['to'](_0x3268a2=>{const _0x2e35aa=_0x3268a2['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x2e35aa)&&this['fire']('showChangeInText',{'index':_0x5df6a5['index']});})}});}async updateContent({part:_0x18f75b,showUnchangedParts:_0xf9bd9e=!0x1,abortSignal:_0x15ed23}){this['partDefinition']=_0x18f75b,this['isVisible']=this['partDefinition']['hasChanges']||_0xf9bd9e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x18f75b,'renderingStrategy':'static','abortSignal':_0x15ed23});}['markAsDone'](){this['isDone']=!0x0;}},wr=class extends _0x56a514{constructor(_0x4f149d,_0x3fad34){super(_0x4f149d),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2b99a1=>!_0x2b99a1)]},'children':this['_createSkeletonItems'](_0x3fad34)});}_createSkeletonItems(_0x4251b9){const _0x33d024=['ck','ck-ai-skeleton__item'];return _0x4251b9['map'](_0x46ea1b=>{let _0x42afdb='';switch(_0x46ea1b['attributes']['align']){case'right':_0x42afdb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x42afdb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x42afdb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x46ea1b['tag'],'attributes':{'class':[..._0x33d024,_0x46ea1b['attributes']['class']?_0x46ea1b['attributes']['class']:''],'style':'width:\x20'+_0x46ea1b['attributes']['width']+';\x20height:\x20'+_0x46ea1b['attributes']['height']+';'+_0x42afdb}};});}};const Cr={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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':fr(0x5,'100%','44px','right'),'aiChatResources':fr(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 fr(_0x5e14e8,_0x13bc0e,_0x287258,_0x27c54a){return new Array(_0x5e14e8)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x13bc0e,'height':_0x287258,'align':_0x27c54a}}));}const br=/* #__PURE__ -- @preserve */
33
+ dt();var Sr=class extends br{['queue']=[];['isProcessing']=!0x1;_abortController;async['enqueue'](_0xb1c40a){const _0x1e8cda=this['createTask'](_0xb1c40a);return this['queue']['push'](_0x1e8cda),this['_processQueue'](),_0x1e8cda['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(_0x4a530b=>{this['once']('_queueEmpty',()=>{_0x4a530b();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x14cbe7=this['queue']['shift']();try{await _0x14cbe7['callback'](this['_abortController']['signal']),_0x14cbe7['resolve']();}catch(_0x13fa22){_0x14cbe7['reject'](_0x13fa22);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}createTask(_0x25cd61){let _0x3e6990,_0x3ff540;const _0x294430=new Promise((_0x87f307,_0x2997eb)=>{_0x3e6990=_0x87f307,_0x3ff540=_0x2997eb;});return{'callback':_0x25cd61,'resolve':_0x3e6990,'reject':_0x3ff540,'completePromise':_0x294430};}},Rr=class extends lr{constructor(_0xe8b8a9){super(_0xe8b8a9),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0xe8b8a9['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}setContent(_0x1d3eef){this['element']['innerHTML']=_0x1d3eef;}};const Or=['applySuggestion','insertSuggestion'];var vr=class extends _0x56a514{_applyChangesButton;_insertSuggestionsButton;['children'];constructor(_0x52eb56,_0x5a1ebb=[...Or],_0x92aeb3){super(_0x52eb56);const _0x54187e=this['bindTemplate'],_0x38d426=Boolean(_0x92aeb3);this['set']('isEnabled',!_0x38d426),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x38d426||(this['_applyChangesButton']=new Mt(_0x52eb56),this['_applyChangesButton']['set']({'label':Es(_0x52eb56,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5a1ebb['includes']('applySuggestion'),'class':Ln}),this['_insertSuggestionsButton']=new Mt(_0x52eb56),this['_insertSuggestionsButton']['set']({'label':Es(_0x52eb56,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5a1ebb['includes']('insertSuggestion'),'class':Pn}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x391094=>{_0x391094['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x54187e['if']('isVisible','ck-hidden',_0x3f04c6=>!_0x3f04c6)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}updateVisibility(_0x32e1b3){this['isVisible']=_0x32e1b3;}_switchButtonLabelsPlurality(_0x6598d3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x6598d3?(this['_applyChangesButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},kr=class extends _0x56a514{['children'];['balloonPanelView'];bodyCollection;constructor(_0x3c64f6,_0x5d0e0a){super(_0x3c64f6),this['bodyCollection']=_0x5d0e0a,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',_0x2cb2ee=>!_0x2cb2ee)]},'children':this['children']});const _0x5e2f07=new _0x56a514(this['locale']),_0x155695=new $t();_0x155695['content']=ht,_0x5e2f07['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x155695,{'tag':'span','children':[{'text':Es(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5e2f07),this['_setupBalloonPanel'](_0x3c64f6);}['addSource'](_0x48fa5e){this['children']['add'](new yr(this['locale'],_0x48fa5e,this['balloonPanelView']));}_setupBalloonPanel(_0x23a8d5){this['balloonPanelView']=new xt(_0x23a8d5),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},yr=class extends Mt{['balloonPanelView'];['source'];constructor(_0x59f3a3,_0x225973,_0x4babf3){super(_0x59f3a3),this['source']=_0x225973,this['balloonPanelView']=_0x4babf3,this['set']({'label':_0x225973['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x4db084=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x4db084['to'](()=>{window['open'](_0x225973['url'],'_blank');}),'mouseenter':_0x4db084['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x4db084['to'](()=>{this['_hideTooltip']();})}}),_0x225973['favicon']){const _0x38a720=new _0x56a514(_0x59f3a3);_0x38a720['setTemplate']({'tag':'img','attributes':{'src':_0x225973['favicon']||ht,'alt':_0x225973['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x38a720);}else this['set']('icon',ht);}_createTooltipContentView(_0x82272d,_0x401fdf){const _0x109bfd=new _0x56a514(_0x82272d),_0x890f86=[];let _0x41137a;_0x401fdf?.['favicon']?(_0x41137a=new _0x56a514(_0x82272d),_0x41137a['setTemplate']({'tag':'img','attributes':{'src':_0x401fdf['favicon'],'alt':_0x401fdf['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x41137a=new $t(),_0x41137a['content']=ht,_0x41137a['extendTemplate']({'attributes':{'alt':_0x401fdf['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x890f86['push'](_0x41137a);const _0x14cd55=new _0x56a514(_0x82272d);_0x14cd55['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x401fdf['url']},'children':[{'text':new URL(_0x401fdf['url'])?.['hostname']}]}),_0x890f86['push'](_0x14cd55);const _0x387847=new _0x56a514(_0x82272d);_0x387847['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x890f86});const _0x294168=new _0x56a514(_0x82272d);return _0x294168['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x401fdf['title']['length']>0x190?_0x401fdf['title']['substring'](0x0,0x190)+'...':_0x401fdf['title']}]}),_0x109bfd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x387847,_0x294168]}),_0x109bfd;}_showTooltip(){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[xt['defaultPositions']['northArrowSouth'],xt['defaultPositions']['northArrowSouthWest'],xt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}_hideTooltip(){this['balloonPanelView']['hide']();}_updateTooltipContent(){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x278917=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x278917);}},Nr=class extends _0x56a514{_actionsView;['_readOnlyByIndex']=new Map();['_sourcesView'];['_children'];_skeletonView;_showSkeletonDebounced=_0x5f51ae(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);_skeletonShownAt=null;_areActionsDisabled;_showUnchangedParts;_updateContentPartsPromiseQueue;_emptyPartsWarningView;_availableActions;_cachedContentParts=[];constructor(_0x3ad9e1,_0x23b448){super(_0x3ad9e1);const {areActionsDisabled:_0xcdcf3d,showUnchangedParts:_0x1968a2,availableActions:_0x40482a}=_0x23b448;this['_areActionsDisabled']=_0xcdcf3d,this['_showUnchangedParts']=_0x1968a2,this['_availableActions']=_0x40482a,this['set']('isTrackChangesOn',!0x1),this['set']('isAcceptAllEnabled',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new wr(_0x3ad9e1,Cr['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Sr(),this['_emptyPartsWarningView']=new Rr({'id':'empty-parts-warning','initialContent':Es(_0x3ad9e1,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new vr(_0x3ad9e1,_0x23b448['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new kr(this['locale'],_0x23b448['bodyCollection']),_0x23b448['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled'),this['_actionsView']['delegate'](...ir)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}destroy(){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get partsCount(){return this['_contentPartViews']['length'];}get _contentPartViews(){return Array['from'](this['_children'])['filter'](_0x435552=>_0x435552 instanceof Tr);}async updateContentParts({parts:_0x2a2110,abortSignal:_0x14ec7e,skipLoadingEffects:_0x45ec19}){this['_cachedContentParts']['length']?_0x2a2110['forEach'](_0x269922=>{const _0x2a5074=this['_cachedContentParts']['findIndex'](_0x528312=>_0x528312['index']==_0x269922['index']);-0x1===_0x2a5074?this['_cachedContentParts']['push'](_0x269922):this['_cachedContentParts'][_0x2a5074]=_0x269922;}):this['_cachedContentParts']=_0x2a2110;const _0x498201=this['_showUnchangedParts']?_0x2a2110:_0x2a2110['filter'](_0x551d46=>_0x551d46['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x498201['length']>0x1),_0x45ec19&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x284a9c of _0x2a2110)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x42ac55=>{let _0x59db60=this['getPartView'](_0x284a9c['index']);if(_0x59db60||_0x284a9c['hasChanges']||this['_showUnchangedParts']){if(!_0x59db60){if(_0x59db60=new Tr(this['locale'],{'part':_0x284a9c,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x59db60['delegate'](...ir)['to'](this),_0x59db60['bind']('isTrackChangesOn')['to'](this),!_0x45ec19&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x42ac55),_0x42ac55['aborted']))return;_0x59db60['isTargetReadOnly']=this['_readOnlyByIndex']['get'](_0x284a9c['index'])??!0x1,this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x59db60,this['_children']['length']-0x1),_0x45ec19||this['_showSkeletonDebounced']();}await _0x59db60['updateContent']({'part':_0x284a9c,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x42ac55}),_0x59db60['markAsDone']();}});return _0x14ec7e?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}updatePartState(_0x5a26df,_0x1cf45d,_0x2b8c1f){const _0x2e30d1=this['getPartView'](_0x5a26df);_0x2e30d1&&(_0x2e30d1['outdatedReason']=_0x2b8c1f,_0x2e30d1['state']=_0x1cf45d);}setGating({readOnlyByIndex:_0x851ed1,isAcceptAllEnabled:_0x56e0e2}){this['_readOnlyByIndex']=_0x851ed1,this['isAcceptAllEnabled']=_0x56e0e2;for(const _0xc52118 of this['_contentPartViews'])_0xc52118['isTargetReadOnly']=_0x851ed1['get'](_0xc52118['partDefinition']['index'])??!0x1;}setPartActive(_0x267545,_0x35e9da){if(!0x1===_0x267545){for(const _0x459054 of this['_contentPartViews'])_0x459054['isActive']=!0x1;}else{const _0x394ce1=this['getPartView'](_0x267545);_0x394ce1&&(_0x394ce1['isActive']=_0x35e9da);}}updateSources(_0x2b96b6){_0x2b96b6['forEach'](_0x291b7c=>this['_sourcesView']['addSource'](_0x291b7c)),this['_sourcesView']['isVisible']=!0x0;}getPartView(_0x5114e7){return this['_contentPartViews']['find'](_0x4c670c=>_0x4c670c['partDefinition']['index']==_0x5114e7)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x37636b=!this['_cachedContentParts']['find'](({hasChanges:_0x4e3cc1})=>_0x4e3cc1),_0x5b0ec4=!!this['_cachedContentParts']['find'](({hasChanges:_0x33012b})=>!_0x33012b);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x5b0ec4,_0x37636b?this['_emptyPartsWarningView']['setContent'](Es(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Es(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0xd42159=>_0xd42159['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']&&!this['_areActionsDisabled']);}async _awaitMinimumSkeletonDisplayTime(_0xc93b6b){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x20b268=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x20b268>0x0){const {promise:_0x15fa44,abortController:_0x32fa49}=nr(_0x20b268);_0xc93b6b?.['addEventListener']('abort',()=>_0x32fa49['abort']()),await _0x15fa44['catch'](()=>{});}}get hasNonEmptyParts(){return this['_contentPartViews']['filter'](_0x50b30b=>_0x50b30b['partDefinition']['hasChanges'])['length']>0x0;}},xr=class extends _0x56a514{['bodyView'];['children'];['headerView'];constructor(_0x5f0156,_0x50dbd4,_0x4d58b8){super(_0x5f0156);const {showDiff:_0xafe860,areActionsDisabled:_0x1be6e2,showUnchangedParts:_0x3eb268,availableActions:_0x30a9de}=_0x50dbd4;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ur(_0x5f0156,{'showDiff':_0xafe860}),this['headerView']['on']('toggleShowChanges',(_0x102f92,_0x4e8e50)=>{this['areChangesVisible']=_0x4e8e50['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4e8e50['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Nr(_0x5f0156,{'areActionsDisabled':_0x1be6e2,'showUnchangedParts':!!_0x3eb268,'availableActions':_0x30a9de,'bodyCollection':_0x4d58b8}),this['bodyView']['delegate'](...ir)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async updateContent(_0xe4b4bc){await this['bodyView']['updateContentParts'](_0xe4b4bc);}updateSources(_0x3c1948){this['bodyView']['updateSources'](_0x3c1948);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},Lr=class extends lr{containerView;constructor(_0x425b4f,_0x57e10f,_0xd56a97){super(_0x57e10f),this['set']('isTrackChangesOn',!0x1),this['containerView']=new xr(_0x425b4f,{'showDiff':_0x57e10f['showDiff'],'areActionsDisabled':_0x57e10f['areActionsDisabled'],'availableActions':_0x57e10f['availableActions']},_0xd56a97),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x19c69e,_0x2c240b)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2c240b['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x3d0a26,{index:_0x3be9e5})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3be9e5});}),this['containerView']['on']('applySuggestion',(_0x400ff4,{index:_0x37380f}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x37380f});}),this['containerView']['on']('insertSuggestion',(_0x19505d,{index:_0x5db426}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5db426});}),this['containerView']['on']('rejectSuggestion',(_0x25ffe0,{index:_0x24b3aa})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x24b3aa});}),this['containerView']['on']('mouseOverSuggestion',(_0x300a25,{index:_0x3ae716})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3ae716});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x146182,{index:_0x34e92a})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x34e92a});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async updateContent(_0x372e85){await this['containerView']['updateContent'](_0x372e85);}updatePartState(_0x15f2c8,_0x3ac70b,_0x1b4295){this['containerView']['bodyView']['updatePartState'](_0x15f2c8,_0x3ac70b,_0x1b4295);}setPartActive(_0x968318,_0x3ca232){!0x1===_0x968318?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x968318,_0x3ca232);}updateSources(_0x1408d2){this['containerView']['updateSources'](_0x1408d2);}getPartView(_0x11e500){return this['containerView']['bodyView']['getPartView'](_0x11e500);}setGating(_0x226513){this['containerView']['bodyView']['setGating'](_0x226513);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},Pr=class extends lr{replyContainer;_bodyCollection;constructor(_0x17ef48,_0x51e343,_0x1479c2){super(_0x51e343),this['_bodyCollection']=_0x1479c2,this['locale']=_0x17ef48,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x56a514(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Rs(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async updateContent({parsedContent:_0x491f2a,renderingStrategy:_0x1ec014,abortSignal:_0x30543f}){'streaming'===_0x1ec014?await this['streamIntoElement'](_0x491f2a,this['replyContainer']['element'],_0x30543f):this['replyContainer']['element']['innerHTML']=_0x35b927(_0x491f2a);}updateSources(_0x4b4799){const _0x4977bd=new kr(this['locale'],this['_bodyCollection']);_0x4977bd['children']['addMany'](_0x4b4799['map'](_0x46c4c1=>new yr(this['locale'],_0x46c4c1,_0x4977bd['balloonPanelView']))),_0x4977bd['isVisible']=!0x0,this['children']['add'](_0x4977bd);}},Dr=class extends _0x14cb96{constructor(_0x196bbe=void 0x0){super();const _0x49c9bd=_0x196bbe?'ck-ai-spinner_'+_0x196bbe:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x49c9bd]}});}};const Hr={'file':_0xd6ab36,'image':_0x1bf77b,'document':_0x2d99a5,'web-resource':_0x3de4d0,'text':_0xd6ab36,'selection':tt,'mcp-tool-context':_0x2d99a5,'context':_0x2d99a5},Mr='ck-ai-chat-context-chip',Ur='ck-ai-chat-context-chip_wide',Vr='ck-ai-chat-context-chip_document',Br='ck-ai-chat-context-chip__label',Gr='ck-ai-chat-context-chip__type-icon',Fr='ck-ai-chat-context-controls__chip-tooltip',Kr='n';var Wr=class extends Mt{constructor(_0x4402c4,_0x12ad3a,_0x35dddc,_0x48a6e4,_0x59d980=!0x1){super(_0x4402c4),this['_isAnimationOnEnterEnabled']=_0x48a6e4,this['_initializeProperties'](_0x12ad3a,_0x35dddc,_0x59d980),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(_0x1c140b,_0x302307,_0x3ebb1c){this['set']('label',_0x1c140b['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1c140b['type']),this['set']('id',_0x1c140b['uiId']),this['set']('readonly',_0x302307),this['set']('isLoading',_0x3ebb1c);}_setupTemplate(){const _0x2dad82=this['_createIconView'](),_0x4a256d=this['_createRemoveButton'](),_0x419dd5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x419dd5),'children':this['_createTemplateChildren'](_0x2dad82,_0x4a256d,_0x419dd5)});}_createTemplateAttributes(_0x41c1bd){return{'class':[Mr,_0x41c1bd['if']('itemType',Vr,_0x4950f6=>'document'==_0x4950f6),_0x41c1bd['if']('itemType',Ur,_0x2f9ed8=>'selection'==_0x2f9ed8)],'data-cke-tooltip-text':_0x41c1bd['to']('label',Yr),'data-cke-tooltip-position':Kr,'data-cke-tooltip-class':Fr};}_createTemplateChildren(_0x6ffb81,_0x3e8347,_0x182085){const _0x28774c=this['_createLabelElement'](_0x182085),_0x290690=this['_createLoaderIcon']();return this['readonly']?[_0x6ffb81,_0x28774c]:[_0x6ffb81,_0x290690,_0x28774c,_0x3e8347];}_createLabelElement(_0x32a387){return{'tag':'span','attributes':{'class':Br},'children':[{'text':_0x32a387['to']('label')}]};}_createRemoveButton(){const _0x3653fc=new Mt(this['locale']);return _0x3653fc['set']({'label':Es(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x572ba4}),this['_setupRemoveButtonEvent'](_0x3653fc),_0x3653fc;}_setupRemoveButtonEvent(_0x2125c4){_0x2125c4['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}_createIconView(){const _0x49bc30=this['bindTemplate'],_0x49c128=new $t();return _0x49c128['content']=Hr[this['itemType']],_0x49c128['extendTemplate']({'attributes':{'class':[Gr,_0x49bc30['if']('isLoading','ck-hidden',_0xd1e37a=>_0xd1e37a)]}}),_0x49c128;}_handleAnimationEndOnce(_0x1a6ad1,_0x14b0c0){if(!_0x1a6ad1)return;const _0x5d5a38=()=>{_0x14b0c0(),_0x1a6ad1['removeEventListener']('animationend',_0x5d5a38),_0x1a6ad1['removeEventListener']('webkitAnimationEnd',_0x5d5a38);};_0x1a6ad1['addEventListener']('animationend',_0x5d5a38),_0x1a6ad1['addEventListener']('webkitAnimationEnd',_0x5d5a38);}_createLoaderIcon(){const _0x22af38=new Dr('small');return _0x22af38['bind']('isVisible')['to'](this,'isLoading',_0x58aa8b=>_0x58aa8b),_0x22af38;}};function Yr(_0x1bc1eb){if(!_0x1bc1eb)return _0x1bc1eb;if(_0x1bc1eb['length']<=0x78)return _0x1bc1eb;const _0xf9a187=_0x1bc1eb['slice'](0x0,0x78),_0x25275f=_0xf9a187['lastIndexOf']('\x20');return(_0x25275f>0x0?_0xf9a187['slice'](0x0,_0x25275f):_0xf9a187)+'…';}const $r={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},qr='300px';var Qr=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];_showMoreButtonView=null;['_showMoreBalloonPanelView']=null;_containerElement=null;_bodyCollection;_parentView=null;_intersectionObserver=null;_pendingCalculation=!0x1;constructor(_0x19bd19,_0x560179,_0xddd67e,_0x84d8c3,_0x1eb8d1){this['_locale']=_0x19bd19,this['_visibleChips']=_0x560179,this['_config']={...$r,..._0xddd67e,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0xddd67e['cssClasses']}},this['_overflowChips']=new lt(),this['_bodyCollection']=_0x84d8c3,this['_parentView']=_0x1eb8d1||null;}setContainerElement(_0xcc45cc){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0xcc45cc,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 _0x31d6fa=[...this['_visibleChips'],...this['_overflowChips']],_0x50eb9c=this['_createCalculationContainer'](),_0x483897=this['_calculateOverflowInContainer'](_0x50eb9c,_0x31d6fa),_0x5bd604=_0x50eb9c['_ancestorsToRestore'];_0x5bd604&&this['_restoreAncestorVisibility'](_0x5bd604),_0x50eb9c['remove'](),this['_applyOverflowResults'](_0x31d6fa,_0x483897);}_createShowMoreButton(){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x44d1a9({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}_createShowMoreButtonView(){const _0xc878c1=new Mt(this['_locale']);_0xc878c1['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4b938a=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4b938a['push'](this['_config']['cssClasses']['controlsButton']),_0xc878c1['extendTemplate']({'attributes':{'class':_0x4b938a}}),_0xc878c1;}_createShowMoreBalloonPanelView(){const _0x4aee5f=new xt(this['_locale']);return _0x4aee5f['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4aee5f),_0x4aee5f;}_updateBalloonContent(){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5d1695=>{_0x5d1695['disableAnimationOnEnter']();});const _0x5f2475=new _0x56a514(this['_locale']);_0x5f2475['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x5f2475);}}_handleShowMoreButtonClick(){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}_updateShowMoreButtonVisibility(){const _0x356c19=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x356c19?'':'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(_0x37b014){const _0x2b55d6=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x43fbc0=this['_containerElement']?.['classList'];if(_0x43fbc0){const _0xd66447=_0x43fbc0[0x0]||'',_0x483079=_0x37b014['querySelector']('.'+_0xd66447),_0x536151=_0x37b014['querySelector'](_0x2b55d6);return _0x483079||_0x536151||_0x37b014;}return _0x37b014['querySelector'](_0x2b55d6)||_0x37b014;}_calculateContainerWidth(){const _0x508f4b=this['_parentView']?.['element']||this['_containerElement'];if(!_0x508f4b)return qr;const _0x568f27=window['getComputedStyle'](_0x508f4b)['width'];if('auto'===_0x568f27||'0px'===_0x568f27||!_0x568f27){const _0x9e5067=_0x508f4b['parentElement'];if(_0x9e5067){const _0x5973c3=window['getComputedStyle'](_0x9e5067);return'auto'!==_0x5973c3['width']?_0x5973c3['width']:qr;}return qr;}return _0x568f27;}_applyCalculationStyles(_0x149199,_0x3df71e){this['_config']['cssClasses']['calculationContainer']&&_0x149199['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x149199['style']['width']=_0x3df71e,_0x149199['style']['position']='absolute',_0x149199['style']['top']='-9999px',_0x149199['style']['left']='-9999px',_0x149199['style']['opacity']='0',_0x149199['style']['pointerEvents']='none',_0x149199['style']['zIndex']='-1',_0x149199['style']['visibility']='visible\x20!important',_0x149199['style']['display']='block\x20!important',_0x149199['style']['boxSizing']='border-box';}_restoreAncestorVisibility(_0x75935b){_0x75935b['forEach'](({element:_0x59454c,originalDisplay:_0x52ea42,originalVisibility:_0x563086})=>{_0x59454c['style']['display']=_0x52ea42,_0x59454c['style']['visibility']=_0x563086;});}_makeAncestorsVisible(_0x590f28){const _0x5699fa=[];let _0x21a51c=_0x590f28;for(;_0x21a51c&&_0x21a51c!==document['body'];){const _0xf9f0ce=window['getComputedStyle'](_0x21a51c);'none'!==_0xf9f0ce['display']&&'hidden'!==_0xf9f0ce['visibility']||(_0x5699fa['push']({'element':_0x21a51c,'originalDisplay':_0x21a51c['style']['display'],'originalVisibility':_0x21a51c['style']['visibility']}),_0x21a51c['style']['display']='block',_0x21a51c['style']['visibility']='visible'),_0x21a51c=_0x21a51c['parentElement'];}return _0x5699fa;}_createContainerElements(){let _0x15c08b,_0x53bdcf;return this['_parentView']?.['element']?(_0x15c08b=this['_parentView']['element']['cloneNode'](!0x0),_0x53bdcf=this['_findTargetContainer'](_0x15c08b)):(_0x15c08b=document['createElement']('div'),_0x53bdcf=_0x15c08b),{'calculationContainer':_0x15c08b,'targetContainer':_0x53bdcf};}_createCalculationContainer(){const {calculationContainer:_0x4c7674,targetContainer:_0x13fe02}=this['_createContainerElements'](),_0x5c5b1b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4c7674,_0x5c5b1b);const _0x356e1b=(this['_parentView']?.['element']||this['_containerElement'])?.['parentElement'];_0x356e1b?_0x356e1b['appendChild'](_0x4c7674):document['body']['appendChild'](_0x4c7674),_0x4c7674['_targetContainer']=_0x13fe02;const _0x363450=this['_makeAncestorsVisible'](_0x356e1b||null);return _0x4c7674['offsetWidth'],_0x4c7674['_ancestorsToRestore']=_0x363450,_0x4c7674;}_calculateOverflowInContainer(_0x12d5d1,_0x16681b){const _0x1f3039=_0x12d5d1['_targetContainer']||_0x12d5d1,_0x4e5da8=[],{rowCount:_0x143fe6}=this['_renderChipsAndCountRows'](_0x1f3039,_0x16681b);if(_0x143fe6<=this['_config']['maxVisibleRows'])return _0x4e5da8;const _0x1a0398=_0x16681b['slice']();for(;_0x1a0398['length']>0x0;){if(this['_testButtonFit'](_0x12d5d1,_0x1f3039,_0x1a0398)){const _0x558bcd=_0x16681b['filter'](_0x55f889=>!_0x1a0398['includes'](_0x55f889));_0x4e5da8['push'](..._0x558bcd);break;}if(!_0x1a0398['pop']())break;}return _0x4e5da8;}_renderChipsAndCountRows(_0xba05f7,_0xed6c43){_0xba05f7['innerHTML']='',_0xed6c43['forEach'](_0x59da17=>{if(_0x59da17['element']){const _0x40ac5a=_0x59da17['element']['cloneNode'](!0x0);_0xba05f7['appendChild'](_0x40ac5a);}}),_0xba05f7['offsetWidth'];const _0x34fe31=_0xba05f7['children'],_0x1d8c67=[];return Array['from'](_0x34fe31)['forEach'](_0x5a30f4=>{const _0x3de9e6=_0x5a30f4['getBoundingClientRect']()['top'];_0x1d8c67['some'](_0x4f42ce=>Math['abs'](_0x4f42ce-_0x3de9e6)<this['_config']['rowDetectionTolerance'])||_0x1d8c67['push'](_0x3de9e6);}),{'rowCount':_0x1d8c67['length']};}_createMockButton(){const _0x990579=document['createElement']('button');return _0x990579['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x990579['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x990579['textContent']='+\x201',_0x990579;}_testButtonFit(_0x403618,_0x138fcc,_0x4a1ede){this['_renderChipsAndCountRows'](_0x138fcc,_0x4a1ede);const _0x4f4d1b=this['_createMockButton']();_0x403618['appendChild'](_0x4f4d1b),_0x403618['offsetWidth'];const _0x45e945=[..._0x138fcc['children'],_0x4f4d1b],_0x5e23d9=[];_0x45e945['forEach'](_0x57bc1e=>{const _0x5d5aad=_0x57bc1e['getBoundingClientRect']()['top'];_0x5e23d9['some'](_0x378673=>Math['abs'](_0x378673-_0x5d5aad)<this['_config']['rowDetectionTolerance'])||_0x5e23d9['push'](_0x5d5aad);});const _0x5ee42f=_0x5e23d9['length'];return _0x4f4d1b['remove'](),_0x5ee42f<=this['_config']['maxVisibleRows'];}_distributeChips(_0x14305c,_0x1ed4fd){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x14305c['forEach'](_0x522866=>{_0x1ed4fd['includes'](_0x522866)?this['_overflowChips']['add'](_0x522866):this['_visibleChips']['add'](_0x522866);});}_updateOverflowUI(_0x24d2a8){if(_0x24d2a8>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x24d2a8>0x0&&this['_showMoreButtonView']){const _0x33d682=''+this['_config']['showMoreLabelPrefix']+(_0x24d2a8<0x63?_0x24d2a8:'99');this['_showMoreButtonView']['label']=_0x33d682;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}_applyOverflowResults(_0x47fcf3,_0x2dd5a7){this['_distributeChips'](_0x47fcf3,_0x2dd5a7),this['_updateOverflowUI'](_0x2dd5a7['length']);}_setupVisibilityObserver(){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x41d946=>{_0x41d946[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 _0x43d4f5=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x43d4f5['width']||0x0===_0x43d4f5['height'])return!0x1;const _0x50d189=window['innerHeight']||document['documentElement']['clientHeight'],_0x3c397a=window['innerWidth']||document['documentElement']['clientWidth'];return _0x43d4f5['bottom']>=-0xc8&&_0x43d4f5['top']<=_0x50d189+0xc8&&_0x43d4f5['right']>=-0xc8&&_0x43d4f5['left']<=_0x3c397a+0xc8;}};const Xr='ck-ai-chat__feed__context-chips',zr='ck-ai-chat-context-chips-wrapper',jr='ck-ai-chat-context-chips-wrapper-balloon',Jr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls_context_show-more-button',to='ck-ai-chat-context-controls__show-more-balloon-panel';var eo=class extends _0x56a514{_contextChips=this['createCollection']();['_overflowManager'];_bodyCollection;constructor(_0x4bd318,_0xdeb5c3,_0x202dd2){super(_0x4bd318),this['_bodyCollection']=_0x202dd2,this['_createContextChips'](_0xdeb5c3);const _0x4f447a={'cssClasses':{'showMoreButton':Zr+'\x20'+Dn,'showMoreBalloon':to,'overflowContainer':jr,'controlsButton':Jr}};this['_overflowManager']=new Qr(_0x4bd318,this['_contextChips'],_0x4f447a,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Xr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':zr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5b7429=this['element']['querySelector']('.'+zr);_0x5b7429&&(this['_overflowManager']['setContainerElement'](_0x5b7429),this['_overflowManager']['reorganizeChips']());}destroy(){super['destroy'](),this['_overflowManager']['destroy']();}_createContextChips(_0x399d82){for(const _0x4884f4 of _0x399d82){const _0x50aedd=new Wr(this['locale'],_0x4884f4,!0x0,!0x1);this['_contextChips']['add'](_0x50aedd);}}},io=class extends lr{_contextChipsView=null;['_locale'];_bodyCollection;_messageContentView;constructor(_0x54322e,_0x1f095f,_0x2e4e54){super(_0x1f095f),this['_locale']=_0x54322e,this['_bodyCollection']=_0x2e4e54,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 eo(this['_locale'],this['options']['contextItems']['filter'](_0x55af14=>!_0x55af14['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}_createMessageContentView(){this['_messageContentView']=new _0x56a514(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}},so=class extends lr{capabilities;constructor(_0x34e352,_0x1c9094){super(_0x1c9094);const {isWebSearchEnabled:_0x20cdc0,isReasoningEnabled:_0x2ed776}=_0x1c9094['capabilities'],_0x39d130=[];let _0x214809='';_0x20cdc0&&_0x2ed776?(_0x214809=Es(_0x34e352,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x39d130['push'](no(ht)),_0x39d130['push'](no(_0x1e95b5))):_0x20cdc0?(_0x214809=Es(_0x34e352,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x39d130['push'](no(ht))):_0x2ed776&&(_0x214809=Es(_0x34e352,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x39d130['push'](no(_0x1e95b5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x214809?'':'ck-hidden']}});const _0x182cda=new _0x56a514();_0x182cda['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x39d130,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x214809]}]}),this['children']['add'](_0x182cda),this['capabilities']=_0x1c9094['capabilities'];}};function no(_0x439f48){const _0x1fe092=new $t();return _0x1fe092['content']=_0x439f48,_0x1fe092;}const ro=['wheel','touchstart','pointerdown','keydown'],oo=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var ao=class{element;animationFrameId;['isRunning'];abortController;['isUserPaused'];['scrollBehavior'];constructor(_0x513390){this['element']=_0x513390,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x14335b of ro){const _0x4fe037='keydown'!==_0x14335b;this['element']['addEventListener'](_0x14335b,this['_onUserEvent']['bind'](this),{'passive':_0x4fe037,'signal':this['abortController']['signal']});}}start({smooth:_0x20c937=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x20c937?'smooth':'auto',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(_0x117a61){if(this['isRunning']){if('keydown'===_0x117a61['type']){const _0x5c077d=_0x117a61['key'];if(!oo['includes'](_0x5c077d))return;}_0x117a61 instanceof WheelEvent?_0x117a61['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}_isAtBottom(){const {scrollTop:_0x2ad35f,scrollHeight:_0xd4a991,clientHeight:_0x22bd03}=this['element'];return _0xd4a991-_0x2ad35f-_0x22bd03<=0x5;}_rafUpdate(){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},ho=class extends lr{constructor(_0x3eed08){super(_0x3eed08),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}},co=class extends _0x56a514{['children'];['scrollManager'];_bodyCollection;constructor(_0x4f4ca4,_0x34c58b){super(_0x4f4ca4),this['_bodyCollection']=_0x34c58b,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...sr)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ao(this['element']);}destroy(){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}addItem(_0x599082,_0x426e59){let _0x53e995;return'ai-reply'===_0x599082?_0x53e995=new Pr(this['locale'],_0x426e59,this['_bodyCollection']):'ai-suggestion-reply'===_0x599082?(_0x53e995=new Lr(this['locale'],_0x426e59,this['_bodyCollection']),_0x53e995['bind']('isTrackChangesOn')['to'](this)):_0x53e995='user-message'===_0x599082?new io(this['locale'],_0x426e59,this['_bodyCollection']):'interaction-header'===_0x599082?new so(this['locale'],_0x426e59):'custom-element'===_0x599082?new ho(_0x426e59):new Rr(_0x426e59),this['children']['add'](_0x53e995),_0x53e995;}async updateReplyItem({id:_0x57618d,parsedContent:_0x303d66,renderingStrategy:_0x51d924,abortSignal:_0x480807}){const _0x1e5e82=this['getItemById'](_0x57618d);if(!(_0x1e5e82 instanceof Pr))throw new ct('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1e5e82,'id':_0x57618d,'parsedContent':_0x303d66});await _0x1e5e82['updateContent']({'parsedContent':_0x303d66,'renderingStrategy':_0x51d924,'abortSignal':_0x480807});}async updateWebSources(_0x243367,_0x2b3e6c){const _0x593467=this['getItemById'](_0x243367);if(_0x593467 instanceof Lr)_0x593467['updateSources'](_0x2b3e6c);else{if(!(_0x593467 instanceof Pr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x593467,'id':_0x243367,'sources':_0x2b3e6c});_0x593467['updateSources'](_0x2b3e6c);}}async updateSuggestionItem({id:_0x283f8b,parts:_0x4b2c83,abortSignal:_0x4ffe7d,skipLoadingEffects:_0x4558e2}){const _0x233a11=this['getItemById'](_0x283f8b);if(!(_0x233a11 instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x233a11,'id':_0x283f8b,'parts':_0x4b2c83});await _0x233a11['updateContent']({'parts':_0x4b2c83,'abortSignal':_0x4ffe7d,'skipLoadingEffects':_0x4558e2});}updateSuggestionPartState({id:_0xd74c05,index:_0x4965d2,state:_0x1afe2b,outdatedReason:_0x2ad15e}){const _0x252547=this['getItemById'](_0xd74c05);if(!(_0x252547 instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0xd74c05});_0x252547['updatePartState'](_0x4965d2,_0x1afe2b,_0x2ad15e);}updateSuggestionGating(_0x2d8719,_0xcc040d){const _0x717541=this['getItemById'](_0x2d8719);if(!(_0x717541 instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2d8719});_0x717541['setGating'](_0xcc040d);}setSuggestionPartActive({id:_0x443f4,index:_0x451f73,isActive:_0x2c1ea5}){const _0x30662d=this['getItemById'](_0x443f4);if(!(_0x30662d instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x443f4});this['children']['filter'](_0x3bbca7=>_0x3bbca7 instanceof Lr)['forEach'](_0x490942=>{_0x490942['setPartActive'](!0x1);}),_0x30662d['setPartActive'](_0x451f73,_0x2c1ea5);}markItemAsDone(_0x56db5a){this['getItemById'](_0x56db5a)['markAsDone']();}getItemIds(){return this['children']['map'](_0x389637=>_0x389637['options']['id']);}removeItem(_0x5b3da8){this['children']['remove'](this['getItemById'](_0x5b3da8));}hasItem(_0x3c600a){return!!this['children']['find'](_0x3c1d51=>_0x3c1d51['options']['id']['includes'](_0x3c600a));}scrollToSuggestion(_0x467b76,_0x73bc60){const _0x3969d3=this['getItemById'](_0x467b76);if(!(_0x3969d3 instanceof Lr))return void St('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x467b76,'partIndex':_0x73bc60});const _0x251c4c=_0x3969d3['getPartView'](_0x73bc60);_0x251c4c?Rt(_0x251c4c['element'],0x14,this['element']['parentElement'],!0x0,!0x0):St('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x467b76,'partIndex':_0x73bc60});}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}_createTemplateChildren(){const _0x18f4de=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x18f4de,this['_createFeedLoader']()];}_createSkeletonLoader(){const _0x1da2f6=new wr(this['locale'],Cr['aiFeed']);return _0x1da2f6['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x1da2f6;}_createFeedItems(){const _0x1499e1=new _0x56a514(this['locale']);return _0x1499e1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1499e1;}_createFeedLoader(){const _0x3a689f=new _0x56a514(this['locale']);return _0x3a689f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x5a7735=>!_0x5a7735)]},'children':this['_createLoaderChildren']()}),_0x3a689f;}_createLoaderChildren(){const _0x318f5e=new Dr();return _0x318f5e['isVisible']=!0x0,[_0x318f5e,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}getItemById(_0x3379ed){const _0xfe5a6c=this['children']['find'](_0x4852f2=>_0x4852f2['options']['id']['includes'](_0x3379ed));if(!_0xfe5a6c)throw new ct('ai-chat-feed-view-item-not-found',this,{'id':_0x3379ed});return _0xfe5a6c;}setLoadingMessage(_0x3655ec){this['set']('loadingMessage',_0x3655ec);}toggleLoadingSkeleton(_0x143e9d){this['set']('isLoadingSkeletonVisible',_0x143e9d);}startAutoScroll(_0x57cf46={}){this['scrollManager']['start'](_0x57cf46);}stopAutoScroll(){this['scrollManager']['stop']();}},lo=class extends Jt{filter(){let _0x4e0dc6=0x0;for(const _0xcdfad of this['items'])_0x4e0dc6+=_0xcdfad['items']['length'];return{'resultsCount':_0x4e0dc6,'totalItemsCount':_0x4e0dc6};}};function uo(_0x5dad65){const _0x2ba70a=[];let _0x37c4e0=!0x1;for(const _0x1df48e of Array['from'](_0x5dad65['items'])){if('file'!==_0x1df48e['kind'])continue;if(_0x1df48e['webkitGetAsEntry']()?.['isDirectory']){_0x37c4e0=!0x0;continue;}const _0x545980=_0x1df48e['getAsFile']();_0x545980&&_0x2ba70a['push'](_0x545980);}return{'files':_0x2ba70a,'hasDirectory':_0x37c4e0};}const _o='ck-ai-chat__prompt-input_highlighted';var go=class AIChatPromptInputView extends Nt{submitButtonView;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;_addContextButtonView;['_queryViewResizeObserver'];constructor(_0x2724f7,_0x5bc9e2){super(_0x2724f7,{'queryView':{'label':'','creator':_0x3cc43c,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new lo(_0x2724f7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5bc9e2,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['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',(_0x530737,_0x4be372)=>!_0x530737&&!_0x4be372),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2f3fc7,_0x301ac9)=>{this['isUploadInProgress']||this['isEmpty']||_0x2f3fc7['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x301ac9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x130223=>this['_handlePaste'](_0x130223)),this['element']['addEventListener']('drop',_0x2601c2=>this['_handleDrop'](_0x2601c2));}_handlePaste(_0x443735){const _0x261692=_0x443735['clipboardData'];if(!_0x261692)return;const {files:_0x23ba28,hasDirectory:_0x1a9756}=uo(_0x261692),_0x165f34={'files':_0x23ba28,'plainText':_0x261692['getData']('text/plain'),'hasDirectory':_0x1a9756,'forceTextAttachment':!0x1,'preventDefault':()=>_0x443735['preventDefault']()};this['fire']('promptInputPaste',_0x165f34);}['_handleDrop'](_0x598ba0){const _0x207a2a=_0x598ba0['dataTransfer'];if(!_0x207a2a)return;const _0x56998e={'files':[],'plainText':_0x207a2a['getData']('text/uri-list')||_0x207a2a['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x598ba0['preventDefault']()};this['fire']('promptInputPaste',_0x56998e);}destroy(){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}submit(){const _0x62d1f9=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x62d1f9)return this['queryView']['errorText']=Es(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x5c2e1f=_0x15f5d8(_0x62d1f9);this['fire']('sendUserMessage',_0x5c2e1f),this['queryView']['fieldView']['reset']();}setPlaceholderText(_0x46bcd9){this['queryView']['fieldView']['set']('placeholder',_0x46bcd9);}['focus'](_0x2debc8=!0x1){super['focus'](),_0x2debc8&&(this['element']['classList']['contains'](_o)||(this['element']['classList']['add'](_o),setTimeout(()=>{this['element']['classList']['remove'](_o);},0x320)));}_createSubmitButton(){const _0x2eb3d7=new Mt(this['locale']);return _0x2eb3d7['set']({'icon':nt,'label':Es(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Ln,'isEnabled':!0x1}),_0x2eb3d7['on']('execute',()=>{this['submit']();}),_0x2eb3d7;}setIsUploadInProgress(_0x3e7e82){this['isUploadInProgress']=_0x3e7e82;}_setUpAddContextButtonPositioning(){const _0x2018fb=this['locale'],_0x25a760=()=>{wt['window']['requestAnimationFrame'](()=>{if(ft(this['element'])){const _0x37e2f0=new It(this['queryView']['fieldView']['element']),_0x1f8dd6=new It(this['_addContextButtonView']['element']),_0x1db57a=_0x37e2f0['width'],_0x88d991='rtl'===_0x2018fb['uiLanguageDirection']?'right':'left';_0x37e2f0['excludeScrollbarsAndBorders']();const _0x5b25f6=_0x1db57a-_0x37e2f0['width']+0x1;this['_addContextButtonView']['element']['style'][_0x88d991]='calc('+(_0x1db57a-_0x1f8dd6['width']-_0x5b25f6)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x25a760),this['on']('render',()=>{_0x25a760(),this['_queryViewResizeObserver']=new pt(this['queryView']['fieldView']['element'],()=>{_0x25a760();});});}},Ao=class extends _0x56a514{constructor(_0x15159a){super(_0x15159a),this['set']('isEnabled',!0x0);const _0x517cc6=new $t();_0x517cc6['content']=_0xd6ab36,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x517cc6,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':Es(_0x15159a,'AI_CHAT_DROP_ZONE_HINT')}]}]});}attach(_0x3c1ed6){let _0x3a54d1=0x0;const _0x10b4a9=()=>{_0x3c1ed6['classList']['toggle']('ck-ai-chat-controls_drag-over',this['isEnabled']&&_0x3a54d1>0x0);};this['on']('change:isEnabled',(_0x2aa8e5,_0x524c43,_0x2fb3ec)=>{_0x2fb3ec&&_0x3a54d1>0x0&&this['fire']('dragEnter'),_0x10b4a9();}),_0x3c1ed6['addEventListener']('dragenter',_0x58de53=>{_0x58de53['dataTransfer']&&(_0x3a54d1++,0x1===_0x3a54d1&&this['isEnabled']&&this['fire']('dragEnter'),_0x10b4a9());}),_0x3c1ed6['addEventListener']('dragover',_0x2bad24=>{_0x2bad24['dataTransfer']&&_0x2bad24['preventDefault']();}),_0x3c1ed6['addEventListener']('dragleave',()=>{--_0x3a54d1<0x0&&(_0x3a54d1=0x0),_0x10b4a9();}),_0x3c1ed6['addEventListener']('drop',_0x1fda22=>{_0x1fda22['preventDefault'](),_0x3a54d1=0x0,_0x10b4a9(),this['isEnabled']&&this['_handleDrop'](_0x1fda22);});}['_handleDrop'](_0x57df4a){const _0x3a98ff=_0x57df4a['dataTransfer'];if(!_0x3a98ff)return;const {files:_0x3c4254,hasDirectory:_0x296ac4}=uo(_0x3a98ff),_0x342988={'files':_0x3c4254,'plainText':_0x3a98ff['getData']('text/uri-list')||_0x3a98ff['getData']('text/plain'),'hasDirectory':_0x296ac4,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0x342988);}},Io=class extends _0x56a514{['dropdownView'];['nameView'];_items;['_config'];constructor(_0x20f983,_0x4e8dc7){super(_0x20f983),this['_config']=_0x4e8dc7,this['set']('modelDisplayMode','selector'),this['set']('activeModelId',null),this['set']('activeModelName',null),this['set']('isEnabled',!0x0),this['dropdownView']=this['_createDropdown'](),this['_items']=new lt(),_0x40e721(this['dropdownView'],this['_items']),this['nameView']=new po(_0x20f983,_0x4e8dc7['nameClass']),this['nameView']['bind']('text')['to'](this,'activeModelName',_0x5d94a6=>_0x5d94a6??''),this['nameView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4968cc=>'name'===_0x4968cc),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-model-selector']},'children':[this['dropdownView'],this['nameView']]});}setModels(_0x47ac3d,_0xc08ecd){var _0xf52e18;this['set']('modelDisplayMode',(_0xf52e18=_0x47ac3d['length'],_0xc08ecd?0x1===_0xf52e18?'name':'selector':'hidden')),this['_items']['clear'](),0x1===_0x47ac3d['length']&&this['set']('activeModelName',_0x47ac3d[0x0]['name']||_0x47ac3d[0x0]['id']);for(const _0x58af36 of _0x47ac3d){const _0x5f3015=new _0x28f92e({'label':_0x58af36['name'],'withText':!0x0,'role':'menuitemradio','id':_0x58af36['id'],'model':_0x58af36});_0x5f3015['bind']('isOn')['to'](this,'activeModelId',_0x56039c=>_0x56039c===_0x58af36['id']),this['_items']['add']({'type':'button','model':_0x5f3015,'labelView':new Eo(this['locale'],_0x58af36,{'nameClass':this['_config']['itemClasses']['name'],'descriptionClass':this['_config']['itemClasses']['description'],'capabilitiesClass':this['_config']['itemClasses']['capabilities'],'extraContent':this['_config']['showCapabilities']?mo(this['locale'],_0x58af36):void 0x0})});}}setSelectedModel(_0x5d73c9){this['set']('activeModelId',_0x5d73c9?_0x5d73c9['id']:null),this['set']('activeModelName',_0x5d73c9?_0x5d73c9['name']||_0x5d73c9['id']:null);}_createDropdown(){const _0x31e2ca=_0x48403c(this['locale']);return _0x31e2ca['set']({'panelPosition':this['_config']['panelPosition'],'class':this['_config']['dropdownClass']}),_0x31e2ca['buttonView']['set']({'withText':!0x0,'tooltipPosition':this['_config']['tooltipPosition'],'class':Dn}),_0x31e2ca['buttonView']['bind']('label')['to'](this,'activeModelName',_0x224290=>_0x224290??this['_config']['defaultLabel']??''),_0x31e2ca['buttonView']['bind']('tooltip')['to'](this,'activeModelName',this,'isEnabled',(_0x3fca7c,_0x2bceab)=>!_0x2bceab&&this['_config']['disabledTooltip']?this['_config']['disabledTooltip']:_0x3fca7c??this['_config']['defaultLabel']??''),_0x31e2ca['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1154b9=>'selector'===_0x1154b9),_0x31e2ca['bind']('isEnabled')['to'](this,'isEnabled'),this['listenTo'](_0x31e2ca,'execute',_0x1a2e4c=>{this['fire']('selectModel',_0x1a2e4c['source']['model']);}),_0x31e2ca;}},po=class extends _0x56a514{constructor(_0x566e79,_0x1c7217){super(_0x566e79),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1d51df=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0x1c7217,_0x1d51df['if']('isVisible','ck-hidden',_0x2eeead=>!_0x2eeead)]},'children':[{'text':_0x1d51df['to']('text')}]});}},Eo=class extends Dt{constructor(_0x25369f,_0x24ce7e,_0x4ff091){super();const _0x103d48=this['bindTemplate'],_0x132a1f=[{'tag':'div','attributes':{'class':[_0x4ff091['nameClass']]},'children':[{'tag':'span','children':[{'text':_0x103d48['to']('text')}]}]},{'tag':'div','attributes':{'class':[_0x4ff091['descriptionClass']]},'children':[{'tag':'span','children':[_0x24ce7e['description']||'']}]}];_0x4ff091['extraContent']?.['length']&&_0x4ff091['capabilitiesClass']&&_0x132a1f['push']({'tag':'div','attributes':{'class':[_0x4ff091['capabilitiesClass']]},'children':_0x4ff091['extraContent']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x103d48['to']('style'),'id':_0x103d48['to']('id')},'children':_0x132a1f});}};function mo(_0x4a6917,_0x8d1a96){return[...To(_0x4a6917,ht,'AI_CHAT_SEARCH_WEB',_0x8d1a96['capabilities']['webSearch']?.['enabled']??!0x1),...To(_0x4a6917,_0x1e95b5,'AI_CHAT_REASONING',_0x8d1a96['capabilities']['reasoning']?.['enabled']??!0x1)];}function To(_0x318937,_0x1522c1,_0xf07d6e,_0xf9ced2){const _0x2b6fea=new $t();_0x2b6fea['content']=_0x1522c1;const _0xd1c402=new _0x56a514(_0x318937);_0xd1c402['setTemplate']({'tag':'span','children':[{'text':Es(_0x318937,_0xf07d6e)+':\x20'}]});const _0x3eb6a6=new _0x56a514(_0x318937);return _0x3eb6a6['setTemplate']({'tag':'span','children':[{'text':Es(_0x318937,_0xf9ced2?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2b6fea,_0xd1c402,_0x3eb6a6];}const wo='ck-ai-chat__prompt-capabilities',Co='ck-ai-chat-controls-button',fo='ck-ai-chat-controls-button--commands',bo='ck-ai-chat-controls__model-selection',So='ck-ai-chat-controls__model-selection__item-name',Ro='ck-ai-chat-controls__model-selection__item-description',Oo='ck-ai-chat-controls__model-selection__item-capabilities',vo='n';var ko=class extends _0x56a514{_webSearchButton;_reasoningButton;_commandsButton;_modelSelector;constructor(_0x7a1029){super(_0x7a1029),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorEnabled',!0x0),this['_modelSelector']=function(_0x1f845e){return new Io(_0x1f845e,{'panelPosition':'ne','dropdownClass':[bo],'nameClass':'ck-ai-chat-controls__model-name','itemClasses':{'name':So,'description':Ro,'capabilities':Oo},'defaultLabel':Es(_0x1f845e,'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'disabledTooltip':Es(_0x1f845e,'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP'),'tooltipPosition':vo,'showCapabilities':!0x0});}(_0x7a1029),this['_modelSelector']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2d6550=>_0x2d6550),this['_modelSelector']['delegate']('selectModel')['to'](this),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x572f7f=>_0x572f7f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x271a0b=>Es(this['locale'],_0x271a0b?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2c0bf5=>_0x2c0bf5),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2ef4db=>Es(this['locale'],_0x2ef4db?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[wo]},'children':[this['_modelSelector'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]});}setWebSearch(_0x16e300){this['set']('webSearchActive',_0x16e300);}setReasoning(_0x291dbd){this['set']('reasoningActive',_0x291dbd);}setModelList(_0xf38e15,_0x3784bc){this['_modelSelector']['setModels'](_0xf38e15,!_0x3784bc);}setModel(_0x72108a){if(!_0x72108a)return;this['_modelSelector']['setSelectedModel'](_0x72108a);const _0x3382c2=_0x72108a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x3382c2),this['_webSearchButton']['set']('isVisible',_0x3382c2);const _0x4bdd5=_0x72108a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4bdd5),this['_reasoningButton']['set']('isVisible',_0x4bdd5);}enableModelSelector(){this['set']('modelSelectorEnabled',!0x0);}disableModelSelector(_0x37bf4d){this['set']('modelSelectorEnabled',!0x1),_0x37bf4d&&(this['_modelSelector']['modelDisplayMode']='hidden');}_createWebSearchButton(){const _0x212705=new Mt();return _0x212705['set']({'label':Es(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':ht,'class':Co+'\x20'+Dn,'isToggleable':!0x0,'tooltipPosition':vo}),_0x212705['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x212705;}_createReasoningButton(){const _0xcd7242=new Mt();return _0xcd7242['set']({'label':Es(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1e95b5,'class':Co+'\x20'+Dn,'isToggleable':!0x0,'tooltipPosition':vo}),_0xcd7242['on']('execute',()=>{this['fire']('toggleReasoning');}),_0xcd7242;}_createCommandsButton(){const _0x12d256=new Mt();return _0x12d256['set']({'label':Es(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x522884,'withText':!0x0,'class':Co+'\x20'+Dn,'isToggleable':!0x0,'tooltip':Es(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':vo}),_0x12d256['extendTemplate']({'attributes':{'class':[fo]}}),_0x12d256['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x12d256;}};const yo='ck-ai-chat-context-controls__url-form',No='ck-ai-chat-context-controls__url-input-section';var xo=class extends _0x56a514{['focusTracker'];keystrokes;['_focusables'];['focusCycler'];urlInputField;backButton;confirmButton;constructor(_0x187396){super(_0x187396),this['focusTracker']=new _t(),this['keystrokes']=new gt(),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 Ft({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x218d71=>{this['focusTracker']['add'](_0x218d71['element']),this['keystrokes']['listenTo'](_0x218d71['element']);}),_0x2801b9({'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(_0x2c72f8){this['urlInputField']['errorText']=_0x2c72f8,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}_createBackButton(){const _0x18d52e=new Mt(this['locale']);return _0x18d52e['set']({'icon':_0xd78e92,'tooltip':Es(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x258919,_0x210c35,_0x4e0e86)=>{_0x18d52e['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4e0e86?'':'\x20ck-hidden')]});}),_0x18d52e;}_createUrlInputField(){const _0x2c11ee=new Qt(this['locale'],_0x4c7fdb);return _0x2c11ee['set']({'label':Es(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2c11ee['fieldView']['set']({'placeholder':Es(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2c11ee;}_createConfirmButton(){const _0x1bf37a=new Mt(this['locale']);return _0x1bf37a['set']({'icon':_0x48b061,'tooltip':Es(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1bf37a;}_setupTemplate(){const _0x43c431=new Kt(this['locale'],{'label':Es(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x43c431['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':yo,'tabindex':'-1'},'children':[_0x43c431,{'tag':'div','attributes':{'class':No},'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',_0x10fc5a=>{_0x10fc5a['stop'](),this['_handleSubmit']();});}_setupKeystrokes(){this['keystrokes']['set']('esc',(_0x59ffc0,_0x618966)=>{this['clear'](),this['fire']('cancel'),_0x618966();});}_handleSubmit(){const _0x82c04a=this['getValue']()['trim']();_0x82c04a?this['_isValidUrl'](_0x82c04a)?(this['clearError'](),this['fire']('submitUrl',_0x82c04a)):this['setError'](Es(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Es(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}_updateConfirmButtonState(){const _0x43fced=this['getValue']()['trim'](),_0x443da9=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x43fced['length']>0x0&&!_0x443da9;}['_isValidUrl'](_0x167eee){try{return!!new URL(_0x167eee);}catch{return!0x1;}}};const Lo='ck-ai-chat-resources__item',Po='ck-ai-chat-resources__item--in-context',Do='ck-ai-chat-resources__item-title',Ho='ck-ai-chat-resources__item__icon';var Mo=class extends jt{['resource'];_titleView;['_iconView'];constructor(_0x3ca556,_0x51df3b){super(_0x3ca556),this['resource']=_0x51df3b,this['set']('isInContext',!!_0x51df3b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}getResourceIcon(_0x419991){if(_0x419991['isInContext'])return _0x48b061;switch(_0x419991['type']){case'document':return _0x2d99a5;case'web-resource':return _0x3de4d0;case'file':case'text':return _0xd6ab36;default:return _0x325a2b;}}highlightText(_0x24964f){if(!_0x24964f||''===_0x24964f['trim']())return void this['_titleView']['highlightText'](null);const _0x288bde=new RegExp(_0x3ff1f3(_0x24964f),'gi');this['_titleView']['highlightText'](_0x288bde);}updateResourceState(_0x217428){this['resource']['isInContext']=_0x217428,this['isInContext']=_0x217428,this['_updateIcon']();}_createTitleView(){const _0x47c568=new Yt();return _0x47c568['text']=this['resource']['label'],_0x47c568['extendTemplate']({'tag':'span','attributes':{'class':[Do]}}),_0x47c568;}_createIconView(){const _0x3f33d3=new $t();return _0x3f33d3['content']=this['getResourceIcon'](this['resource']),_0x3f33d3;}_setupTemplate(){const _0x4e198d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Lo,_0x4e198d['if']('isVisible','ck-hidden',_0x2f872b=>!_0x2f872b),_0x4e198d['if']('isInContext',Po)]},'children':[{'tag':'div','attributes':{'class':[Ho]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4e198d['to']('execute')}});}_updateIcon(){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}};const Uo='ck-ai-chat-resources__list';var Vo=class extends Jt{['_source'];constructor(_0x5d1c76,_0x18b043){super(_0x5d1c76),this['_source']=_0x18b043,this['extendTemplate']({'attributes':{'class':[Uo]}});}setResources(_0x10a5ca,_0x64a29b){this['items']['clear']();let _0x5160b5=_0x10a5ca;if(this['_source']['useDefaultFiltering']&&_0x64a29b&&''!==_0x64a29b['trim']()){const _0x2c7b4e=new RegExp(_0x64a29b['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5160b5=_0x10a5ca['filter'](_0x374f60=>_0x2c7b4e['test'](_0x374f60['label']));}for(const _0x5d00cb of _0x5160b5){const _0x53f64a=new Mo(this['locale'],_0x5d00cb);_0x53f64a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5d00cb);}),this['items']['add'](_0x53f64a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x64a29b);}highlightText(_0x32a33d){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x180701=>{_0x180701['highlightText'](_0x32a33d);});}updateResourceState(_0x2db8e2,_0x4d169f){for(const _0x215080 of this['items']){const _0x55c853=_0x215080;_0x55c853['resource']['id']===_0x2db8e2&&_0x55c853['updateResourceState'](_0x4d169f);}}_handleResourceSelection(_0x58b117,_0x3281cf){this['fire']('addResourceToContext',{'source':_0x58b117,'resource':_0x3281cf});}},Bo=class extends Qt{['iconView'];resetButtonView;['_viewConfig'];constructor(_0x2625a5){const t=_0x2625a5['t'],_0x2b886d={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4c7fdb,'label':Es(_0x2625a5,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2625a5,_0x2b886d['creator']),this['label']=_0x2b886d['label'],this['_viewConfig']=_0x2b886d,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2625a5,t),this['_setupEventListeners']();}reset(){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x8575e2){this['fire']('search',_0x8575e2);}getQuery(){return this['fieldView']['element']?.['value']||'';}_setupSearchIcon(){this['iconView']=new $t(),this['iconView']['content']=_0x4cf30b,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}_setupResetButton(_0x2de0d4,t){this['resetButtonView']=new Mt(_0x2de0d4),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x572ba4,'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',_0x246b1c=>!_0x246b1c),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);}},Go=class extends _0x56a514{['_searchView'];_searchSection;_searchInputVisibleFrom;_resourcesListView;_skeletonLoader;['_source'];['children'];_latestLoadResourcesUid=null;constructor(_0x28575b,_0xab31f4){super(_0x28575b),this['_source']=_0xab31f4['source'],this['_searchInputVisibleFrom']=_0xab31f4['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 _0x93f04d([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}_createSearchView(){return new Bo(this['locale']);}_createSearchSection(){const _0x28b80c=new _0x56a514(this['locale']);return _0x28b80c['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1bab9c,_0x41dfbc)=>{this['loadResources'](_0x41dfbc),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x41dfbc);}),_0x28b80c;}_createResourcesListView(){const _0x35cc75=new Vo(this['locale'],this['_source']);return _0x35cc75['delegate']('addResourceToContext')['to'](this),_0x35cc75['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x35cc75;}_createSkeletonView(){const _0x40b810=new wr(this['locale'],Cr['aiChatResources']);return _0x40b810['bind']('isVisible')['to'](this,'isLoading'),_0x40b810;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x33f08b){const _0x313d70=kt();this['_latestLoadResourcesUid']=_0x313d70,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x33f08b,'uid':_0x313d70}),this['isLoading']=!0x0;}setResources(_0x15fe34,_0x497831){if(_0x497831&&_0x497831!==this['_latestLoadResourcesUid'])return;const _0x20c4d5=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x15fe34,_0x20c4d5),_0x15fe34['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}updateResourceState(_0x5e6a5c,_0x32e65d){this['_resourcesListView']['updateResourceState'](_0x5e6a5c,_0x32e65d);}};const Fo='ck-ai-chat-context-controls__source-balloon-panel',Ko='ck-button-icon\x20ck-button-back',Wo='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';var Yo=class{['_sourceResourceBalloons']=new Map();_bodyCollection;['_locale'];['_config'];constructor(_0xbd3462,_0x34a423,_0x1fbf40){this['_locale']=_0xbd3462,this['_bodyCollection']=_0x34a423,this['_config']=_0x1fbf40;}['showSourceResourcesBalloon']({source:_0x4bc3cd,withBackButton:_0x4c0998}){let _0x6730f3=this['_sourceResourceBalloons']['get'](_0x4bc3cd['id']);_0x6730f3||(_0x6730f3=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4bc3cd['id'],_0x6730f3),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x6730f3)),this['_addSourceResourceContent']({'balloonPanel':_0x6730f3,'source':_0x4bc3cd,'withBackButton':_0x4c0998}),_0x6730f3['show']();const _0x501b15=this['_config']['getTargetElement']();_0x501b15&&_0x6730f3['pin']({'target':_0x501b15,'limiter':this['_config']['getLimiterElement']()});}populateSourceResourceBalloon(_0xdeb68,_0x57cc46,_0x5c6bd8){const _0x3ab5ec=this['_sourceResourceBalloons']['get'](_0xdeb68);if(!_0x3ab5ec)return;const _0x401fc9=this['_getResourcesViewFromBalloon'](_0x3ab5ec);_0x401fc9&&(_0x401fc9['setResources'](_0x57cc46,_0x5c6bd8),_0x401fc9['once']('change:isLoading',()=>{_0x3ab5ec['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5aa0db){const _0xce73e8=this['_sourceResourceBalloons']['get'](_0x5aa0db);_0xce73e8&&requestAnimationFrame(()=>{_0xce73e8['hide'](),this['_sourceResourceBalloons']['delete'](_0x5aa0db),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x48f3aa of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x48f3aa);}['isAnyResourceBalloonVisible'](){for(const _0x443f22 of this['_sourceResourceBalloons']['values']())if(_0x443f22['isVisible'])return!0x0;return!0x1;}updateResourceState(_0xb2b097,_0x222825,_0x3d3560){const _0x27014b=this['_sourceResourceBalloons']['get'](_0xb2b097);if(!_0x27014b||!_0x27014b['isVisible'])return;const _0x6886ee=this['_config']['getTargetElement']();if(!_0x6886ee)return;_0x27014b['pin']({'target':_0x6886ee,'limiter':this['_config']['getLimiterElement']()});const _0x56a129=this['_getResourcesViewFromBalloon'](_0x27014b);_0x56a129&&_0x56a129['updateResourceState'](_0x222825,_0x3d3560);}destroy(){for(const _0x5bbb53 of this['_sourceResourceBalloons']['values']())_0x5bbb53['destroy']();this['_sourceResourceBalloons']['clear']();}_createSourceResourceBalloonPanel(){const _0x4b4c85=new xt(this['_locale']);return _0x4b4c85['extendTemplate']({'attributes':{'class':Fo}}),this['_bodyCollection']['add'](_0x4b4c85),_0x4b4c85;}_addSourceResourceContent({balloonPanel:_0x551401,source:_0x382bc3,withBackButton:_0x9ffd1f}){_0x551401['content']['clear']();const _0x42e447=this['_createBalloonHeader']({'balloonPanel':_0x551401,'source':_0x382bc3,'withBackButton':_0x9ffd1f});_0x551401['content']['add'](_0x42e447);const _0x2f69de=this['_createBalloonResourcesView'](_0x382bc3);_0x551401['content']['add'](_0x2f69de);}_createBalloonHeader({balloonPanel:_0x746446,source:_0x4d4f7f,withBackButton:_0x11d417}){const _0x875737=new Kt(this['_locale'],{'label':_0x4d4f7f['label'],'class':Wo});return _0x11d417&&_0x875737['children']['add'](this['_createBackButton'](_0x746446),0x0),_0x875737;}_createBackButton(_0xa23c7b){const _0x2f30b8=new Mt(this['_locale']);return _0x2f30b8['set']({'icon':_0xd78e92,'tooltip':Es(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ko}),_0x2f30b8['on']('execute',()=>{_0xa23c7b['hide'](),this['_config']['onBackToContext']();}),_0x2f30b8;}_createBalloonResourcesView(_0x48572b){const _0x2d201c=new Go(this['_locale'],{'source':_0x48572b,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2d201c['on']('loadSourceResources',(_0x3de4e8,_0x3d844e)=>{this['_config']['onLoadSourceResources'](_0x3d844e);}),_0x2d201c['on']('addResourceToContext',(_0x531316,_0x6fab8)=>{this['_config']['onResourceSelected'](_0x6fab8['source'],_0x6fab8['resource']),this['closeSourceResourceBalloon'](_0x48572b['id']);}),_0x2d201c;}_getResourcesViewFromBalloon(_0x7b3f6){const _0x4c898d=_0x7b3f6['content']['get'](0x1);return _0x4c898d instanceof Go?_0x4c898d:null;}_setupSingleResourceBalloonClickOutsideHandler(_0x1fcde9){_0x44d1a9({'emitter':_0x1fcde9,'contextElements':[_0x1fcde9['element']],'callback':()=>{_0x1fcde9['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x1fcde9['isVisible']});}};const $o=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],qo='ck-ai-chat-context-controls',Qo='ck-ai-chat-context-controls__pending-contexts',Xo='ck-ai-chat-context-controls__add-context-balloon-panel',zo='ck-ai-chat-context-controls__add-context-button',jo='ck-ai-chat-context-controls__url-balloon-panel',Jo='ck-ai-chat-context-controls__balloon-button',Zo='ck-ai-chat-context-controls__balloon-button-source',ta='ck-ai-chat-controls-button',ea='ck-ai-chat-context-chips-wrapper-balloon',ia='ck-ai-chat-controls_context_show-more-button',sa='ck-ai-chat-context-controls__show-more-balloon-panel',na='ck-ai-chat',ra=[xt['defaultPositions']['northArrowSouthWest'],xt['defaultPositions']['northArrowSouth'],xt['defaultPositions']['northArrowSouthEast'],xt['defaultPositions']['southArrowNorthWest'],xt['defaultPositions']['southArrowNorth'],xt['defaultPositions']['southArrowNorthEast']];var oa=class extends _0x56a514{addContextButtonView;_currentContextsChips=this['createCollection']();_conversationContextsChips=this['createCollection']();['_overflowManager'];_addContextBalloonPanelView;['_urlBalloonPanelView'];_urlInputView;['_resourcesBalloonView'];_addContextBalloonConfig;_hasExactlyOneSource=!0x1;bodyCollection;constructor(_0x10754b,_0xb726cc){super(_0x10754b),this['bodyCollection']=_0xb726cc['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x10754b),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x10754b),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x10754b),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x10754b,_0xb726cc);const _0x3a86bd={'cssClasses':{'showMoreButton':ia+'\x20'+Dn,'showMoreBalloon':sa,'overflowContainer':ea,'controlsButton':ta}};this['_overflowManager']=new Qr(_0x10754b,this['_currentContextsChips'],_0x3a86bd,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(_0x5592fd,_0x2254af){const _0x33dd18=this['_createContextButton'](_0x5592fd,'current',!0x0,_0x2254af);this['_addContextToCollection'](_0x33dd18,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}removeContextItem(_0x478e6e){this['_removeContextFromCollection'](_0x478e6e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x478e6e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}setContextItemLoading(_0x56a61b,_0x2633de){let _0x5ded39=this['_currentContextsChips']['find'](_0x47f5f7=>_0x47f5f7['id']===_0x56a61b);_0x5ded39||(_0x5ded39=this['_overflowManager']['overflowChips']['find'](_0x447b55=>_0x447b55['id']===_0x56a61b)),_0x5ded39&&(_0x5ded39['isLoading']=_0x2633de);}setConversationContext(_0x1d4eef){this['_conversationContextsChips']['clear']();for(const _0x5b7546 of _0x1d4eef){const _0x427014=this['_createContextButton'](_0x5b7546,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x427014,this['_conversationContextsChips']);}}clearCurrentContextItems(){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}clearConversationContextItems(){this['_conversationContextsChips']['clear']();}updateResourceState(_0x1c02d7,_0xa01da7,_0x1d2abf){this['_resourcesBalloonView']['updateResourceState'](_0x1c02d7,_0xa01da7,_0x1d2abf);}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;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x38d436,withBackButton:_0x4fb4bc}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x38d436,'withBackButton':_0x4fb4bc}),this['addContextButtonView']['isOn']=!0x0;}populateSourceResourceBalloon(_0x5a2872,_0x1fe94a,_0x1ed151,_0x1b4b3a){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5a2872,_0x1ed151,_0x1b4b3a);}['closeSourceResourceBalloon'](_0x5d52ef){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x5d52ef),this['addContextButtonView']['isOn']=!0x1;}setAddContextOptions(_0x5c34a0){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5c34a0),this['_setAddContextButtonEnabled'](_0x5c34a0);}_setAddContextButtonEnabled(_0x55bb4b){const _0x213814=!_0x55bb4b['document']['isHidden']&&_0x55bb4b['document']['enabled'],_0x34dcfb=_0x55bb4b['urls']['enabled'],_0x56a8e2=_0x55bb4b['files']['enabled'],_0x26c596=_0x55bb4b['sources']['length']>0x0,_0x2f0482=_0x55bb4b['customItems']&&_0x55bb4b['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x213814||_0x34dcfb||_0x56a8e2||_0x26c596||_0x2f0482;}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':[qo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Qo},'children':this['_currentContextsChips']}]});}_bindEventHandlers(){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}_createAddContextButtonView(_0x5d2609){const _0x185b14=new Mt(_0x5d2609);return _0x185b14['set']({'label':Es(_0x5d2609,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':ta+'\x20'+zo+'\x20'+Dn,'icon':_0x3ff1a2,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x185b14;}_createAddContextBalloonPanelView(_0x55b86f){return this['_createBaseBalloonPanel'](_0x55b86f,Xo);}_createUrlBalloonPanelView(_0x5ddbd7){const _0x3d81b8=this['_createBaseBalloonPanel'](_0x5ddbd7,jo);return this['_addUrlContent'](_0x3d81b8,_0x5ddbd7),_0x3d81b8;}_createResourcesBalloonView(_0x5d640b,_0x2118c2){const _0x59d097={'searchInputVisibleFrom':_0x2118c2['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra});},'onResourceSelected':(_0x23a13e,_0xbe4e23)=>{this['fire']('addResourceToContext',{'source':_0x23a13e,'resource':_0xbe4e23});},'onLoadSourceResources':_0x561e09=>{this['fire']('loadSourceResources',_0x561e09);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Yo(_0x5d640b,_0x2118c2['bodyCollection'],_0x59d097);}_getLimiterElement(){return this['element']?.['closest']('.'+na)||document['body'];}_createBaseBalloonPanel(_0x1e052f,_0x46693f){const _0xf560d0=new xt(_0x1e052f);return _0xf560d0['extendTemplate']({'attributes':{'class':_0x46693f}}),this['bodyCollection']['add'](_0xf560d0),_0xf560d0;}_setBalloonPanelContent(_0x2fa49b,_0x1fdee7,_0x47fd72){if(_0x2fa49b['content']['clear'](),!_0x47fd72['document']['isHidden']&&_0x47fd72['document']['enabled']){const _0x217c26=this['_createBalloonButton'](_0x1fdee7,{'label':Es(_0x1fdee7,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2d99a5});_0x217c26['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2fa49b['content']['add'](_0x217c26);}if(_0x47fd72['urls']['enabled']){const _0x194a9f=this['_createBalloonButton'](_0x1fdee7,{'label':Es(_0x1fdee7,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3de4d0});_0x194a9f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra}),this['_urlInputView']['focus']();}),_0x2fa49b['content']['add'](_0x194a9f);}if(_0x47fd72['files']['enabled']){const _0x152ca6=new Gt(_0x1fdee7);_0x152ca6['set']({'label':Es(_0x1fdee7,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x15107d,'withText':!0x0,'tooltip':!0x0,'class':Jo,'allowMultipleFiles':!0x0}),_0x152ca6['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x152ca6['on']('done',(_0x511b5d,_0xa85d6b)=>{this['fire']('addFileToContext',_0xa85d6b);}),_0x152ca6['tooltip']=!0x0,_0x2fa49b['content']['add'](_0x152ca6);}for(const _0x3b0d13 of _0x47fd72['sources']){const _0x42ddfe=this['_createBalloonButton'](_0x1fdee7,{'label':_0x3b0d13['label'],'icon':_0x3b0d13['icon']||_0x325a2b,'type':'source'});_0x2fa49b['content']['add'](_0x42ddfe),_0x42ddfe['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3b0d13,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x466efa of _0x47fd72['customItems']||[]){const _0x5d0b2c=this['_createBalloonButton'](_0x1fdee7,{'label':_0x466efa['label'],'icon':_0x466efa['icon']||_0x325a2b,'type':'customItem'});_0x2fa49b['content']['add'](_0x5d0b2c),_0x5d0b2c['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x466efa);});}this['_hasExactlyOneSource']=0x1===_0x2fa49b['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}_addUrlContent(_0x1ae121,_0x31aea5){this['_urlInputView']=new xo(_0x31aea5),this['_urlInputView']['on']('submitUrl',(_0x1e2bd1,_0x3cf1e3)=>{this['_handleUrlSubmit'](_0x3cf1e3);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra});}),_0x1ae121['content']['add'](this['_urlInputView']);}_createBalloonButton(_0x1cbcaa,_0x3e35f2){const _0x2d8c4b='source'===_0x3e35f2['type']?new aa(_0x1cbcaa):new Mt(_0x1cbcaa);return _0x2d8c4b['set']({'label':_0x3e35f2['label'],'icon':_0x3e35f2['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Jo}),_0x2d8c4b;}_setupAllBalloonClickOutsideHandlers(){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}_setupUrlBalloonClickOutsideHandler(){_0x44d1a9({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}_toggleAddContextBalloon(_0x2b89d1){const _0x2074c3=this['_addContextBalloonConfig'];_0x2074c3['buttonView']['isOn']=_0x2b89d1,_0x2b89d1?_0x2074c3['balloonView']['show']():_0x2074c3['balloonView']['hide']();}_setupAddContextBalloonClickOutsideHandler(){const {balloonView:_0x1e2207,buttonView:_0x165b84,hideMethod:_0x23e909}=this['_addContextBalloonConfig'];_0x44d1a9({'emitter':_0x1e2207,'contextElements':[_0x1e2207['element'],_0x165b84['element']],'callback':()=>{_0x23e909();},'activator':()=>_0x165b84['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}_createContextButton(_0x4728ae,_0x4c0742,_0x7548c=!0x1,_0x407cc2=!0x1){const _0x4d0528='conversation'===_0x4c0742||!0x0===_0x4728ae['isReadOnly'],_0x283459=new Wr(this['locale'],_0x4728ae,_0x4d0528,_0x7548c,_0x407cc2);return _0x4d0528||_0x283459['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x283459['id']);}),_0x283459;}_addContextToCollection(_0x5a97d8,_0x256f24){_0x256f24['add'](_0x5a97d8,0x0);}_removeContextFromCollection(_0x3a3e29,_0x1a4ba3){const _0x5c3447=_0x1a4ba3['find'](_0x34645d=>_0x34645d['id']===_0x3a3e29);_0x5c3447&&_0x1a4ba3['remove'](_0x5c3447);}_handleAddContextButtonClick(){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}_handleUrlSubmit(_0x15c84e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x15c84e);}},aa=class extends Mt{['arrowView'];constructor(_0x3e4b40){super(_0x3e4b40),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Zo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x2631f9=new $t();return _0x2631f9['content']=_0x1193f0,_0x2631f9['extendTemplate']({'attributes':{'class':Zo+'__arrow'}}),_0x2631f9;}},ha=class extends _0x56a514{_cancelButtonView;['_loaderView'];constructor(_0xd3e93e){super(_0xd3e93e),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 _0x520df6=new Mt(this['locale']);return _0x520df6['set']({'label':Es(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Pn+'\x20ck-ai-button-stop-generating','icon':st}),_0x520df6['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x520df6;}_createLoaderView(){const _0x23a2c3=new _0x56a514(this['locale']);return _0x23a2c3['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':Es(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x23a2c3;}},ca=class extends _0x56a514{_contextPanelView;_promptInputView;['_dropZoneView'];_promptCapabilitiesView;['_loaderView'];['_modelUnavailableMessageView'];_shouldRestorePromptInputFocus;['_filesEnabled'];constructor(_0xaca5c9,_0xb48cc1){super(_0xaca5c9),this['_filesEnabled']=_0xb48cc1['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0xaca5c9,{'bodyCollection':_0xb48cc1['bodyCollection'],'searchInputVisibleFrom':_0xb48cc1['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0xaca5c9),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0xaca5c9),this['_loaderView']=this['_createLoaderView'](_0xaca5c9),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0xaca5c9),this['_dropZoneView']=new Ao(_0xaca5c9),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste')['to'](this),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_dropZoneView']['bind']('isEnabled')['to'](this,'isLoading',_0x3ce71f=>!_0x3ce71f),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'](...$o)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x199796=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x199796['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x199796['if']('isLoading','ck-hidden',_0x4b7387=>_0x4b7387||!this['isModelAvailable']),_0x199796['if']('isModelAvailable','ck-hidden',_0x5d3b6d=>!_0x5d3b6d||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x199796['if']('isLoading','ck-hidden',_0x296412=>!_0x296412)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x199796['if']('isModelAvailable','ck-hidden',_0x3a82d7=>_0x3a82d7)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView']]}),_0x44d1a9({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}_createContextPanelView(_0x38e256,_0x5482f0){return new oa(_0x38e256,_0x5482f0);}_createPromptInputView(_0xaaa41a){return new go(_0xaaa41a,this['_contextPanelView']['addContextButtonView']);}_createPromptCapabilitiesView(_0x3bffcf){return new ko(_0x3bffcf);}_createLoaderView(_0xaefc71){return new ha(_0xaefc71);}_createModelUnavailableMessageView(_0x6a672e){const _0x5f3d20=new la(_0x6a672e);return _0x5f3d20['delegate']('startConversation')['to'](this),_0x5f3d20;}_handlePromptInputFocus(_0x3d1e1c,_0x33fb95,_0x374de0){_0x374de0?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}addContextItem(_0x2cb9c2,_0x552e77){this['_contextPanelView']['addContextItem'](_0x2cb9c2,_0x552e77);}removeContextItem(_0x1e03a8){this['_contextPanelView']['removeContextItem'](_0x1e03a8);}setContextItemLoading(_0x586885,_0x497ce3){this['_contextPanelView']['setContextItemLoading'](_0x586885,_0x497ce3);}setIsUploadInProgress(_0x5cb961){this['_promptInputView']['setIsUploadInProgress'](_0x5cb961);}setConversationContext(_0x5d2e1a){this['_contextPanelView']['setConversationContext'](_0x5d2e1a);}clearPendingContextUI(){this['_contextPanelView']['clearCurrentContextItems']();}clearConversationContextUI(){this['_contextPanelView']['clearConversationContextItems']();}updateResourceState(_0x50f7c8,_0x2f32e5,_0x5786c4){this['_contextPanelView']['updateResourceState'](_0x50f7c8,_0x2f32e5,_0x5786c4);}setWebSearch(_0x423b56){this['_promptCapabilitiesView']['setWebSearch'](_0x423b56);}setReasoning(_0x448586){this['_promptCapabilitiesView']['setReasoning'](_0x448586);}resetMessageInput(){this['_promptInputView']['reset']();}setAddContextOptions(_0x2ad29d){this['_contextPanelView']['setAddContextOptions'](_0x2ad29d);}setInputPlaceholder(_0x6c66cd){this['_promptInputView']['setPlaceholderText'](_0x6c66cd);}setModelList(_0x542dc8,_0x27743a){this['_promptCapabilitiesView']['setModelList'](_0x542dc8,_0x27743a);}setModel(_0x5649fb){_0x5649fb?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x5649fb)):this['isModelAvailable']=!0x1;}enableModelSelector(){this['_promptCapabilitiesView']['enableModelSelector']();}disableModelSelector(_0x2069cf){this['_promptCapabilitiesView']['disableModelSelector'](_0x2069cf);}populateSourceResourceBalloon(_0x379d1b,_0x11f9f9,_0x3a86fd,_0x673b55){this['_contextPanelView']['populateSourceResourceBalloon'](_0x379d1b,_0x11f9f9,_0x3a86fd,_0x673b55);}['closeSourceResourceBalloon'](_0x42e8ee){this['_contextPanelView']['closeSourceResourceBalloon'](_0x42e8ee);}focusPromptInput(_0x21596d=!0x1){this['_promptInputView']['focus'](_0x21596d);}setPromptInputValue(_0x486a88){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x486a88;}},la=class extends _0x56a514{constructor(_0x17d719){super(_0x17d719);const _0x5fb387=new Mt(_0x17d719);_0x5fb387['set']({'label':Es(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5fb387['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Es(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5fb387]}]});}},ua=class extends Kt{resizeButton;constructor(_0x4d5b5d,_0x8db98f){super(_0x4d5b5d,{'label':_0x8db98f['label'],'class':'ck-ai-header\x20'+_0x8db98f['class'],'icon':_0x8db98f['icon']}),this['set']('isMaximized',!0x1),_0x8db98f['content']&&this['children']['add'](_0x8db98f['content']),_0x8db98f['showResizeButton']&&(this['resizeButton']=Hn(_0x4d5b5d,this),this['children']['add'](this['resizeButton']));}},da=class extends _0x56a514{constructor(_0x299b9f){super(_0x299b9f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Es(_0x299b9f,'AI_DISCLAIMER_TEXT')}]}]});}};function _a(_0x2b252f,_0x23ee97){const _0x3b7d18=new Mt(_0x2b252f);return _0x3b7d18['set']({'label':Es(_0x2b252f,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x3da945,'class':'ck-ai-chat__start-conversation\x20'+Pn}),_0x3b7d18['on']('execute',()=>{_0x23ee97['fire']('startConversation');}),_0x3b7d18;}var ga=class extends _0x56a514{chatHeader;chatFeed;chatControls;chatDisclaimer;_bodyCollection;constructor(_0x2aa254,_0x52eaae){super(_0x2aa254),this['_bodyCollection']=Mn(_0x2aa254);const _0x2dee34=_a(_0x2aa254,this);this['chatHeader']=new ua(_0x2aa254,{'label':Es(_0x2aa254,'AI_CHAT_HEADING'),'icon':_0x19cce7,'class':'ck-ai-header_chat','content':_0x2dee34,'showResizeButton':_0x52eaae['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new co(_0x2aa254,this['_bodyCollection']),this['chatFeed']['delegate'](...sr)['to'](this),this['chatControls']=new ca(_0x2aa254,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x52eaae['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x52eaae['filesEnabled']}),this['chatControls']['delegate'](...sr)['to'](this),this['chatDisclaimer']=new da(_0x2aa254),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2aa254['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}populateSourceResourceBalloon(_0x5d36d3,_0x107087,_0x545297,_0x47345c){this['chatControls']['populateSourceResourceBalloon'](_0x5d36d3,_0x107087,_0x545297,_0x47345c);}['closeSourceResourceBalloon'](_0x201129){this['chatControls']['closeSourceResourceBalloon'](_0x201129);}destroy(){this['_bodyCollection']['detachFromDom'](),super['destroy']();}},Aa=class extends _0x898608{static get requires(){return[gs];}['_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;get['idleUiPromise'](){return this['_promiseQueue']['queueEmptyPromise'];}constructor(_0x5c20a8){super(_0x5c20a8);const _0x5e25ba=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['set']('isChatStreaming',!0x1),this['_promiseQueue']=new Sr(),this['_view']=new ga(this['context']['locale'],{'showResizeButton':_0x5e25ba['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x5e25ba),this['_view']['delegate'](...sr)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4efcde,{showDiff:_0x26914f})=>{this['showDiff']=_0x26914f;}),this['disableControls'](),_0x5e25ba['view']['addTab']({'id':'chat','buttonLabel':Es(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x19cce7,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x5e25ba['view'],'isMaximized',_0x49ee9b=>_0x49ee9b),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isChatStreaming',_0xc48b5e=>_0xc48b5e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}destroy(){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}createConversation({availableModels:_0x443767}){const _0x323e97=this['context']['config']['get']('ai.chat.welcomeMessage')??Es(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x443767,!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x323e97}),this['fire']('conversationCreated');}async addFeedItemStaticMessage({id:_0xd4e613,staticMessage:_0x3fc576}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xd4e613,'initialContent':'<p>'+_0x3fc576+'</p>'});});}async addFeedItemUserMessage(_0x381290){const _0x7914f1=_0x381290['attributes']?.['displayedPrompt']||_0x381290['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x381290['contextItems']['values']()),'initialContent':'<p>'+_0x7914f1+'</p>','id':_0x381290['id']});});}async addFeedItemError({errorMessage:_0x4987e1,id:_0x389ea5}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4987e1+'</p>','id':_0x389ea5});});}async addFeedItemAIReply(_0xbc32ea){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xbc32ea['interactionId']+':'+_0xbc32ea['id']}),this['clearLoadingMessage']();});}async addFeedItemAISuggestion(_0x333434){const _0x46658f=bs(this['context']),_0x5c911e=_0x46658f['map'](_0x57535c=>_0x57535c['config']['get']('ai.availableReplyActions')||[...Or]);let _0xb531df=_0x5c911e['reduce']((_0x1c63e5,_0x5a9b7b)=>_0x1c63e5['filter'](_0x5c4a7a=>_0x5a9b7b['includes'](_0x5c4a7a)),_0x5c911e[0x0]||[...Or]);const _0x4bedcb=_0x46658f['every'](_0x192044=>_0x192044['plugins']['has']('TrackChanges')),_0x15d2ff=_0x46658f['map'](_0x4a1b82=>_0x4a1b82['commands']['get']('trackChanges'));return _0x4bedcb?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x15d2ff,'value',(..._0x4b39f5)=>_0x4b39f5['some'](_0x5ac46e=>_0x5ac46e))):_0xb531df=_0xb531df['filter'](_0x126faa=>'insertSuggestion'!=_0x126faa),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x333434['interactionId']+':'+_0x333434['id'],'areActionsDisabled':_0x333434['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0xb531df}),this['clearLoadingMessage']();});}async addFeedInteractionHeader(_0x351335,_0x1127c0){return this['_promiseQueue']['enqueue'](async()=>{const _0x5d6cdf=this['_view']['chatFeed']['children']['last'];if(_0x5d6cdf instanceof so)return this['_view']['chatFeed']['children']['remove'](_0x5d6cdf),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x351335['id'],'capabilities':{'isWebSearchEnabled':_0x5d6cdf['capabilities']['isWebSearchEnabled']||_0x1127c0['isWebSearchEnabled'],'isReasoningEnabled':_0x5d6cdf['capabilities']['isReasoningEnabled']||_0x1127c0['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x351335['id'],'capabilities':_0x1127c0});});}async addFeedItemCustomElement(_0x134d49,_0x2bb6b1){let _0x5b4456;return await this['_promiseQueue']['enqueue'](async()=>{_0x5b4456=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x134d49,'id':_0x2bb6b1});}),_0x5b4456;}removeFeedItem(_0x6f9009){this['_view']['chatFeed']['removeItem'](_0x6f9009);}hasFeedItem(_0x2d495a){return this['_view']['chatFeed']['hasItem'](_0x2d495a);}updateFeedInteractionHeader(_0x2342dc){const _0x483c95=this['_view']['chatFeed']['children']['find'](_0x54d65c=>_0x54d65c['options']['id']==_0x2342dc['id']&&_0x54d65c instanceof so);_0x483c95&&_0x483c95['set']('isVisible',_0x2342dc['isVisible']);}async updateFeedItemAIReplyContent(_0x315922){const _0x2391cd=_0x315922['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x181541=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x315922,'abortSignal':_0x181541,'renderingStrategy':_0x2391cd}),_0x315922['isDone']&&this['markFeedItemAsDone'](_0x315922['id']);});}updateFeedItemAIReplySources(_0x422003,_0x396026){this['_view']['chatFeed']['updateWebSources'](_0x422003,_0x396026);}async updateFeedItemAIReplySuggestionContent(_0x42b75d){return this['_promiseQueue']['enqueue'](async _0x210570=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x42b75d,'abortSignal':_0x210570}),_0x42b75d['isDone']&&this['markFeedItemAsDone'](_0x42b75d['id']);});}updateFeedItemAIReplySuggestionPartState(_0x4a6cd8){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4a6cd8);}setSuggestionGating(_0x6a8d97,_0x25595c){this['_view']['chatFeed']['updateSuggestionGating'](_0x6a8d97,_0x25595c);}setFeedItemAIReplySuggestionPartActive(_0x14a8c4){this['_view']['chatFeed']['setSuggestionPartActive'](_0x14a8c4);}markFeedItemAsDone(_0x16efc9){this['_view']['chatFeed']['markItemAsDone'](_0x16efc9);}removeFeedInteraction(_0x39118d){this['_view']['chatFeed']['getItemIds']()['filter'](_0x58711f=>_0x58711f['startsWith'](_0x39118d))['forEach'](_0x47a69c=>this['_view']['chatFeed']['removeItem'](_0x47a69c));}startInteraction(){const _0x12b81a=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x12b81a),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['isChatStreaming']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}stopInteraction(_0x4c27ed){this['_promiseQueue']['abort'](),_0x4c27ed&&this['_view']['chatFeed']['getItemIds']()['filter'](_0x40212c=>_0x40212c['startsWith'](_0x4c27ed['id']))['forEach'](_0x35bc64=>this['markFeedItemAsDone'](_0x35bc64)),this['resetChatBusyStateToIdle']();}resetChatBusyStateToIdle(){this['isBusy']=!0x1,this['isChatStreaming']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async finishInteraction(){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['resetChatBusyStateToIdle']();});}addContextItem(_0x4a5349,_0x45b2fc){this['_view']['chatControls']['addContextItem'](_0x4a5349,_0x45b2fc);}removeContextItem(_0x2bb9b2){this['_view']['chatControls']['removeContextItem'](_0x2bb9b2);}setContextItemLoading(_0x3a291b,_0x41b5e8){this['_view']['chatControls']['setContextItemLoading'](_0x3a291b,_0x41b5e8);}setIsUploadInProgress(_0x46dd43){this['_view']['chatControls']['setIsUploadInProgress'](_0x46dd43);}setConversationContext(_0xd0ce42){this['_view']['chatControls']['setConversationContext'](_0xd0ce42);}clearPendingContextUI(){this['_view']['chatControls']['clearPendingContextUI']();}clearConversationContextUI(){this['_view']['chatControls']['clearConversationContextUI']();}updateResourceState(_0x17f8ad,_0x3bebf8,_0x487038){this['_view']['chatControls']['updateResourceState'](_0x17f8ad,_0x3bebf8,_0x487038);}resetMessageInput(){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}setAddContextOptions(_0x3427c9){this['_view']['chatControls']['setAddContextOptions'](_0x3427c9);}updateCapabilities(_0x2904a3){this['_view']['chatControls']['setWebSearch'](_0x2904a3['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2904a3['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2904a3));}setSelectedModel(_0x3404ba,_0x460203){this['_view']['chatControls']['setModel'](_0x3404ba),_0x460203&&this['_view']['chatControls']['disableModelSelector'](!0x1);}setFeedItemRenderingStrategy(_0x21f33a){this['feedItemRenderingStrategy']=_0x21f33a;}toggleLoadingSkeleton(_0x1a9f36){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1a9f36);}resetConversationTitle(){this['setConversationTitle'](Es(this['context']['locale'],'AI_CHAT_HEADING'));}emptyConversationTitle(){this['setConversationTitle']('');}setConversationTitle(_0x4608a6,_0x28d8fb=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x28d8fb&&!Et()&&_0x4608a6['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4608a6);this['_view']['chatHeader']['label']=_0x4608a6;}setLoadingMessage(_0x40b3d4){this['_view']['chatFeed']['setLoadingMessage'](_0x40b3d4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}_animateConversationTitle(_0x18af93){let _0x2e977b=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x18af93[_0x2e977b],_0x2e977b++,_0x2e977b===_0x18af93['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x3e7664){return _0x3e7664['isWebSearchEnabled']&&_0x3e7664['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3e7664['isWebSearchEnabled']?Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3e7664['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}_getInputPlaceholder(_0x5ee36d){return _0x5ee36d?_0x5ee36d['isWebSearchEnabled']&&_0x5ee36d['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x5ee36d['isWebSearchEnabled']?Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x5ee36d['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}populateSourceResourceBalloon(_0x2f2f84,_0x48cba4,_0x13d885,_0x3e9dc7){this['_view']['populateSourceResourceBalloon'](_0x2f2f84,_0x48cba4,_0x13d885,_0x3e9dc7);}['closeSourceResourceBalloon'](_0x489d06){this['_view']['closeSourceResourceBalloon'](_0x489d06);}setPromptInputValue(_0x3f2f99){this['_view']['chatControls']['setPromptInputValue'](_0x3f2f99);}focusPromptInput(_0x3b6456=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x3b6456);}scrollFeedToSuggestion(_0x587c48,_0x7c5c0b){this['_view']['chatFeed']['scrollToSuggestion'](_0x587c48,_0x7c5c0b);}startAutoScroll(_0x2316e7={}){this['_view']['chatFeed']['startAutoScroll'](_0x2316e7);}stopAutoScroll(){this['_view']['chatFeed']['stopAutoScroll']();}disableControls(){this['_view']['chatControls']['isDisabled']=!0x0;}enableControls(){this['_view']['chatControls']['isDisabled']=!0x1;}toggleConversationLoading(_0x34e03a){_0x34e03a?(this['isBusy']=_0x34e03a,this['disableControls']()):(this['enableControls'](),this['resetChatBusyStateToIdle']());}},Ia=class extends Jt{sections;constructor(_0x1dabf2,_0xdc5473){super(_0x1dabf2),this['sections']=_0xdc5473,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}filter(_0x57138c){let _0x1249b6=0x0,_0x44e55b=0x0;for(const _0x31ded0 of this['sections']){const {resultsCount:_0x4d1153,totalItemsCount:_0x513bb3}=_0x31ded0['filter'](_0x57138c);_0x1249b6+=_0x4d1153,_0x44e55b+=_0x513bb3;}return{'resultsCount':_0x1249b6,'totalItemsCount':_0x44e55b};}},pa=class extends jt{title;itemsViews;_itemsListView;constructor(_0x19235f,{title:_0x3b7a5c,items:_0x3d8d64}){super(_0x19235f);const _0x5ad1a8=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3b7a5c,this['itemsViews']=_0x3d8d64;const _0x1ac70d=new _0x56a514(_0x19235f);_0x1ac70d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Jt(_0x19235f),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5ad1a8['if']('isVisible','ck-hidden',_0x2fc25d=>!_0x2fc25d)]},'children':[_0x1ac70d,this['_itemsListView']]});}filter(_0x412147){const _0x21ea6b=this['itemsViews']['length'];let _0x1444f0=0x0;for(const _0x4b063c of this['itemsViews'])_0x412147?(_0x4b063c['isVisible']=!!_0x4b063c['isMatching'](_0x412147),_0x4b063c['highlightText'](_0x412147)):(_0x4b063c['isVisible']=!0x0,_0x4b063c['highlightText'](null)),_0x4b063c['isVisible']&&_0x1444f0++;return this['isVisible']=_0x1444f0>0x0,{'resultsCount':_0x1444f0,'totalItemsCount':_0x21ea6b};}getItem(_0x54343f){return this['itemsViews']['find'](_0x54cfca=>_0x54cfca['id']===_0x54343f);}removeItem(_0x3b5424){const _0x299cdc=this['itemsViews']['indexOf'](_0x3b5424);-0x1!==_0x299cdc&&(this['itemsViews']['splice'](_0x299cdc,0x1),this['_itemsListView']['items']['remove'](_0x3b5424));}};const Ea=/* #__PURE__ -- @preserve */
34
+ _0x5a953b(jt);var ma=class AIChatHistoryListItemView extends Ea{['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(_0x217a9d,_0x5cc329){super(_0x217a9d);const _0x2f9384=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5cc329['pinned']),this['set']('loadingState',null),this['set']('title',_0x5cc329['title']),this['id']=_0x5cc329['id'];const {createdAt:_0x21fbe2,active:_0x101085=!0x1}=_0x5cc329;this['_titleView']=new Yt(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x9c07a2=this['_createCheckView'](),_0x12f43a=this['_createPinButtonView'](_0x217a9d),_0x268949=this['_createMenuDropdownView'](),_0x26c7a1=this['_createEditInputView'](_0x217a9d),_0x4c5161=this['_createAcceptEditButtonView'](_0x217a9d,_0x26c7a1),_0x22ae5f=this['_createCancelEditButtonView'](_0x217a9d);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x12f43a),this['actions']['add'](_0x268949),this['on']('change:isEdit',(_0x103800,_0x5d61ea,_0x212448)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x212448?(this['actions']['add'](_0x4c5161),this['actions']['add'](_0x22ae5f),this['mainContent']['add'](_0x26c7a1),_0x26c7a1['element']['value']=this['title']||'',_0x26c7a1['element']['focus']()):(this['actions']['add'](_0x12f43a),this['actions']['add'](_0x268949),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x101085?'ck-ai-chat-history__item--active':'',_0x2f9384['if']('isVisible','ck-hidden',_0xffa49=>!_0xffa49),_0x2f9384['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',_0x2f9384['if']('loadingState','ck-hidden',_0x1bdb29=>!!_0x1bdb29)]},'children':_0x101085?[_0x9c07a2]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2f9384['if']('loadingState','ck-hidden',_0xcb402d=>!_0xcb402d)]},'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-container',_0x2f9384['if']('loadingState','ck-hidden',_0x238546=>!!_0x238546)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2f9384['if']('loadingState','ck-hidden',_0x1b9906=>!_0x1b9906)]},'children':[{'text':_0x2f9384['to']('loadingState',_0x449388=>_0x449388?Es(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x449388]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x21fbe2]}]},{'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(_0x428adc){this['set']('title',_0x428adc);}updateLoadingState(_0x42f0aa,_0x46c046){this['set']('loadingState',_0x46c046?_0x42f0aa:null);}_createCheckView(){const _0x20bcba=new $t();return _0x20bcba['set']({'content':_0x48b061}),_0x20bcba;}_createPinButtonView(_0x16b5fa){const _0x45433c=new Mt(_0x16b5fa);return _0x45433c['set']({'label':Es(_0x16b5fa,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5b153c,'withText':!0x1,'tooltip':!0x0}),_0x45433c['bind']('isOn')['to'](this,'pinned'),_0x45433c['on']('execute',()=>{const _0x67d8a8=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x67d8a8});}),_0x45433c;}_createMenuDropdownView(){const _0x7cc662=_0x48403c(this['locale']),_0x1b4627=_0x7cc662['panelView']['children'];_0x7cc662['buttonView']['set']({'label':Es(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':rt}),_0x7cc662['panelPosition']='sw';const _0x3b59fb=new Mt(this['locale']);_0x3b59fb['label']=Es(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3b59fb['withText']=!0x0,_0x3b59fb['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3ae52c=new Mt(this['locale']);_0x3ae52c['label']=Es(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3ae52c['withText']=!0x0,_0x3ae52c['on']('execute',()=>{this['showConfirm'](Es(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x493731=new Jt(this['locale']),_0x2450bb=new jt(this['locale']);_0x2450bb['children']['add'](_0x3b59fb);const _0x519b55=new jt(this['locale']);return _0x519b55['children']['add'](_0x3ae52c),_0x493731['items']['addMany']([_0x2450bb,_0x519b55]),_0x1b4627['add'](_0x493731),_0x7cc662;}_createEditInputView(_0x166163){const _0x2b982b=new qt(_0x166163),_0x49dcb8=_0x2b982b['bindTemplate'];return _0x2b982b['extendTemplate']({'on':{'keydown':_0x49dcb8['to'](_0x44efb9=>{'Enter'==_0x44efb9['key']&&this['_commitEditInputValue'](_0x2b982b);})}}),_0x2b982b;}_createAcceptEditButtonView(_0x142d51,_0x3a4015){const _0x921d4a=new Mt(_0x142d51);return _0x921d4a['set']({'icon':_0x48b061,'withText':!0x1,'tooltip':Es(_0x142d51,'AI_CHAT_HISTORY_ACCEPT')}),_0x921d4a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x921d4a['on']('execute',()=>{this['_commitEditInputValue'](_0x3a4015);}),_0x921d4a;}_commitEditInputValue(_0x11eb85){const _0x332940=_0x11eb85['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x332940});}_createCancelEditButtonView(_0x26fdfb){const _0x23cd65=new Mt(_0x26fdfb);return _0x23cd65['set']({'icon':_0x572ba4,'withText':!0x1,'tooltip':Es(_0x26fdfb,'AI_CHAT_HISTORY_CANCEL')}),_0x23cd65['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x23cd65['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x23cd65;}_createSpinnerView(){const _0x2fc812=new Dr('tiny');return _0x2fc812['isVisible']=!0x0,_0x2fc812;}isMatching(_0x326a62){return'string'==typeof this['title']&&this['title']['match'](_0x326a62)?{'title':!0x0}:null;}highlightText(_0x58f278){this['_titleView']['highlightText'](_0x58f278);}},Ta=class extends _0x56a514{['headerView'];['searchView'];['mainErrorView'];skeletonView;emptyView;sectionsView;constructor(_0x1ef502,_0x2a86c6){super(_0x1ef502),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x4633fe=_a(_0x1ef502,this);this['headerView']=new ua(_0x1ef502,{'label':Es(_0x1ef502,'AI_CHAT_HISTORY_HEADING'),'icon':_0x4afa16,'class':'ck-ai-header_history','content':_0x4633fe,'showResizeButton':_0x2a86c6}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new Ia(_0x1ef502,[]),this['sectionsView']['delegate'](...wa)['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',_0x3a749d=>!_0x3a749d)]}}),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':[this['headerView'],{'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 _0x226e5f=new _0xdb63d9(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Es(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x4b8edd=>Es(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x4b8edd),'secondary':Es(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x1058f3=this['_createErrorView']();return _0x1058f3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x19b1a6=>!_0x19b1a6)]}}),_0x226e5f['on']('render',()=>{_0x226e5f['children']['add'](_0x1058f3,0x1);}),_0x226e5f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x5d3a7a=>!_0x5d3a7a)]}}),_0x226e5f;}_createSkeletonView(){const _0xc11ee8=new wr(this['locale'],Cr['aiHistory']);return _0xc11ee8['bind']('isVisible')['to'](this,'isLoading'),_0xc11ee8;}_createErrorView(){const _0x513c5d=new _0x56a514(this['locale']),_0x303fd3=new Mt(this['locale']);_0x303fd3['set']({'withText':!0x1,'icon':_0x572ba4,'class':'ck-ai-notification_error__dismiss-button'}),_0x303fd3['bind']('isVisible')['to'](this,'hasItems',_0x19245f=>!!_0x19245f),_0x303fd3['on']('execute',()=>{this['errorMessage']='';});const _0x36144a=this['bindTemplate'];return _0x513c5d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x36144a['to']('errorMessage')}]},_0x303fd3]}),_0x513c5d;}_createEmptyStateView(){const _0x9fcfbd=new _0x56a514(this['locale']);return _0x9fcfbd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x295593=>!_0x295593)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Es(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x9fcfbd;}_createListItemViews(_0x2eca43,_0x3b6c19){const _0x356dc=[];for(const _0x953a1a of _0x2eca43){const _0x40a5cf=new ma(_0x3b6c19,_0x953a1a);_0x40a5cf['delegate'](...wa)['to'](this),_0x356dc['push'](_0x40a5cf);}return _0x356dc;}updateHistoryItemsWithCategories(_0x279da7){const _0x1397c2=this['locale']||'en',_0x59c7b4=[];for(const _0x23f35e of _0x279da7){const _0x3ba54d=this['_createListItemViews'](_0x23f35e['items'],_0x1397c2);_0x59c7b4['push'](new pa(_0x1397c2,{'title':_0x23f35e['title'],'items':_0x3ba54d}));}this['sectionsView']['sections']=_0x59c7b4,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x59c7b4),this['hasItems']=_0x279da7['some'](_0x5dd84a=>_0x5dd84a['items']['length']>0x0),this['_refreshSearch']();}removeHistoryItem(_0x4640a2){for(const _0x33468a of this['sectionsView']['sections']){const _0x276ff9=_0x33468a['getItem'](_0x4640a2);if(_0x276ff9){if(_0x33468a['removeItem'](_0x276ff9),0x0===_0x33468a['itemsViews']['length']){const _0x3c5759=this['sectionsView']['sections']['indexOf'](_0x33468a);-0x1!==_0x3c5759&&(this['sectionsView']['sections']['splice'](_0x3c5759,0x1),this['sectionsView']['items']['remove'](_0x33468a));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}updateItemTitle(_0x59403d,_0x42ca2b){for(const _0x16f138 of this['sectionsView']['sections']){const _0x3e70f8=_0x16f138['getItem'](_0x59403d);if(_0x3e70f8){_0x3e70f8['updateTitle'](_0x42ca2b);break;}}}updateItemLoadingState(_0x590fbe,_0x346cb9,_0x5ae150){for(const _0x4ac78f of this['sectionsView']['sections']){const _0x4de325=_0x4ac78f['getItem'](_0x590fbe);if(_0x4de325){_0x4de325['updateLoadingState'](_0x346cb9,_0x5ae150);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x519798=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x519798);}}};const wa=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var Ca=class extends _0x898608{static get requires(){return[gs];}_historyView;static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1fe769){super(_0x1fe769);const _0x7976a1=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ta(this['context']['locale'],_0x7976a1['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x7976a1),this['_historyView']['delegate'](...wa)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x7976a1['view'],'isMaximized',_0x490e5=>_0x490e5),_0x7976a1['view']['addTab']({'id':'history','buttonLabel':Es(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x4afa16,'order':0x0,'content':this['_historyView']});}removeHistoryItem(_0x5cf98b){this['_historyView']['removeHistoryItem'](_0x5cf98b);}updateItems(_0x324192){this['_historyView']['updateHistoryItemsWithCategories'](_0x324192);}updateItemTitle(_0xd732da,_0x262969){this['_historyView']['updateItemTitle'](_0xd732da,_0x262969);}updateItemLoadingState(_0x213187,_0x9c79a2,_0x182350){this['_historyView']['updateItemLoadingState'](_0x213187,_0x9c79a2,_0x182350);}setLoadingSkeleton(_0x184277){this['_historyView']['isLoading']=_0x184277;}['showError'](_0xb6ec70){this['_historyView']['errorMessage']=_0xb6ec70;}['hideError'](){this['_historyView']['errorMessage']='';}};const fa=/* #__PURE__ -- @preserve */
35
+ At();var ba=class extends fa{['id'];createdAt;constructor({id:_0x2e9dd5,title:_0x3618fa,createdAt:_0x24d2d2,updatedAt:_0x470d11,pinned:_0xb900e6}){super(),this['id']=_0x2e9dd5,this['createdAt']=new Date(_0x24d2d2),this['set']('title',_0x3618fa),this['set']('updatedAt',_0x470d11?new Date(_0x470d11):null),this['set']('pinned',_0xb900e6||!0x1);}updateTitle(_0x515bf1){this['set']('title',_0x515bf1),this['updatedAt']=new Date();}updatePinned(_0x43bd79){this['set']('pinned',_0x43bd79),this['updatedAt']=new Date();}};const Sa=/* #__PURE__ -- @preserve */
36
+ dt();var Ra=class extends Sa{items=[];connector;['group'];constructor({connector:_0x2943d1,group:_0x369ee9}){super(),this['connector']=_0x2943d1,this['group']=_0x369ee9;}async init(){try{const _0x1c435f=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x1c435f);}catch(_0x490e77){this['fire']('error',{'error':_0x490e77,'operation':'init'});}}addItem(_0x1ef300){this['items']['push'](_0x1ef300);}async removeItem(_0x351f14){const _0x15b060=this['items']['findIndex'](_0x4e17c4=>_0x4e17c4['id']===_0x351f14);if(-0x1===_0x15b060)return!0x1;try{return await this['connector']['deleteConversation'](_0x351f14)['execute'](),this['items']['splice'](_0x15b060,0x1),this['fire']('itemRemoved',{'itemId':_0x351f14}),!0x0;}catch(_0x359fe1){return this['fire']('error',{'error':_0x359fe1,'operation':'removeItem','itemId':_0x351f14}),!0x1;}}getItem(_0x1d1d7c){return this['items']['find'](_0x476f18=>_0x476f18['id']===_0x1d1d7c);}async updateItemTitle(_0x39d0bd,_0x5f55c9){const _0x3902c0=this['getItem'](_0x39d0bd);if(!_0x3902c0)return!0x1;try{return await this['connector']['updateConversation'](_0x39d0bd,{'title':_0x5f55c9})['getResult'](),_0x3902c0['updateTitle'](_0x5f55c9),this['fire']('itemUpdated',{'itemId':_0x39d0bd,'updates':{'title':_0x5f55c9}}),!0x0;}catch(_0x283b50){return this['fire']('error',{'error':_0x283b50,'operation':'updateItemTitle','itemId':_0x39d0bd}),!0x1;}}async updateItemPinned(_0x22cf5d,_0x5afed5){const _0xb7d944=this['getItem'](_0x22cf5d);if(!_0xb7d944)return!0x1;try{return await this['connector']['updateConversation'](_0x22cf5d,{'pinned':_0x5afed5})['getResult'](),_0xb7d944['updatePinned'](_0x5afed5),this['fire']('itemUpdated',{'itemId':_0x22cf5d,'updates':{'pinned':_0x5afed5}}),!0x0;}catch(_0x5cf34d){return this['fire']('error',{'error':_0x5cf34d,'operation':'updateItemPinned','itemId':_0x22cf5d}),!0x1;}}loadItems(_0x3f5ddb){try{this['items']=[],_0x3f5ddb['map'](_0x5021f2=>{this['addItem'](new ba(_0x5021f2));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x5f2757){this['fire']('error',{'error':_0x5f2757,'operation':'loadItems'});}}getItems(_0x1d5dba={}){const _0x1eeade=void 0x0!==_0x1d5dba['pinned']&&_0x1d5dba['pinned'],_0x709e38=_0x1d5dba['from']?new Date(_0x1d5dba['from']['getFullYear'](),_0x1d5dba['from']['getMonth'](),_0x1d5dba['from']['getDate']()):null,_0x137099=_0x1d5dba['to']?new Date(_0x1d5dba['to']['getFullYear'](),_0x1d5dba['to']['getMonth'](),_0x1d5dba['to']['getDate']()):null;return this['items']['filter'](_0x4d043b=>{if(_0x4d043b['pinned']!==_0x1eeade)return!0x1;if(_0x137099){const _0x16aa0b=new Date(_0x4d043b['createdAt']['getFullYear'](),_0x4d043b['createdAt']['getMonth'](),_0x4d043b['createdAt']['getDate']());return _0x709e38?_0x709e38['getTime']()===_0x137099['getTime']()?_0x16aa0b['getTime']()===_0x709e38['getTime']():_0x16aa0b<_0x137099&&_0x16aa0b>=_0x709e38:_0x16aa0b<_0x137099;}return!0x0;});}},Oa=class extends _0x898608{_aiConnector;_reporter;_aiChatHistoryUi;_aiChatController;static get requires(){return[Is,Nn,er,Ca,gs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiConnector']=this['context']['plugins']['get'](Is),this['_aiChatHistoryUi']=this['context']['plugins']['get'](Ca),this['_aiChatController']=this['context']['plugins']['get'](er),this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aichathistory');const _0x5b3e9f=this['context']['plugins']['get'](gs);try{const _0x5614a4=this['_aiChatController']['getGroupId']();this['history']=new Ra({'connector':this['_aiConnector'],'group':_0x5614a4}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x270da2,_0xcbaeb4)=>{this['_setItemLoading'](_0xcbaeb4['id'],'remove'),this['_handleRemove'](_0xcbaeb4['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x558267,_0x4923b9)=>{this['_setItemLoading'](_0x4923b9['id'],'rename'),this['_handleEditTitle'](_0x4923b9['id'],_0x4923b9['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5a6dd4,_0x2f3ad9)=>{void 0x0!==_0x2f3ad9['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2f3ad9['itemId'],_0x2f3ad9['updates']['title']),void 0x0!==_0x2f3ad9['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2f3ad9['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x14e059,_0x492a1e)=>{this['_aiChatController']['_handleRemovedConversation'](_0x492a1e['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x492a1e['itemId']),this['_clearItemLoading'](_0x492a1e['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x198b0b,_0x757ad4)=>{this['_handleHistoryErrorUI'](_0x757ad4['error'],_0x757ad4['operation'],_0x757ad4['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2a596b,_0x31bb3f)=>{this['_handleSelectConversation'](_0x31bb3f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2bbd33,_0x132091)=>{const _0x28a751=_0x132091['pinned']?'pin':'unpin';this['_setItemLoading'](_0x132091['id'],_0x28a751),this['_handleTogglePin'](_0x132091['id'],_0x132091['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x5b3e9f['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x5b3e9f['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x1723bc){this['_handleHistoryErrorUI'](_0x1723bc,'init');}}async _handleEditTitle(_0x5cefb1,_0x26af96){await this['history']['updateItemTitle'](_0x5cefb1,_0x26af96);}async['_handleTogglePin'](_0x3521e4,_0x3a98f4){await this['history']['updateItemPinned'](_0x3521e4,_0x3a98f4);}async['_handleRemove'](_0x23977a){await this['history']['removeItem'](_0x23977a);}async _handleSelectConversation(_0x39bacd){await this['_aiChatController']['loadConversation'](_0x39bacd);}async _showConversationHistory(){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_updateHistoryItemsUI(){const _0xbf4dea=this['_aiChatController']['activeConversation']?.['id'],_0x159480=this['_getCategorizedItems']()['map'](_0x251fcf=>({'title':_0x251fcf['title'],'items':_0x251fcf['items']['map'](_0x5378c7=>({'id':_0x5378c7['id'],'title':_0x5378c7['title']||Es(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5378c7['createdAt'])['toLocaleDateString'](),'active':_0x5378c7['id']===_0xbf4dea,'pinned':_0x5378c7['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x159480);}_setItemLoading(_0x51aad7,_0x328ad1){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x51aad7,_0x328ad1,!0x0);}_clearItemLoading(_0x46d919){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x46d919,null,!0x1);}_handleHistoryErrorUI(_0x536e19,_0x3ffa35,_0xea3463){const _0xe13562=this['_generateErrorMessage'](_0x3ffa35,_0xea3463);this['_aiChatHistoryUi']['showError'](_0xe13562),this['_reporter']['reportError'](_0x536e19,{'context':{'operation':_0x3ffa35}}),_0xea3463&&this['_clearItemLoading'](_0xea3463),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_generateErrorMessage(_0x5a7801,_0x312576){const _0xad7f56=_0x312576?this['history']['getItem'](_0x312576):null,_0x3c568b=_0xad7f56?.['title']||Es(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x5a7801){case'updateItemTitle':return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3c568b);case'updateItemPinned':{const _0x56aeb2=Es(this['context']['locale'],_0xad7f56?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x56aeb2,_0x3c568b]);}case'removeItem':return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3c568b);case'init':case'loadItems':return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}_getCategorizedItems(){const _0x45fbe8=new Date(),_0x1f20d3=new Date(_0x45fbe8['getFullYear'](),_0x45fbe8['getMonth'](),_0x45fbe8['getDate']()),_0x4501fb=new Date(_0x1f20d3);_0x4501fb['setDate'](_0x4501fb['getDate']()-0x1);const _0x9be5e6=new Date(_0x1f20d3);_0x9be5e6['setDate'](_0x9be5e6['getDate']()-0xe);const _0x5c79ec=this['history']['getItems']({'pinned':!0x0}),_0x56fee7=this['history']['getItems']({'from':_0x1f20d3,'to':_0x1f20d3}),_0x27a21b=this['history']['getItems']({'from':_0x4501fb,'to':_0x4501fb}),_0x1f4dfe=this['history']['getItems']({'from':_0x9be5e6,'to':_0x4501fb}),_0x1d9f52=this['history']['getItems']({'to':_0x9be5e6}),_0x184c27=[];return _0x5c79ec['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5c79ec}),_0x56fee7['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x56fee7}),_0x27a21b['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x27a21b}),_0x1f4dfe['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1f4dfe}),_0x1d9f52['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x1d9f52}),_0x184c27;}},va=class extends _0x898608{static get requires(){return[Oa,Ca];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ka=class extends _0x898608{static get requires(){return[er,tn,Aa,va,vn];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c4a5d){super(_0x3c4a5d),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'contextLibrary':{'enabled':!0x1},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}},ya=class extends Mt{['id'];constructor(_0x505c26,_0x3c4921){super(_0x505c26);const {id:_0x4dea5d,type:_0x256c4a,icon:_0x268640}=_0x3c4921;this['id']=_0x4dea5d,this['set']({'label':_0x3c4921['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x3c4921['id']}}),_0x268640?this['icon']=_0x268640:'chat'===_0x256c4a?this['icon']=_0x19cce7:'review'===_0x256c4a?this['icon']=_0x510915:'translate'===_0x256c4a&&(this['icon']=_0x370c5b);}},Na=class extends _0x56a514{listView;constructor(_0x26238f,_0x5b011e){super(_0x26238f),this['set']('isEnabled',!0x0);const _0x271b23=_0x5b011e['map'](_0x5560da=>{const _0x9f60d5=new jt(this['locale']),_0x40ee97=new ya(this['locale'],_0x5560da);return _0x40ee97['bind']('isEnabled')['to'](this),_0x9f60d5['children']['add'](_0x40ee97),_0x40ee97['delegate']('execute')['to'](this),_0x9f60d5;});this['listView']=new Jt(this['locale']),this['listView']['items']['addMany'](_0x271b23),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const xa='chat-shortcuts';var La=class extends _0x898608{_shortcuts;_shortcutsView;_aiChatUI;_listenedConversation;static get requires(){return[Aa,fs];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiChatUI']=this['context']['plugins']['get'](Aa),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x23a33c=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0x57075c=_0x23a33c['activeConversation'];_0x57075c['isFromHistory']||this['_injectShortcuts'](_0x57075c);}),this['listenTo'](_0x23a33c,'interactionStarted',()=>{this['_removeShortcuts']();}));}_validateShortcuts(){const _0x3c6073=['chat','review','translate'];this['_shortcuts']['forEach'](_0x434351=>{let _0x16122b=!0x0;if(_0x434351['id']&&_0x434351['label']&&_0x3c6073['includes'](_0x434351['type'])?'chat'===_0x434351['type']&&(_0x16122b='string'==typeof _0x434351['prompt']):_0x16122b=!0x1,!_0x16122b)throw new ct('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x434351});});}_injectShortcuts(_0x495202){this['_removeShortcuts'](),this['_shortcutsView']=new Na(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],xa),this['_shortcutsView']['on']('execute',_0x5f131e=>{const _0x5d0e05=_0x5f131e['source']['id'];this['_executeShortcut'](_0x5d0e05);}),this['_listenedConversation']=_0x495202,this['listenTo'](_0x495202,'uploadProgressChanged',(_0x468e0,_0x33aaec)=>{this['_shortcutsView']['isEnabled']=!_0x33aaec['isUploadInProgress'];});}_removeShortcuts(){const _0x435bfa=this['context']['plugins']['get'](Aa);_0x435bfa['hasFeedItem'](xa)&&_0x435bfa['removeFeedItem'](xa),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}_executeShortcut(_0x22c4a8){const _0x2cd41d=this['_shortcuts']['find'](_0x6b6a1f=>_0x6b6a1f['id']===_0x22c4a8),_0x2afbe1=_0x2cd41d['type'];'chat'===_0x2afbe1?this['_runChatShortcut'](_0x2cd41d):'review'===_0x2afbe1?_0x2cd41d['commandId']?this['_runReviewShortcut'](_0x2cd41d):this['_switchTab']('reviewMode'):'translate'===_0x2afbe1&&(_0x2cd41d['language']?this['_runTranslateShortcut'](_0x2cd41d):this['_switchTab']('translate'));}_switchTab(_0x48bb18){if(!this['context']['plugins']['has']('AITabs'))throw new ct('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x48bb18});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x48bb18);}async _runChatShortcut({id:_0x576c18,prompt:_0x5b8a45,draftMode:_0x37f7e5,useWebSearch:_0xea3c6c=!0x1,useReasoning:_0x22f44f=!0x1,model:_0x5b2153}){const _0x284188=this['context']['plugins']['get']('AIChatController'),_0x2352b1=_0x284188['activeConversation'],_0x58de76=this['context']['plugins']['get'](fs),_0xbeefee=await _0x58de76['models']['resolveModel'](_0x5b2153);_0xbeefee&&await _0x2352b1['setModel'](_0xbeefee),_0x2352b1['setWebSearch'](_0xea3c6c),_0x2352b1['setReasoning'](_0x22f44f);const _0x384aae=_0x58de76['contextLibrary']['resolveContext']({'feature':'chat','ids':[_0x576c18],'idScopedOnly':!0x0,'context':new Yn()});_0x2352b1['addDefaultContext'](_0x384aae['refs']),_0x284188['addCurrentDocumentToChatContext'](),_0x37f7e5?(this['_aiChatUI']['setPromptInputValue'](_0x5b8a45),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x284188['sendMessage']({'message':_0x5b8a45});}_runReviewShortcut({commandId:_0x5a4a9f,model:_0x137e51,prompt:_0x51f8d4,params:_0x337544}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ct('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x435b86={'id':_0x5a4a9f,'isCustom':'custom'===_0x5a4a9f};_0x137e51&&_0x51f8d4&&(_0x435b86['args']={'model':_0x137e51,'prompt':_0x51f8d4}),_0x337544&&(_0x435b86['params']=_0x337544),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x435b86);}_runTranslateShortcut({language:_0x5ef3c1}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ct('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x5ef3c1,'args':{'language':_0x5ef3c1}});}},Pa=class extends _0x23b7b0{constructor(_0x2588ba){super(_0x2588ba);const _0x1b954e=_0x2588ba['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1b954e,'isVisible'),this['isEnabled']=!0x0;}execute(){const _0x3b0ac2=this['editor']['plugins']['get']('AITabs')['view'];_0x3b0ac2['isVisible']=!_0x3b0ac2['isVisible'];}},Da=class extends _0x622916{static get requires(){return[gs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x4efafb=this['editor'];_0x4efafb['commands']['add']('toggleAi',new Pa(_0x4efafb)),_0x4efafb['ui']['componentFactory']['add']('toggleAi',()=>{const _0x26403b=this['_createAIUIButton'](Mt);return _0x26403b['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x26403b;}),_0x4efafb['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x2016bd=this['_createAIUIButton'](Zt);return _0x2016bd['set']({'role':'menuitemcheckbox'}),_0x2016bd;});}_createAIUIButton(_0x40ba03){const _0x1213f7=this['editor'],_0x56538a=_0x1213f7['commands']['get']('toggleAi'),_0xd8a777=new _0x40ba03(_0x1213f7['locale']);return _0xd8a777['set']({'label':Es(_0x1213f7['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2eb0d7,'isToggleable':!0x0}),_0xd8a777['bind']('isEnabled')['to'](_0x56538a),_0xd8a777['bind']('isOn')['to'](_0x56538a,'value',_0x13e317=>!!_0x13e317),this['listenTo'](_0xd8a777,'execute',()=>{_0x56538a['execute']();}),_0xd8a777;}};const Ha=['applySuggestion','insertSuggestion','showNext','showPrevious'];var Ma=class extends _0x56a514{['_errorView'];constructor(_0x2a1c45){super(_0x2a1c45),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5788a5){this['showError'](_0x5788a5);}['showError'](_0x1fac60){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x1fac60,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}_createErrorView(){const _0x5416c4=new _0x56a514(this['locale']),_0x228254=new _0x56a514(this['locale']);return _0x228254['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5416c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5be14a=>!_0x5be14a)]},'children':[_0x228254]}),_0x5416c4;}};const Ua=0xa;var Va=class extends _0x898608{static get requires(){return[tn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;_currentConfig;_editor;_isUpdatingMarkers=!0x1;['open'](_0x14f9ac){const {id:_0x5cefff}=this['_currentConfig']??{};this['_currentConfig']=_0x14f9ac,this['_editor']=_0x14f9ac['targetEditor'];const {id:_0x5bec8d}=this['_currentConfig'];this['isOpen']&&_0x5cefff===_0x5bec8d?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x294724=this['_editor'];if(!_0x294724)return;const _0x145b25=_0x294724['plugins']['get']('Dialog');_0x145b25['isOpen']&&this['_currentConfig']&&_0x145b25['id']===this['_currentConfig']['id']&&_0x145b25['hide']();}_updateDialog(){const _0x27d32b=this['_editor']['plugins']['get']('Dialog'),{icon:_0x9cd904,title:_0x37eebb}=this['_currentConfig'];_0x27d32b['view']?.['headerView']&&(_0x27d32b['view']['headerView']['label']=_0x37eebb,_0x27d32b['view']['headerView']['iconView']&&_0x9cd904&&(_0x27d32b['view']['headerView']['iconView']['content']=_0x9cd904)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x27d32b['view']?.['updatePosition']();}_showFakeVisualSelection(){this['context']['plugins']['get'](tn)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}_hideFakeVisualSelection(){this['context']['plugins']['get'](tn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x5d1e9d=this['_editor']['plugins']['get']('Dialog'),{id:_0x4b7e6f,title:_0x26d45e,icon:_0x97ec2,class:_0x227d45,mainView:_0x21a5c1}=this['_currentConfig'];_0x21a5c1['delegate'](...Ha)['to'](this),_0x5d1e9d['show']({'title':_0x26d45e,'icon':_0x97ec2,'hasCloseButton':!0x0,'id':_0x4b7e6f,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x227d45||''),'content':_0x21a5c1,'onShow':_0xe49561=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0xe49561['view']?.['updatePosition']();const _0x11b26d=this['_getSelectionElements']();_0x11b26d&&_0x11b26d[0x0]&&Ot({'target':_0x11b26d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xe49561['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x4b7e6f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x4b7e6f}),this['isOpen']=!0x1;}});}_calculateDialogPosition(_0x179d09,_0x5c57a2,_0x9910cb){const _0x2d6314=_0x5c57a2||_0x9910cb;if(!_0x2d6314)return null;const _0x11fdfe=this['_getSelectionElements']();if(!_0x11fdfe||0x0===_0x11fdfe['length'])return{'left':Math['round'](_0x2d6314['left']+_0x2d6314['width']/0x2-_0x179d09['width']/0x2),'top':Math['round'](_0x2d6314['top']+_0x2d6314['height']/0x2-_0x179d09['height']/0x2)};const _0xdea21e=Math['round'](_0x2d6314['left']+_0x2d6314['width']/0x2-_0x179d09['width']/0x2),_0x26ee54=_0x11fdfe['map'](_0x24ffb8=>new It(_0x24ffb8)),_0x35e525=_0x179d09['height'];return{'left':_0xdea21e,'top':this['_calculateOptimalTopPosition'](_0x26ee54,_0x35e525,_0x2d6314)};}_calculateOptimalTopPosition(_0x1cd63b,_0x32ac3f,_0x900a21){const _0x1e14ad=new It(wt['window']),_0x5717a1=_0x1cd63b['map'](_0x7e1778=>_0x7e1778['getVisible']())['filter'](_0x3615bc=>_0x3615bc),_0x29d531=It['getBoundingRect'](_0x5717a1);if(!_0x29d531)return Math['round'](_0x900a21['top']+_0x900a21['height']/0x2);const _0x4168a4=_0x1e14ad['getIntersection'](_0x29d531);if(!_0x4168a4)return Math['round'](_0x900a21['top']+_0x900a21['height']/0x2);const _0x42777d=_0x900a21['getVisible'](),_0x45e9fb=_0x42777d&&_0x29d531['height']>_0x42777d['height'],_0x4030a1=_0x4168a4['top'],_0x9514f5=_0x4168a4['bottom'];if(_0x45e9fb){const _0x435eb6=_0x1e14ad['top']+_0x1e14ad['height']/0x2-_0x32ac3f/0x2,_0x2e4ae0=_0x4030a1-Ua-_0x1e14ad['top'],_0x302491=_0x1e14ad['bottom']-_0x9514f5-Ua;return _0x2e4ae0>=_0x32ac3f?Math['max'](Ua,_0x4030a1-_0x32ac3f-Ua):_0x302491>=_0x32ac3f?_0x9514f5+Ua:Math['max'](Ua,_0x435eb6);}const _0x25203e=_0x4030a1-_0x32ac3f,_0x1b0872=_0x1e14ad['bottom']-_0x9514f5-Ua,_0x2b21d1=_0x4030a1-Ua-_0x1e14ad['top'];let _0x2c7176;return _0x2c7176=_0x1b0872>=_0x32ac3f?_0x9514f5+Ua:_0x2b21d1>=_0x32ac3f?_0x25203e-Ua:_0x4030a1+_0x29d531['height']/0x2-_0x32ac3f/0x2,_0x2c7176;}_setupFakeVisualSelectionMarkerRemovalListener(){const _0x583af8=this['_editor'];this['listenTo'](_0x583af8['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x3b3d41,data:{newRange:_0x2392cd}}of _0x583af8['model']['document']['differ']['getChangedMarkers']())if(_0x3b3d41['startsWith']('ai-selection:')&&(_0x2392cd&&(_0x2392cd['start']['isEqual'](_0x2392cd['end'])||'$graveyard'==_0x2392cd['root']['rootName'])||null==_0x2392cd)){const _0x5189fa=Es(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5189fa),this['fire']('selectionRemoved');}}});}_cleanupFakeVisualSelectionMarkerRemovalListener(){const _0xf312bf=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0xf312bf['model']['document']);}_getSelectionElements(){const _0x29f5be=this['_editor'];return _0x42da8e(_0x29f5be['editing'],[..._0x29f5be['model']['markers']['getMarkersGroup']('ai-selection'),..._0x29f5be['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}_getCurrentDomRootName(){const _0x5cd55f=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x5cd55f&&_0x5cd55f['rootName']?_0x5cd55f['rootName']:null;}},Ba=class extends _0x54b9b5{copyButton;likeButton;dislikeButton;showChangesButton;['_config'];constructor(_0x32f2ea,_0x55d59c={}){super(_0x32f2ea),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x55d59c};const _0x347699=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x347699?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}toggleShowChangesEnabled(_0x549d26){this['showChangesButton']['isEnabled']=_0x549d26;}_setupRatingButtons(){this['likeButton']=new Mt(this['locale']),this['likeButton']['set']({'icon':at,'label':Es(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Dn,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Mt(this['locale']),this['dislikeButton']['set']({'icon':ot,'label':Es(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Dn,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}_setupCopyButton(){this['copyButton']=new Mt(this['locale']),this['copyButton']['set']({'icon':_0xaeff50,'label':Es(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Dn,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x3e7cf1=new $t();_0x3e7cf1['set']({'content':_0x48b061}),_0x3e7cf1['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\x20'+Dn,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Dn;},0x7d0);}),this['copyButton']['children']['add'](_0x3e7cf1);}_setupShowChangesButton(){this['showChangesButton']=new Mt(this['locale']),this['showChangesButton']['set']({'icon':et,'label':Es(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Dn}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x33e7f3=>_0x33e7f3?it:et),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},Ga=class extends Ma{['children'];nextButtonView;previousButtonView;['focusCycler'];['_focusables'];['_focusTracker'];_keystrokes;['_config'];_streamableContentView;_toolbarContainerView;_partToolbarView;_stateView;['_miniToolbarView'];constructor(_0x4bc8c0,_0x2aba14){super(_0x4bc8c0);const _0x4d0a27=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['set']('_outdatedReason',void 0x0),this['set']('isTargetReadOnly',!0x1),this['set']('areActionsDisabled',!0x1),this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x2aba14,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new mr(_0x4bc8c0),this['_partToolbarView']=new Ir(_0x4bc8c0,_0x2aba14['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_partToolbarView']['bind']('isTargetReadOnly')['to'](this),this['_partToolbarView']['bind']('isEnabled')['to'](this,'areActionsDisabled',this,'_isErrorVisible',(_0x25db62,_0xc462e9)=>!_0x25db62&&!_0xc462e9),this['_togglePartToolbarButtonsVisibility'](_0x2aba14),this['_stateView']=new gr(_0x4bc8c0),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ba(_0x4bc8c0,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new Fa(_0x4bc8c0,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x41cf8d,_0x419e73,_0x21cc0b,_0x261868)=>{let _0x349243,_0x17cbac;'pending'===_0x261868?(_0x349243=this['_partToolbarView'],_0x17cbac=this['_stateView']):(_0x349243=this['_stateView'],_0x17cbac=this['_partToolbarView']),this['_stateView']['setState'](_0x21cc0b,this['_outdatedReason']),_0x349243['isVisible']=!0x1,_0x17cbac['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x4d0a27['to']('_state',_0x55820e=>'ck-ai-chat-balloon-main_state_'+_0x55820e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2aba14);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}destroy(){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}focusLast(){this['focusCycler']['focusLast']();}async updateContent(_0xc9bdd7){_0xc9bdd7?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xc9bdd7);}clearContent(){this['_streamableContentView']['clear']();}setState(_0x2c8805,_0x378b0f){this['_outdatedReason']=_0x378b0f,this['_state']=_0x2c8805;}['showError'](_0x2ad242){super['showError'](_0x2ad242),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}toggleRotatorButtonsVisibility(_0x7dfc64){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x7dfc64;}_togglePartToolbarButtonsVisibility({showApplyButton:_0x543d65,showSuggestButton:_0x1b29f9}){_0x543d65=_0x543d65&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1b29f9=_0x1b29f9&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x543d65,'showSuggestButton':_0x1b29f9});}_createNextButtonView(){const _0x1fef31=new Mt(this['locale']);return _0x1fef31['set']({'icon':_0x4e351c,'label':Es(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1fef31['on']('execute',()=>{this['fire']('showNext');}),_0x1fef31;}_createPreviousButtonView(){const _0xca25cd=new Mt(this['locale']);return _0xca25cd['set']({'icon':_0x582ecb,'label':Es(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0xca25cd['on']('execute',()=>{this['fire']('showPrevious');}),_0xca25cd;}},Fa=class extends _0x56a514{constructor(_0x2bbd57,_0x37f69c){super(_0x2bbd57),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x37f69c});}},Ka=class extends _0x622916{static get requires(){return[Ut,Va];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_chatBalloonView;constructor(_0x24e83e){super(_0x24e83e),this['set']('showDiff',!0x1);}['open'](_0x116ab7){const _0xfb1d6=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0xfb1d6['plugins']['get']('AIBalloon')['open']({..._0x116ab7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x116ab7['showRotator']),this['_chatBalloonView']['areActionsDisabled']=_0x116ab7['areActionsDisabled'],this['_chatBalloonView']['isTargetReadOnly']=_0x116ab7['isTargetReadOnly'],this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}updateContent(_0x432276){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x432276);}clearContent(){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}setState(_0x531c56,_0x4e61b3){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x531c56,_0x4e61b3);}setTargetReadOnly(_0x1be7aa){this['_chatBalloonView']&&(this['_chatBalloonView']['isTargetReadOnly']=_0x1be7aa);}_createChatBalloonView(){const _0x4ad38b=this['editor'],_0x103e6f=_0x4ad38b['plugins']['get']('AIBalloon'),_0x150669=_0x4ad38b['commands']['get']('trackChanges');let _0x4527be=_0x4ad38b['config']['get']('ai.availableReplyActions')||[...Or];_0x4ad38b['plugins']['has']('TrackChanges')||(_0x4527be=_0x4527be['filter'](_0x2909d0=>'insertSuggestion'!=_0x2909d0));const _0x40c417=new Ga(_0x4ad38b['locale'],{'availableActions':_0x4527be,'showApplyButton':!0x0,'showSuggestButton':!!_0x150669});return _0x40c417['bind']('showDiff')['to'](this),_0x40c417['delegate'](...ir)['to'](this),_0x40c417['delegate']('showPrevious','showNext')['to'](this),_0x103e6f['delegate']('dialogClosed')['to'](this),_0x40c417['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40c417['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40c417['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x150669&&_0x40c417['bind']('isTrackChangesOn')['to'](_0x150669,'value'),_0x40c417['render'](),_0x40c417;}_toggleRotatorButtonsInDialogHeader(_0x17194e){const _0x27cbbc=this['editor'],_0x6a5881=_0x27cbbc['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x17194e),_0x6a5881['has'](this['_chatBalloonView']['previousButtonView'])||(_0x6a5881['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x27cbbc['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x6a5881['remove'](this['_chatBalloonView']['previousButtonView']),_0x6a5881['remove'](this['_chatBalloonView']['nextButtonView']);}));}_restoreDefaultViewFocus(){this['_chatBalloonView']['focus']();}},Wa=class extends _0x622916{static get requires(){return[Da,Ka,_0x34a1f4];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Ya(_0x318b19){const {editor:_0x6828d1,action:_0x4eb7b9,withText:_0x2d2b3a=!0x1,withIcon:_0x35efd8=!0x0,isInDropdown:_0x26b8b5=!0x0,shouldPreventFocus:_0x169fc4=!0x1,actionButtons:_0x52ff50}=_0x318b19;return()=>{const _0x3e3497=_0x6828d1['locale'],_0x1a0cf9=new Mt(_0x3e3497),_0xd984ec=_0x1a0cf9['bindTemplate'];_0x26b8b5&&_0x1a0cf9['extendTemplate']({'on':{'mouseenter':_0xd984ec['to'](()=>{_0x169fc4&&_0x169fc4()||_0x1a0cf9['focus']();})}}),_0x52ff50['push']({'buttonView':_0x1a0cf9,'action':_0x4eb7b9});const _0x269506=_0x4eb7b9['icon']??_0x4eb7b9['parent']?.['icon'];return _0x1a0cf9['set']({'label':_0x4eb7b9['label'],'withText':_0x2d2b3a,'role':'menuitem','icon':_0x35efd8?_0x269506??_0x10bb99:void 0x0,'tooltip':!_0x2d2b3a,'class':'ck-ai-quick-actions-button','isEnabled':_0x4eb7b9['isEnabled']}),_0x1a0cf9['on']('execute',()=>{_0x6828d1['editing']['view']['focus'](),_0x6828d1['commands']['execute']('aiQuickAction',_0x4eb7b9);}),_0x1a0cf9;};}var $a=class extends Xt{['arrowView'];constructor(_0x2dec09,_0x40b703){super(_0x2dec09,_0x40b703);const _0x116ff5=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',_0x260bb4=>String(_0x260bb4)),'data-cke-tooltip-disabled':_0x116ff5['to']('isOn')},'on':{'mouseenter':_0x116ff5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x1cdda7=new $t();return _0x1cdda7['content']=_0x1193f0,_0x1cdda7['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x1cdda7;}},qa=class extends Jt{_allListItems;_allSearchableItems;constructor(_0x3ec9a,_0x12b99c,_0x34feab){super(_0x3ec9a),this['_allListItems']=_0x12b99c,this['_allSearchableItems']=_0x34feab;}filter(_0x59aa69){if(!_0x59aa69)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4aaa4f=_0x59aa69['source']['toLowerCase']()['trim'](),_0x2e1e8c=this['_allSearchableItems']['filter'](_0x57a88e=>(_0x57a88e['groupLabel']?_0x57a88e['label']+'\x20('+_0x57a88e['groupLabel']+')':_0x57a88e['label'])['toLowerCase']()['includes'](_0x4aaa4f));return this['items']['clear'](),this['items']['addMany'](_0x2e1e8c['sort']((_0x34ca8f,_0x344c14)=>{const _0x16fcba=_0x34ca8f['groupLabel'],_0x571167=_0x344c14['groupLabel'];return _0x16fcba||_0x571167?_0x16fcba?0x1:-0x1:0x0;})['map'](_0xc44dce=>_0xc44dce['item'])),this['_highlightQuery'](_0x4aaa4f,_0x2e1e8c),{'resultsCount':_0x2e1e8c['length'],'totalItemsCount':this['_allSearchableItems']['length']};}_highlightQuery(_0x29fdf5,_0x213062){if(!_0x29fdf5)return;const _0x5f11de=new RegExp(_0x3ff1f3(_0x29fdf5),'gi');_0x213062['forEach'](_0x11be96=>{_0x11be96['highlightViews']&&_0x11be96['highlightViews']['forEach'](_0x3342b0=>{'function'==typeof _0x3342b0['highlightText']&&_0x3342b0['highlightText'](_0x5f11de);});});}_clearHighlight(){this['_allSearchableItems']['forEach'](_0x124f98=>{_0x124f98['highlightViews']&&_0x124f98['highlightViews']['forEach'](_0x2704f0=>{'function'==typeof _0x2704f0['highlightText']&&_0x2704f0['highlightText'](null);});});}};const Qa='menu',Xa='menuitem';var za=class extends _0x56a514{_bodyCollection;optionsListView;_searchTextView=null;_allSearchableItems=[];['children'];['focusTracker'];keystrokes;['_focusables'];['focusCycler'];_openNestedPanels=new Set();['_hasSearch'];_actionButtons;constructor(_0x506bf7,_0x4cdbe7,_0x2f9cb9,_0x2915e8,_0x4b6a02=!0x1,_0x2dc90a=[]){const _0x347c15=_0x506bf7['locale'];super(_0x347c15),this['_bodyCollection']=_0x2915e8,this['_hasSearch']=_0x4b6a02,this['_actionButtons']=_0x2dc90a;const _0x129cca=this['_createListItems'](_0x506bf7,_0x4cdbe7,_0x2f9cb9);this['optionsListView']=new qa(_0x347c15,_0x129cca,this['_allSearchableItems']),this['optionsListView']['role']=Qa,this['optionsListView']['items']['addMany'](_0x129cca),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x4b6a02&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x129cca,this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4b6a02&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5ae2c6=_0x4b6a02&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x93f04d(_0x5ae2c6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x347c15['uiLanguageDirection']},'children':this['children']});}_createSearchTextView(){return new _0xdb63d9(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Es(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Es(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x14442a=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x14442a);}_createListItems(_0x32ced5,_0x1c110d,_0x117f06){const _0x3068bf=new _0x93f04d();return _0x1c110d['forEach'](_0xd33a56=>{if('actions'in _0xd33a56){const {listItem:_0x9da425}=this['_createActionGroupButton'](_0x32ced5,_0xd33a56,_0x117f06);_0x3068bf['add'](_0x9da425),_0xd33a56['actions']['forEach'](_0x450dec=>{const {listItem:_0x29b622,highlightViews:_0x1d42c0}=this['_createSearchResultActionButton'](_0x32ced5,_0x450dec,_0xd33a56['label'],_0xd33a56['icon']);this['_allSearchableItems']['push']({'item':_0x29b622,'label':_0x450dec['label'],'groupLabel':_0xd33a56['label'],'highlightViews':_0x1d42c0});});}else{const {listItem:_0x42580c}=this['_createActionButton'](_0x32ced5,_0xd33a56);_0x3068bf['add'](_0x42580c);const _0x22bb76=_0x42580c['children']['first'];if(_0x22bb76){const {listItem:_0x48ad63,highlightViews:_0x508c5b}=this['_createSearchResultActionButton'](_0x32ced5,_0xd33a56);this['_allSearchableItems']['push']({'item':_0x48ad63,'label':_0x22bb76['label']||'','highlightViews':_0x508c5b});}}}),_0x3068bf;}_createActionButton(_0x2ece5a,_0x1c9f2f,_0x4efb8c,_0x5c643c){const _0x99525c=new jt(this['locale']);if(_0x4efb8c&&_0x5c643c){const _0x45ab59=new Mt(this['locale']),_0x15c72b=_0x45ab59['bindTemplate'],_0x4057b7=new Yt();_0x4057b7['text']=_0x1c9f2f['label'];const _0x26c876=new Yt();_0x26c876['text']=_0x4efb8c;const _0x1c5b8e=new $t();_0x1c5b8e['content']=_0x5c643c,_0x1c5b8e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3aba77=new _0x56a514(this['locale']);_0x3aba77['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2beec2=new _0x56a514(this['locale']);return _0x2beec2['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x45ab59['set']({'label':_0x1c9f2f['label']+'\x20('+_0x4efb8c+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x1c9f2f['isEnabled']}),_0x45ab59['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x15c72b['if']('isEnabled','ck-disabled',_0xae813b=>!_0xae813b)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x4057b7,_0x3aba77,_0x1c5b8e,_0x26c876,_0x2beec2],'on':{'mouseenter':_0x15c72b['to'](()=>{this['_isSearchFocused']()||_0x45ab59['focus']();}),'click':_0x15c72b['to'](()=>{_0x45ab59['fire']('execute');})}}),_0x45ab59['on']('execute',()=>{_0x45ab59['isEnabled']&&(_0x2ece5a['editing']['view']['focus'](),_0x2ece5a['commands']['execute']('aiQuickAction',_0x1c9f2f));}),_0x99525c['children']['add'](_0x45ab59),this['_actionButtons']['push']({'buttonView':_0x45ab59,'action':_0x1c9f2f}),{'listItem':_0x99525c,'highlightViews':[_0x4057b7,_0x26c876]};}{const _0x10e1cd=new Ht(),_0x2066bb=new Mt(this['locale'],_0x10e1cd),_0x2e6549=_0x2066bb['bindTemplate'],_0x188250=_0x1c9f2f['icon']??_0x1c9f2f['parent']?.['icon'],_0x183181=void 0x0!==_0x1c9f2f['icon'];return _0x2066bb['set']({'label':_0x1c9f2f['label'],'withText':!0x0,'role':'menuitem','icon':_0x183181?_0x188250??_0x10bb99:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x1c9f2f['isEnabled']}),_0x2066bb['extendTemplate']({'on':{'mouseenter':_0x2e6549['to'](()=>{this['_isSearchFocused']()||_0x2066bb['focus']();})}}),_0x2066bb['on']('execute',()=>{_0x2ece5a['editing']['view']['focus'](),_0x2ece5a['commands']['execute']('aiQuickAction',_0x1c9f2f);}),_0x99525c['children']['add'](_0x2066bb),this['_actionButtons']['push']({'buttonView':_0x2066bb,'action':_0x1c9f2f}),{'listItem':_0x99525c,'highlightViews':[_0x10e1cd]};}}_createSearchResultActionButton(_0x168907,_0x3023fa,_0x1bc1b3,_0x5073f2){return _0x1bc1b3&&_0x5073f2?this['_createSearchResultGroupedActionButton'](_0x168907,_0x3023fa,_0x1bc1b3,_0x5073f2):this['_createSearchResultIndividualActionButton'](_0x168907,_0x3023fa);}_createSearchResultGroupedActionButton(_0x26babf,_0xfa98f3,_0x2c78f3,_0x30c44d){const _0x2eb367=new jt(this['locale']),_0x226e4e=new Mt(this['locale']),_0x1b9b7b=_0x226e4e['bindTemplate'],{view:_0x51c4ee,highlightView:_0x81d1a}=this['_createSearchResultGroupRow'](_0x2c78f3,_0x30c44d),{view:_0x3ac22b,highlightView:_0x28608c}=this['_createSearchResultActionRow'](_0xfa98f3['label']),_0x1f4e0a=this['_createSearchResultContentView'](_0x51c4ee,_0x3ac22b);return _0x226e4e['set']({'label':_0xfa98f3['label'],'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,'isEnabled':_0xfa98f3['isEnabled']}),_0x226e4e['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',_0x1b9b7b['if']('isEnabled','ck-disabled',_0x27a071=>!_0x27a071)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x1f4e0a],'on':{'mouseenter':_0x1b9b7b['to'](()=>{this['_isSearchFocused']()||_0x226e4e['focus']();}),'click':_0x1b9b7b['to'](()=>{this['_handleSearchResultButtonClick'](_0x226e4e);})}}),this['_setupActionButtonExecution'](_0x226e4e,_0x26babf,_0xfa98f3),_0x2eb367['children']['add'](_0x226e4e),this['_actionButtons']['push']({'buttonView':_0x226e4e,'action':_0xfa98f3}),{'listItem':_0x2eb367,'highlightViews':[_0x81d1a,_0x28608c]};}_createSearchResultIndividualActionButton(_0x59f3bf,_0x3de1cb){const _0x4e7773=new jt(this['locale']),_0x5f38c7=new Ht(),_0x745949=new Mt(this['locale'],_0x5f38c7),_0x577b4b=_0x745949['bindTemplate'];return _0x745949['set']({'label':_0x3de1cb['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x3de1cb['isEnabled']}),_0x745949['extendTemplate']({'on':{'mouseenter':_0x577b4b['to'](()=>{this['_isSearchFocused']()||_0x745949['focus']();})}}),this['_setupActionButtonExecution'](_0x745949,_0x59f3bf,_0x3de1cb),_0x4e7773['children']['add'](_0x745949),this['_actionButtons']['push']({'buttonView':_0x745949,'action':_0x3de1cb}),{'listItem':_0x4e7773,'highlightViews':[_0x5f38c7]};}_createSearchResultGroupRow(_0x420aa6,_0x30752a){const _0x2ff208=new _0x56a514(this['locale']),_0x5e97b3=new $t();_0x5e97b3['content']=_0x30752a,_0x5e97b3['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5c583f=new Yt();return _0x5c583f['text']=_0x420aa6,_0x2ff208['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5e97b3,_0x5c583f]}),{'view':_0x2ff208,'highlightView':_0x5c583f};}_createSearchResultActionRow(_0x5c9aaf){const _0x4c5d72=new _0x56a514(this['locale']),_0x1ad3d0=new Yt();return _0x1ad3d0['text']=_0x5c9aaf,_0x4c5d72['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x1ad3d0]}),{'view':_0x4c5d72,'highlightView':_0x1ad3d0};}_createSearchResultContentView(_0x146547,_0xb77c2a){const _0x55e9aa=new _0x56a514(this['locale']);return _0x55e9aa['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x146547,_0xb77c2a]}),_0x55e9aa;}_setupActionButtonExecution(_0xcb8c77,_0x3120e0,_0x4bd7fd){_0xcb8c77['on']('execute',()=>{_0xcb8c77['isEnabled']&&(_0x3120e0['editing']['view']['focus'](),_0x3120e0['commands']['execute']('aiQuickAction',_0x4bd7fd));});}_createActionGroupButton(_0x5ebcbf,_0xd93d7a,_0x2f6c3e){const _0x17d19a=new jt(this['locale']),_0x6bb792=new Ht(),_0x322530=new $a(this['locale'],_0x6bb792),_0x28024b=_0x322530['bindTemplate'],_0x77f89=this['_getPanelKeystroke'](_0x2f6c3e),_0x423678=this['_createGroupActionsList'](_0x5ebcbf,_0xd93d7a['actions'],_0x2f6c3e);_0x322530['set']({'label':_0xd93d7a['label'],'withText':!0x0,'role':Xa,'icon':_0xd93d7a['icon']??_0x10bb99,'isEnabled':_0xd93d7a['actions']['some'](_0x3dca56=>_0x3dca56['isEnabled'])}),_0x322530['extendTemplate']({'on':{'mouseenter':_0x28024b['to'](()=>{this['_isSearchFocused']()||_0x322530['focus']();})}});const _0x2fd790=new xt(this['locale']);return _0x2fd790['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x28024b['to'](_0x801451=>{this['_handlePanelKeydown'](_0x801451,_0x77f89,_0x322530,_0x2fd790);})}}),_0x322530['bind']('isOn')['to'](_0x2fd790,'isVisible'),this['_bodyCollection']['add'](_0x2fd790),_0x2fd790['content']['add'](_0x423678),this['_setupGroupMenuBehavior'](_0x322530,_0x2fd790),_0x17d19a['children']['add'](_0x322530),this['_actionButtons']['push']({'buttonView':_0x322530,'action':_0xd93d7a}),{'listItem':_0x17d19a,'highlightView':_0x6bb792};}_createGroupActionsList(_0x5bb7a9,_0x3754ed,_0x18c54a){const _0x4c7d9d=new Jt(this['locale']);return _0x4c7d9d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x3754ed['forEach'](_0xbfca94=>{const _0x2ee0b4=new jt(this['locale']),_0x2ba851=Ya({'editor':_0x5bb7a9,'action':_0xbfca94,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x2ee0b4['children']['add'](_0x2ba851),_0x18c54a['focusTracker']['add'](_0x2ba851),_0x4c7d9d['items']['add'](_0x2ee0b4);}),_0x4c7d9d;}_setupGroupMenuBehavior(_0x15af98,_0x17829c){const _0x265ab2=_0x15af98['bindTemplate'],_0x41f2c7=this['_getButtonKeystroke'](_0x15af98);_0x15af98['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x265ab2['to'](()=>{this['_showNestedPanel'](_0x17829c,_0x15af98);}),'mouseleave':_0x265ab2['to'](_0x2e9c47=>{const _0x4995d1=_0x2e9c47['relatedTarget'];this['_isMovingToNestedMenu'](_0x4995d1,_0x17829c)||this['_hideNestedPanel'](_0x17829c);}),'keydown':_0x265ab2['to'](_0x15e2bc=>{_0x15e2bc['key']==_0x41f2c7&&(this['_showNestedPanel'](_0x17829c,_0x15af98),_0x17829c['content']['get'](0x0)['focus']());})}}),_0x17829c['on']('render',()=>{_0x17829c['element']?.['addEventListener']('mouseleave',_0x4984ad=>{const _0xda9685=_0x4984ad['relatedTarget'];_0x15af98['element']?.['contains'](_0xda9685)||this['_isMovingToNestedMenu'](_0xda9685,_0x17829c)||this['_hideNestedPanel'](_0x17829c);});});}_showNestedPanel(_0x3a1c2d,_0x13a8e3){this['_openNestedPanels']['forEach'](_0x159f28=>{_0x159f28!==_0x3a1c2d&&_0x159f28['isVisible']&&_0x159f28['hide']();}),_0x3a1c2d['show'](),_0x3a1c2d['pin']({'positions':[Bt['eastSouth']],'target':_0x13a8e3['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3a1c2d);}_hideNestedPanel(_0xbb03c7){_0xbb03c7['hide'](),this['_openNestedPanels']['delete'](_0xbb03c7);}_hideAllNestedPanels(){this['_openNestedPanels']['forEach'](_0x572ada=>_0x572ada['hide']()),this['_openNestedPanels']['clear']();}_isMovingToNestedMenu(_0x4bb1a0,_0x415c0e){if(!_0x4bb1a0)return!0x1;if(_0x415c0e['element']?.['contains'](_0x4bb1a0))return!0x0;const _0x2f6ead=_0x4bb1a0;return _0x2f6ead['closest']&&(null!==_0x2f6ead['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x2f6ead['closest']('.ck-ai-quick-actions-group-list')||null!==_0x2f6ead['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(_0x415e42){return'rtl'===_0x415e42['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}_getButtonKeystroke(_0x4c915a){return'rtl'===_0x4c915a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x6ebbf4,_0x33e031,_0x2a5c3d,_0x1f7d03){_0x6ebbf4['key']==_0x33e031&&(_0x2a5c3d['focus'](),this['_hideNestedPanel'](_0x1f7d03));}_handleSearchResultButtonClick(_0x493578){_0x493578['fire']('execute');}};function ja(_0x3579d3){const {editor:_0x3c4cf0,content:_0x176e84,buttonDefinition:_0x156b3e,bodyCollection:_0x220de3,hasSearch:_0xa673a5=!0x1,actionButtons:_0x56321a}=_0x3579d3;return()=>{const _0x4a6dbc=_0x3c4cf0['locale'],_0x3c6858=_0x3c4cf0['commands']['get']('aiQuickAction'),_0x11bfaf=_0x48403c(_0x4a6dbc);_0x11bfaf['bind']('isEnabled')['to'](_0x3c6858),_0x11bfaf['buttonView']['set']({'icon':_0x156b3e['icon']??_0x10bb99,'label':_0x156b3e['label'],'tooltip':!0x0}),_0x11bfaf['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5d0968=new za(_0x3c4cf0,_0x176e84,_0x11bfaf,_0x220de3,_0xa673a5,_0x56321a);return _0x11bfaf['panelView']['children']['add'](_0x5d0968),_0xa673a5&&_0x11bfaf['on']('change:isOpen',(_0x49a005,_0x57e343,_0x95e8d8)=>{if(_0x95e8d8){if(_0x3c4cf0['plugins']['has']('AIEditing')){const _0x1630e0=_0x3c4cf0['plugins']['get'](tn),_0x228453=_0x3c4cf0['model']['document']['selection'],_0x3d7834=Array['from'](_0x228453['getRanges']());_0x3d7834['length']>0x0&&_0x1630e0['showFakeVisualSelection']({'editor':_0x3c4cf0,'ranges':_0x3d7834,'id':'quick-action','priority':0x14});}}else _0x3c4cf0['plugins']['has']('AIEditing')&&_0x3c4cf0['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x5d0968['resetSearch']();}),_0x11bfaf;};}const Ja='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Za='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',th='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',eh=/* #__PURE__ -- @preserve */
37
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());var ih=class AIQuickActionsUI extends _0x622916{_actionButtons=[];['_menuBarGroupViews']=[];_reporter;static get requires(){return[Lt,Is,Nn,fs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_reporter']=this['editor']['plugins']['get'](Nn)['createReporter']('aiquickactions');const _0x4ea121=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x4ea121),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static getDefaultQuickActions(_0x3412d6){return function(_0x3120f5){const _0x38a275=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x3120f5['uiLanguage'])||'English';return[{'id':'ask-ai','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x3bbd8f},{'id':'chat-commands','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x3bbd8f,'actions':[{'id':'explain','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Es(_0x3120f5,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ja['replace']('%0',_0x38a275),'type':'chat'},{'id':'summarize','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Es(_0x3120f5,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Za['replace']('%0',_0x38a275),'type':'chat'},{'id':'highlight-key-points','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Es(_0x3120f5,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':th['replace']('%0',_0x38a275),'type':'chat'}]},{'id':'improve-writing','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x448b65},{'id':'continue','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x123cf3},{'id':'fix-grammar','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x37ebe4},{'id':'adjust-length','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x55d620,'actions':[{'id':'make-shorter','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x173850,'actions':[{'id':'make-tone-casual','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x370c5b,'actions':[{'id':'translate-to-english','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x400907,'actions':[]}];}(_0x3412d6);}_getDefaultAndCustomActions(){const _0x4a177a=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0xc4d724=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x3ee4c4=>({..._0x3ee4c4,'type':'chat'===_0x3ee4c4['type']?'chat':'action','icon':void 0x0}));return _0x4a177a['find'](_0x3e7c54=>'other'===_0x3e7c54['id'])['actions']['push'](..._0xc4d724),_0x4a177a;}async _initActionTypeQuickActions(){try{const _0x51b7d4=this['editor']['plugins']['get'](fs),_0xaa284e=await _0x51b7d4['models']['getAllModels'](),_0x524d96=(await _0x51b7d4['models']['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x524d96),this['_enableButtonsByType']('action',_0x4cfde3=>!!_0xaa284e['find'](_0x5b9ef8=>_0x5b9ef8['id']===_0x4cfde3['model'])||void 0x0===_0x4cfde3['model']);}catch(_0x23e16d){const _0x14e380=new ct('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x23e16d});this['_reporter']['logError'](_0x14e380);}}_initChatTypeQuickActions(){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x44f888=this['editor']['plugins']['get']('AIChatController'),_0x428aa1=this['editor']['plugins']['has']('AIChatUI')?this['editor']['plugins']['get']('AIChatUI'):null;this['listenTo'](_0x44f888,'change:isConversationReady',(_0x34c892,_0x37385d,_0x50b109)=>{this['_enableButtonsByType']('chat',()=>_0x50b109&&!_0x428aa1?.['isBusy']);}),_0x428aa1&&this['listenTo'](_0x428aa1,'change:isBusy',(_0x56a3ba,_0x28551b,_0x55382a)=>{this['_enableButtonsByType']('chat',()=>_0x44f888['isConversationReady']&&!_0x55382a);}),this['_enableButtonsByType']('chat',()=>_0x44f888['isConversationReady']&&!_0x428aa1?.['isBusy']);}_enableButtonsByType(_0x2051f6,_0x5e368e){this['_quickActionsDefinition']['forEach'](_0x50b763=>{'actions'in _0x50b763?_0x50b763['actions']['forEach'](_0x5089da=>{_0x5089da['type']===_0x2051f6&&(_0x5089da['isEnabled']=_0x5e368e(_0x5089da));}):_0x50b763['type']===_0x2051f6&&(_0x50b763['isEnabled']=_0x5e368e(_0x50b763));}),this['_actionButtons']['forEach'](_0x363393=>{if(sh(_0x363393['action']))return;if(_0x363393['action']['type']!==_0x2051f6)return;const _0x56c10f=_0x5e368e(_0x363393['action']);if(_0x363393['action']['isEnabled']=_0x56c10f,_0x363393['buttonView']['isEnabled']=_0x56c10f,'action'===_0x2051f6&&!_0x56c10f&&_0x363393['action']['model']){const _0x1af1c9=new ct('ai-quick-actions-unavailable-model',this,{'actionId':_0x363393['action']['id'],'modelId':_0x363393['action']['model']});this['_reporter']['logError'](_0x1af1c9);}}),this['_actionButtons']['filter'](_0x2f14ce=>sh(_0x2f14ce['action']))['forEach'](_0x2fa562=>{_0x2fa562['buttonView']['isEnabled']=_0x2fa562['action']['actions']['some'](_0x5c1c45=>_0x5c1c45['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x415565,group:_0x1ab1fc})=>{_0x415565['isEnabled']=_0x1ab1fc['actions']['some'](_0x4e06ed=>_0x4e06ed['isEnabled']);});}_enableButtonById(_0x338d45,_0x2e97e8){this['_quickActionsDefinition']['forEach'](_0x27fe5c=>{'actions'in _0x27fe5c?_0x27fe5c['actions']['forEach'](_0x227786=>{_0x227786['id']===_0x338d45&&(_0x227786['isEnabled']=_0x2e97e8(_0x227786));}):_0x27fe5c['id']===_0x338d45&&(_0x27fe5c['isEnabled']=_0x2e97e8(_0x27fe5c));}),this['_actionButtons']['forEach'](_0xe8b6bb=>{if(sh(_0xe8b6bb['action']))return;if(_0xe8b6bb['action']['id']!==_0x338d45)return;const _0x232f78=_0x2e97e8(_0xe8b6bb['action']);_0xe8b6bb['action']['isEnabled']=_0x232f78,_0xe8b6bb['buttonView']['isEnabled']=_0x232f78;});}_assignDefaultModelToCustomActions(_0x6f6faa){this['_actionButtons']['forEach'](_0x4add1f=>{sh(_0x4add1f['action'])||'action'===_0x4add1f['action']['type']&&(_0x4add1f['action']['model']||(_0x4add1f['action']['model']=_0x6f6faa));});}_initializeQuickActionsComponentsAndCommands(){const _0x56655e=new Pt(this['editor']['locale']);_0x56655e['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x56655e),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x56655e);}_initializeQuickActionsDropdown(_0x85deb8){const _0x397962=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ja({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x10bb99,'label':Es(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x85deb8,'hasSearch':_0x397962,'actionButtons':this['_actionButtons']}));}_prepareQuickActionsDefinition(_0x24925f){this['_quickActionsDefinition']=_0x24925f['map'](_0x5a5c87=>{if('actions'in _0x5a5c87){const _0x332b5f=_0x5a5c87;return{..._0x332b5f,'actions':_0x332b5f['actions']['map'](_0x3311aa=>{const {actions:_0x274718,..._0x51d49c}=_0x332b5f;return{..._0x3311aa,'isEnabled':!0x1,'parent':_0x51d49c};})['filter'](_0x15061f=>this['_shouldIncludeAction'](_0x15061f))};}return{..._0x5a5c87,'isEnabled':!0x1};})['filter'](_0x36170c=>'actions'in _0x36170c?_0x36170c['actions']['length']>0x0:this['_shouldIncludeAction'](_0x36170c));}_shouldIncludeAction(_0x45418e){const _0x2a217c=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](eh[_0x45418e['type']])&&!_0x2a217c['includes'](_0x45418e['id'])&&!('chat'===_0x45418e['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}_initializeQuickActionsComponents(_0x2f4a64){this['_quickActionsDefinition']['forEach'](_0x1e7500=>{if('actions'in _0x1e7500){const _0x47de0e=ja({'editor':this['editor'],'content':_0x1e7500['actions'],'buttonDefinition':_0x1e7500,'bodyCollection':_0x2f4a64,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x1e7500['id'],_0x47de0e),_0x1e7500['actions']['forEach'](_0x3d5b02=>{const _0x195944=Ya({'editor':this['editor'],'action':_0x3d5b02,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x3d5b02['id'],_0x195944);});}else{const _0x21fafb=Ya({'editor':this['editor'],'action':_0x1e7500,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x1e7500['id'],_0x21fafb);}});}_initializeQuickActionsMenuBar(){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x35e3e1=>{const _0x48303f=this['editor']['commands']['get']('aiQuickAction'),_0x5716ff=new _0x1021d4(_0x35e3e1),_0x1f010c=Es(_0x35e3e1,'AI_QUICK_ACTIONS_HEADING');_0x5716ff['buttonView']['set']({'label':_0x1f010c,'icon':_0x10bb99});const _0x512274=new _0x14eb7a(_0x35e3e1);return _0x512274['set']({'ariaLabel':_0x1f010c,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2a3a2d=>{if('actions'in _0x2a3a2d){const _0x2962ee=_0x2a3a2d,_0x386eff=new te(_0x35e3e1,_0x5716ff),_0x171b3c=new _0x1021d4(_0x35e3e1),_0x1d5ced=new _0x14eb7a(_0x35e3e1);_0x171b3c['buttonView']['set']({'label':_0x2962ee['label'],'icon':_0x2962ee['icon']}),_0x2962ee['actions']['forEach'](_0xede260=>{const _0x40dcf1=new te(_0x35e3e1,_0x171b3c),_0x3b523f=new Zt(_0x35e3e1);_0x3b523f['set']({'label':_0xede260['label'],'icon':_0xede260['icon'],'role':'menuitem','isEnabled':_0xede260['isEnabled']}),_0x3b523f['on']('execute',()=>{this['_executeQuickAction'](_0xede260);}),this['_actionButtons']['push']({'buttonView':_0x3b523f,'action':_0xede260}),_0x3b523f['delegate']('execute')['to'](_0x171b3c),_0x40dcf1['children']['add'](_0x3b523f),_0x1d5ced['items']['add'](_0x40dcf1);}),_0x171b3c['isEnabled']=_0x2962ee['actions']['some'](_0x286eb2=>_0x286eb2['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x171b3c,'group':_0x2962ee}),_0x171b3c['panelView']['children']['add'](_0x1d5ced),_0x386eff['children']['add'](_0x171b3c),_0x512274['items']['add'](_0x386eff);}else{const _0x9d212c=_0x2a3a2d,_0x4ede87=new te(_0x35e3e1,_0x5716ff),_0x3d5977=new Zt(_0x35e3e1);_0x3d5977['set']({'label':_0x9d212c['label'],'icon':_0x9d212c['icon'],'role':'menuitem','isEnabled':_0x9d212c['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x3d5977,'action':_0x9d212c}),_0x3d5977['on']('execute',()=>{this['_executeQuickAction'](_0x9d212c);}),_0x3d5977['delegate']('execute')['to'](_0x5716ff),_0x4ede87['children']['add'](_0x3d5977),_0x512274['items']['add'](_0x4ede87);}}),Object['values'](eh)['some'](_0x5452fa=>this['editor']['plugins']['has'](_0x5452fa))?_0x5716ff['bind']('isEnabled')['to'](_0x48303f):_0x5716ff['set']({'isEnabled':!0x1}),_0x5716ff['panelView']['children']['add'](_0x512274),_0x5716ff;});}_executeQuickAction(_0x46e9e4){const _0x2f904c=this['editor'];_0x2f904c['editing']['view']['focus'](),_0x2f904c['commands']['execute']('aiQuickAction',_0x46e9e4);const _0x51f20f=_0x2f904c['ui']['view']['menuBarView'];_0x51f20f&&_0x51f20f['close']&&_0x51f20f['close']();}};function sh(_0x4b875b){return'actions'in _0x4b875b;}function nh(_0x20d778,_0x36902b){const _0x2b5a4a=_0x20d778['plugins']['get']('AITabs')['view'];_0x2b5a4a['isVisible']=!0x0,_0x2b5a4a['activateTab'](_0x36902b);}var rh=class extends _0x23b7b0{execute(_0x5997a8){switch(this['_expandSelectionIfCollapsed'](),_0x5997a8['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x3446c3=Es(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ct('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3446c3});}this['_handleAIChatAction'](_0x5997a8);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x2d2fd6=Es(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ct('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2d2fd6});}this['_handleAIActionsAction'](_0x5997a8);}}async _handleAIChatAction(_0x14ac08){const _0x4f27ad=this['editor']['plugins']['get']('AIChatController');if(nh(this['editor'],'chat'),'ask-ai'===_0x14ac08['id'])_0x4f27ad['removeSelectionFromChatContext'](),_0x4f27ad['addSelectionToChatContext'](this['editor']),_0x4f27ad['focusPromptInput']();else await _0x4f27ad['startConversation']({'modelId':_0x14ac08['model'],'contexts':this['_resolveActionContexts'](_0x14ac08)}),_0x4f27ad['removeSelectionFromChatContext'](),_0x4f27ad['addSelectionToChatContext'](this['editor']),_0x4f27ad['focusPromptInput'](),await _0x4f27ad['sendMessage']({'message':_0x14ac08['prompt']||_0x14ac08['displayedPrompt']||_0x14ac08['label'],'attributes':{'quickActionData':{'id':_0x14ac08['id']},'displayedPrompt':_0x14ac08['displayedPrompt']}});}_expandSelectionIfCollapsed(){const _0x3a08ba=this['editor'],_0x5aff8c=_0x3a08ba['model']['document']['selection'];if(!_0x5aff8c['isCollapsed'])return;const _0x15ed9a=mt(_0x5aff8c['getSelectedBlocks']())||_0x3a08ba['model']['schema']['getLimitElement'](_0x5aff8c);_0x3a08ba['model']['change'](_0x4c759c=>{_0x4c759c['setSelection'](_0x15ed9a,'in');});}_handleAIActionsActionLabel(_0x16ad50){return _0x16ad50['parent']?.['label']&&'other'!==_0x16ad50['parent']?.['id']?_0x16ad50['parent']['label']+':\x20'+_0x16ad50['label']:_0x16ad50['label'];}async _handleAIActionsAction(_0x5ab438){const _0x553d30=this['editor']['plugins']['get']('AIActions'),_0x3c3ff3=this['_resolveActionContexts'](_0x5ab438);let _0x24bd25;_0x24bd25=_0x5ab438['prompt']?{'userMessage':_0x5ab438['prompt'],'model':_0x5ab438['model'],'contexts':_0x3c3ff3}:_0x5ab438['context']?{'model':_0x5ab438['model'],'contexts':_0x3c3ff3}:{'actionName':_0x5ab438['actionName']||_0x5ab438['id'],'args':_0x5ab438['args'],'contexts':_0x3c3ff3};const _0x84589f=this['_handleAIActionsActionLabel'](_0x5ab438);await _0x553d30['executeAction'](_0x24bd25,_0x84589f,_0x5ab438['icon']);}_resolveActionContexts(_0x517f49){const _0x2f6c5e=_0x517f49['parent']?.['id']?[_0x517f49['id'],_0x517f49['parent']['id']]:[_0x517f49['id']];return this['editor']['plugins']['get'](fs)['contextLibrary']['resolveContext']({'feature':'quickActions','ids':_0x2f6c5e,'extraContexts':_0x517f49['context']?[_0x517f49['context']]:[],'context':new Yn()})['refs'];}},oh=class extends _0x622916{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5e72ff=this['editor'],_0xe57c98=new rh(this['editor']);if(_0x5e72ff['commands']['add']('aiQuickAction',_0xe57c98),_0x5e72ff['plugins']['has']('AIChat')){const _0x4c9777=this['editor']['plugins']['get']('AIChatController');_0x5e72ff['model']['document']['selection']['on']('change:range',(_0x4940e7,_0x32c933)=>{_0x32c933['directChange']&&_0x4c9777['removeSelectionFromChatContext']();});}}},ah=class extends Vn{appendContent(_0x55ac55,_0xba8aad='text'){'modification'===this['type']&&'text'===_0xba8aad&&(_0xba8aad=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x55ac55,_0xba8aad);}updateChangeGroups(_0x4d6874){const _0x42c505=this['parsedContent']['get'](_0x4d6874)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x4d6874,_0x42c505),this['changeGroups']=[],0x0==_0x42c505['childNodes']['length'])return;on(this['documentContextContent']['get'](_0x4d6874),this['parsedMergedContent']['get'](_0x4d6874));const _0x468541=_0x11f069(this['documentContextContent']['get'](_0x4d6874)['children']['map'](_0x2674e1=>({'node':_0x2674e1,'id':Ps(_0x2674e1,'data-id')})),_0x42c505['children']['map'](_0x48d21e=>({'node':_0x48d21e,'id':Ps(_0x48d21e,'data-id')||kt()})),{'comparator':(_0x52a1b8,_0x11c41c)=>_0x52a1b8['id']==_0x11c41c['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x468541['length']&&_0x468541[_0x468541['length']-0x1]['removed'];)_0x468541['pop']();}const _0x29d600=_0x468541['map'](_0x16f2cd=>{const _0x24db9b=_0x16f2cd['added']?'new':_0x16f2cd['removed']?'removed':'modified';return{'node':_0x16f2cd['value'][0x0]['node'],'type':_0x24db9b,'id':_0x16f2cd['value'][0x0]['id']};}),_0x5317f3=this['_documentIdToSource']['get'](_0x4d6874);this['changeGroups']['push']({'changes':_0x29d600,'state':'pending','index':this['changeGroups']['length'],'editor':_0x5317f3['editor'],'rootName':_0x5317f3['rootName'],'documentId':_0x4d6874});}_getDifferentChangeGroups(_0x4da7c2,_0x5ddb81){return _0x5ddb81;}},hh=class extends Fn{content;['version'];editor;rootName;actionName;['args'];['userMessage'];['model'];contexts;['hasError']=!0x1;stoppedExplicitly=!0x1;constructor(_0x3d2723){super(_0x3d2723),this['content']=_0x3d2723['content'],this['version']=_0x3d2723['version'],this['editor']=_0x3d2723['editor'],this['rootName']=_0x3d2723['rootName'],this['actionName']=_0x3d2723['actionName'],this['args']=_0x3d2723['args'],this['userMessage']=_0x3d2723['userMessage'],this['model']=_0x3d2723['model'],this['contexts']=_0x3d2723['contexts'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}sendRequest(){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args'],'contexts':this['contexts']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html','contexts':this['contexts']});}getDocumentContext(){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':kt(),'channelId':this['editor']['config']['get']('collaboration.channelId'),'selectionSignature':''}],'label':'Current\x20document','uiId':'current-document'};}createReply(_0x39ef90){const _0x1bf7eb=this['editor']['config']['get']('collaboration.channelId'),_0x25a6a4=new ah({..._0x39ef90,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x1bf7eb,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x1bf7eb,this['editor']]])});return this['replies']['push'](_0x25a6a4),_0x25a6a4['delegate'](...Gn)['to'](this),this['fire']('replyCreated',_0x25a6a4),_0x25a6a4;}},ch=class extends _0x54b9b5{constructor(_0x5baacd,_0x5d48b9=!0x0,_0x1cebb1=!0x0){super(_0x5baacd),this['set']('isEnabled',!0x1),_0x5d48b9&&(this['applyButton']=this['_createButton'](Es(_0x5baacd,'AI_BALLOON_APPLY_BUTTON'),Ln),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x1cebb1&&(this['suggestButton']=this['_createButton'](Es(_0x5baacd,'AI_BALLOON_SUGGEST_BUTTON'),_0x5d48b9?Pn:Ln),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x5d48b9,'showSuggestButton':_0x1cebb1}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}setButtonsVisibility({showApplyButton:_0x31ceff,showSuggestButton:_0x319095}){this['applyButton']&&(this['applyButton']['isVisible']=_0x31ceff),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x319095);}_createButton(_0x398e6c,_0x2125e6){const _0xf1eac4=new Mt(this['locale']);return _0xf1eac4['set']({'label':_0x398e6c,'class':_0x2125e6,'isVisible':!0x0,'withText':!0x0}),_0xf1eac4;}},lh=class extends _0x56a514{constructor(_0x27c1b4){super(_0x27c1b4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Es(_0x27c1b4,'AI_DISCLAIMER_TEXT')}]}]});}},uh=class extends _0x56a514{constructor(_0x17ae46){super(_0x17ae46),this['set']('isVisible',!0x0);const _0x10ad56=new Dr('small');_0x10ad56['isVisible']=!0x0;const _0x190335=new _0x56a514(this['locale']);_0x190335['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Es(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x4935a1=>!_0x4935a1)]},'children':[_0x10ad56,_0x190335]});}},dh=class extends Ma{['focusCycler'];['_config'];_contentWrapper;_streamableContentView;_toolbarView;['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];_keystrokes;_dialogContent;['_focusables'];['_scrollManager'];['_miniToolbarResizeObserver'];_navigationPreviousButton;_navigationNextButton;_navigationTryAgainButton;_navigationCounter;constructor(_0x29f4b4,_0x4809c5){super(_0x29f4b4),this['set']('isBusy',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4809c5,this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x93f04d(),this['_addContentWrapper'](_0x4809c5),this['_addDisclaimerView'](),this['_addToolbar'](_0x4809c5),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x4809c5);}),this['on']('render',()=>{this['_setupMiniToolbarPositioning']();});}['render'](){super['render']();for(const _0x25529b of this['_focusables'])this['_focusTracker']['add'](_0x25529b['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}destroy(){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy'](),this['_miniToolbarResizeObserver']&&this['_miniToolbarResizeObserver']['destroy']();}['focus'](_0x3e9ec1){-0x1===_0x3e9ec1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}setIsLoading(_0x3b33b5){this['_isLoading']=_0x3b33b5;}setErrorState(){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}clearErrorState(){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x4a8538){super['showError'](_0x4a8538),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3c7777){super['showBlockingError'](_0x3c7777),this['setErrorState']();}addMiniToolbarItem(_0x151333){this['_miniToolbarView']['items']['has'](_0x151333)||this['_miniToolbarView']['items']['add'](_0x151333);}removeMiniToolbarItem(_0x37d1fb){this['_miniToolbarView']['items']['has'](_0x37d1fb)&&this['_miniToolbarView']['items']['remove'](_0x37d1fb);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}_toggleToolbarButtonsVisibility({showApplyButton:_0x226a74,showSuggestButton:_0x162504}){_0x226a74=_0x226a74&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x162504=_0x162504&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x226a74,'showSuggestButton':_0x162504});}async updateContent(_0x245b25){await this['_streamableContentView']['update'](_0x245b25);}finalizeContent(){this['_streamableContentView']['cleanUpStreamingArtifacts']();}clearContent(){this['_streamableContentView']['clear']();}_addContentWrapper(_0x56e833){this['_contentWrapper']=new _0x56a514(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content',this['bindTemplate']['if']('_isErrorVisible','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x56e833['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new lh(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x46b71f,showSuggestButton:_0x226e4f}){this['_toolbarView']=new ch(this['locale'],_0x46b71f,_0x226e4f),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',this,'isTargetReadOnly',(_0x514aeb,_0x58bbce,_0x5cc2ca,_0x145ce5)=>!(_0x514aeb||_0x58bbce||_0x5cc2ca||_0x145ce5)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x46b71f,'showSuggestButton':_0x226e4f}),this['_dialogContent']['add'](this['_toolbarView']);}_createMiniToolbar(_0x561f1b){return this['_miniToolbarView']=new Ba(this['locale'],_0x561f1b),this['_miniToolbarView']['delegate'](...ir)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x34e9e8,_0x155a04)=>!(_0x34e9e8||_0x155a04)),this['_miniToolbarView'];}_createLoaderView(){return this['_loaderView']=new uh(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}_createStreamableContentView(){return this['_streamableContentView']=new mr(this['locale']),this['_streamableContentView'];}_setupMiniToolbarButtons(){const _0x5e5609=new Mt(this['locale']),_0x13fc22=new Mt(this['locale']),_0x3f8535=new _h(this['locale']),_0x332e1e=new Mt(this['locale']);_0x5e5609['set']({'icon':_0x184821,'label':Es(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Dn}),_0x13fc22['set']({'icon':_0xd78e92,'tooltip':Es(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Dn}),_0x332e1e['set']({'icon':_0x57e767,'tooltip':Es(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Dn}),_0x5e5609['bind']('isEnabled')['to'](this,'isBusy',_0x5f1cd1=>!_0x5f1cd1),_0x5e5609['on']('execute',()=>{this['fire']('tryAgain');}),_0x13fc22['bind']('isEnabled')['to'](this,'isBusy',_0x5e4d03=>!_0x5e4d03),_0x13fc22['on']('execute',()=>{this['fire']('showPrevious');}),_0x332e1e['bind']('isEnabled')['to'](this,'isBusy',_0xa554e2=>!_0xa554e2),_0x332e1e['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x13fc22,this['_navigationCounter']=_0x3f8535,this['_navigationNextButton']=_0x332e1e,this['_navigationTryAgainButton']=_0x5e5609;}updateMiniToolbarButtons(_0x1a1ecc,_0x1f4a32){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x5ce479=_0x1a1ecc>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x5ce479){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x14f9ae=_0x1a1ecc-_0x1f4a32;this['_navigationCounter']['setInteractionCount'](_0x14f9ae+'/'+_0x1a1ecc),this['_navigationPreviousButton']['isEnabled']=_0x1f4a32<_0x1a1ecc-0x1,this['_navigationNextButton']['isEnabled']=_0x1f4a32>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}disableMiniToolbarButtons(){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}startAutoScroll(){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}stopAutoScroll(){this['_scrollManager']&&this['_scrollManager']['stop']();}toggleIsLoading(_0x31a424){this['_isLoading']=_0x31a424;}resetShowChangesButton(){this['_miniToolbarView']['isShowChangesOn']=!0x1;}_setupMiniToolbarPositioning(){const _0x2fa425=this['_streamableContentView']['element'],_0x495a6a=this['_miniToolbarView']['element'],_0x1dd73f=()=>{wt['window']['requestAnimationFrame'](()=>{const _0x4e9c24=_0x2fa425['offsetWidth']-_0x2fa425['clientWidth'];_0x495a6a['style']['right']='calc('+_0x4e9c24+'px\x20+\x20var(--ck-spacing-large))';});};_0x1dd73f(),this['_miniToolbarResizeObserver']=new pt(_0x2fa425,()=>{_0x1dd73f();});}_initializeScrollManager(){const _0x5ed185=this['_getScrollableElement']();_0x5ed185&&!this['_scrollManager']&&(this['_scrollManager']=new ao(_0x5ed185));}_getScrollableElement(){return this['_streamableContentView']['element'];}},_h=class extends _0x56a514{constructor(_0x4ea744){super(_0x4ea744);const _0x4ff7db=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x4ff7db['to']('interactionCount')}]});}setInteractionCount(_0x1cd175){this['set']('interactionCount',_0x1cd175);}},gh=class extends _0x622916{static get requires(){return[Is,Nn,Ut,tn,Va,_0x45dea0];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_aiConnector;_interactions=[];_currentInteractionIndex=0x0;_interactionParams;['_balloonShowDiff']=!0x1;['_promiseQueue'];get _interaction(){return this['_interactions'][this['_interactions']['length']-0x1];}_actionsBalloonView;_reporter;constructor(_0x38f0b7){super(_0x38f0b7),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](Nn)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Sr();}stopInteraction(){this['_stopInteraction']();}async executeAction(_0x3d0ea0,_0x15ce3c,_0x282296){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x219dfc,anchorData:_0x1503f5,root:_0x57ea0c}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3d0ea0,_0x219dfc,_0x1503f5,_0x57ea0c,_0x15ce3c,_0x282296);}const {modelFragment:_0x32168b,anchorData:_0x2dd88e,root:_0x3fe69d}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3d0ea0,_0x32168b,_0x2dd88e,_0x3fe69d,_0x15ce3c,_0x282296);}async destroy(){return this['_stopInteraction'](),super['destroy']();}_createActionsBalloonView(){const _0x4372a4=this['editor']['plugins']['has']('TrackChanges');let _0x44fb79=this['editor']['config']['get']('ai.availableReplyActions')||[...Or];_0x4372a4||(_0x44fb79=_0x44fb79['filter'](_0x1ced20=>'insertSuggestion'!=_0x1ced20));const _0x537a99=this['editor']['commands']['get']('trackChanges'),_0x56e6ef=new dh(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x4372a4,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x44fb79});return _0x56e6ef['bind']('isBusy')['to'](this),_0x56e6ef['bind']('isTargetReadOnly')['to'](this['editor'],'isReadOnly'),_0x537a99&&_0x56e6ef['bind']('isTrackChangesOn')['to'](_0x537a99,'value'),_0x56e6ef['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x56e6ef['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x56e6ef['on']('showNext',()=>{this['_navigateToNext']();}),_0x56e6ef;}_normalizeSelectionStart(){const _0x3c6c1c=this['editor']['model'],_0x2cd6ee=_0x3c6c1c['document']['selection'],_0x331cc7=_0x2cd6ee['getFirstRange']();if(!_0x331cc7||_0x331cc7['isCollapsed'])return;const _0x36a804=mt(_0x2cd6ee['getSelectedBlocks']());if(!_0x36a804)return;const _0x5a83f7=_0x3c6c1c['createPositionAt'](_0x36a804,0x0);_0x5a83f7['isAfter'](_0x331cc7['start'])&&_0x3c6c1c['change'](_0x898da2=>{_0x898da2['setSelection'](_0x898da2['createRange'](_0x5a83f7,_0x331cc7['end']));});}_getExecuteDataRegular(){const _0x233489=this['editor']['model']['document']['selection'],_0x46637e=_0x233489['getFirstRange']()['start']['root'];if(_0x233489['isCollapsed']){const _0x2dd185=mt(_0x233489['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x233489);this['editor']['model']['change'](_0x2e5151=>{_0x2e5151['setSelection'](_0x2dd185,'in');});}this['_normalizeSelectionStart']();const _0x34f2c9=_0x233489['getFirstRange'](),_0x366101=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x233489),_0x34f2c9['start'],_0x34f2c9['end']);this['_copyMarkersToFragment'](_0x366101,_0x233489,{'isTableSelection':!0x1});const _0x2660c6=_0x233489['getFirstRange']()['start'],_0x169669=new Map();let _0x339b72=_0x366101;for(let _0x92ba67=0x0;_0x92ba67<_0x2660c6['path']['length'];_0x92ba67++)_0x169669['set'](_0x339b72,_0x2660c6['path'][_0x92ba67]),_0x339b72=_0x339b72['getChild'](0x0);return{'modelFragment':_0x366101,'anchorData':_0x169669,'root':_0x46637e};}_getExecuteDataInTable(){const _0x4c6d59=this['editor']['model']['document']['selection'],_0x2a8ff9=this['editor']['plugins']['get']('TableSelection'),_0x204bd0=_0x4c6d59['getFirstRange']()['start']['root'],_0x2a2827=_0x2a8ff9['getSelectionAsFragment'](),_0x2d37a1=_0x4c6d59['getFirstRange']()['start']['parent']['parent'],_0x14f430=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2d37a1),this['editor']['model']['createPositionAfter'](_0x2d37a1)),_0x4ce7cb=this['_wrapWithCommonAncestors'](_0x2a2827,_0x14f430['start'],_0x14f430['end']);this['_copyMarkersToFragment'](_0x4ce7cb,_0x4c6d59,{'isTableSelection':!0x0});const _0x2a5271=_0x4c6d59['getFirstRange']()['start'],_0x3df788=new Map();let _0x5e0a88=_0x4ce7cb;for(let _0x298073=0x0;_0x298073<_0x2a5271['path']['length'];_0x298073++)if(_0x3df788['set'](_0x5e0a88,_0x2a5271['path'][_0x298073]),_0x298073<_0x2a5271['path']['length']-0x1)_0x5e0a88=_0x5e0a88['getChild'](0x0);else{let _0x35a89d=_0x5e0a88['nextSibling'];for(;_0x35a89d;)_0x3df788['set'](_0x35a89d,_0x2a5271['path'][_0x298073]),_0x35a89d=_0x35a89d['nextSibling'];}return{'modelFragment':_0x4ce7cb,'anchorData':_0x3df788,'root':_0x204bd0};}async _executeAction(_0x56058d,_0x185282,_0x5b5fd9,_0x4bfd87,_0x3da008,_0x187ca7){const _0x379ac2=this['editor']['plugins']['get'](tn),_0xbd967d=this['editor']['plugins']['get'](Va),_0x149c2f=this['editor']['model']['document']['selection'],_0x4a1f09=await _0x379ac2['modelToDataWithIds'](_0x185282,this['editor'],_0x4bfd87['rootName']),_0x291186=this['editor']['model']['document']['version'],_0x4176fe=[..._0x149c2f['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0xbd967d['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x3da008,'icon':_0x187ca7||_0x10bb99,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4176fe,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xbd967d),this['_interactionParams']={'action':_0x56058d,'content':_0x4a1f09,'version':_0x291186,'aiBalloon':_0xbd967d,'modelFragment':_0x185282,'anchorData':_0x5b5fd9,'root':_0x4bfd87},this['_setupApplyListeners'](),this['listenTo'](_0xbd967d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xbd967d,'dialogClosed',(_0x67eab2,{id:_0x3c8fa3})=>{if('aiActionsBalloon'===_0x3c8fa3){for(const _0x482d8f of this['_interactions']){if(0x0===_0x482d8f['replies']['length']||_0x482d8f['stoppedExplicitly'])continue;const _0x3bf97c=_0x482d8f['replies'][_0x482d8f['replies']['length']-0x1],_0xa5bcf6=_0x3bf97c['changeGroups'][0x0];_0xa5bcf6&&'pending'===_0xa5bcf6['state']&&_0x3bf97c['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xbd967d);}}),this['_createInteraction'](_0x4a1f09,_0x291186,_0xbd967d,_0x56058d);}_setupApplyListeners(){if(!this['_interactionParams'])return;const {modelFragment:_0x541465,anchorData:_0x3cf601,root:_0x3b8c72}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x541465,_0x3cf601,_0x3b8c72,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x541465,_0x3cf601,_0x3b8c72,!0x0);});}_wrapWithCommonAncestors(_0x453833,_0x51eff8,_0x30fd03){const _0x56c380=this['editor']['model']['createRange'](_0x51eff8,_0x30fd03)['getCommonAncestor'](),_0x4cfd86=_0x56c380['is']('documentFragment')?[]:_0x56c380['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4cfd86['length']){const _0x2b3bc1=_0x4cfd86['map'](_0x2ef266=>_0x2ef266['_clone'](!0x1));for(let _0x5d9e76=0x1;_0x5d9e76<_0x2b3bc1['length'];_0x5d9e76++)_0x2b3bc1[_0x5d9e76-0x1]['_appendChild'](_0x2b3bc1[_0x5d9e76]);return _0x2b3bc1[_0x2b3bc1['length']-0x1]['_appendChild'](_0x453833),new _0x28e306(_0x2b3bc1[0x0]);}return _0x453833;}_copyMarkersToFragment(_0x5f410c,_0x249db8,_0x619476={'isTableSelection':!0x1}){const _0x50f325=this['editor']['model'],_0x1a82c5=Array['from'](_0x249db8['getRanges']()),_0x2ad917=_0x249db8['getFirstRange']()['start'];for(const _0x56cb83 of _0x50f325['markers']){if(_0x56cb83['name']['startsWith']('ai-selection')||!_0x56cb83['affectsData'])continue;const _0x36b961=_0x56cb83['getRange']();if(!_0x1a82c5['some'](_0x447767=>_0x447767['containsRange'](_0x36b961,!0x0)))continue;const _0x8bc5f5=this['_regularCalculateMarkerPath'](_0x36b961['start'],_0x2ad917,_0x619476['isTableSelection']),_0x3befe6=this['_regularCalculateMarkerPath'](_0x36b961['end'],_0x2ad917,_0x619476['isTableSelection']),_0x1da471=_0x50f325['createPositionFromPath'](_0x5f410c,_0x8bc5f5),_0x1169ac=_0x50f325['createPositionFromPath'](_0x5f410c,_0x3befe6);if(!_0x1da471['isEqual'](_0x1169ac)){const _0x47189=_0x50f325['createRange'](_0x1da471,_0x1169ac);_0x5f410c['markers']['set'](_0x56cb83['name'],_0x47189);}}}_regularCalculateMarkerPath(_0xa6c6c5,_0x485b15,_0x1c2dce=!0x1){const _0x443676=[..._0xa6c6c5['path']['slice']()];for(let _0x54d2e2=0x0;_0x54d2e2<Math['max'](_0x485b15['path']['length'],_0xa6c6c5['path']['length']);_0x54d2e2++){const _0x3304b4=_0x485b15['path'][_0x54d2e2]||0x0,_0x522f5c=(_0xa6c6c5['path'][_0x54d2e2]||0x0)-_0x3304b4;if(_0x443676[_0x54d2e2]=_0x522f5c,0x0!==_0x522f5c&&!_0x1c2dce)break;}return _0x443676;}async _createInteraction(_0x2f0fda,_0x3d4302,_0x49fee9,_0x343cc3){const _0x52b1f1=this['editor'],_0x42abea=_0x52b1f1['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x343cc3,'content':_0x2f0fda,'version':_0x3d4302,'aiBalloon':_0x49fee9,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x42abea});const _0x300a11=new hh({'connector':this['_aiConnector'],'locale':_0x52b1f1['locale'],'content':_0x2f0fda,'version':_0x3d4302,'editor':_0x52b1f1,'rootName':_0x42abea['rootName'],..._0x343cc3});this['_interactions']['push'](_0x300a11);const _0x230401=(_0x5bb23c,_0x37da5d=!0x1,_0x316c72='streaming')=>{const {isDone:_0x343209}=_0x5bb23c;return this['_promiseQueue']['enqueue'](async _0x1f34ef=>{try{if(this['_isUnsupportedInlineRootChange'](_0x5bb23c,_0x42abea))return this['_actionsBalloonView']['showBlockingError'](Es(_0x52b1f1['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),void(_0x343209&&this['_actionsBalloonView']['finalizeContent']());const _0x492aac=ln({'changeGroups':_0x5bb23c['changeGroups'],'documentContextContent':_0x5bb23c['documentContextContent'],'showDiff':_0x37da5d,'trimUnchanged':!0x1});_0x492aac['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x492aac[0x0],'renderingStrategy':_0x316c72,'abortSignal':_0x1f34ef}),_0x343209&&this['_actionsBalloonView']['finalizeContent']();}catch(_0x4181b1){if(kn(_0x4181b1))return;throw _0x4181b1;}});};_0x300a11['on']('replyCreated',(_0x343200,_0x4886bf)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x230401(_0x4886bf)['catch'](_0x27ae4d=>{this['_reporter']['logError'](_0x27ae4d,{'context':{'operation':'reply-create'}}),this['_setErrorState'](_0x300a11,_0x27ae4d);});}),_0x300a11['on']('replyContentUpdated',(_0x1fb402,_0x372151)=>{_0x230401(_0x372151)['catch'](_0x410400=>{this['_reporter']['logError'](_0x410400,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0x300a11,_0x410400);});}),_0x300a11['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5b7c47){this['_reporter']['logError'](_0x5b7c47,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0x300a11,_0x5b7c47);}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1bb6d3,{showDiff:_0x342d1a})=>{try{this['_balloonShowDiff']=_0x342d1a;const _0x379a68=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x379a68&&await _0x230401(_0x379a68,_0x342d1a,'static');}catch(_0x8b874e){this['_reporter']['logError'](_0x8b874e,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0x300a11,_0x8b874e);}}),_0x300a11['on']('replyChangeGroupStateUpdated',()=>{const _0x653281={'positiveCount':_0x300a11['replies']['reduce']((_0xf681c2,_0x2c3641)=>_0xf681c2+_0x2c3641['changeGroups']['filter'](_0x498c37=>'accepted'===_0x498c37['state'])['length'],0x0),'totalCount':_0x300a11['replies']['reduce']((_0x2845f3,_0x26a966)=>_0x2845f3+_0x26a966['changeGroups']['length'],0x0)},_0x3c3606=_0x300a11['actionCallId'],_0x261969=_0x300a11['actionName'];_0x261969?this['_aiConnector']['upsertAIActionRating'](_0x261969,_0x3c3606,_0x653281):this['_aiConnector']['upsertCustomAIActionRating'](_0x3c3606,_0x653281);}),this['_setLoadingState']();try{const _0x3585b5=await _0x300a11['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3585b5;}catch(_0x4f7d08){kn(_0x4f7d08)||this['_actionsBalloonView']['hideLoader'](),this['_reporter']['logError'](_0x4f7d08,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0x300a11,_0x4f7d08);}}_isUnsupportedInlineRootChange(_0xf48f2e,_0x346a0b){const _0x47e0f8=this['editor'];return!!Gs(_0x47e0f8,_0x346a0b['rootName'])&&!Ys(_0x47e0f8,new _0x139fbf((_0xf48f2e['changeGroups'][0x0]?.['changes']??[])['filter'](_0x965914=>'removed'!==_0x965914['type'])['map'](_0x305736=>_0x305736['node']['cloneNode'](!0x0))));}['_applyChanges'](_0x5d74b1,_0x392ee1,_0x1643ba,_0x4185dd){const _0x50a17c=this['editor'];if(_0x4185dd&&!_0x50a17c['plugins']['has']('TrackChanges'))throw new ct('ai-no-track-changes',null);const _0x5f48e8=this['editor']['plugins']['get'](_0x45dea0),_0x11ed77=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x11ed77||!_0x11ed77['replies']['length'])return;const _0x13a8ca=_0x11ed77['replies'][_0x11ed77['replies']['length']-0x1];if(this['_isUnsupportedInlineRootChange'](_0x13a8ca,_0x1643ba))return void this['_actionsBalloonView']['showBlockingError'](Es(_0x50a17c['locale'],'AI_SUGGESTION_NO_PARTS_WARNING'));_0x13a8ca['setChangeGroupState'](0x0,'accepted');const _0x7dd903=Jn({'documentSuggestions':Zn({'groups':[_0x13a8ca['changeGroups'][0x0]],'documentContextContent':_0x13a8ca['documentContextContent'],'documents':_0x11ed77['getDocumentContext']()['documents']}),'transform':!0x1,'documentCompare':_0x5f48e8,'documentCompareOptions':{'anchor':_0x50a17c['model']['createPositionAt'](_0x5d74b1,0x0),'markDeletions':_0x4185dd}})['values']()['next']()['value']??[],_0x278a69=this['_filterOperationsOutsideRange'](_0x7dd903,_0x392ee1);for(const _0x5c6879 of _0x278a69)this['_anchorOperation'](_0x392ee1,_0x5c6879,_0x1643ba);const _0x344c42=_0x11ed77['getDocumentContext']()['documents'][0x0]['version'],_0x1aa9af=_0x5dec67(_0x278a69,_0x50a17c['model']['document']['history']['getOperations'](_0x344c42),{'document':_0x50a17c['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];mn(_0x1aa9af,'quickActions');try{_0x50a17c['model']['change'](_0xe5e99b=>{_0xe5e99b['setSelection'](_0x50a17c['model']['document']['selection']['focus']),_0x4185dd?_0x50a17c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1aa9af):_0x5f48e8['applyOperations'](_0xe5e99b,_0x1aa9af);});}catch(_0x2dec8c){throw this['_reporter']['logError'](new yn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x2dec8c})),_0x2dec8c;}this['editor']['plugins']['get']('AIBalloon')['close']();}_filterOperationsOutsideRange(_0x3e3b34,_0x213e47){return _0x3e3b34['filter'](_0x37dd6e=>{if('rename'==_0x37dd6e['type']){const _0x4c6a95=_0x37dd6e['position']['nodeAfter'];return!_0x213e47['has'](_0x4c6a95);}if(_0x37dd6e['type']['indexOf']('Attribute')>-0x1){const _0x5d48c6=_0x37dd6e['range']['start']['nodeAfter'];return!_0x213e47['has'](_0x5d48c6);}return!0x0;});}_anchorOperation(_0x1b2256,_0x22c22b,_0x234e05){const _0x153896=_0x22c22b['clone']();for(const _0x1671a0 in _0x22c22b){const _0x20c415=_0x22c22b[_0x1671a0];_0x20c415 instanceof _0x2827cc?_0x22c22b[_0x1671a0]=new _0x2827cc(_0x2bada3(_0x20c415['start']),_0x2bada3(_0x20c415['end'])):_0x20c415 instanceof _0x4febba&&(_0x22c22b[_0x1671a0]=_0x2bada3(_0x20c415));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x153896['type'])){if(_0x153896['isDocumentOperation']=!0x1,_0x153896['baseVersion']=null,'remove'==_0x153896['type']){const _0x194db2=_0x153896['sourcePosition'],_0xa0a6f1=_0x153896['howMany'];new _0x4f656c(_0x194db2,_0xa0a6f1)['_execute']();}else _0x153896['_execute']();}function _0x2bada3(_0x5557dd){if('$graveyard'==_0x5557dd['root']['rootName'])return _0x5557dd;const _0x12c476=[];let _0x163011=_0x5557dd['root'];for(let _0x471f8a=0x0;_0x471f8a<_0x5557dd['path']['length'];_0x471f8a++){const _0x17cd1f=_0x1b2256['get'](_0x163011)||0x0;_0x12c476[_0x471f8a]=_0x5557dd['path'][_0x471f8a]+_0x17cd1f,_0x163011=_0x163011['getChildAtOffset'](_0x5557dd['path'][_0x471f8a]);}return new _0x4febba(_0x234e05,_0x12c476,_0x5557dd['stickiness']);}}_refreshInteraction(){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4bc6b3,content:_0xb777a6,version:_0x14100e,aiBalloon:_0x176404}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0xb777a6,_0x14100e,_0x176404,_0x4bc6b3)['catch'](_0x6855c2=>{this['_reporter']['logError'](_0x6855c2,{'context':{'operation':'refresh-interaction'}});});}_clearInteractionHistory(){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_stopInteraction(){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}_navigateToPrevious(){const _0x5c5353=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5c5353-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}_navigateToNext(){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async _displayInteractionAtIndex(_0x4d101a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4d101a;const _0x111c43=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x111c43)return;if(_0x111c43['hasError'])return this['_setErrorState'](_0x111c43),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x111c43['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x29cf18=_0x111c43['replies'][_0x111c43['replies']['length']-0x1];if(_0x29cf18)try{const _0x4f7790=ln({'changeGroups':_0x29cf18['changeGroups'],'documentContextContent':_0x29cf18['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x12969f=>setTimeout(_0x12969f,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4f7790[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xfaaba3){this['_reporter']['logError'](_0xfaaba3,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_setLoadingState(){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async _setErrorState(_0x382408,_0x5369b2){if(void 0x0!==_0x5369b2&&kn(_0x5369b2))return;const _0x5ad12f=Es(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x5ad12f),_0x382408['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}_clearErrorState(){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async _clearLoadingState(){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}},Ah=class extends _0x622916{static get requires(){return[ih,oh,gh];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51fd4e){super(_0x51fd4e),_0x51fd4e['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},Ih=class extends _0x56a514{resultResponseView;acceptButtonView;dismissButtonView;infoButtonView;outdatedButtonView;constructor(_0x1e1332,_0x490eb9){super(_0x1e1332),this['id']=_0x490eb9,this['set']('status','pending'),this['set']('changeId',_0x490eb9),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x48a289,_0xb2df2c)=>{_0xb2df2c&&_0xb2df2c['target']&&'A'===_0xb2df2c['target']['tagName']&&_0xb2df2c['preventDefault'](),this['fire']('activateChange',{'id':_0x490eb9,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x490eb9,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x490eb9,'source':this});}),this['on']('change:showDiff',()=>this['_syncResponseVisibility']());}['render'](){super['render'](),this['_syncResponseVisibility']();}setItemAsActive(){this['isActive']=!0x0;}setItemAsInactive(){this['isActive']=!0x1;}_createResultResponseView(){const _0x540861=new _0x56a514(this['locale']);return _0x540861['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response']}}),_0x540861;}updateResponseContent(_0x631d8b,_0x527b34){const _0x55d626=_0x527b34||'div',_0x8b30f7=this['resultResponseView']['element'];if(_0x8b30f7['tagName']['toLowerCase']()!==_0x55d626){const _0x252077=new _0x24e6f7({'tag':_0x55d626,'attributes':{'class':_0x8b30f7['className']}})['render']();_0x8b30f7['replaceWith'](_0x252077),this['resultResponseView']['element']=_0x252077,this['_syncResponseVisibility']();}this['resultResponseView']['element']['innerHTML']=_0x631d8b;}_syncResponseVisibility(){this['resultResponseView']['element']?.['classList']['toggle']('ck-hidden',!this['showDiff']);}_createAcceptButtonView(){const _0x335fda=new Mt(this['locale']);return _0x335fda['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x335fda['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1d38aa=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x1d38aa['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x155cae=>'pending'!==_0x155cae&&'accepted'!==_0x155cae),this['bindTemplate']['if']('status',Pn,_0x4f449b=>'pending'===_0x4f449b),this['bindTemplate']['if']('status',Dn,_0x47c749=>'pending'!==_0x47c749),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2b85a3=>'accepted'===_0x2b85a3)]}}),this['on']('change:status',(_0x9c6e29,_0x3dfb5d,_0x4860a1)=>{_0x335fda['isEnabled']='pending'===_0x4860a1,'accepted'===_0x4860a1&&(_0x335fda['label']=Es(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x335fda['icon']=_0x48b061);}),_0x335fda;}_createDismissButtonView(){const _0x570a77=new Mt(this['locale']);return _0x570a77['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x570a77['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x30fd5b=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x30fd5b['stopPropagation']();})},'attributes':{'class':[Dn,this['bindTemplate']['if']('status','ck-hidden',_0x4b18cd=>'pending'!==_0x4b18cd&&'rejected'!==_0x4b18cd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x225e90=>'pending'===_0x225e90),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3b0566=>'rejected'===_0x3b0566)]}}),this['on']('change:status',(_0xd7f7cd,_0x450b92,_0x219d6f)=>{_0x570a77['isEnabled']='pending'===_0x219d6f,'rejected'===_0x219d6f&&(_0x570a77['label']=Es(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x570a77['icon']=_0x572ba4);}),_0x570a77;}_createInfoButtonView(){const _0x1a4300=new Mt(this['locale']);return _0x1a4300['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x41da4b,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Dn+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x1a4300['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5618bf=>_0x5618bf),_0x1a4300['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1a4300;}_createOutdatedButtonView(){const _0x341d91=new Mt(this['locale']);return _0x341d91['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x157ef8,'withText':!0x0,'isEnabled':!0x1}),_0x341d91['extendTemplate']({'attributes':{'class':[Dn,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5e4550=>'outdated'!==_0x5e4550)],'disabled':'disabled'}}),_0x341d91;}},ph=class extends xt{resultItemView;_pinnedRectIndex=void 0x0;_pinnedTargetElement=void 0x0;_pinnedTargetChangeId=void 0x0;constructor(_0x217f22,_0xc43cb){super(_0x217f22),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']()),_0xc43cb['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}updateContent(_0x2415f8){this['resultItemView']['changeId']=_0x2415f8['id'],this['resultItemView']['updateResponseContent'](_0x2415f8['contentDiffed'],_0x2415f8['wrapperTag']);}['showBalloon'](_0x233e21,_0x18e4aa,_0x1cf4c5,_0x498074,_0xd92c7f,_0x2cff36){const _0x384420=_0x18e4aa();if(!_0x384420)return;this['updateContent'](_0x233e21),this['show']();const _0x47ba34=Array['from'](_0x384420['getClientRects']())['reverse'](),_0xba1a41=this['_getPointedRectIndexFromEvent'](_0x1cf4c5,_0x47ba34),_0xcdbf6e=_0x47ba34[_0xba1a41??0x0];'click'===_0x498074?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x18e4aa(),_0xba1a41,_0x233e21['id'],_0xd92c7f,_0x2cff36)||_0xcdbf6e})):'hover'===_0x498074&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x18e4aa(),_0xba1a41,_0x233e21['id'])||_0xcdbf6e}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}deactivateChange(){this['fire']('deactivateChange',{'origin':'balloon'});}_setupClickOutsideHandler(){_0x44d1a9({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4be4e2=[this['element']];return this['_pinnedTargetElement']&&_0x4be4e2['push'](this['_pinnedTargetElement']),_0x4be4e2;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}_createContentView(){const _0x3690bf=new _0x56a514();return this['resultItemView']=new Ih(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3690bf['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x3690bf;}_getBestRectPositionOnClick(_0x3cdf61,_0x5a4468,_0x4e5657,_0x46c4ff,_0x11d6ff){if(!_0x3cdf61)return null;const _0x312d09=this['position']['replace']('arrow_',''),_0x398b2c=Array['from'](_0x3cdf61['getClientRects']());let _0x2ab069,_0x3b5143=_0x398b2c['reverse']();return void 0x0!==_0x5a4468&&this['_isPinnedRectVisible'](_0x3b5143[_0x5a4468],_0x46c4ff,_0x11d6ff)?(_0x2ab069=_0x3b5143[_0x5a4468],this['_pinnedRectIndex']=_0x5a4468):this['_isPinnedRectVisible'](_0x3b5143[0x0],_0x46c4ff,_0x11d6ff)&&void 0x0===_0x5a4468?_0x2ab069=_0x3b5143[0x0]:(_0x3b5143='s'==_0x312d09[0x0]?[..._0x398b2c]['reverse']():_0x398b2c,_0x3b5143['forEach'](_0x5b089e=>{this['_isPinnedRectVisible'](_0x5b089e,_0x46c4ff,_0x11d6ff)&&(_0x2ab069=_0x5b089e);})),this['_pinnedTargetChangeId']=_0x4e5657,this['_pinnedTargetElement']=_0x3cdf61,_0x2ab069||_0x3cdf61['getBoundingClientRect']();}_getBestRectPositionOnHover(_0x2a95ca,_0x6be707,_0x590645){if(!_0x2a95ca)return null;const _0x34cee5=Array['from'](_0x2a95ca['getClientRects']())['reverse']();return void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x6be707&&this['_pinnedTargetChangeId']!==_0x590645?(this['_pinnedRectIndex']=_0x6be707,this['_pinnedTargetElement']=_0x2a95ca,this['_pinnedTargetChangeId']=_0x590645,_0x34cee5[_0x6be707]):void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x590645?_0x2a95ca!==this['_pinnedTargetElement']?Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']]:_0x34cee5[this['_pinnedRectIndex']]:void 0x0!==_0x6be707&&this['_pinnedTargetChangeId']!==_0x590645?(this['_pinnedRectIndex']=_0x6be707,this['_pinnedTargetElement']=_0x2a95ca,this['_pinnedTargetChangeId']=_0x590645,_0x34cee5[_0x6be707]):_0x2a95ca['getBoundingClientRect']();}_getPointedRectIndexFromEvent(_0x3abf0c,_0x289dd7){if(_0x3abf0c)for(let _0x4bc3ab=0x0;_0x4bc3ab<_0x289dd7['length'];_0x4bc3ab++){const _0x2b0d7d=_0x289dd7[_0x4bc3ab];if(_0x3abf0c['clientX']>=_0x2b0d7d['left']-0x3&&_0x3abf0c['clientX']<=_0x2b0d7d['right']+0x3&&_0x3abf0c['clientY']>=_0x2b0d7d['top']-0x3&&_0x3abf0c['clientY']<=_0x2b0d7d['bottom']+0x3)return _0x4bc3ab;}}_isPinnedRectVisible(_0x125715,_0x3a5ea5,_0x109b57){const _0x3282c5=new It(_0x125715),_0x5a8005=_0x3a5ea5||document['documentElement'],_0x536282=_0x3282c5['getIntersection'](Tt(_0x109b57)),_0x3b89b8=new It(_0x5a8005)['getIntersection'](_0x3282c5);return!!(_0x536282&&_0x3b89b8&&_0x3282c5['width']>0x0);}};const Eh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];var mh=class extends _0x898608{['_mainView'];_balloonSuggestionView;_bodyCollection;static get requires(){return[gs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c9410){super(_0x2c9410),this['_bodyCollection']=Mn(this['context']['locale']),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Eh)['to'](this),this['_balloonSuggestionView']=new ph(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}init(){const _0x5ebd8a=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5ebd8a);}destroy(){this['_bodyCollection']['detachFromDom'](),super['destroy']();}setAvailableChecks(_0x1e9e44){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x22c4be=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1e9e44,_0x22c4be);}this['_mainView']['showReviewCheckListView']();}showReviewCheckList(){this['fire']('getReviewCheckList');}showCheckRunResults(_0x40a946){_0x40a946&&('error-general'!==_0x40a946['status']?'error-chunk'!==_0x40a946['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}showCheckRunResult(_0x565705){this['_mainView']['addCheckRunResult'](_0x565705);}showGeneralResultsErrorView(){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0xd138cd){this['_mainView']['showGeneralReviewCoreErrorView'](_0xd138cd??Es(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}showUnsupportedInlineChangeView(){this['_mainView']['showUnsupportedInlineChangeView']();}setCheckResultTitle(_0x352996,_0x22159e){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x352996,_0x22159e);}setAcceptAllEnabled(_0x406c33){this['_mainView']['reviewCheckResultsView']['setAcceptAllEnabled'](_0x406c33);}setActiveStateInResults(_0x384004){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x55d8b5=>{_0x55d8b5['id']===_0x384004&&_0x55d8b5['setItemAsActive']();});}resetActiveStateInResults(){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x424e0c=>_0x424e0c['setItemAsInactive']());}updateChangeState(_0x1cdd7c,_0xa7e789){'accepted'===_0xa7e789||'rejected'===_0xa7e789||'outdated'===_0xa7e789?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x1cdd7c,_0xa7e789):this['_mainView']['reviewCheckResultsView']['showResult'](_0x1cdd7c,_0xa7e789);}showReviewCompletedView(){this['_mainView']['showReviewCompletedView']();}showActionsWhenResultIsReady(){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}hideActionsWhenResultIsReady(){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x26b31f,_0x2a1ea7,_0x2d21fb,_0x26d567,_0x2b19c0,_0x1a8a87){this['_balloonSuggestionView']['showBalloon'](_0x26b31f,_0x2a1ea7,_0x2d21fb,_0x26d567,_0x2b19c0,_0x1a8a87);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}getChangeElement(_0x220851){const _0x3aefc9=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x441fc1=>_0x441fc1['id']===_0x220851);return _0x3aefc9?_0x3aefc9['element']:null;}deactivateChange(){this['_balloonSuggestionView']['deactivateChange']();}},Th=class extends _0x56a514{constructor(_0x24e47f){super(_0x24e47f),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x33d84f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x33d84f['if']('isVisible','ck-hidden',_0x5cd6d1=>!_0x5cd6d1)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x33d84f['to']('errorMessage')}]}]});}},wh=class extends _0x56a514{['reviewCoreHeader'];['generalErrorView'];reviewCheckListView;reviewCheckResultsView;reviewCompletedView;constructor(_0x58628d,_0xd5e6c6){super(_0x58628d),this['reviewCoreHeader']=_0xd5e6c6['header'],this['generalErrorView']=new Th(_0x58628d),this['reviewCheckListView']=_0xd5e6c6['list'],this['reviewCheckListView']['delegate'](...Eh)['to'](this),this['reviewCheckResultsView']=_0xd5e6c6['results'],this['reviewCheckResultsView']['delegate'](...Eh)['to'](this),this['reviewCompletedView']=_0xd5e6c6['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}showReviewCheckListView(){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}showReviewCheckResultsView(){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}addCheckRunResult(_0xb9f256){this['reviewCheckResultsView']['addResult'](_0xb9f256),this['reviewCheckResultsView']['set']('isLoading',!0x1);}showReviewCompletedView(){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}showActionsWhenResultIsReady(){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}hideActionsWhenResultIsReady(){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x58d038){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x58d038;}showGeneralResultsErrorView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}showUnsupportedInlineChangeView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showUnsupportedInlineChangeMessage']();}},Ch=class extends Mt{constructor(_0x164483,_0x2a542d){super(_0x2a542d),this['set']({'label':_0x164483,'withText':!0x0,'class':Ln}),this['on']('execute',()=>{this['fire']('finishReview');});}},fh=class extends jt{_resultViews;_resultsHeader;_resultsBody;['reviewDisclaimer'];_cancelButtonView;_acceptAllButtonView;_exitReviewButtonView;_toggleDiffButtonView;['_errorMessageView'];_finishReviewButtonView;_contents;constructor(_0x1bbce9,_0x2f8c50){super(_0x1bbce9),this['_contents']=_0x2f8c50,this['_resultViews']=new _0x93f04d(),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['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new da(_0x1bbce9),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),this['set']('isAcceptAllEnabled',!0x1),this['_acceptAllButtonView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled',this,'isError',(_0x13fc47,_0x240c7a)=>_0x13fc47&&!_0x240c7a);const _0x317085=this['_createCombinedSkeletonLoader'](),_0x564e6b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x564e6b['if']('isLoading','ck-ai_review__check-run_loading',_0x20e0ee=>_0x20e0ee),_0x564e6b['if']('isResultReady','ck-ai_review__check-run_ready',_0xb8be7e=>_0xb8be7e),_0x564e6b['if']('isVisible','ck-hidden',_0x8d6218=>!_0x8d6218)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x317085,this['reviewDisclaimer']]});}clearResults(){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}getResults(){return this['_resultViews'];}addResult(_0x2771c8){const _0x245473=new Ih(this['locale'],_0x2771c8['id']);_0x245473['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x245473),_0x245473['updateResponseContent'](_0x2771c8['contentDiffed'],_0x2771c8['wrapperTag']);}hideResult(_0x1a6425,_0x5e161c){if('pending'===_0x5e161c)return;const _0x260750=this['_resultViews']['find'](_0x28fddd=>_0x28fddd['id']===_0x1a6425);_0x260750&&(_0x260750['status']=_0x5e161c,_0x260750['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}showResult(_0x3bfe10,_0x190921){if('pending'!==_0x190921)return;const _0x318885=this['_resultViews']['find'](_0x2c07d3=>_0x2c07d3['id']===_0x3bfe10);_0x318885&&(_0x318885['status']=_0x190921,_0x318885['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}setTitle(_0x36630b,_0x2516c1){this['headerTitle']=_0x36630b,this['headerSubtitle']=_0x2516c1||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}showUnsupportedInlineChangeMessage(){this['errorType']='unsupported-inline',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}resetErrorState(){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}setAcceptAllEnabled(_0x12f736){this['isAcceptAllEnabled']=_0x12f736;}_createSkeletonLoader(){return new wr(this['locale'],Cr['aiReviewChecks']);}_createCombinedSkeletonLoader(){const _0x1d26a3=new _0x56a514(this['locale']),_0x1edeb7=[];for(let _0x4b3d03=0x0;_0x4b3d03<0x10;_0x4b3d03++){const _0x37ad21=this['_createSkeletonLoader']();_0x37ad21['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x1edeb7['push'](_0x37ad21);}return _0x1d26a3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x60dd1a=>!_0x60dd1a)]},'children':_0x1edeb7}),_0x1d26a3;}_createResultsBodyView(){const _0x4f57e8=new _0x56a514(this['locale']);return _0x4f57e8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3960e1=>_0x3960e1)]},'children':this['_resultViews']}),_0x4f57e8;}_createErrorView(){const _0x3bf517=new _0x56a514(this['locale']),_0x5c5299=new Mt(this['locale']),t=this['locale']['t'];return _0x3bf517['delegate']('retryReview')['to'](this),_0x5c5299['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Pn+'\x20ck-ai_review__check-run-error-retry-button'}),_0x5c5299['on']('execute',()=>{this['fire']('retryReview');}),_0x3bf517['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x42826c=>!_0x42826c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x38e492=>'chunk'===_0x38e492)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0xe82d3b=>'chunk'===_0xe82d3b||'unsupported-inline'===_0xe82d3b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x224b26=>'general'!==_0x224b26)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2f68cd=>'chunk'!==_0x2f68cd)]},'children':[{'text':Es(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x202ae3=>'unsupported-inline'!==_0x202ae3)]},'children':[{'text':Es(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')}]}]},_0x5c5299]}),_0x3bf517;}_createCancelButtonView(){const _0x4281d6=new Mt(this['locale']);return _0x4281d6['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Pn+'\x20ck-ai-button-stop-generating'],'icon':st}),_0x4281d6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4760c4=>_0x4760c4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x791c08=>_0x791c08)]}}),_0x4281d6['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4281d6;}_createToggleDiffButtonView(){const _0x4d7349=new Mt(this['locale']);_0x4d7349['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4d7349['bind']('isEnabled')['to'](this,'isError',_0x5993a7=>!_0x5993a7),_0x4d7349['extendTemplate']({'attributes':{'class':[Pn,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1758df=>!_0x1758df),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c127f=>_0x5c127f)]}});const _0x16c0f7=Es(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x4169c4=Es(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4d7349['bind']('isOn')['to'](this,'isToggleDiffOn',_0x422f6c=>_0x422f6c),_0x4d7349['bind']('icon')['to'](this,'isToggleDiffOn',_0x277099=>_0x277099?_0x112882:_0x3bafdd),_0x4d7349['bind']('label')['to'](this,'isToggleDiffOn',_0x409b95=>_0x409b95?_0x16c0f7:_0x4169c4),_0x4d7349['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4d7349;}_createAcceptAllButtonView(){const _0x2ac570=new Mt(this['locale']);return _0x2ac570['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2ac570['extendTemplate']({'attributes':{'class':[Ln,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x273fe5=>!_0x273fe5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5f4c14=>_0x5f4c14)]}}),_0x2ac570['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2ac570;}_createExitReviewButtonView(){const _0x41a673=new Mt(this['locale']);return _0x41a673['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x41a673['extendTemplate']({'attributes':{'class':[Dn,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x326eaf=>!_0x326eaf),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5bd87c=>_0x5bd87c)]}}),_0x41a673['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x41a673;}_createResultHeaderView(){const _0x417ef5=new _0x56a514(this['locale']),_0x4de76f=this['_createTitleView']();return _0x417ef5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5f16ef=>_0x5f16ef)]},'children':[_0x4de76f,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c3ec0=>!_0x5c3ec0)],'title':Es(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':Es(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x417ef5;}_createTitleView(){const _0x9863ce=new _0x56a514(this['locale']),_0x5373d4=new Dr();return _0x5373d4['bind']('isVisible')['to'](this,'isResultReady',_0x266e11=>!_0x266e11),_0x9863ce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1cf89e=>_0x1cf89e)]},'children':[_0x5373d4,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x9863ce;}_createFinishReviewButtonView(){const _0x1eca77=new Ch(Es(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1eca77['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ea5d2=>!_0x1ea5d2)]}}),_0x1eca77['delegate']('finishReview')['to'](this),_0x1eca77;}},bh=class extends jt{_resultsHeader;_finishReviewButtonView;constructor(_0x1c6b7f,_0x40a390){super(_0x1c6b7f),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x40a390['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x40a390['headerText']);const _0x412ca1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x412ca1['if']('isVisible','ck-hidden',_0x10e766=>!_0x10e766)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x40a390['emptyResultsText']}]}]}]});}_createFinishReviewButtonView(_0x1b3075){const _0xf667e2=new Ch(_0x1b3075,this['locale']);return _0xf667e2['delegate']('finishReview')['to'](this),_0xf667e2;}_createResultHeaderView(_0x3302f4){const _0x3c2c3f=new _0x56a514(this['locale']);return _0x3c2c3f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x3302f4},'children':[{'text':_0x3302f4}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x3c2c3f;}},Sh=class extends _0x56a514{['_dropdownView'];_defaultValue;_defaultLabel;constructor(_0x4853ac,_0x71d70d){super(_0x4853ac),this['_defaultValue']=_0x71d70d['default']||(_0x71d70d['data']['length']>0x0?_0x71d70d['data'][0x0]['id']:''),this['_defaultLabel']=_0x71d70d['data']['find'](_0x26b4a1=>_0x26b4a1['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x48403c(this['locale']);const _0x49dfc1=this['_prepareListOptions'](_0x71d70d['data']);_0x40e721(this['_dropdownView'],_0x49dfc1,{'role':'menu','ariaLabel':_0x71d70d['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x13efc6=>{_0x13efc6['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5dd753=>{this['formValue']=_0x5dd753['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5dd753['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}resetToDefault(){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}_prepareListOptions(_0x469510=[]){const _0x129787=new lt();this['resetToDefault']();for(const _0x532c8a of _0x469510){const _0x2772c6=new _0x28f92e({'label':_0x532c8a['label'],'withText':!0x0,'role':'menuitemradio','id':_0x532c8a['id'],'model':_0x532c8a});_0x2772c6['bind']('isOn')['to'](this,'formValue',_0x24db0f=>_0x24db0f===_0x2772c6['id']);const _0x24bab9={'type':'button','model':_0x2772c6};_0x129787['add'](_0x24bab9);}return _0x129787;}},Rh=class extends jt{_formItem=null;constructor(_0x4b34bd,_0x43d31d,_0xa02c31){if(super(_0x4b34bd),this['argsKey']=_0x43d31d?.['argsKey'],'dropdown'===_0x43d31d['formType'])this['_formItem']=new Sh(this['locale'],_0x43d31d);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x447b78=new Wt(this['locale'],{'children':[this['_formItem']],'class':[_0xa02c31?'ck-form__row_with-submit':'']});_0xa02c31&&_0x447b78['children']['add'](_0xa02c31),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x447b78]});}resetToDefault(){this['_formItem']['resetToDefault']();}},Oh=class AIReviewCorePromptInputView extends _0x324c99{keystrokes;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xa5e722){super(_0xa5e722),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}},vh=class extends _0x56a514{['focusTracker']=new _t();keystrokes=new gt();['focusCycler'];['_focusables']=new _0x93f04d();submitButtonView;cancelButtonView;promptInputView;actionsFooterView;_modelSelector;['_check'];constructor(_0x498718,_0xe45d19,_0x5e4f99=!0x1){super(_0x498718),this['_check']=_0xe45d19,this['set']('prompt',''),this['set']('modelId',''),this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Qt(this['locale'],()=>new Oh(_0x498718)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelector']=new Io(_0x498718,{'panelPosition':'se','dropdownClass':'ck-ai_review__check-list-item-model-dropdown','nameClass':'ck-ai_review__check-list-item-model-name','itemClasses':{'name':'ck-ai_review__check-list-item-model-dropdown-name','description':'ck-ai_review__check-list-item-model-dropdown-description'}}),this['listenTo'](this['_modelSelector'],'selectModel',(_0x467697,_0x3b4c55)=>{this['modelId']=_0x3b4c55['id'],this['_modelSelector']['setSelectedModel'](_0x3b4c55);}),this['_setModelList'](_0x5e4f99),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new Wt(this['locale'],{'children':[this['promptInputView']]}),new Wt(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x111596,_0x318e89)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x318e89()):_0x318e89();}),this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),[this['promptInputView'],this['_modelSelector']['dropdownView'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x3451c2=>{this['_focusables']['add'](_0x3451c2),this['focusTracker']['add'](_0x3451c2['element']);}),this['keystrokes']['listenTo'](this['element']);}resetToDefault(){this['prompt']='',this['modelId']=this['_check']['defaultModel']?.['id']??'',this['_check']['defaultModel']&&this['_modelSelector']['setSelectedModel'](this['_check']['defaultModel']),this['resetFormValidationStatus']();}resetFormValidationStatus(){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x19c2a2 of this['_getFormValidators']()){const _0xe7faae=_0x19c2a2();if(_0xe7faae)return this['promptInputView']['errorText']=_0xe7faae,!0x1;}return!0x0;}_getFormValidators(){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Es(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}_createSubmitButtonView(){const _0x3727c9=new Mt(this['locale']),t=this['locale']['t'];return _0x3727c9['set']({'label':t('Submit'),'withText':!0x0,'class':Ln}),_0x3727c9['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3727c9;}_createCancelButtonView(){const _0x8040ca=new Mt(this['locale']),t=this['locale']['t'];return _0x8040ca['set']({'label':t('Cancel'),'withText':!0x0,'class':Dn}),_0x8040ca['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x820065=>{_0x820065['stopPropagation']();})}}),_0x8040ca['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x8040ca;}_setModelList(_0x4b09dc){this['_modelSelector']['setModels'](this['_check']['models'],!_0x4b09dc),this['resetToDefault']();}_createActionsFooterView(){const _0x5a6980=new _0x56a514(this['locale']);return _0x5a6980['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelector'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x5a6980;}},kh=class extends jt{_formItemsCollection=new _0x93f04d();_customCheckView=null;['_hideModels']=!0x1;constructor(_0x20c85c,_0x37dc6d,_0x3111d0,_0x39dc46=!0x1){super(_0x20c85c),this['_hideModels']=_0x39dc46,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x37dc6d['isParameterized']);const _0x3f6c80=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x18e0d6=>_0x18e0d6),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x439ec3=>_0x439ec3)],'style':{'--ck-ai-review-check-list-item-index':_0x3111d0}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x37dc6d['title']}]},_0x3f6c80]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x37dc6d['description']?[{'text':_0x37dc6d['description']}]:[]}]}]},..._0x37dc6d['isParameterized']?[this['_createParameterizedView'](_0x37dc6d)]:[],...'custom'===_0x37dc6d['id']?[this['_createCustomView'](_0x37dc6d,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x37dc6d['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x37dc6d['id'],'args':_0x37dc6d['useArgs']?_0x37dc6d['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x44d1a9({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}resetToDefault(){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x2f902c=>{_0x2f902c['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}_createIconView(){const _0x9e129f=new $t();return _0x9e129f['content']=_0x2fee64,_0x9e129f['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x9e129f;}_createParameterizedView(_0x29cca5){const _0x56bc9b=new _0x56a514(),_0x4ed031=this['_createFormView'](_0x29cca5);return _0x56bc9b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3eb7b0=>!_0x3eb7b0)]},'children':[_0x4ed031]}),_0x56bc9b;}_createFormView(_0x426214){const _0x1a530b=new _0x56a514(),_0x8dd717=Array['isArray'](_0x426214['options'])?_0x426214['options']:[],_0x2fa37e=new Mt(this['locale']),t=this['locale']['t'];_0x2fa37e['set']({'label':t('Submit'),'withText':!0x0,'class':Ln}),_0x2fa37e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4d3992=>{_0x4d3992['stopPropagation']();})}}),_0x2fa37e['on']('execute',()=>{const _0x2a5d63=[],_0x1d6919={};this['_formItemsCollection']['forEach'](_0x4c3e8c=>{_0x2a5d63['push'](_0x4c3e8c['value']),_0x426214['useArgs']&&_0x426214['options']&&(_0x1d6919[_0x4c3e8c['argsKey']]=_0x4c3e8c['value']);}),this['fire']('runReviewCheck',{'id':_0x426214['id'],'params':_0x2a5d63['length']?_0x2a5d63:void 0x0,'args':Object['keys'](_0x1d6919)['length']?_0x1d6919:void 0x0});});const _0xfdf8f1=_0x8dd717['length'];return _0x8dd717['forEach']((_0x26fdb5,_0x5b1539)=>{const _0x1e8466=_0x5b1539===_0xfdf8f1-0x1;this['_formItemsCollection']['add'](new Rh(this['locale'],_0x26fdb5,_0x1e8466?_0x2fa37e:null));}),_0x1a530b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1a530b;}_createCustomView(_0x338f93,_0x4be595=!0x1){return this['_customCheckView']=new vh(this['locale'],_0x338f93,_0x4be595),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2e5ec7=>!_0x2e5ec7)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x12e5fc,_0x3d53e2,_0x2b9a95)=>{_0x2b9a95||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}},yh=class extends jt{['_checkViews'];constructor(_0x3119cf){super(_0x3119cf),this['_checkViews']=new _0x93f04d(),this['_setupTemplate']();}setChecks(_0x5764c5,_0xe115fc=!0x1){this['_checkViews']['clear']();for(const [_0xe91387,_0x48c34a]of _0x5764c5['entries']()){const _0x166078=new kh(this['locale'],_0x48c34a,_0xe91387,_0xe115fc);_0x166078['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x166078);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}resetAllParameterizedChecks(){for(const _0x1022af of this['_checkViews'])_0x1022af instanceof kh&&_0x1022af['resetToDefault']();}_setupTemplate(){const _0x56f363=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x56f363['if']('isVisible','ck-hidden',_0x288e6f=>!_0x288e6f)]},'children':this['_checkViews']});}},Nh=class extends mh{static get['pluginName'](){return'AIReviewModeUI';}createMainView(){const _0x2db8f6=this['context']['plugins']['get']('AITabs'),_0x182e8b=this['context']['locale'],_0x1facdf=new ua(_0x182e8b,{'label':Es(_0x182e8b,'AI_REVIEW_MODE'),'icon':_0x510915,'class':'ck-ai-header_review','showResizeButton':_0x2db8f6['showResizeButton']});return _0x1facdf['delegate']('resizeTabs')['to'](_0x2db8f6),_0x1facdf['bind']('isMaximized')['to'](_0x2db8f6['view'],'isMaximized',_0x33f97c=>_0x33f97c),new wh(this['context']['locale'],{'header':_0x1facdf,'list':new yh(_0x182e8b),'results':new fh(_0x182e8b,{'generalErrorText':Es(_0x182e8b,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new bh(_0x182e8b,{'headerText':Es(_0x182e8b,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Es(_0x182e8b,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Es(_0x182e8b,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}registerTab(){const _0x2fd9d5=this['context']['plugins']['get']('AITabs');_0x2fd9d5['view']['on']('activateTab',(_0x59ccb7,{newTab:_0x45d745,oldTab:_0x5ee703})=>{'reviewMode'===_0x45d745?this['fire']('getReviewCheckList'):'reviewMode'===_0x5ee703&&this['fire']('leaveReview');}),_0x2fd9d5['view']['addTab']({'id':'reviewMode','buttonLabel':Es(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x510915,'order':0x0,'content':this['_mainView']});}},xh=class extends Sn{_affectedBlocks=[];get affectedBlocks(){return this['_affectedBlocks']['slice']();}set affectedBlocks(_0x1904f6){this['_affectedBlocks']=_0x1904f6;}};const Lh='review-',Ph=['softBreak'],Dh=['htmlScript','htmlStyle','htmlCustomElement'];var Hh=class extends _0x898608{static get requires(){return[_0x45dea0,tn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();_activeMarkers=new Set();_domEmitter;_eventEmitter;_reviewEditingAttachedEditors=new WeakSet();_boundEditables=new WeakMap();_inlineRootDataIds=new WeakMap();constructor(_0x295ffd){super(_0x295ffd),this['_domEmitter']=new(ut())(),this['_eventEmitter']=new(dt())();}get emitter(){return this['_eventEmitter'];}afterInit(){const _0x1e28c3=_0x5b6197=>this['_scheduleAttachReviewEditingToEditor'](_0x5b6197);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x24cd6f)return void _0x1e28c3(this['context']);const _0x36aa6c=this['context'];for(const _0x451029 of _0x36aa6c['editors'])_0x1e28c3(_0x451029);this['listenTo'](_0x36aa6c['editors'],'add',(_0x36e063,_0x1e94a0)=>{_0x1e28c3(_0x1e94a0);}),this['listenTo'](_0x36aa6c['editors'],'remove',(_0x26d1b6,_0x17bb7b)=>{for(const [_0x52a60b,_0x1a0716]of this['_markers'])_0x1a0716['editor']===_0x17bb7b&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x52a60b,'changeId':_0x1a0716['groupId']}),this['_markers']['delete'](_0x52a60b));});}_scheduleAttachReviewEditingToEditor(_0x1176b7){const _0x250851=()=>{'destroyed'!==_0x1176b7['state']&&_0x1176b7['conversion']&&this['_attachReviewEditingToEditor'](_0x1176b7);};if('ready'===_0x1176b7['state'])return void _0x250851();const _0x56b2fa=()=>{this['stopListening'](_0x1176b7,'ready',_0x56b2fa),_0x250851();};this['listenTo'](_0x1176b7,'ready',_0x56b2fa);}_attachReviewEditingToEditor(_0x3d468b){this['_reviewEditingAttachedEditors']['has'](_0x3d468b)||(_0x3d468b['conversion']['for']('editingDowncast')['markerToElement']({'model':Lh+'insert','view':(_0x5b5e54,{writer:_0x249de6})=>{const _0x18a721=this['_markers']['get'](_0x5b5e54['markerName']),_0xe4ee6e={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x18a721?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x5b5e54['markerName']};return _0x249de6['createUIElement']('span',_0xe4ee6e,function(_0x4a6d31){const _0x3c62ac=this['toDomElement'](_0x4a6d31);return _0x3c62ac['innerHTML']=_0x18a721?.['content']?.['asString']||'',_0x3c62ac;});}}),_0x3d468b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lh+'remove-only','view':_0xea6103=>{const _0x56837b=this['_markers']['get'](_0xea6103['markerName']),_0x1542ac=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x56837b?.['id']||'')&&_0x1542ac['push']('ck-ai_review__change_active'),{'classes':_0x1542ac,'attributes':{'data-marker-id':_0xea6103['markerName']}};}}),_0x3d468b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lh+'remove-context','view':_0x144cc7=>{const _0x41fe36=this['_markers']['get'](_0x144cc7['markerName']),_0xa19c2f=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x41fe36?.['id']||'')&&_0xa19c2f['push']('ck-ai_review__change_active'),{'classes':_0xa19c2f,'attributes':{'data-marker-id':_0x144cc7['markerName']}};}}),_0x3d468b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lh+'remove-text','view':_0x3d39b9=>{const _0x58830e=this['_markers']['get'](_0x3d39b9['markerName']),_0x23dd86=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x58830e?.['id']||'')&&_0x23dd86['push']('ck-ai_review__change_active'),{'classes':_0x23dd86,'attributes':{'data-marker-id':_0x3d39b9['markerName']}};}}),_0x3d468b['conversion']['for']('dataDowncast')['markerToElement']({'model':Lh+'suggestion-context','view':(_0x1b64e1,{writer:_0x39a022})=>_0x39a022['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x1b64e1['isOpening']?'start':'end')})}),_0x3d468b['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4fabc2,'view':_0x322962}),this['_updateMouseMarkerInteractionListeners'](_0x3d468b),this['listenTo'](_0x3d468b,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x3d468b),{'priority':'lowest'}),this['listenTo'](_0x3d468b,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x3d468b),{'priority':'lowest'}),_0x3d468b['model']['document']['registerPostFixer'](_0x4853a6=>this['_validateMarkers'](_0x3d468b,_0x4853a6)),_0x3d468b['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x3d468b)),this['_reviewEditingAttachedEditors']['add'](_0x3d468b));}_updateMouseMarkerInteractionListeners(_0x141573){let _0x5d14b5=this['_boundEditables']['get'](_0x141573);_0x5d14b5||(_0x5d14b5=new Map(),this['_boundEditables']['set'](_0x141573,_0x5d14b5));const _0x13da6f=new Set(_0x141573['ui']['getEditableElementsNames']());for(const _0x24bb7c of _0x13da6f){if(_0x5d14b5['has'](_0x24bb7c))continue;const _0xdcee18=_0x141573['ui']['getEditableElement'](_0x24bb7c);_0x5d14b5['set'](_0x24bb7c,_0xdcee18),this['_attachMouseMarkerInteractionListeners'](_0xdcee18);}for(const [_0x16f8fe,_0x3f8f95]of _0x5d14b5)_0x13da6f['has'](_0x16f8fe)||(_0x5d14b5['delete'](_0x16f8fe),this['_domEmitter']['stopListening'](_0x3f8f95));}_attachMouseMarkerInteractionListeners(_0x2dd0ac){this['_domEmitter']['listenTo'](_0x2dd0ac,'mouseup',(_0x117801,_0x23bcf3)=>{const _0x1d4b5c=_0x23bcf3['target'],_0x5db2ee=this['_findMarkerElement'](_0x1d4b5c);if(!_0x5db2ee)return;const _0xc055fd=_0x5db2ee['getAttribute']('data-marker-id'),_0xbfaab6=_0xc055fd['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0xc055fd,'changeId':_0xbfaab6,'markerElement':()=>this['_findMarkerElementById'](_0xc055fd),'domEvent':_0x23bcf3});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x2dd0ac,'mouseover',(_0x316f80,_0x598950)=>{const _0x2f5c01=_0x598950['target'],_0x20101f=_0x598950['relatedTarget'];let _0x1f7f82=this['_findMarkerElement'](_0x2f5c01);if(!_0x1f7f82&&_0x20101f&&(_0x1f7f82=this['_findMarkerElement'](_0x20101f)),!_0x1f7f82)return;const _0x3fbaa0=_0x1f7f82['getAttribute']('data-marker-id'),_0x4a957b=_0x3fbaa0['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x4a957b,'markerElement':()=>this['_findMarkerElementById'](_0x3fbaa0),'domEvent':_0x598950});});}_registerGlobalBalloonBlurHandler(){this['_domEmitter']['listenTo'](document,'mouseover',_0x5f51ae((_0x3f248a,_0x3402d4)=>{const _0x1244ab=_0x3402d4['target'];this['_findMarkerElement'](_0x1244ab)||_0x1244ab['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}getDocumentData(_0x414296){const _0x514e10=this['context']['plugins']['get']('AIEditing'),_0x2d1699=bs(this['context']);if(!_0x2d1699['length'])throw new ct('ai-get-editor-from-context-no-editor',this);const _0x25ca58=_0x414296?.['roots'];if(_0x25ca58&&0x0===_0x25ca58['length'])throw new ct('ai-reviewcoreediting-empty-roots',this);const _0x2be759=_0x25ca58?new Set(_0x25ca58['map'](_0x4f54c8=>_0x4f54c8['channelId']+'\x00'+_0x4f54c8['rootName'])):null,_0x1ed305=_0x2be759?new Set():null,_0x5b4a41=new Set(),_0xd52994=[],_0x4226d7=new Map(),_0x3bbc47=[];for(const _0x123d89 of _0x2d1699){const _0x176383=_0x123d89['config']['get']('collaboration.channelId');for(const _0x213a8b of _0x123d89['model']['document']['getRoots']()){const _0x39d0db=_0x176383+'\x00'+_0x213a8b['rootName'];if(_0x2be759&&!_0x2be759['has'](_0x39d0db))continue;const _0x396847=this['_buildDocumentDataSliceForRoot'](_0x123d89,_0x213a8b,_0x514e10,_0x5b4a41);_0xd52994['push'](_0x396847['content']);for(const [_0x45a066,_0x2a9cff]of _0x396847['elements'])_0x4226d7['set'](_0x45a066,_0x2a9cff);_0x3bbc47['push']({'channelId':_0x176383,'rootName':_0x213a8b['rootName']}),_0x1ed305?.['add'](_0x39d0db);}}if(_0x25ca58&&_0x1ed305['size']!==_0x2be759['size']){const _0x17e796=_0x25ca58['find'](_0xb53c1a=>!_0x1ed305['has'](_0xb53c1a['channelId']+'\x00'+_0xb53c1a['rootName']));throw new ct('ai-reviewcoreediting-root-not-found',this,{'channelId':_0x17e796['channelId'],'rootName':_0x17e796['rootName']});}return{'elements':_0x4226d7,'content':_0xd52994['join'](''),'roots':_0x3bbc47};}async['runCheck'](_0x49d059,_0x5e66c5){const _0x6f9778=new On(),_0x121ab2=_0x5e66c5?.['signal'];let _0x249edc;const _0x13ad4b=()=>{_0x6f9778['abort'](),_0x49d059['abort']();};if(_0x121ab2){if(_0x121ab2['aborted'])return _0x13ad4b(),_0x6f9778;_0x121ab2['addEventListener']('abort',_0x13ad4b),_0x249edc=()=>_0x121ab2['removeEventListener']('abort',_0x13ad4b);}const _0x5e84a0={'apiId':_0x49d059['sourceCheck']['apiId']};try{_0x49d059['on']('reviewCheckRunUpdated',(_0x9451aa,_0x22081a)=>{'aborted'===_0x22081a['status']?_0x6f9778['abort']():'error-general'!==_0x22081a['status']&&'error-chunk'!==_0x22081a['status']||(_0x6f9778['error']=bn(_0x22081a['error'],'ai-reviewcoreediting-check-run-failed',this,_0x5e84a0));}),'aborted'!==_0x6f9778['status']&&await _0x49d059['start']();}catch(_0x31ec41){_0x6f9778['error']=bn(_0x31ec41,'ai-reviewcoreediting-check-run-failed',this,_0x5e84a0);}finally{_0x249edc&&_0x249edc();}return'error'===_0x6f9778['status']||'aborted'===_0x6f9778['status']||(_0x6f9778['addResult'](...this['_buildPerRootResults'](_0x49d059)),_0x6f9778['status']='completed'),_0x6f9778;}buildErrorContext(_0x12e799){return{'apiId':_0x12e799['sourceCheck']['apiId']};}_buildPerRootResults(_0x14e9e5){const _0x3ee6ce=this['buildErrorContext'](_0x14e9e5),_0x4bbba0=this['context']['plugins']['get']('AIEditing'),_0x334b3c=this['context']['plugins']['get']('AIGateway'),_0x4bfc36=this['_groupElementsByRoot'](_0x14e9e5['documentData']['elements']),_0xff9701=new Map();for(const _0x239f2a of bs(this['context']))_0xff9701['set'](_0x239f2a['config']['get']('collaboration.channelId'),_0x239f2a);return _0x14e9e5['documentData']['roots']['map'](({channelId:_0xa4a52c,rootName:_0x3438e0})=>{const _0x3b10b5=_0xff9701['get'](_0xa4a52c),_0xd255f0=new xh({'editor':_0x3b10b5,'rootName':_0x3438e0,'channelId':_0xa4a52c,'sessionId':_0x4bbba0['getSessionId'](_0x3b10b5)}),_0xd3bbf9=_0x4bfc36['get'](_0xd255f0['editor'])?.['get'](_0xd255f0['rootName'])??[];_0xd255f0['contentRawOld']=_0xd3bbf9['map'](_0x2853c7=>_0x2853c7['getContent']())['join'](''),_0xd255f0['documentVersion']=_0xd3bbf9[0x0]?.['documentVersion']??0x1;const _0x2ab101=this['_collectResultAffectedBlocks'](_0xd255f0,_0x14e9e5['results'],_0x14e9e5['documentData']['elements']);_0xd255f0['affectedBlocks']=_0x2ab101;try{_0xd255f0['contentRawNew']=Os(_0x334b3c['mergeChangesIntoContent'](_0x2ab101,_0xd255f0['contentRawOld'],_0xd255f0['editor']));}catch(_0x59fed0){_0xd255f0['error']=bn(_0x59fed0,'ai-reviewcoreediting-check-run-failed',this,_0x3ee6ce);}return _0xd255f0;});}_collectResultAffectedBlocks(_0x5cd49a,_0x1ab86c,_0x4238ca){return _0x1ab86c['filter'](_0x175565=>{const _0x25eb30=_0x4238ca['get'](_0x175565['id']);return!!_0x25eb30&&_0x25eb30['editor']===_0x5cd49a['editor']&&_0x25eb30['rootName']===_0x5cd49a['rootName'];})['map'](_0x5baf72=>({'id':_0x5baf72['id'],'content':_0x5baf72['contentNew']}));}_groupElementsByRoot(_0xae9f93){const _0x323408=new Map();for(const _0x410f99 of _0xae9f93['values']()){let _0x23d53c=_0x323408['get'](_0x410f99['editor']);_0x23d53c||(_0x23d53c=new Map(),_0x323408['set'](_0x410f99['editor'],_0x23d53c));let _0x17ef5d=_0x23d53c['get'](_0x410f99['rootName']);_0x17ef5d||(_0x17ef5d=[],_0x23d53c['set'](_0x410f99['rootName'],_0x17ef5d)),_0x17ef5d['push'](_0x410f99);}return _0x323408;}_buildDocumentDataSliceForRoot(_0x558944,_0x1e8299,_0x46deb6,_0x2f7469){const _0x5f47d1=_0x558944['model'],_0x2fab6f=new _0x28e306();for(const _0xafbc4c of _0x1e8299['getChildren']())_0x2fab6f['_appendChild'](_0xafbc4c['_clone'](!0x0));for(const _0x17394c of _0x5f47d1['markers']){const _0x6236aa=_0x17394c['getRange']();_0x6236aa&&_0x6236aa['root']['rootName']===_0x1e8299['rootName']&&_0x2fab6f['markers']['set'](_0x17394c['name'],this['_changeRangeOwnerDocument'](_0x6236aa['clone'](),_0x2fab6f));}const _0x3d046f=new Map(),_0x53d088=_0x5f47d1['document']['version'];if(Gs(_0x558944,_0x1e8299['rootName'])){let _0x4acb8b=this['_inlineRootDataIds']['get'](_0x1e8299);_0x4acb8b?_0x2f7469['add'](_0x4acb8b):(_0x4acb8b=_0x46deb6['_nextDataId'](_0x2f7469),this['_inlineRootDataIds']['set'](_0x1e8299,_0x4acb8b));const _0x36b874=Fs(_0x558944['data']['processor']['toData'](_0x558944['data']['toView'](_0x2fab6f)),_0x4acb8b);return _0x3d046f['set'](_0x4acb8b,{'editor':_0x558944,'rootName':_0x1e8299['rootName'],'path':[],'documentVersion':_0x53d088,'getContent':()=>_0x36b874}),{'content':_0x36b874,'elements':_0x3d046f};}const _0x3d9ea1=new _0x28cad7({'ignoreElementEnd':!0x0,'startPosition':_0x5f47d1['createPositionAt'](_0x2fab6f,0x0)});for(const {item:_0x2ab3bf}of _0x3d9ea1){if(_0x2ab3bf['is']('element')&&_0x2ab3bf['name']&&Dh['includes'](_0x2ab3bf['name'])){const _0x562cb5=this['_upsertDataId'](_0x2ab3bf,()=>_0x46deb6['_nextDataId'](_0x2f7469));_0x2f7469['add'](_0x562cb5);}if(!_0x2ab3bf['is']('$textProxy'))continue;const _0x2c8cfd=_0x2ab3bf['parent'];if(!_0x2c8cfd||!_0x2c8cfd['is']('element'))continue;const _0x4d0064=this['_upsertDataId'](_0x2c8cfd,()=>_0x46deb6['_nextDataId'](_0x2f7469));_0x2f7469['add'](_0x4d0064);for(const _0x47a4a5 of _0x2c8cfd['getChildren']())_0x47a4a5['is']('element')&&(_0x47a4a5['name']&&Ph['includes'](_0x47a4a5['name'])||_0x2f7469['add'](this['_upsertDataId'](_0x47a4a5,()=>_0x46deb6['_nextDataId'](_0x2f7469))));let _0x42e545=_0x2c8cfd;for(;_0x42e545['parent']&&!_0x42e545['parent']['is']('documentFragment');)_0x42e545=_0x42e545['parent'],_0x42e545['hasAttribute'](_0x4fabc2)&&_0x42e545['_removeAttribute'](_0x4fabc2);_0x3d046f['set'](_0x4d0064,{'editor':_0x558944,'rootName':_0x1e8299['rootName'],'path':_0x2c8cfd['getPath'](),'documentVersion':_0x53d088,'getContent':this['_createGetContentUsingDataIdFn'](_0x42e545['_clone'](!0x0),_0x4d0064,_0x558944['data'])}),_0x3d9ea1['jumpTo'](_0x5f47d1['createPositionAfter'](_0x2c8cfd));}return{'content':_0x558944['data']['processor']['toData'](_0x558944['data']['toView'](_0x2fab6f)),'elements':_0x3d046f};}diffContent(_0x1d5d92,_0x3f4647,_0x37f8cf,_0x52b6c2=!0x1){const {contentInitial:_0x5442b1,contentNew:_0x310764}=this['_neutralizeChangesOnUnsupportedElements'](_0x3f4647,_0x37f8cf),_0x30806d=[],_0x3a98b3=_0x1d5d92['data']['parse'](_0x310764,'$documentFragment'),_0x135d85=_0x1d5d92['data']['parse'](_0x5442b1,'$documentFragment'),_0x54fcd2=_0x1d5d92['model']['createPositionAt'](_0x135d85,0x0);if(this['_haveSingleTopLevelElement'](_0x3a98b3)){if(!this['_hasSameTopLevelElement'](_0x135d85,_0x3a98b3))return _0x30806d;}else{const _0x5ab81d=_0x1d5d92['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x135d85,_0x5ab81d)||!this['_haveOnlyInlineContent'](_0x3a98b3,_0x5ab81d))return _0x30806d;}const _0x148106=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5442b1,_0x310764,{'targetEditor':_0x1d5d92,'anchor':_0x54fcd2,'markDeletions':!0x0})['getOperations']()['filter'](_0x410acd=>'insert'===_0x410acd['type']||'marker'===_0x410acd['type']&&_0x410acd['name']['startsWith']('$markedRemove')),_0x3bea8b=this['_groupAdjacentOperations'](_0x148106),_0x39f03e=[];if(_0x52b6c2){if(_0x3bea8b['length']){const _0x4c15a9=_0x3bea8b[0x0]['operations'][0x0],_0xacea27='insert'===_0x4c15a9['type']?_0x4c15a9['position']:_0x4c15a9['newRange']['start'],_0x3ae813=this['_getPositionLimitingRange'](_0xacea27,_0x1d5d92,'inside'),_0x3238b2=_0x3ae813?_0x3a98b3['getChild'](0x0)['getChildren']():_0x3a98b3['getChildren'](),_0x1ffbbb=_0x3ae813||_0x1d5d92['model']['createRangeIn'](_0x135d85),_0x6414b2=[new _0x5bbb57('$markedRemove:synthetic'+kt(),null,_0x1ffbbb,_0x1d5d92['model']['document']['model']['markers'],!0x0,_0x1d5d92['model']['document']['version']+0x1),new _0x52fe51(_0x1ffbbb['end'],_0x3238b2,_0x1d5d92['model']['document']['version']+0x2)];_0x39f03e['push']({'operations':_0x6414b2,'operationsIsolated':_0x6414b2,'groupOffset':0x0});}}else _0x39f03e['push'](..._0x3bea8b);let _0x2a58f4=0x0;return _0x1d5d92['model']['change'](_0x54e7e1=>{for(let _0x3ebb29=0x0;_0x3ebb29<_0x39f03e['length'];_0x3ebb29++){const _0x2ff100=_0x39f03e[_0x3ebb29],_0xcf0337=_0x54e7e1['createDocumentFragment']();for(const _0x5e3530 of _0x135d85['getChildren']())_0x54e7e1['append'](_0x5e3530['_clone'](!0x0),_0xcf0337);for(const _0x4c067b of _0x2ff100['operationsIsolated'])if('insert'===_0x4c067b['type']){const _0x4e793c=_0x4c067b;_0x4e793c['baseVersion']=null,_0x4e793c['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4e793c,_0xcf0337),_0x54e7e1['batch']['addOperation'](_0x4c067b),_0x1d5d92['model']['applyOperation'](_0x4c067b);const _0x559b66='suggestion:insertion:id:authorId:'+_0x2a58f4++,_0x13108a=_0x1d5d92['model']['createRange'](_0x4e793c['position'],_0x4e793c['position']['getShiftedBy'](_0x4e793c['howMany']));_0xcf0337['markers']['set'](_0x559b66,_0x13108a);}else{if('marker'===_0x4c067b['type']&&_0x4c067b['name']['startsWith']('$markedRemove')){const _0x11ba22=_0x4c067b,_0x317f81='suggestion:deletion:id:authorId:'+_0x2a58f4++;this['_changeOperationOwnerDocument'](_0x11ba22,_0xcf0337),_0xcf0337['markers']['set'](_0x317f81,_0x11ba22['newRange']);}}if(_0x52b6c2)_0x30806d['push']({..._0x2ff100,'context':this['_createGetContentFn'](_0x135d85,_0x1d5d92['data']),'content':this['_createGetContentFn'](_0x135d85,_0x1d5d92['data'])});else{const _0x1c7af1=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x2ff100['operationsIsolated'][0x0]),_0xcf0337),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x2ff100['operationsIsolated'][_0x2ff100['operationsIsolated']['length']-0x1]),_0xcf0337),_0x1d5d92);_0xcf0337['markers']['set'](Lh+'suggestion-context',new _0x2827cc(_0x1c7af1['start'],_0x1c7af1['end'])),_0x30806d['push']({..._0x2ff100,'context':this['_createGetContextFn'](_0xcf0337,_0x1d5d92['data'],{'ellipsisBefore':_0x1c7af1['hasContentBefore'],'ellipsisAfter':_0x1c7af1['hasContentAfter']}),'content':this['_createGetContentFn'](_0xcf0337,_0x1d5d92['data'])});}}}),_0x30806d;}markChangePositionInEditorContent(_0x5c8096,_0x183b06){if(!_0x5c8096['length'])return;const _0x27d38f=_0x5c8096[0x0]['parent']['id'],_0x1dcf00=_0x183b06['elements']['get'](_0x27d38f);if(!_0x1dcf00)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x27d38f);const _0x545a3f=_0x1dcf00['path'],_0x2f5c3=_0x1dcf00['editor'],_0x152bf6=_0x2f5c3['model']['document']['getRoot'](_0x1dcf00['rootName']);if(!_0x152bf6)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x1dcf00['rootName']);const _0x1cedd3=_0x2f5c3['model']['document']['history']['getOperations'](_0x1dcf00['documentVersion']),_0x1b5e1a=[];for(const _0x39df91 of _0x5c8096){const _0x4c04f5=_0x39df91['operationsIsolated']['map'](_0x4d3450=>this['_translateOperationToEditorContent'](_0x4d3450,_0x545a3f,_0x152bf6));if(!_0x4c04f5||!_0x4c04f5['length'])continue;const _0x1ea0f7=_0x4c04f5['every'](_0x29bfb6=>'marker'===_0x29bfb6['type']&&_0x29bfb6['name']['startsWith']('$markedRemove')),_0x855527=_0x5dec67(_0x4c04f5,_0x1cedd3,{'document':_0x2f5c3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];for(const _0x3971d8 of _0x855527)if('insert'===_0x3971d8['type']){const _0xb02df=_0x3971d8,_0x5d1c1c=_0xb02df['nodes'];_0x2f5c3['model']['change'](_0x1db63c=>{const _0x3ece7a=_0x1db63c['createDocumentFragment']();for(const _0x11cd0e of _0x5d1c1c)_0x1db63c['append'](_0x11cd0e['_clone'](!0x0),_0x3ece7a);_0x1b5e1a['push']({'start':_0xb02df['position'],'end':_0xb02df['position'],'type':'insert','groupId':_0x39df91['id'],'content':{'asString':this['_createGetContentFn'](_0x3ece7a,_0x2f5c3['data'])(),'asFragment':_0x3ece7a}});});}else{if('marker'===_0x3971d8['type']&&_0x3971d8['name']['startsWith']('$markedRemove')){const _0x3ea4b8=_0x3971d8;let _0x58b3df='remove-text';if(_0x1ea0f7){const _0x10b2c4=this['_findAdjacentContextDistance'](_0x3ea4b8['newRange']['start'],'backward',_0x2f5c3['model']['schema']),_0xdfa102=this['_findAdjacentContextDistance'](_0x3ea4b8['newRange']['end'],'forward',_0x2f5c3['model']['schema']);if(_0x10b2c4||_0xdfa102){const _0x338368=_0x3ea4b8['newRange']['start']['getShiftedBy'](-_0x10b2c4),_0x1496e4=_0x3ea4b8['newRange']['end']['getShiftedBy'](_0xdfa102);_0x1b5e1a['push']({'start':_0x338368,'end':_0x1496e4,'groupId':_0x39df91['id'],'type':'remove-context'});}else _0x58b3df='remove-only';}_0x1b5e1a['push']({'start':_0x3ea4b8['newRange']['start'],'end':_0x3ea4b8['newRange']['end'],'groupId':_0x39df91['id'],'type':_0x58b3df});}}}this['_insertMarkers'](_0x1b5e1a,_0x2f5c3);}['clearAllMarkers'](){const _0x4bfd74=new Map();for(const _0x2edffc of this['_markers']['keys']()){const _0x16f5d8=this['_markers']['get'](_0x2edffc);_0x16f5d8?.['editor']&&(_0x4bfd74['has'](_0x16f5d8['editor'])||_0x4bfd74['set'](_0x16f5d8['editor'],[]),_0x4bfd74['get'](_0x16f5d8['editor'])['push'](_0x2edffc));}for(const [_0x23a71e,_0x9b9e18]of _0x4bfd74)_0x23a71e['model']['change'](_0x33f003=>{for(const _0x264643 of _0x9b9e18)_0x23a71e['model']['markers']['get'](_0x264643)&&_0x33f003['removeMarker'](_0x264643);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}switchToReadOnly(){for(const _0x42ff8d of this['getEditors']())_0x42ff8d['enableReadOnlyMode']('ai-review');}switchToEdit(){for(const _0x2895a5 of this['getEditors']())_0x2895a5['disableReadOnlyMode']('ai-review');}['applyChange'](_0xac6d78,_0x3f2e5a=null){const _0xe73413=_0xac6d78['map'](_0x429aed=>this['_getMarkersDataForGroup'](_0x429aed))['flat'](),_0x1cb81e=new Map();for(const _0x540230 of _0xe73413)_0x1cb81e['has'](_0x540230['editor'])||_0x1cb81e['set'](_0x540230['editor'],[]),_0x1cb81e['get'](_0x540230['editor'])['push'](_0x540230);for(const [_0x45c821,_0x2980b9]of _0x1cb81e){const _0x52eecd=_0x45c821['model'],_0x44b43e=_0x45c821['plugins']['has']('TrackChangesEditing')?_0x45c821['plugins']['get']('TrackChangesEditing'):null,_0x550835=_0x3f2e5a&&_0x44b43e?new Set(_0x44b43e['getSuggestions']()['map'](_0x1344fb=>_0x1344fb['id'])):null;_0x52eecd['change'](_0x20fbb7=>{const _0x1b309f=_0x20fbb7['batch']['operations']['length'];for(const _0x3d1226 of _0x2980b9){const _0x30ccb3=_0x45c821['model']['markers']['get'](_0x3d1226['id']);if(_0x30ccb3){if('insert'===_0x3d1226['type']){if(!_0x3d1226['content'])continue;_0x52eecd['insertContent'](_0x3d1226['content']['asFragment']||null,_0x30ccb3['getRange']()['start']);}else'remove-text'!==_0x3d1226['type']&&'remove-only'!==_0x3d1226['type']||_0x52eecd['deleteContent'](_0x52eecd['createSelection'](_0x30ccb3['getRange']()));_0x20fbb7['removeMarker'](_0x3d1226['id']),this['_markers']['delete'](_0x3d1226['id']);}}if(_0x3f2e5a&&(mn(_0x20fbb7['batch']['operations']['slice'](_0x1b309f),_0x3f2e5a),_0x44b43e)){for(const _0x362eba of _0x44b43e['getSuggestions']())_0x550835['has'](_0x362eba['id'])||_0x362eba['setAttribute']('@ai',{'type':_0x3f2e5a});}});}}rejectChange(_0x5dd2fc){const _0x8925b4=this['_getMarkersDataForGroup'](_0x5dd2fc),_0x3a9a4f=new Map();for(const _0x2712ca of _0x8925b4)_0x3a9a4f['has'](_0x2712ca['editor'])||_0x3a9a4f['set'](_0x2712ca['editor'],[]),_0x3a9a4f['get'](_0x2712ca['editor'])['push'](_0x2712ca);for(const [_0x675db8,_0x3f9013]of _0x3a9a4f)_0x675db8['model']['change'](_0xe83c65=>{for(const _0x155af4 of _0x3f9013)_0xe83c65['removeMarker'](_0x155af4['id']),this['_markers']['delete'](_0x155af4['id']);});}getEditor(){return Ss(this['context']);}getEditors(){return bs(this['context']);}getEditorForChange(_0x24008a){return this['_getMarkersDataForGroup'](_0x24008a)[0x0]?.['editor'];}getMarkerElementForChange(_0x2d3ede){const _0x2fbc17=Array['from'](this['_markers']['values']())['filter'](_0x321da3=>_0x321da3['groupId']===_0x2d3ede);if(!_0x2fbc17['length'])return null;const _0x3423de=0x1===_0x2fbc17['length']?_0x2fbc17[0x0]:this['_sortMarkers'](_0x2fbc17)[0x0],_0x15ef64=_0x3423de['editor']['model']['markers']['get'](_0x3423de['id']);return _0x15ef64?{'modelRange':_0x15ef64['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3423de['id'])}:null;}getContentElementForChange(_0x5c3693){const _0x334e8c=Array['from'](this['_markers']['values']())['filter'](_0xf929f8=>_0xf929f8['groupId']===_0x5c3693);if(!_0x334e8c['length'])return null;const _0x49a961=0x1===_0x334e8c['length']?_0x334e8c[0x0]:this['_sortMarkers'](_0x334e8c)[0x0],_0x2e11da=_0x49a961['editor'],_0x7619c2=_0x2e11da['model']['markers']['get'](_0x49a961['id']);if(!_0x7619c2)return null;const _0x142d0d=_0x7619c2['getRange'](),_0x4c12f5=_0x2e11da['editing']['view']['getDomRoot'](_0x142d0d['root']['rootName'])||_0x2e11da['editing']['view']['getDomRoot']();if(!_0x4c12f5||!_0x142d0d)return null;let _0x18e834=_0x142d0d['start']['parent'];for(;_0x18e834['parent']&&!_0x18e834['parent']['is']('rootElement');)_0x18e834=_0x18e834['parent'];if(!_0x18e834||!_0x18e834['name'])return null;const _0x5119f0=_0x4c12f5['querySelector']('[data-marker-id=\x22'+_0x49a961['id']+'\x22]');if(!_0x5119f0)return null;if(_0x18e834['is']('rootElement'))return _0x5119f0;let _0x2cd1f6=null;_0x2e11da['model']['change'](_0x532ae9=>{_0x2cd1f6=_0x532ae9['createDocumentFragment'](),_0x532ae9['append'](_0x18e834['_clone'](!0x0),_0x2cd1f6);});const _0x533a54=_0x2e11da['data']['toView'](_0x2cd1f6)['getChild'](0x0);return _0x5119f0['closest'](_0x533a54['name']);}reactivateMarkers(_0x17de9e){const _0x5783d7=this['_getMarkersDataForGroup'](_0x17de9e);if(!_0x5783d7['length'])return;const _0x6d53d1=Array['from'](this['_activeMarkers'])['sort'](),_0x45cb8e=Array['from'](new Set(_0x5783d7['map'](_0x4172d7=>_0x4172d7['id'])))['sort']();_0x6d53d1['join']('|')!==_0x45cb8e['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x17de9e));}setMarkersInElementAsActive(_0x19727e){const _0xcfd7a2=this['_getMarkersDataForGroup'](_0x19727e);if(!_0xcfd7a2['length'])return;const _0x1dd802=_0xcfd7a2[0x0]['editor'],_0x14223e=new Set(_0xcfd7a2['map'](_0x2fb314=>_0x2fb314['id'])),_0x9ae0e8=Array['from'](_0x14223e['values']())['map'](_0x59e4b1=>_0x1dd802['model']['markers']['get'](_0x59e4b1))['filter'](_0x4c0fb0=>!!_0x4c0fb0);_0x14223e['forEach'](_0x522832=>{this['_activeMarkers']['add'](_0x522832);}),_0x1dd802['model']['change'](()=>{_0x9ae0e8['forEach'](_0x2af4a4=>{_0x1dd802['editing']['reconvertMarker'](_0x2af4a4);});});}setAllMarkersAsInactive(){const _0x432c99=Array['from'](this['_activeMarkers']);if(!_0x432c99['length'])return;this['_activeMarkers']['clear']();const _0x334dd8=new Map();for(const _0x2d3930 of _0x432c99){const _0x17a0bd=this['_markers']['get'](_0x2d3930);if(!_0x17a0bd)continue;const _0x42c05a=_0x17a0bd['editor'],_0x4f0280=_0x42c05a['model']['markers']['get'](_0x2d3930);_0x4f0280&&(_0x334dd8['has'](_0x42c05a)||_0x334dd8['set'](_0x42c05a,[]),_0x334dd8['get'](_0x42c05a)['push'](_0x4f0280));}for(const [_0x7e4fe2,_0xbc25f9]of _0x334dd8)_0x7e4fe2['model']['change'](()=>{_0xbc25f9['forEach'](_0x45060a=>{_0x7e4fe2['editing']['reconvertMarker'](_0x45060a);});});}_getPositionLimitingRange(_0x48408f,_0x5a4369,_0x5611bf='outside'){if(!_0x48408f)return null;let _0x13b71f=_0x48408f['parent'];for(;_0x13b71f&&_0x13b71f['parent']&&!_0x13b71f['parent']['is']('rootElement')&&!_0x5a4369['model']['schema']['isLimit'](_0x13b71f)&&!_0x5a4369['model']['schema']['isBlock'](_0x13b71f);)_0x13b71f=_0x13b71f['parent'];if(!_0x13b71f||!_0x13b71f['name']||_0x13b71f['is']('rootElement'))return null;let _0x49ea63=null;return _0x5a4369['model']['change'](_0x2c1057=>{_0x49ea63='inside'===_0x5611bf?_0x2c1057['createRangeIn'](_0x13b71f):_0x2c1057['createRangeOn'](_0x13b71f);}),_0x49ea63;}_validateMarkers(_0x3a91ed,_0x462231){const _0x1cd737=Array['from'](this['_markers']['keys']()),_0x2a2fa9=new Map();for(const _0x29d976 of _0x1cd737){const _0x3a4aa2=_0x3a91ed['model']['markers']['get'](_0x29d976);if(!_0x3a4aa2)continue;const _0x17d422=_0x3a4aa2['getStart']()['root']['rootName']+':'+_0x3a4aa2['getStart']()['path'][0x0];_0x2a2fa9['has'](_0x17d422)||_0x2a2fa9['set'](_0x17d422,[]),_0x2a2fa9['get'](_0x17d422)['push'](_0x3a4aa2);}const _0x456e91=new Set();for(const _0x23ebaa of _0x3a91ed['model']['document']['differ']['getChanges']()){let _0x13b199,_0x3416a7;if('insert'===_0x23ebaa['type'])_0x3416a7=new _0x2827cc(_0x23ebaa['position'],_0x23ebaa['position']['getShiftedBy'](_0x23ebaa['length'])),_0x13b199=_0x23ebaa['position']['root']['rootName']+':'+_0x23ebaa['position']['path'][0x0];else{if('remove'!==_0x23ebaa['type'])continue;_0x3416a7=new _0x2827cc(_0x23ebaa['position']),_0x13b199=_0x23ebaa['position']['root']['rootName']+':'+_0x23ebaa['position']['path'][0x0];}const _0x4f41f9=_0x2a2fa9['get'](_0x13b199)||[];if(_0x4f41f9['length']){for(const _0xe828c4 of _0x4f41f9)if(_0x3416a7['root']['rootName']===_0xe828c4['getRange']()['root']['rootName']&&('insert'!==_0x23ebaa['type']||!_0x3416a7['containsRange'](_0xe828c4['getRange']()))&&(_0x3416a7['isIntersecting'](_0xe828c4['getRange']())||_0x3416a7['start']['isTouching'](_0xe828c4['getRange']()['end'])||_0x3416a7['end']['isTouching'](_0xe828c4['getRange']()['start']))){const _0xa833c3=this['_parseMarkerName'](_0xe828c4['name']);Array['from'](this['_markers']['values']())['filter'](_0x5898ea=>_0x5898ea['groupId']===_0xa833c3['groupId'])['forEach'](_0x29a483=>_0x456e91['add'](_0x29a483['id']));}}}if(_0x456e91['size']){for(const _0x5de87d of _0x456e91)_0x462231['removeMarker'](_0x5de87d);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xe50ce5){for(const {name:_0x21ce95,data:_0x291be5}of _0xe50ce5['model']['document']['differ']['getChangedMarkers']()){if(!_0x21ce95['startsWith'](Lh))continue;const _0x21dce2=_0x291be5['oldRange'],_0x1e869b=_0x291be5['newRange'],_0x516d64=_0x21dce2&&'$graveyard'===_0x21dce2['root']['rootName'],_0x4a9127=_0x1e869b&&'$graveyard'===_0x1e869b['root']['rootName'];if(_0x516d64&&_0x4a9127)continue;const _0xa32d81=this['_parseMarkerName'](_0x21ce95);this['_markers']['get'](_0x21ce95)&&(_0x4a9127||!_0x1e869b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x21ce95,'changeId':_0xa32d81['groupId']}):_0x516d64&&_0x1e869b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x21ce95,'changeId':_0xa32d81['groupId']}));}}['_parseMarkerName'](_0x11a6fb){const _0x527999=_0x11a6fb['split'](':'),_0x45c9a1=(_0x527999[0x1]||'')['split']('_');return{'prefix':_0x527999[0x0],'groupId':_0x45c9a1[0x0],'suffix':_0x45c9a1[0x1]};}_translateOperationToEditorContent(_0x2a9caa,_0x1bd43e,_0x4019a5){if('insert'===_0x2a9caa['type']){const _0x1bd7c8=_0x2a9caa;return new _0x52fe51(this['_changePosition'](_0x1bd43e['concat'](_0x1bd7c8['position']['offset']),_0x4019a5),_0x1bd7c8['nodes'],_0x1bd7c8['baseVersion']);}if('marker'===_0x2a9caa['type']&&_0x2a9caa['name']['startsWith']('$markedRemove')){const _0x1b76a9=_0x2a9caa;return new _0x5bbb57(_0x1b76a9['name'],_0x1b76a9['oldRange'],this['_changeRange'](_0x1b76a9['newRange'],_0x1bd43e['concat'](_0x1b76a9['newRange']['start']['offset']),_0x1bd43e['concat'](_0x1b76a9['newRange']['end']['offset']),_0x4019a5),_0x1b76a9['_markers'],_0x1b76a9['affectsData'],_0x1b76a9['baseVersion']);}return _0x2a9caa;}_groupAdjacentOperations(_0x268ffa){if(!_0x268ffa['length'])return[];const _0x4eb614=[];let _0x494c82=0x0,_0x53f24a=0x0,_0x6afa40=[];for(let _0x593df9=0x0;_0x593df9<=_0x268ffa['length'];_0x593df9++){const _0x2c9292=_0x268ffa[_0x593df9],_0x3e3a24=_0x268ffa[_0x593df9-0x1];!_0x2c9292||_0x3e3a24&&!this['_getOperationEnd'](_0x3e3a24)['isTouching'](this['_getOperationStart'](_0x2c9292))?(_0x4eb614['push']({'operations':_0x6afa40,'operationsIsolated':_0x6afa40['map'](_0x54a9fc=>this['_shiftOperation'](_0x54a9fc['clone'](),-_0x53f24a)),'groupOffset':_0x494c82}),_0x6afa40=_0x2c9292?[_0x2c9292]:[],_0x53f24a+=_0x494c82,_0x494c82=0x0):_0x6afa40['push'](_0x2c9292),_0x2c9292&&'insert'===_0x2c9292['type']&&(_0x494c82+=_0x2c9292['howMany']);}return _0x4eb614;}_findAdjacentContextDistance(_0x3127f5,_0x3940c4,_0x10a388,_0x499b5e=0x1){const _0x2e2cc6=new _0x28cad7({'startPosition':_0x3127f5,'direction':_0x3940c4});let _0x5466e4=0x0;for(let _0x38042c=0x0;_0x38042c<_0x499b5e;_0x38042c++){let _0x4fbdd3=0x0,_0x4be4e0=!0x1,_0x52de4d='forward'===_0x3940c4?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x41e1bb}of _0x2e2cc6)if(_0x41e1bb['is']('$textProxy')){const _0xcf11bb=_0x52de4d['exec'](_0x41e1bb['data']);if(_0xcf11bb&&_0xcf11bb['length']){if(_0x4fbdd3+='forward'===_0x3940c4?_0xcf11bb['index']+_0xcf11bb[0x0]['length']:_0x41e1bb['data']['length']-_0xcf11bb['index'],_0xcf11bb[0x0]['length']!==_0x41e1bb['data']['length'])break;_0x4be4e0=!0x0,_0x52de4d='forward'===_0x3940c4?/^\w+/:/\w+$/;}else{if(_0x4be4e0)break;_0x4fbdd3+=_0x41e1bb['offsetSize'];}}else{if(_0x41e1bb['is']('element')){_0x10a388['isInline'](_0x41e1bb)&&!_0x4be4e0&&(_0x4fbdd3+=0x1);break;}}_0x5466e4+=_0x4fbdd3,_0x2e2cc6['jumpTo'](_0x3127f5['getShiftedBy']('forward'===_0x3940c4?_0x5466e4:-_0x5466e4));}return _0x5466e4;}_getChangeContext(_0x31bbdb,_0x220132,_0x1b0544){const _0x3815a5=_0x1b0544['model']['schema'],_0x575f88=this['_findAdjacentContextDistance'](_0x31bbdb,'backward',_0x3815a5,0x6),_0x4b1bbf=this['_findAdjacentContextDistance'](_0x220132,'forward',_0x3815a5,0x6),_0x361e74=_0x31bbdb['getShiftedBy'](-_0x575f88),_0x1067e9=_0x220132['getShiftedBy'](_0x4b1bbf);return{'start':_0x361e74,'end':_0x1067e9,'hasContentBefore':!_0x361e74['isAtStart'],'hasContentAfter':!_0x1067e9['isAtEnd']};}_insertMarkers(_0x34f630,_0x3afcd0){const _0x42deb0=this['context']['plugins']['get']('AIEditing'),_0x2f5821=new Set();_0x3afcd0['model']['change'](_0x30f92f=>{for(const _0x12e633 of _0x34f630){const _0x1ed4fe=''+Lh+_0x12e633['type']+':'+_0x12e633['groupId']+'_'+_0x42deb0['_nextDataId'](_0x2f5821);this['_markers']['set'](_0x1ed4fe,{'id':_0x1ed4fe,'groupId':_0x12e633['groupId'],'type':_0x12e633['type'],'content':_0x12e633['content'],'editor':_0x3afcd0}),_0x30f92f['addMarker'](_0x1ed4fe,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30f92f['createRange'](_0x12e633['start'],_0x12e633['end'])});}});}_createGetContextFn(_0x23b288,_0x45634e,_0x174d0e){let _0x75dc01='';return()=>{if(!_0x75dc01){const _0x129ac8=_0x45634e['toView'](_0x23b288,{'showSuggestionHighlights':!0x0});let _0x4ef6a2=_0x129ac8['getChild'](0x0);if(_0x4ef6a2['is']('containerElement')||(_0x4ef6a2=_0x129ac8),!_0x4ef6a2)return'';let _0xfd1421=!0x1;const _0x447cef=[];for(const _0x22eed6 of _0x4ef6a2['getChildren']())_0x22eed6['is']('element','span')&&_0x22eed6['hasClass']('ck-ai_review-marker_context-end')&&(_0xfd1421=!0x1),_0xfd1421&&_0x447cef['push'](_0x22eed6),_0x22eed6['is']('element','span')&&_0x22eed6['hasClass']('ck-ai_review-marker_context-start')&&(_0xfd1421=!0x0);_0x4ef6a2['_removeChildren'](0x0,_0x4ef6a2['childCount']),_0x174d0e?.['ellipsisBefore']&&_0x4ef6a2['_appendChild']('…'),_0x4ef6a2['_appendChild'](_0x447cef),_0x174d0e?.['ellipsisAfter']&&_0x4ef6a2['_appendChild']('…');const _0x59c90a=_0x45634e['htmlProcessor']['domConverter']['viewToDom'](_0x129ac8),_0x557112=_0x45634e['htmlProcessor']['htmlWriter']['getHtml'](_0x59c90a);_0x75dc01=this['_removeUnsupportedElements'](_0x557112);}return _0x75dc01;};}_createGetContentFn(_0x1db6c5,_0x4e59ad){let _0x398498='';return()=>(_0x398498||(_0x398498=this['_removeUnsupportedElements'](_0x4e59ad['stringify'](_0x1db6c5,{'showSuggestionHighlights':!0x0}))),_0x398498);}_createGetContentUsingDataIdFn(_0x5e5f3b,_0x24300a,_0x273242){let _0x4e36a9='';return()=>{if(!_0x4e36a9){const _0x259759=_0x273242['toView'](new _0x28e306(_0x5e5f3b));_0x4e36a9=_0x273242['htmlProcessor']['domConverter']['viewToDom'](_0x259759)['querySelector']('[data-id=\x22'+_0x24300a+'\x22]')?.['outerHTML']||'';}return _0x4e36a9;};}_removeUnsupportedElements(_0x33ea51){if(!_0x33ea51)return'';const _0x263889=Rs(_0x33ea51,{'decodeEntities':!0x1}),_0x2aba53=ys(_0x263889);if(!_0x2aba53['length'])return _0x33ea51;for(const _0x22d881 of _0x2aba53)_0x47cc1f(_0x22d881);return Os(_0x263889,{'encodeEntities':!0x1});}_neutralizeChangesOnUnsupportedElements(_0x3ed590,_0x14e9e1){const _0xe86d9f=Rs(_0x3ed590,{'decodeEntities':!0x1}),_0x19d233=Rs(_0x14e9e1,{'decodeEntities':!0x1}),_0x38e518=ys(_0xe86d9f),_0x4209a9=ys(_0x19d233);if(!_0x38e518['length']&&!_0x4209a9['length'])return{'contentInitial':_0x3ed590,'contentNew':_0x14e9e1};const _0x382bb2=new Map(),_0x11b084=new Map();for(const _0x2bb952 of _0x38e518){const _0x2f14b5=Ps(_0x2bb952,'data-id');if(_0x2f14b5)_0x382bb2['set'](_0x2f14b5,_0x2bb952);else{const _0x317b7f=Os(_0x2bb952,{'encodeEntities':!0x1}),_0x2e77d7=_0x11b084['get'](_0x317b7f);_0x2e77d7?_0x2e77d7['push'](_0x2bb952):_0x11b084['set'](_0x317b7f,[_0x2bb952]);}}for(const _0x29ade7 of _0x4209a9){const _0x49f85c=Ps(_0x29ade7,'data-id');let _0x40b3ba;if(_0x49f85c)_0x40b3ba=_0x382bb2['get'](_0x49f85c);else{const _0x39001b=_0x11b084['get'](Os(_0x29ade7,{'encodeEntities':!0x1}));_0x40b3ba=_0x39001b&&_0x39001b['length']?_0x39001b['shift']():void 0x0;}_0x40b3ba?_0x452856(_0x29ade7,_0x2a3383(_0x40b3ba,!0x0)):_0x47cc1f(_0x29ade7);}return{'contentInitial':Os(_0xe86d9f,{'encodeEntities':!0x1}),'contentNew':Os(_0x19d233,{'encodeEntities':!0x1})};}_findMarkerElement(_0x4f4154,_0x4997e9=0x5){let _0x519067=_0x4f4154,_0x47d026=null;for(let _0x34224d=0x0;_0x34224d<_0x4997e9&&_0x519067;_0x34224d++)if(_0x519067['className']){if((''+_0x519067['className'])['includes']('ck-ai_review-marker_')){if(!_0x519067['getAttribute']('data-marker-id'))break;_0x47d026=_0x519067;break;}_0x519067=_0x519067['parentElement'];}else _0x519067=_0x519067['parentElement'];return _0x47d026;}_findMarkerElementById(_0x2361b9){const _0x1855fc=this['_markers']['get'](_0x2361b9);if(!_0x1855fc)return null;const _0x948901=_0x1855fc['editor']['model']['markers']['get'](_0x2361b9);return _0x948901?_0x497b83(_0x1855fc['editor']['editing'],_0x948901):null;}_getMarkersDataForGroup(_0x12f406){return Array['from'](this['_markers']['values']())['filter'](_0x2b7a44=>_0x2b7a44['groupId']===_0x12f406);}_getOperationStart(_0xa2f6ee){return'insert'===_0xa2f6ee['type']?_0xa2f6ee['position']:_0xa2f6ee['newRange']['start'];}_getOperationEnd(_0x545f76,_0xb17176=!0x1){return'insert'===_0x545f76['type']?_0xb17176?_0x545f76['position']:_0x545f76['position']['getShiftedBy'](_0x545f76['howMany']):_0x545f76['newRange']['end'];}_shiftOperation(_0x349814,_0x5cc590){return'insert'===_0x349814['type']?_0x349814['position']=_0x349814['position']['getShiftedBy'](_0x5cc590):'marker'===_0x349814['type']&&_0x349814['newRange']&&(_0x349814['newRange']=new _0x2827cc(_0x349814['newRange']['start']['getShiftedBy'](_0x5cc590),_0x349814['newRange']['end']['getShiftedBy'](_0x5cc590))),_0x349814;}_changeOperationOwnerDocument(_0x216df3,_0xd647f7){'insert'===_0x216df3['type']?_0x216df3['position']=this['_changePositionOwnerDocument'](_0x216df3['position'],_0xd647f7):'marker'===_0x216df3['type']&&_0x216df3['newRange']&&(_0x216df3['newRange']=this['_changeRangeOwnerDocument'](_0x216df3['newRange'],_0xd647f7));}_changePositionOwnerDocument(_0x4a19de,_0x5babf6){return new _0x4febba(_0x5babf6,_0x4a19de['path']);}_changeRangeOwnerDocument(_0x1c144d,_0x443c8b){return new _0x2827cc(this['_changePositionOwnerDocument'](_0x1c144d['start'],_0x443c8b),this['_changePositionOwnerDocument'](_0x1c144d['end'],_0x443c8b));}_changePosition(_0x45bb72,_0x337b01){return new _0x4febba(_0x337b01,[..._0x45bb72]);}['_changeRange'](_0x278dd5,_0x4dece2,_0x4413e5,_0x45f110){return new _0x2827cc(this['_changePosition'](_0x4dece2,_0x45f110),this['_changePosition'](_0x4413e5,_0x45f110));}_sortMarkers(_0x96f6f0){const _0x1b2fe3=_0x47d387=>{switch(_0x47d387){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x96f6f0['sort']((_0x3d7421,_0x15ef03)=>_0x1b2fe3(_0x3d7421['type'])-_0x1b2fe3(_0x15ef03['type']));}_hasSameTopLevelElement(_0x263d92,_0x4735d6){const _0x3099fb=_0x263d92['getChild'](0x0),_0x59f756=_0x4735d6['getChild'](0x0);return!(!_0x3099fb||!_0x59f756)&&((!_0x3099fb['is']('element')||!_0x59f756['is']('element')||_0x3099fb['name']===_0x59f756['name'])&&!(_0x3099fb['is']('element')&&!_0x59f756['is']('element')||!_0x3099fb['is']('element')&&_0x59f756['is']('element')));}_haveSingleTopLevelElement(_0x2305ed){return 0x1===_0x2305ed['childCount'];}_haveOnlyInlineContent(_0x1166c4,_0x3abd5b){for(const _0x4146da of _0x1166c4['getChildren']())if(_0x4146da['is']('element')&&!_0x3abd5b['isInline'](_0x4146da))return!0x1;return!0x0;}_upsertDataId(_0x37eb35,_0x13d4db){let _0x2a4c2c=_0x37eb35['getAttribute'](_0x4fabc2);return _0x2a4c2c||(_0x2a4c2c=_0x13d4db(),_0x37eb35['_setAttribute'](_0x4fabc2,_0x2a4c2c)),_0x2a4c2c;}};const Mh=/* #__PURE__ -- @preserve */
38
+ dt();var Uh=class extends Mh{['id'];contentNew;contentInitial;documentVersion;constructor({id:_0xc306a0,contentNew:_0x4bf95b,contentInitial:_0x424161,documentVersion:_0x5d97a2}){super(),this['id']=_0xc306a0,this['contentNew']=_0x4bf95b,this['contentInitial']=_0x424161,this['documentVersion']=_0x5d97a2;}};const Vh=/* #__PURE__ -- @preserve */
39
+ At();var Bh=class extends Vh{['id'];parent;editor;_data;_editorOperations=[];constructor(_0xcf1aca,_0x500d41,_0x282bff,_0x416d73){super(),this['id']=_0xcf1aca,this['parent']=_0x282bff,this['editor']=_0x416d73,this['_data']=_0x500d41,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']['wrapperTag']?function(_0x118063){const _0x1796ef=Rs(_0x118063)['children']['filter'](_0x545292);return 0x1!==_0x1796ef['length']?_0x118063:_0x1796ef[0x0]['children']['map'](_0xde8499=>Os(_0xde8499))['join']('');}(this['_data']['context']()):this['_data']['context']();}get['wrapperTag'](){return this['_data']['wrapperTag'];}get operations(){return this['_data']['operations']['slice']();}get operationsIsolated(){return this['_data']['operationsIsolated']['slice']();}};const Gh=/* #__PURE__ -- @preserve */
40
+ At();var Fh=class extends Gh{['id']=kt();['callId'];_results=new Map();['_changes']=[];_hasUnsupportedInlineChange=!0x1;['_sourceCheck'];_documentData;_aiConnector;['_reviewParams'];['_reviewArgs'];_contexts;_activeRequest=null;_currentError;_wasAborted=!0x1;constructor(_0x68a329,_0x415056,_0x2b2509,_0x31a9cd,_0x50f356,_0x3c0e3f){super(),this['_sourceCheck']=_0x415056,this['_documentData']=_0x68a329,this['_aiConnector']=_0x2b2509,this['_reviewParams']=_0x31a9cd,this['_reviewArgs']=_0x50f356,this['_contexts']=_0x3c0e3f,this['on']('change:status',(_0x427587,_0x368e21,_0x4c40a4)=>{'aborted'==_0x4c40a4&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4c40a4,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get documentData(){return this['_documentData'];}get['sourceCheck'](){return this['_sourceCheck'];}get processedResultsCount(){return this['_results']['size'];}get hasUnsupportedInlineChange(){return this['_hasUnsupportedInlineChange'];}get title(){return this['_sourceCheck']['title'];}get subTitle(){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get hasModifications(){return!this['_changes']['every'](_0x2f412f=>'pending'===_0x2f412f['status']);}get currentError(){return this['_currentError'];}get results(){return Array['from'](this['_results']['values']());}updateDocumentData(_0x5c9755){this['_documentData']=_0x5c9755;}async start(){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x47f426=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x2a716c of _0x47f426)'unmodified'!==_0x2a716c['data']['operation']&&('error'!==_0x2a716c['data']['operation']?'review-metadata'!==_0x2a716c['event']?this['_addReviewCheckResult'](_0x2a716c['data']['dataId'],_0x2a716c['data']['textDelta']):this['callId']=_0x2a716c['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x5acdb3){this['_currentError']=_0x5acdb3,kn(_0x5acdb3)?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async restart(){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,this['_hasUnsupportedInlineChange']=!0x1,await this['start']();}addResultChanges(_0x19a589,_0x32a218){const _0x47a609=this['_results']['get'](_0x19a589);if(!_0x47a609)return;if(0x0===_0x32a218['length'])return;const _0x25f30d=this['_documentData']['elements']['get'](_0x19a589);if(!_0x25f30d)return;const _0x4969ae=[];_0x32a218['forEach']((_0x455983,_0x2e5e9f)=>{const _0x403be0=new Bh(_0x47a609['id']+'-'+_0x2e5e9f,_0x455983,_0x47a609,_0x25f30d['editor']);_0x403be0['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x403be0,'status':_0x403be0['status']});}),_0x403be0['on']('change:isActivated',()=>{_0x403be0['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x403be0}):this['fire']('reviewCheckResultDeactivated',{'change':_0x403be0});}),this['_changes']['push'](_0x403be0),_0x4969ae['push'](_0x403be0);}),this['fire']('reviewCheckResultReady',{'changes':_0x4969ae,'result':_0x47a609,'source':this});}abort(){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}isChangeActive(_0x30798e){const _0x5c9a53=this['_changes']['find'](_0x4fdba1=>_0x4fdba1['id']===_0x30798e);return!(!_0x5c9a53||'pending'!==_0x5c9a53['status']);}isAnyChangeActivated(){return this['_changes']['some'](_0x250cad=>!0x0===_0x250cad['isActivated']);}getActiveChanges(){return this['_changes']['filter'](_0x3580d3=>'pending'===_0x3580d3['status']);}getChangeById(_0x2337dc){return this['_changes']['find'](_0x27131c=>_0x27131c['id']===_0x2337dc);}markAllChangesAsAccepted(){for(const _0x18a020 of this['_changes'])'pending'===_0x18a020['status']&&(_0x18a020['status']='accepted');this['_checkIfFinished']();}markChangeAsAccepted(_0x4ab2bf){const _0x323770=this['_changes']['find'](_0xc1f4fb=>_0xc1f4fb['id']===_0x4ab2bf);_0x323770&&'pending'===_0x323770['status']&&(_0x323770['status']='accepted'),this['_checkIfFinished']();}markChangeAsRejected(_0x420749){const _0x4a0285=this['_changes']['find'](_0x2db1b5=>_0x2db1b5['id']===_0x420749);_0x4a0285&&'pending'===_0x4a0285['status']&&(_0x4a0285['status']='rejected'),this['_checkIfFinished']();}markChangeAsOutdated(_0x36a007){const _0x2f7a4b=this['_changes']['find'](_0x41a2b8=>_0x41a2b8['id']===_0x36a007);_0x2f7a4b&&'pending'===_0x2f7a4b['status']&&(_0x2f7a4b['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x373b3e){const _0x5d3de0=this['_changes']['find'](_0x29e1e9=>_0x29e1e9['id']===_0x373b3e);_0x5d3de0&&'outdated'===_0x5d3de0['status']&&(_0x5d3de0['status']='pending'),this['_checkIfFinished']();}activateChange(_0x38e955){this['_changes']['filter'](_0x23efc5=>_0x23efc5['isActivated']&&_0x23efc5['id']!==_0x38e955)['forEach'](_0x53f69d=>{_0x53f69d['isActivated']=!0x1;});const _0x1c1396=this['_changes']['find'](_0x32ff78=>_0x32ff78['id']===_0x38e955);_0x1c1396&&'pending'===_0x1c1396['status']&&(_0x1c1396['isActivated']=!0x0);}deactivateChange(){this['_changes']['filter'](_0x17bc2d=>_0x17bc2d['isActivated'])['forEach'](_0x32f488=>{_0x32f488['isActivated']=!0x1;});}forceReadyState(){this['status']='ready';}async sendRating(_0x43c4af){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x10359e;if(_0x43c4af){const _0x3257d2=this['_changes']['find'](_0x4bfe80=>_0x4bfe80['id']===_0x43c4af);if(_0x3257d2&&_0x3257d2['isRated'])return;_0x3257d2&&(_0x10359e=_0x3257d2['parent']['id'],_0x3257d2['isRated']=!0x0);}const _0x3e7127={'positiveCount':this['_changes']['filter'](_0x2726ff=>'accepted'===_0x2726ff['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3e7127,this['callId'],_0x10359e);}_addReviewCheckResult(_0x592493,_0x3735c8){const _0x363142=this['_documentData']['elements']['get'](_0x592493);if(!_0x363142)return;if(Gs(_0x363142['editor'],_0x363142['rootName'])&&!Ys(_0x363142['editor'],Rs(_0x3735c8)))return void(this['_hasUnsupportedInlineChange']=!0x0);const _0x1d85fa=_0x363142['getContent']();if(_0x1d85fa===_0x3735c8)return;const _0x53d591=new Uh({'id':_0x592493,'contentInitial':_0x1d85fa,'contentNew':_0x3735c8,'documentVersion':_0x363142['documentVersion']});this['_results']['set'](_0x53d591['id'],_0x53d591),this['fire']('reviewCheckResultAdded',{'result':_0x53d591,'source':this,'editor':_0x363142['editor'],'rootName':_0x363142['rootName']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0x38a88d=>'pending'===_0x38a88d['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x410f07=>'pending'===_0x410f07['status'])['length']&&(this['status']='finished');}},Kh=class extends Fh{get subTitle(){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1dcd31=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x255e55=0x0;_0x255e55<this['_reviewParams']['length'];_0x255e55++){if(!this['_reviewParams'][_0x255e55]||!this['_sourceCheck']['options'][_0x255e55])continue;const _0x1450f5=this['_sourceCheck']['options'][_0x255e55]['data']?.['find'](_0x190f80=>_0x190f80['id']===this['_reviewParams'][_0x255e55]);_0x1450f5&&_0x1dcd31['push'](_0x1450f5['label']);}return _0x1dcd31['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}_createApiRequest(){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs'],'contexts':this['_contexts']});}_sendRatingRequest(_0x3f65c2,_0x564f47,_0x1818f5){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x564f47,_0x3f65c2,_0x1818f5);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Wh=class extends _0x898608{_aiConnector;['_aiReviewCoreUi'];_aiReviewCoreEditing;['_availableReviewChecks'];_reporter;_currentReviewCheckRun;_changeActivationSource=null;static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async _initAvailableReviewChecks(){this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}_initUIListeners(){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x4fd527,_0x70b29b)=>this['runCheck'](_0x70b29b)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x16ffbe=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x16ffbe['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x16ffbe['map'](_0x2089f0=>_0x2089f0['id']),this['_aiSource']);const _0x1cf8e6=this['_currentReviewCheckRun'];_0x1cf8e6['markAllChangesAsAccepted'](),_0x1cf8e6['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x43a84b,_0x11340a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x11340a['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x11340a['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x11340a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x11340a['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5d9db8,_0x5b2c52)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5b2c52['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5b2c52['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5b2c52['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5b2c52['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreUi']['setAcceptAllEnabled'](!0x1),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x5b1289,_0x381622)=>{this['_onActivateChange'](_0x381622);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2a8287,_0xec569e)=>{this['_onDeactivateChange'](_0xec569e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x10be03,_0x11f996)=>{this['_onChangeMarkerClicked'](_0x10be03,_0x11f996);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x2ba404,_0x4ec513)=>{this['_onChangeMarkerHovered'](_0x2ba404,_0x4ec513);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x5de019,_0x562468)=>{this['_onChangeMarkerRemoved'](_0x5de019,_0x562468);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x197d86,_0x1ec56c)=>{this['_onChangeMarkerRestored'](_0x197d86,_0x1ec56c);});}async['runCheck'](_0x2b5caf){if(!this['_availableReviewChecks'])return;const _0x4dad9f=this['_availableReviewChecks']['find'](_0x3ca8f2=>_0x3ca8f2['id']===_0x2b5caf['id']);if(!_0x4dad9f)return void this['_logError'](new ct('ai-review-mode-source-check-not-found',this,{'checkId':_0x2b5caf['id']}));this['_onReviewCheckRun'](_0x2b5caf),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_aiReviewCoreUi']['setAcceptAllEnabled'](!0x1);const _0x33b0d5=this['context']['plugins']['get'](fs)['contextLibrary']['resolveContext']({'feature':this['_defaultContextFeature'],'ids':[_0x2b5caf['id']],'context':new Yn()});this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2b5caf,_0x4dad9f,_0x33b0d5);const _0x22ce61=this['_currentReviewCheckRun'];_0x22ce61['on']('reviewCheckResultChangeStatusUpdated',(_0x49b274,_0x4fb2af)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4fb2af['change']['id'],_0x4fb2af['status']),this['_pushAcceptAllEnabled'](_0x22ce61);}),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x1e24e2,_0x5d3e92)=>{switch(_0x5d3e92['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5d3e92);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ct('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ct('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x5d3e92['status']&&'error-chunk'!==_0x5d3e92['status']&&'error-general'!==_0x5d3e92['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4aa41f,_0x2d87ba)=>{if(!this['_currentReviewCheckRun'])throw new ct('ai-review-mode-no-current-check-run',this);const _0x3b6abc=Gs(_0x2d87ba['editor'],_0x2d87ba['rootName']);let _0x4a4090=_0x2d87ba['result']['contentInitial'],_0x4095bc=_0x2d87ba['result']['contentNew'];_0x3b6abc&&(_0x4a4090=Ws(_0x4a4090),_0x4095bc=Ws(_0x4095bc));const _0x32675a=this['_diffContent'](_0x2d87ba['editor'],_0x4a4090,_0x4095bc);if(_0x3b6abc){const _0x574732=_0x2d87ba['editor']['ui']['getEditableElement'](_0x2d87ba['rootName'])?.['tagName']['toLowerCase']();for(const _0x5c6350 of _0x32675a)_0x5c6350['wrapperTag']=_0x574732;}_0x2d87ba['source']['addResultChanges'](_0x2d87ba['result']['id'],_0x32675a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4708f0,_0x3e9d83)=>{for(const _0x16feaf of _0x3e9d83['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x16feaf);this['_pushAcceptAllEnabled'](_0x3e9d83['source']),this['_markChangePositionInEditorContent'](_0x3e9d83['changes'],_0x3e9d83['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4cac66,_0x4a6728)=>{this['_onReviewCheckResultActivated'](_0x4a6728);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x430521){if(kn(_0x430521))return;_0x430521 instanceof ct?this['_logError'](_0x430521):this['_logError'](new ct('ai-review-mode-check-run-failed',this,void 0x0,_0x430521));}}abort(){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}getAvailableChecks(){return(this['_availableReviewChecks']??[])['slice']();}getCurrentCheckRun(){return this['_currentReviewCheckRun'];}_pushAcceptAllEnabled(_0x2cc22d){this['_aiReviewCoreUi']['setAcceptAllEnabled'](_0x2cc22d['getActiveChanges']()['length']>0x0);}_createReviewCheckRun(_0x4db18e,_0x292d99,_0x3ab97f=new Yn()){return new Kh(this['_aiReviewCoreEditing']['getDocumentData'](),_0x292d99,this['_aiConnector'],_0x4db18e['params'],_0x4db18e['args'],_0x3ab97f['refs']);}['_onChangeMarkerRemoved'](_0x4f50e3,_0x4fa692){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4fa692['changeId']);}_onChangeMarkerRestored(_0x246173,_0x3ccbc3){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3ccbc3['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}_initRequiredPlugins(){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aireview');}['_onReviewRunLeave'](_0x3f6b48=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3f6b48&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x46cf04 of this['_aiReviewCoreEditing']['getEditors']())_0x46cf04['editing']['view']['change'](_0x3f4991=>{for(const _0x3a67cd of _0x46cf04['editing']['view']['document']['getRoots']())_0x3f4991['removeClass']('ck-ai_review-diff',_0x3a67cd),_0x3f4991['removeClass']('ck-ai_review-highlights',_0x3a67cd),_0x3f4991['removeClass']('ck-ai-translate-mode-content',_0x3a67cd);});}['_logError'](_0x26b4c8){this['_reporter']['logError'](_0x26b4c8),'ai-review-mode-models-unable-to-retrieve'===function(_0xc974a3){return _0xc974a3 instanceof yn?_0xc974a3['code']:_0xc974a3 instanceof Error?_0xc974a3['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x26b4c8)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x1bf7b5){if('content'===this['_changeActivationSource']){const _0x40b389=this['_aiReviewCoreUi']['getChangeElement'](_0x1bf7b5);_0x40b389&&Rt(_0x40b389['closest']('.ck-ai_review__check-run-result')||_0x40b389);}else{if('panel'===this['_changeActivationSource']){const _0x331434=this['_getChangeContentElement'](_0x1bf7b5);if(!_0x331434)return;Ot({'target':_0x331434,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}},Yh=class extends Fh{_prompt;['_model'];constructor(_0x50ccfa,_0x2d6a44,_0x4522c0,_0x21d765,_0xb31fab,_0x4e3e0c){super(_0x4522c0,_0x21d765,_0xb31fab,void 0x0,void 0x0,_0x4e3e0c),this['_prompt']=_0x50ccfa,this['_model']=_0x2d6a44;}get subTitle(){return this['_prompt']??'';}_createApiRequest(){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],...void 0x0!==this['_prompt']&&{'prompt':this['_prompt']},'model':this['_model'],'contexts':this['_contexts']});}_sendRatingRequest(_0x6d5cdd,_0x54af6d,_0x19e71b){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x54af6d,_0x6d5cdd,_0x19e71b);}},$h=class{['id'];['commandId'];title;description;isParameterized;['useArgs'];options;['args'];get['apiId'](){return this['commandId'];}constructor(_0x28734e){this['id']=_0x28734e['id'],this['commandId']=_0x28734e['commandId'],this['title']=_0x28734e['title'],this['description']=_0x28734e['description'],this['isParameterized']=_0x28734e['isParameterized'],this['useArgs']=_0x28734e['useArgs'],this['options']=_0x28734e['options'],this['args']=_0x28734e['args'];}},qh=class extends $h{isExtra=!0x0;prompt;context;['model'];_defaultModel=null;constructor(_0x32ae19,_0x366505,_0x40b8fe){super(_0x32ae19),this['prompt']=_0x32ae19['prompt'],this['context']=_0x32ae19['context'],this['model']=_0x32ae19['model'],this['model']?this['_defaultModel']=_0x366505['find'](_0x19990a=>_0x19990a['id']===this['model'])||null:this['_defaultModel']=_0x40b8fe;}get defaultModel(){return this['_defaultModel'];}},Qh=class extends Yh{get subTitle(){return'';}set prompt(_0xcaafa7){this['_prompt']=_0xcaafa7;}set['model'](_0x295a7c){this['_model']=_0x295a7c;}},Xh=class extends _0x898608{static get requires(){return[Is,Nn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];_reporter;init(){this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aireview');}getChecksList(){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const zh=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}],jh=/* #__PURE__ -- @preserve */
41
+ At();var Jh=class extends jh{['_checks']=[];setupChecks(_0x206f97){this['_checks']=_0x206f97['map'](_0x9f523d=>new $h(_0x9f523d));}get['checks'](){return this['_checks']['slice']();}getCheckById(_0x45ed69){return this['checks']['find'](_0x31b596=>_0x31b596['id']===_0x45ed69);}['removeCheckById'](_0x4f455c){this['_checks']=this['_checks']['filter'](_0x23a832=>_0x23a832['id']!==_0x4f455c);}},Zh=class extends $h{['_models']=[];_defaultModel=null;constructor(_0x3a2ac6,_0x18311a,_0x30e65c){super(_0x3a2ac6),this['_models']=_0x18311a,this['_defaultModel']=_0x30e65c;}get['models'](){return this['_models']['slice']();}get defaultModel(){return this['_defaultModel'];}},tc=class extends Jh{['_allModels']=[];['_recommendedModels']=[];_defaultModel=null;constructor(_0x12e22f,_0x8f7b2a,_0x32c104){super(),this['_allModels']=_0x12e22f,this['_recommendedModels']=_0x8f7b2a,this['_defaultModel']=_0x32c104;}get['allModels'](){return this['_allModels']['slice']();}setupChecks(_0x5e37fc){this['_checks']=_0x5e37fc['map'](_0x11acf3=>!0x0===_0x11acf3['isExtra']?new qh(_0x11acf3,this['_allModels'],this['_defaultModel']):'custom'===_0x11acf3['id']?new Zh(_0x11acf3,this['_recommendedModels'],this['_defaultModel']):new $h(_0x11acf3));}},ec=class extends Xh{static get['pluginName'](){return'AIReviewModeCheckRegistry';}static get requires(){return[Is,Nn,fs];}['_modelsLoadError']=null;constructor(_0x2dec76){super(_0x2dec76),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}getExtraChecks(){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0xab3105=>({'id':_0xab3105['id'],'commandId':_0xab3105['id'],'title':_0xab3105['label'],'description':_0xab3105['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0xab3105['prompt'],'context':_0xab3105['context'],'model':_0xab3105['model']}));}async _loadChecksList(){const _0x580e20=[...zh,...this['getExtraChecks']()]['map'](_0x13a4b5=>_0x13a4b5['isExtra']?_0x13a4b5:this['_translateReviewCheck'](_0x13a4b5)),_0x1002fa=this['context']['plugins']['get'](fs);let _0xb54353;try{_0xb54353=new tc(await _0x1002fa['models']['getAllModels'](),await _0x1002fa['models']['getAvailableModels'](),await _0x1002fa['models']['getDefault']()),this['_modelsLoadError']=null;}catch(_0x1d359d){this['_modelsLoadError']=new ct('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x1d359d),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),_0xb54353=new tc([],[],null);}return _0xb54353['setupChecks'](_0x580e20),_0xb54353;}_translateReviewCheck(_0x52311d){const _0x38954a='AI_REVIEW_CHECK_'+_0x52311d['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x4ad601={..._0x52311d,'title':this['_translate'](_0x38954a+'_TITLE',_0x52311d['title']),'description':this['_translate'](_0x38954a+'_DESCRIPTION',_0x52311d['description'])};return _0x52311d['options']&&(_0x4ad601['options']=_0x52311d['options']['map'](_0x50394b=>({..._0x50394b,'label':this['_translate'](_0x38954a+'_OPTIONS_LABEL',_0x50394b['label']||''),'data':_0x50394b['data']?_0x50394b['data']['map'](_0x211fc8=>({..._0x211fc8,'label':this['_translate'](_0x38954a+'_OPTIONS_DATA_'+_0x211fc8['id']['toUpperCase'](),_0x211fc8['label'])})):void 0x0}))),_0x4ad601;}_translate(_0x134a5a,_0x23c7f6){const _0x54e609=Es(this['context']['locale'],_0x134a5a);return _0x54e609===_0x134a5a?_0x23c7f6:_0x54e609;}},ic=class extends Wh{static get['pluginName'](){return'AIReviewModeController';}static get requires(){return[Nn,ec,fs];}get['_aiSource'](){return'review';}get _defaultContextFeature(){return'review';}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0x592661){super(_0x592661),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',zh['map'](_0x58ed76=>_0x58ed76['id']));}init(){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0xaf273b,_0x28ecfd)=>{this['_isDiffOn']=_0x28ecfd['on'],this['_onDiffChange'](this['_isDiffOn']);});}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x6a1c8d,_0x396e6a,_0x3b18c6=new Yn()){if(_0x6a1c8d['isCustom'])return new Yh(_0x6a1c8d['args']['prompt'],_0x6a1c8d['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x396e6a,this['_aiConnector'],_0x3b18c6['refs']);if(_0x396e6a['isExtra']){const _0x1c80e1=_0x396e6a,_0x16a338=_0x1c80e1['context']?_0x3b18c6['cloneWith'](_0x1c80e1['context'])['refs']:_0x3b18c6['refs'];return new Qh(_0x6a1c8d['args']?.['prompt']??_0x1c80e1['prompt'],_0x6a1c8d['args']?.['model']??_0x1c80e1['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x396e6a,this['_aiConnector'],_0x16a338);}return new Kh(this['_aiReviewCoreEditing']['getDocumentData'](),_0x396e6a,this['_aiConnector'],_0x6a1c8d['params'],_0x6a1c8d['args'],_0x3b18c6['refs']);}_onReviewCheckResultActivated(_0x19adb9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x19adb9['change']['id']),this['_scrollToChange'](_0x19adb9['change']['id']);const _0x3a5161=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x19adb9['change']['id']);if(!_0x3a5161)return;const _0x592a85=this['_aiReviewCoreEditing']['getEditorForChange'](_0x19adb9['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x19adb9['change'],()=>_0x3a5161['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x592a85,_0x3a5161['modelRange']['root']['rootName']),_0x592a85?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x19adb9['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}_onActivateChange(_0xf04681){this['_currentReviewCheckRun']&&'click'===_0xf04681['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xf04681['id']));}_onDeactivateChange(_0x1d04d6){this['_currentReviewCheckRun']&&'balloon'===_0x1d04d6['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3f5be8,_0x3db505){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3db505['changeId']);const _0x25fb43=this['_currentReviewCheckRun']['getChangeById'](_0x3db505['changeId']);if(!_0x25fb43)return;const _0x13c6a4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3db505['changeId']),_0x7ee0ef=this['_aiReviewCoreEditing']['getEditorForChange'](_0x3db505['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x25fb43,_0x3db505['markerElement'],_0x3db505['domEvent'],'click',this['_getBalloonDomRoot'](_0x7ee0ef,_0x13c6a4?.['modelRange']['root']['rootName']),_0x7ee0ef?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x47a6b4,_0x5a5355){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x101c13=this['_currentReviewCheckRun']['getChangeById'](_0x5a5355['changeId']);if(!_0x101c13)return;const _0x3494f5=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5a5355['changeId']),_0x480c62=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5a5355['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x101c13,_0x5a5355['markerElement'],_0x5a5355['domEvent'],'hover',this['_getBalloonDomRoot'](_0x480c62,_0x3494f5?.['modelRange']['root']['rootName']),_0x480c62?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']());}_getChangeContentElement(_0x2a66ca){const _0x4a672b=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2a66ca);return _0x4a672b?_0x4a672b['getElement']():null;}_markChangePositionInEditorContent(_0x2ce39c,_0xc8a4cb){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2ce39c,_0xc8a4cb);}_diffContent(_0xe45ed4,_0x189896,_0x326b20){return this['_aiReviewCoreEditing']['diffContent'](_0xe45ed4,_0x189896,_0x326b20,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0xe8fe27){_0xe8fe27?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0xf3e5d9 of this['_aiReviewCoreEditing']['getEditors']())_0xf3e5d9['editing']['view']['change'](_0x42a7d2=>{for(const _0x28d44d of _0xf3e5d9['editing']['view']['document']['getRoots']()){for(const _0x313960 of _0x28d44d['getClassNames']())_0x313960['startsWith']('ck-ai_review-')&&_0x42a7d2['removeClass'](_0x313960,_0x28d44d);_0x42a7d2['addClass'](_0xe8fe27?'ck-ai_review-diff':'ck-ai_review-highlights',_0x28d44d);}});}_getBalloonDomRoot(_0x1e77bb,_0x470961){const _0xe99966=_0x1e77bb['editing']['view'];if(_0x470961){const _0x81052a=_0xe99966['getDomRoot'](_0x470961);if(_0x81052a)return _0x81052a;}return _0xe99966['getDomRoot']()??void 0x0;}async _getReviewChecks(){const _0x51303f=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x8d478=await _0x51303f['getChecksList']();_0x51303f['modelsLoadError']&&this['_logError'](_0x51303f['modelsLoadError']);let _0x5e0fc5=_0x8d478['checks'];const _0x2abf74=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x2abf74,_0x5e0fc5),this['_usesAvailableCommandsConfig']&&(_0x5e0fc5=_0x2abf74['map'](_0x272516=>_0x5e0fc5['find'](_0x32ac93=>_0x32ac93['id']===_0x272516))['filter'](_0x6396cf=>!!_0x6396cf)),this['_filterChecksWithMissingModel'](_0x5e0fc5);}_logWarningForNonExistentChecks(_0x3642dc,_0x16a6a2){const _0x307dd8=_0x3642dc['filter'](_0xd4b5ea=>!_0x16a6a2['some'](_0x3cb6f2=>_0x3cb6f2['id']===_0xd4b5ea));_0x307dd8['length']&&this['_reporter']['logError'](new yn({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x307dd8['join'](',\x20')}}));}_filterChecksWithMissingModel(_0x2174cb){const _0x2b9757=[];return _0x2174cb['forEach'](_0xffa6af=>{(_0xffa6af instanceof qh&&!_0xffa6af['defaultModel']||_0xffa6af instanceof Zh&&!_0xffa6af['models']['length'])&&_0x2b9757['push'](_0xffa6af['id']);}),_0x2b9757['length']&&_0x2b9757['forEach'](_0x41cfba=>{_0x2174cb=_0x2174cb['filter'](_0x2a3843=>_0x2a3843['id']!==_0x41cfba),this['_reporter']['logError'](new yn({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x41cfba}}));}),_0x2174cb;}},sc=class extends _0x898608{static get['pluginName'](){return'AIReviewGateway';}static get requires(){return[Hh,ec,Is,tn,Tn,fs];}get['models'](){return this['context']['plugins']['get'](fs)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async getAllCommands(){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x3dd5a0=>{const _0x228fde={'id':_0x3dd5a0['id'],'title':_0x3dd5a0['title'],'description':_0x3dd5a0['description']};return'custom'!==_0x3dd5a0['id']&&_0x3dd5a0['options']?.['length']&&(_0x228fde['parameters']=_0x3dd5a0['options'][0x0]['data']['map'](_0x514866=>({..._0x514866}))),_0x228fde;});}async['runReview'](_0x291ed8,_0x272932){const _0x24f8b1=await this['_resolveReviewCheck'](_0x291ed8),_0x3ed398=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x2598ff=this['context']['plugins']['get']('AIConnector'),_0x1e0da8=_0x3ed398['getDocumentData']({'roots':_0x272932?.['roots']}),_0x2aa800=this['_createReviewCheckRun'](_0x24f8b1,_0x1e0da8,_0x2598ff,_0x272932?.['parameterId'],_0x272932?.['contexts']);return _0x3ed398['runCheck'](_0x2aa800,{'signal':_0x272932?.['signal']});}async runCustomReview(_0x505705,_0x2ec184){const {reviewCheck:_0x84af4b,resolvedModel:_0x45f2cf}=await this['_resolveCustomReviewCheck'](_0x505705,_0x2ec184?.['model']),_0x4b6290=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x12e04c=this['context']['plugins']['get']('AIConnector'),_0x56d972=new Yh(_0x505705,_0x45f2cf,_0x4b6290['getDocumentData']({'roots':_0x2ec184?.['roots']}),_0x84af4b,_0x12e04c,_0x2ec184?.['contexts']);return _0x4b6290['runCheck'](_0x56d972,{'signal':_0x2ec184?.['signal']});}['applyReview'](_0x49ae7c,_0x377d82){this['context']['plugins']['get']('AIGateway')['apply'](_0x49ae7c,{'aiSource':'review',..._0x377d82});}async['_resolveReviewCheck'](_0x234630){const _0x1f1ec4=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x13b686=>_0x13b686['id']===_0x234630);if(!_0x1f1ec4)throw new ct('ai-reviewgateway-unknown-command',this,{'checkId':_0x234630});if(_0x1f1ec4 instanceof Zh)throw new ct('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x234630});if(_0x1f1ec4 instanceof qh&&!_0x1f1ec4['defaultModel']?.['id'])throw new ct('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x234630});return _0x1f1ec4;}async _resolveCustomReviewCheck(_0x412a42,_0x19e39a){const _0x1c86d3='custom',_0xbc0a6e=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x14804d=>_0x14804d['id']===_0x1c86d3);if(!_0xbc0a6e)throw new ct('ai-reviewgateway-unknown-command',this,{'checkId':_0x1c86d3});if(!(_0xbc0a6e instanceof Zh))throw new ct('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x1c86d3});if(!_0x412a42)throw new ct('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x1c86d3});const _0x20d7ab=_0x19e39a??_0xbc0a6e['defaultModel']?.['id'];if(!_0x20d7ab)throw new ct('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x1c86d3});return{'reviewCheck':_0xbc0a6e,'resolvedModel':_0x20d7ab};}_createReviewCheckRun(_0x6420dc,_0x2f780c,_0x701d40,_0xecf72e,_0x4072d8=[]){if(_0x6420dc instanceof qh){const _0x477b99=_0x6420dc['context']?[..._0x4072d8,_0x6420dc['context']]:_0x4072d8;return new Qh(_0x6420dc['prompt'],_0x6420dc['defaultModel']['id'],_0x2f780c,_0x6420dc,_0x701d40,_0x477b99);}return new Kh(_0x2f780c,_0x6420dc,_0x701d40,_0xecf72e?[_0xecf72e]:void 0x0,void 0x0,_0x4072d8);}},nc=class extends _0x898608{static get requires(){return[ic,Nh,Hh,sc];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startReview(_0x5f380b,_0x4402a8){if(this['assertStartReviewPreconditions'](_0x5f380b)instanceof Zh)throw new ct('ai-reviewmode-not-a-system-command',this,{'commandId':_0x5f380b});nh(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x5f380b,'params':_0x4402a8?.['parameterId']?[_0x4402a8['parameterId']]:void 0x0});}async startCustomReview(_0x50ba85,_0x13d9bc){if(!_0x50ba85)throw new ct('ai-reviewmode-missing-custom-command-prompt',this);const _0xa41ae2=zh['find'](_0x2eff1b=>'custom'===_0x2eff1b['commandId'])['id'],_0x3d31d7=this['assertStartReviewPreconditions'](_0xa41ae2),_0x52870c=_0x13d9bc?.['model']??_0x3d31d7['defaultModel']?.['id'];if(!_0x52870c)throw new ct('ai-reviewmode-missing-custom-command-model',this);nh(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0xa41ae2,'isCustom':!0x0,'args':{'prompt':_0x50ba85,'model':_0x52870c}});}getAvailableCommands(){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x7a590c=>{const _0x41beba={'id':_0x7a590c['id'],'title':_0x7a590c['title'],'description':_0x7a590c['description']};return'custom'!==_0x7a590c['id']&&_0x7a590c['options']?.['length']&&(_0x41beba['parameters']=_0x7a590c['options'][0x0]['data']['map'](_0x2e8e2b=>({..._0x2e8e2b}))),_0x41beba;});}assertStartReviewPreconditions(_0x472c6a){const _0x32b416=this['context']['plugins']['get']('AIReviewModeController');if(_0x32b416['getCurrentCheckRun']())throw new ct('ai-reviewmode-review-already-running',this);const _0x639f8c=_0x32b416['getAvailableChecks']()['find'](_0x54d735=>_0x54d735['id']===_0x472c6a);if(!_0x639f8c)throw new ct('ai-reviewmode-unknown-command',this,{'commandId':_0x472c6a});return _0x639f8c;}},rc=class extends Kh{_title;constructor(_0x5a064b,_0x48463d,_0x90b90e,_0x5a5bcf,_0x1c1f6b,_0x3ea3d6,_0x47ac7a){super(_0x5a064b,_0x48463d,_0x90b90e,_0x1c1f6b,_0x3ea3d6,_0x47ac7a),this['_title']=_0x5a5bcf;}get title(){return this['_title'];}get subTitle(){return this['_sourceCheck']['title'];}},oc=class extends $h{get['apiId'](){return'translate';}},ac=class extends Jh{setupChecks(_0x2991b3){this['_checks']=_0x2991b3['map'](_0x5584f8=>new oc(_0x5584f8));}};const hc=[{'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'}];var cc=class extends Xh{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x62f28c){super(_0x62f28c),this['context']['config']['define']('ai.translate.languages',hc);}async _loadChecksList(){const _0x2f05f3=[],_0x365329=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x51784c of _0x365329)_0x2f05f3['push']({'title':_0x51784c['label'],'id':_0x51784c['id'],'commandId':_0x51784c['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x51784c['id']}});const _0x39a3ed=new ac();return _0x39a3ed['setupChecks'](this['_translateChecks'](_0x2f05f3)),_0x39a3ed;}_translateChecks(_0x52e89a){const _0x5a0f25=this['context']['locale'];return _0x52e89a['map'](_0x588928=>{const _0x4df75c='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x588928['title']['toUpperCase']()['replaceAll']('-','_'),_0x1f4ead=Es(_0x5a0f25,_0x4df75c);return{..._0x588928,'title':_0x1f4ead===_0x4df75c?_0x588928['title']:_0x1f4ead};});}},lc=class extends Wh{static get['pluginName'](){return'AITranslateController';}static get requires(){return[Nn,cc,fs];}get['_aiSource'](){return'translate';}get _defaultContextFeature(){return'translate';}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x37ff7d,_0x524346,_0x289f66){return new rc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x524346,this['_aiConnector'],Es(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x37ff7d['params'],_0x37ff7d['args'],_0x289f66?.['refs']);}_onReviewCheckResultActivated(_0x558b0c){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x558b0c['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x558b0c['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}_onActivateChange(_0x1505ab){this['_currentReviewCheckRun']&&('hover'===_0x1505ab['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1505ab['id'])),'click'===_0x1505ab['uiInteraction']&&this['_scrollToChange'](_0x1505ab['id']));}_onDeactivateChange(_0x15fedb){this['_currentReviewCheckRun']&&'panel'===_0x15fedb['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x27d457,_0x59133b){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x59133b['changeId']),this['_scrollToChange'](_0x59133b['changeId']));}['_onChangeMarkerHovered'](_0x343583,_0x13ed24){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x13ed24['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x13ed24['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}_getChangeContentElement(_0x792a0){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x792a0);}_markChangePositionInEditorContent(_0x4f791f,_0x2574f4){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4f791f,_0x2574f4);}_diffContent(_0x208fe3,_0x105ddf,_0x1d244e){return this['_aiReviewCoreEditing']['diffContent'](_0x208fe3,_0x105ddf,_0x1d244e,!0x0);}['_onReviewCheckRun'](){for(const _0x2a5f86 of this['_aiReviewCoreEditing']['getEditors']())_0x2a5f86['editing']['view']['change'](_0x12953e=>{for(const _0xdad1d8 of _0x2a5f86['editing']['view']['document']['getRoots']())_0x12953e['addClass']('ck-ai-translate-mode-content',_0xdad1d8);});}async _getReviewChecks(){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},uc=class extends fh{constructor(_0x49653d,_0x56cd26){super(_0x49653d,_0x56cd26),this['on']('set:isLoading',(_0x1ea966,_0x2b5638,_0x321337)=>{_0x321337&&(this['headerTitle']=Es(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2ae03f,_0x5b8aad,_0x118d68)=>{_0x118d68&&(this['headerTitle']=Es(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}_createAcceptAllButtonView(){const _0x1155f0=super['_createAcceptAllButtonView']();return _0x1155f0['set']('label',Es(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1155f0;}_createExitReviewButtonView(){const _0x165c59=super['_createExitReviewButtonView']();return _0x165c59['set']('label',Es(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x165c59;}},dc=class extends yh{_setupTemplate(){const _0x313b9c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x313b9c['if']('isVisible','ck-hidden',_0x36a5cd=>!_0x36a5cd)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Es(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Es(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x313b9c['if']('isVisible','ck-hidden',_0x3b20b0=>!_0x3b20b0)]},'children':this['_checkViews']}]});}},_c=class extends mh{static get['pluginName'](){return'AITranslateUI';}createMainView(){const _0x5916dc=this['context']['plugins']['get']('AITabs'),_0x4d4a6c=this['context']['locale'],_0x7d8c5d=new ua(_0x4d4a6c,{'label':Es(_0x4d4a6c,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x370c5b,'class':'ck-ai-header_review-translate','showResizeButton':_0x5916dc['showResizeButton']});_0x7d8c5d['delegate']('resizeTabs')['to'](_0x5916dc),_0x7d8c5d['bind']('isMaximized')['to'](_0x5916dc['view'],'isMaximized',_0x4144f1=>_0x4144f1);const _0x563849=new wh(_0x4d4a6c,{'header':_0x7d8c5d,'list':new dc(_0x4d4a6c),'results':new uc(_0x4d4a6c,{'generalErrorText':Es(_0x4d4a6c,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new bh(_0x4d4a6c,{'headerText':Es(_0x4d4a6c,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Es(_0x4d4a6c,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Es(_0x4d4a6c,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x563849['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x563849;}registerTab(){const _0x40a6f6=this['context']['plugins']['get']('AITabs');_0x40a6f6['view']['on']('activateTab',(_0x458a49,{newTab:_0x197e29,oldTab:_0x917211})=>{'translate'===_0x197e29?this['fire']('getReviewCheckList'):'translate'===_0x917211&&this['fire']('leaveReview');}),_0x40a6f6['view']['addTab']({'id':'translate','buttonLabel':Es(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x370c5b,'order':0x0,'content':this['_mainView']});}},gc=class extends _0x898608{static get['pluginName'](){return'AITranslateGateway';}static get requires(){return[Hh,Is,tn,Tn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async runTranslate(_0x38549d,_0x11b05c){const _0x4526ac=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x1686ec=this['context']['plugins']['get']('AIConnector'),_0xf2d3b3=new oc({'id':_0x38549d,'commandId':_0x38549d,'title':_0x38549d,'description':'','isParameterized':!0x1}),_0x35e2b7=new Kh(_0x4526ac['getDocumentData']({'roots':_0x11b05c?.['roots']}),_0xf2d3b3,_0x1686ec,void 0x0,{'language':_0x38549d},_0x11b05c?.['contexts']);return _0x4526ac['runCheck'](_0x35e2b7,{'signal':_0x11b05c?.['signal']});}applyTranslate(_0x207de6,_0x44d238){this['context']['plugins']['get']('AIGateway')['apply'](_0x207de6,_0x44d238);}},Ac=class extends _0x898608{static get requires(){return[lc,_c,Hh,gc];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startTranslate(_0x56065e){const _0x1cd0f6=this['assertStartTranslatePreconditions'](_0x56065e);nh(this['context'],'translate'),await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x1cd0f6['id'],'args':_0x1cd0f6['useArgs']?_0x1cd0f6['args']:void 0x0});}getAvailableLanguages(){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x1c503d=>({'id':_0x1c503d['id'],'label':_0x1c503d['title']}));}assertStartTranslatePreconditions(_0x3cb845){const _0x3839a9=this['context']['plugins']['get']('AITranslateController');if(_0x3839a9['getCurrentCheckRun']())throw new ct('ai-translate-translation-already-running',this);const _0x25ce65=_0x3839a9['getAvailableChecks']()['find'](_0x9a8eb7=>_0x9a8eb7['id']===_0x3cb845);if(!_0x25ce65)throw new ct('ai-translate-unknown-language',this,{'languageId':_0x3cb845});return _0x25ce65;}};export{gh as AIActions,Li as AIAdapter,ss as AIAssistant,ts as AIAssistantUI,Va as AIBalloon,ka as AIChat,er as AIChatController,ho as AIChatFeedCustomElementView,va as AIChatHistory,Oa as AIChatHistoryController,Ca as AIChatHistoryUI,Xn as AIChatInteraction,La as AIChatShortcuts,Aa as AIChatUI,xh as AICheckRunSingleRootResult,Is as AIConnector,Yn as AIContext,Cs as AIContextLibrary,fs as AICore,yn as AICoreError,vn as AIDocumentProcessingGateway,Rn as AIDocumentProcessingRunResult,tn as AIEditing,Wa as AIEditorIntegration,xn as AIErrorReporter,Nn as AIErrorSink,Tn as AIGateway,Fn as AIInteraction,Ts as AIModels,Ah as AIQuickActions,ih as AIQuickActionsUI,Vn as AIReply,Pi as AIRequestError,$h as AIReviewCheck,Uh as AIReviewCheckResult,Bh as AIReviewCheckResultChange,Fh as AIReviewCheckRun,sc as AIReviewGateway,nc as AIReviewMode,Wh as AIReviewModeController,Hh as AIReviewModeEditing,Nh as AIReviewModeUI,On as AIRunResult,Sn as AIRunSingleRootResult,gs as AITabs,_s as AITabsMainView,ls as AITabsView,rs as AITextAdapter,Da as AIToggleButtonUI,Ac as AITranslate,lc as AITranslateController,gc as AITranslateGateway,_c as AITranslateUI,as as AWSTextAdapter,os as OpenAITextAdapter,Hi as ShowAIAssistantCommand,Pa as ToggleAICommand,Hn as createResizeButton,ns as getDefaultAICommands,mn as markOperationsAsAI};