jodit-pro 4.8.13 → 4.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/es2015/jodit.css +2 -2
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +38 -38
  5. package/es2015/jodit.js +531 -448
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +17 -17
  8. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +376 -406
  9. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +2282 -2279
  10. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  11. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +11 -11
  12. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  13. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  14. package/es2015/plugins/backup/backup.css +1 -1
  15. package/es2015/plugins/backup/backup.js +1 -1
  16. package/es2015/plugins/backup/backup.min.js +1 -1
  17. package/es2015/plugins/button-generator/button-generator.css +1 -1
  18. package/es2015/plugins/button-generator/button-generator.js +1 -1
  19. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  20. package/es2015/plugins/change-case/change-case.js +1 -1
  21. package/es2015/plugins/change-case/change-case.min.js +1 -1
  22. package/es2015/plugins/color-picker/color-picker.css +1 -1
  23. package/es2015/plugins/color-picker/color-picker.js +1 -1
  24. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  25. package/es2015/plugins/emoji/emoji.css +1 -1
  26. package/es2015/plugins/emoji/emoji.js +1 -1
  27. package/es2015/plugins/emoji/emoji.min.js +1 -1
  28. package/es2015/plugins/export-docs/export-docs.js +1 -1
  29. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  30. package/es2015/plugins/finder/finder.css +1 -1
  31. package/es2015/plugins/finder/finder.js +2 -2
  32. package/es2015/plugins/finder/finder.min.js +2 -2
  33. package/es2015/plugins/google-maps/google-maps.css +1 -1
  34. package/es2015/plugins/google-maps/google-maps.js +52 -59
  35. package/es2015/plugins/google-maps/google-maps.min.js +6 -6
  36. package/es2015/plugins/google-search/google-search.js +1 -1
  37. package/es2015/plugins/google-search/google-search.min.js +1 -1
  38. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  39. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  40. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  41. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  42. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  43. package/es2015/plugins/keyboard/keyboard.css +1 -1
  44. package/es2015/plugins/keyboard/keyboard.js +1 -1
  45. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  46. package/es2015/plugins/mobile-view/mobile-view.js +4 -1
  47. package/es2015/plugins/mobile-view/mobile-view.min.js +2 -2
  48. package/es2015/plugins/page-break/page-break.js +4 -1
  49. package/es2015/plugins/page-break/page-break.min.js +3 -3
  50. package/es2015/plugins/paste-code/paste-code.css +1 -1
  51. package/es2015/plugins/paste-code/paste-code.js +4 -1
  52. package/es2015/plugins/paste-code/paste-code.min.js +2 -2
  53. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  54. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  55. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  56. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  57. package/es2015/plugins/todo-list/todo-list.css +1 -1
  58. package/es2015/plugins/todo-list/todo-list.js +1 -1
  59. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  60. package/es2015/plugins/translate/translate.css +1 -1
  61. package/es2015/plugins/translate/translate.js +1 -1
  62. package/es2015/plugins/translate/translate.min.js +1 -1
  63. package/es2015/plugins/tune-block/tune-block.css +1 -1
  64. package/es2015/plugins/tune-block/tune-block.js +1 -1
  65. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  66. package/es2018/jodit.fat.min.css +1 -1
  67. package/es2018/jodit.fat.min.js +32 -32
  68. package/es2018/jodit.min.css +1 -1
  69. package/es2018/jodit.min.js +17 -17
  70. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  71. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +6 -6
  72. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  73. package/es2018/plugins/backup/backup.min.js +1 -1
  74. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  75. package/es2018/plugins/change-case/change-case.min.js +1 -1
  76. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  77. package/es2018/plugins/emoji/emoji.min.js +1 -1
  78. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  79. package/es2018/plugins/finder/finder.min.js +2 -2
  80. package/es2018/plugins/google-maps/google-maps.min.js +6 -6
  81. package/es2018/plugins/google-search/google-search.min.js +1 -1
  82. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  83. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  84. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  85. package/es2018/plugins/mobile-view/mobile-view.min.js +2 -2
  86. package/es2018/plugins/page-break/page-break.min.js +3 -3
  87. package/es2018/plugins/paste-code/paste-code.min.js +2 -2
  88. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  89. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  90. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  91. package/es2018/plugins/translate/translate.min.js +1 -1
  92. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  93. package/es2021/jodit.css +2 -2
  94. package/es2021/jodit.fat.min.css +1 -1
  95. package/es2021/jodit.fat.min.js +36 -36
  96. package/es2021/jodit.js +531 -448
  97. package/es2021/jodit.min.css +1 -1
  98. package/es2021/jodit.min.js +21 -21
  99. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +376 -406
  100. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +4901 -4898
  101. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  102. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +28 -28
  103. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  104. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  105. package/es2021/plugins/backup/backup.css +1 -1
  106. package/es2021/plugins/backup/backup.js +1 -1
  107. package/es2021/plugins/backup/backup.min.js +1 -1
  108. package/es2021/plugins/button-generator/button-generator.css +1 -1
  109. package/es2021/plugins/button-generator/button-generator.js +1 -1
  110. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  111. package/es2021/plugins/change-case/change-case.js +1 -1
  112. package/es2021/plugins/change-case/change-case.min.js +1 -1
  113. package/es2021/plugins/color-picker/color-picker.css +1 -1
  114. package/es2021/plugins/color-picker/color-picker.js +1 -1
  115. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  116. package/es2021/plugins/emoji/emoji.css +1 -1
  117. package/es2021/plugins/emoji/emoji.js +1 -1
  118. package/es2021/plugins/emoji/emoji.min.js +1 -1
  119. package/es2021/plugins/export-docs/export-docs.js +1 -1
  120. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  121. package/es2021/plugins/finder/finder.css +1 -1
  122. package/es2021/plugins/finder/finder.js +2 -2
  123. package/es2021/plugins/finder/finder.min.js +2 -2
  124. package/es2021/plugins/google-maps/google-maps.css +1 -1
  125. package/es2021/plugins/google-maps/google-maps.js +52 -59
  126. package/es2021/plugins/google-maps/google-maps.min.js +7 -7
  127. package/es2021/plugins/google-search/google-search.js +1 -1
  128. package/es2021/plugins/google-search/google-search.min.js +1 -1
  129. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  130. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  131. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  132. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  133. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  134. package/es2021/plugins/keyboard/keyboard.css +1 -1
  135. package/es2021/plugins/keyboard/keyboard.js +1 -1
  136. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  137. package/es2021/plugins/mobile-view/mobile-view.js +4 -1
  138. package/es2021/plugins/mobile-view/mobile-view.min.js +2 -2
  139. package/es2021/plugins/page-break/page-break.js +4 -1
  140. package/es2021/plugins/page-break/page-break.min.js +3 -3
  141. package/es2021/plugins/paste-code/paste-code.css +1 -1
  142. package/es2021/plugins/paste-code/paste-code.js +4 -1
  143. package/es2021/plugins/paste-code/paste-code.min.js +2 -2
  144. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  145. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  146. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  147. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  148. package/es2021/plugins/todo-list/todo-list.css +1 -1
  149. package/es2021/plugins/todo-list/todo-list.js +1 -1
  150. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  151. package/es2021/plugins/translate/translate.css +1 -1
  152. package/es2021/plugins/translate/translate.js +1 -1
  153. package/es2021/plugins/translate/translate.min.js +1 -1
  154. package/es2021/plugins/tune-block/tune-block.css +1 -1
  155. package/es2021/plugins/tune-block/tune-block.js +1 -1
  156. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  157. package/es2021.en/jodit.css +2 -2
  158. package/es2021.en/jodit.fat.min.css +1 -1
  159. package/es2021.en/jodit.fat.min.js +36 -36
  160. package/es2021.en/jodit.js +531 -448
  161. package/es2021.en/jodit.min.css +1 -1
  162. package/es2021.en/jodit.min.js +21 -21
  163. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +376 -406
  164. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +4779 -4776
  165. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  166. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +6 -6
  167. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  168. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  169. package/es2021.en/plugins/backup/backup.css +1 -1
  170. package/es2021.en/plugins/backup/backup.js +1 -1
  171. package/es2021.en/plugins/backup/backup.min.js +1 -1
  172. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  173. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  174. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  175. package/es2021.en/plugins/change-case/change-case.js +1 -1
  176. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  177. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  178. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  179. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  180. package/es2021.en/plugins/emoji/emoji.css +1 -1
  181. package/es2021.en/plugins/emoji/emoji.js +1 -1
  182. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  183. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  184. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  185. package/es2021.en/plugins/finder/finder.css +1 -1
  186. package/es2021.en/plugins/finder/finder.js +2 -2
  187. package/es2021.en/plugins/finder/finder.min.js +2 -2
  188. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  189. package/es2021.en/plugins/google-maps/google-maps.js +52 -59
  190. package/es2021.en/plugins/google-maps/google-maps.min.js +7 -7
  191. package/es2021.en/plugins/google-search/google-search.js +1 -1
  192. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  193. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  194. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  195. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  196. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  197. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  198. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  199. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  200. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  201. package/es2021.en/plugins/mobile-view/mobile-view.js +4 -1
  202. package/es2021.en/plugins/mobile-view/mobile-view.min.js +2 -2
  203. package/es2021.en/plugins/page-break/page-break.js +4 -1
  204. package/es2021.en/plugins/page-break/page-break.min.js +3 -3
  205. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  206. package/es2021.en/plugins/paste-code/paste-code.js +4 -1
  207. package/es2021.en/plugins/paste-code/paste-code.min.js +2 -2
  208. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  209. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  210. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  211. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  212. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  213. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  214. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  215. package/es2021.en/plugins/translate/translate.css +1 -1
  216. package/es2021.en/plugins/translate/translate.js +1 -1
  217. package/es2021.en/plugins/translate/translate.min.js +1 -1
  218. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  219. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  220. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  221. package/es5/jodit.css +3 -3
  222. package/es5/jodit.fat.min.css +1 -1
  223. package/es5/jodit.fat.min.js +2 -2
  224. package/es5/jodit.js +546 -458
  225. package/es5/jodit.min.css +3 -3
  226. package/es5/jodit.min.js +2 -2
  227. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +376 -406
  228. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +2121 -2121
  229. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  230. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +2 -2
  231. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  232. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  233. package/es5/plugins/backup/backup.css +1 -1
  234. package/es5/plugins/backup/backup.js +1 -1
  235. package/es5/plugins/backup/backup.min.js +1 -1
  236. package/es5/plugins/button-generator/button-generator.css +1 -1
  237. package/es5/plugins/button-generator/button-generator.js +1 -1
  238. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  239. package/es5/plugins/change-case/change-case.js +1 -1
  240. package/es5/plugins/change-case/change-case.min.js +1 -1
  241. package/es5/plugins/color-picker/color-picker.css +1 -1
  242. package/es5/plugins/color-picker/color-picker.js +1 -1
  243. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  244. package/es5/plugins/emoji/emoji.css +1 -1
  245. package/es5/plugins/emoji/emoji.js +1 -1
  246. package/es5/plugins/emoji/emoji.min.js +1 -1
  247. package/es5/plugins/export-docs/export-docs.js +1 -1
  248. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  249. package/es5/plugins/finder/finder.css +1 -1
  250. package/es5/plugins/finder/finder.js +2 -2
  251. package/es5/plugins/finder/finder.min.js +2 -2
  252. package/es5/plugins/google-maps/google-maps.css +1 -1
  253. package/es5/plugins/google-maps/google-maps.js +61 -59
  254. package/es5/plugins/google-maps/google-maps.min.js +2 -2
  255. package/es5/plugins/google-search/google-search.js +1 -1
  256. package/es5/plugins/google-search/google-search.min.js +1 -1
  257. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  258. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  259. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  260. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  261. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  262. package/es5/plugins/keyboard/keyboard.css +1 -1
  263. package/es5/plugins/keyboard/keyboard.js +1 -1
  264. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  265. package/es5/plugins/mobile-view/mobile-view.js +7 -1
  266. package/es5/plugins/mobile-view/mobile-view.min.js +2 -2
  267. package/es5/plugins/page-break/page-break.js +7 -1
  268. package/es5/plugins/page-break/page-break.min.js +2 -2
  269. package/es5/plugins/paste-code/paste-code.css +1 -1
  270. package/es5/plugins/paste-code/paste-code.js +7 -1
  271. package/es5/plugins/paste-code/paste-code.min.js +2 -2
  272. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  273. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  274. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  275. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  276. package/es5/plugins/todo-list/todo-list.css +1 -1
  277. package/es5/plugins/todo-list/todo-list.js +1 -1
  278. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  279. package/es5/plugins/translate/translate.css +1 -1
  280. package/es5/plugins/translate/translate.js +1 -1
  281. package/es5/plugins/translate/translate.min.js +1 -1
  282. package/es5/plugins/tune-block/tune-block.css +1 -1
  283. package/es5/plugins/tune-block/tune-block.js +1 -1
  284. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  285. package/es5/polyfills.fat.min.js +1 -1
  286. package/es5/polyfills.js +1 -1
  287. package/es5/polyfills.min.js +1 -1
  288. package/esm/config.d.ts +1 -6
  289. package/esm/config.js +1 -1
  290. package/esm/jodit-pro.d.ts +3 -1
  291. package/esm/jodit-pro.js +1 -1
  292. package/esm/plugins/ai-assistant-pro/ui/conversation-list/conversation-list-item.js +1 -1
  293. package/esm/plugins/ai-assistant-pro/ui/main-panel/main-panel.js +2 -2
  294. package/esm/plugins/ai-assistant-pro/ui/message-list/artifact.d.ts +0 -1
  295. package/esm/plugins/ai-assistant-pro/ui/message-list/artifact.js +1 -1
  296. package/esm/plugins/ai-assistant-pro/ui/message-list/{message-list-item.d.ts → item/message-list-item.d.ts} +1 -1
  297. package/esm/plugins/ai-assistant-pro/ui/message-list/item/message-list-item.js +1 -0
  298. package/esm/plugins/ai-assistant-pro/ui/message-list/message-list.d.ts +1 -1
  299. package/esm/plugins/ai-assistant-pro/ui/message-list/message-list.js +1 -1
  300. package/esm/plugins/ai-assistant-pro/ui/settings-button/settings-button.d.ts +4 -2
  301. package/esm/plugins/ai-assistant-pro/ui/settings-button/settings-button.js +1 -1
  302. package/esm/plugins/finder/browser.js +1 -1
  303. package/esm/plugins/google-maps/interface.d.ts +8 -0
  304. package/esm/plugins/google-maps/ui/editors/marker/marker.d.ts +1 -0
  305. package/esm/plugins/google-maps/ui/editors/marker/marker.js +1 -1
  306. package/esm/plugins/google-maps/ui/editors/polygon/polygon.d.ts +1 -0
  307. package/esm/plugins/google-maps/ui/editors/polygon/polygon.js +1 -1
  308. package/esm/plugins/google-maps/ui/editors/polyline/polyline.d.ts +1 -0
  309. package/esm/plugins/google-maps/ui/editors/polyline/polyline.js +1 -1
  310. package/esm/plugins/google-maps/ui/map/map.d.ts +3 -3
  311. package/esm/plugins/google-maps/ui/map/map.js +2 -2
  312. package/esm/plugins/google-maps/ui/map/modules/add-new-in-state.d.ts +2 -3
  313. package/esm/plugins/google-maps/ui/map/modules/init-or-update-element-from-state.d.ts +2 -3
  314. package/esm/plugins/google-maps/ui/map/modules/on-change-geometries.d.ts +2 -3
  315. package/esm/plugins/google-maps/ui/map/modules/open-props-dialog.d.ts +2 -3
  316. package/esm/plugins/google-maps/ui/map/modules/remove-element.d.ts +2 -3
  317. package/esm/plugins/google-maps/ui/map/modules/update-state-and-gme.d.ts +2 -3
  318. package/esm/plugins/mobile-view/mobile-view.js +1 -1
  319. package/esm/plugins/page-break/page-break.d.ts +1 -0
  320. package/esm/plugins/page-break/page-break.js +1 -1
  321. package/esm/plugins/paste-code/paste-code.d.ts +1 -0
  322. package/esm/plugins/paste-code/paste-code.js +1 -1
  323. package/esm/plugins/paste-from-word/cases/clean-styles.d.ts +2 -2
  324. package/esm/plugins/paste-from-word/cases/clear-attributes.d.ts +2 -2
  325. package/esm/plugins/paste-from-word/cases/convert-style-unit-to-pixels.js +1 -1
  326. package/esm/plugins/paste-from-word/cases/convert-to-list.d.ts +3 -3
  327. package/esm/plugins/paste-from-word/cases/convert-to-list.js +1 -1
  328. package/esm/plugins/paste-from-word/cases/remove-extra-tags.d.ts +2 -2
  329. package/esm/plugins/paste-from-word/cases/remove-inside-comment.d.ts +2 -2
  330. package/esm/plugins/paste-from-word/cases/replace-old-tags.d.ts +2 -2
  331. package/esm/plugins/paste-from-word/element/checkers.d.ts +5 -5
  332. package/esm/plugins/paste-from-word/element/element.d.ts +2 -1
  333. package/esm/plugins/paste-from-word/element/element.js +1 -1
  334. package/esm/plugins/paste-from-word/element/render.d.ts +3 -3
  335. package/esm/plugins/paste-from-word/element/style.js +1 -1
  336. package/esm/plugins/paste-from-word/helpers/apply-styles-pro.js +1 -1
  337. package/esm/plugins/paste-from-word/helpers/calc-list-levels.d.ts +2 -2
  338. package/esm/plugins/paste-from-word/helpers/calc-list-levels.js +1 -1
  339. package/esm/plugins/paste-from-word/helpers/helpers.d.ts +2 -2
  340. package/esm/plugins/paste-from-word/helpers/transform-word-to-html.d.ts +2 -2
  341. package/esm/plugins/paste-from-word/interface.d.ts +25 -3
  342. package/package.json +1 -1
  343. package/types/config.d.ts +1 -6
  344. package/types/jodit-pro.d.ts +3 -1
  345. package/types/plugins/ai-assistant-pro/ui/message-list/artifact.d.ts +0 -1
  346. package/types/plugins/ai-assistant-pro/ui/message-list/{message-list-item.d.ts → item/message-list-item.d.ts} +1 -1
  347. package/types/plugins/ai-assistant-pro/ui/message-list/message-list.d.ts +1 -1
  348. package/types/plugins/ai-assistant-pro/ui/settings-button/settings-button.d.ts +4 -2
  349. package/types/plugins/google-maps/interface.d.ts +8 -0
  350. package/types/plugins/google-maps/ui/editors/marker/marker.d.ts +1 -0
  351. package/types/plugins/google-maps/ui/editors/polygon/polygon.d.ts +1 -0
  352. package/types/plugins/google-maps/ui/editors/polyline/polyline.d.ts +1 -0
  353. package/types/plugins/google-maps/ui/map/map.d.ts +3 -3
  354. package/types/plugins/google-maps/ui/map/modules/add-new-in-state.d.ts +2 -3
  355. package/types/plugins/google-maps/ui/map/modules/init-or-update-element-from-state.d.ts +2 -3
  356. package/types/plugins/google-maps/ui/map/modules/on-change-geometries.d.ts +2 -3
  357. package/types/plugins/google-maps/ui/map/modules/open-props-dialog.d.ts +2 -3
  358. package/types/plugins/google-maps/ui/map/modules/remove-element.d.ts +2 -3
  359. package/types/plugins/google-maps/ui/map/modules/update-state-and-gme.d.ts +2 -3
  360. package/types/plugins/page-break/page-break.d.ts +1 -0
  361. package/types/plugins/paste-code/paste-code.d.ts +1 -0
  362. package/types/plugins/paste-from-word/cases/clean-styles.d.ts +2 -2
  363. package/types/plugins/paste-from-word/cases/clear-attributes.d.ts +2 -2
  364. package/types/plugins/paste-from-word/cases/convert-to-list.d.ts +3 -3
  365. package/types/plugins/paste-from-word/cases/remove-extra-tags.d.ts +2 -2
  366. package/types/plugins/paste-from-word/cases/remove-inside-comment.d.ts +2 -2
  367. package/types/plugins/paste-from-word/cases/replace-old-tags.d.ts +2 -2
  368. package/types/plugins/paste-from-word/element/checkers.d.ts +5 -5
  369. package/types/plugins/paste-from-word/element/element.d.ts +2 -1
  370. package/types/plugins/paste-from-word/element/render.d.ts +3 -3
  371. package/types/plugins/paste-from-word/helpers/calc-list-levels.d.ts +2 -2
  372. package/types/plugins/paste-from-word/helpers/helpers.d.ts +2 -2
  373. package/types/plugins/paste-from-word/helpers/transform-word-to-html.d.ts +2 -2
  374. package/types/plugins/paste-from-word/interface.d.ts +25 -3
  375. package/esm/plugins/ai-assistant-pro/ui/message-list/message-list-item.js +0 -1
  376. package/esm/plugins/google-maps/ui/map/modules/index.d.ts +0 -10
  377. package/esm/plugins/google-maps/ui/map/modules/index.js +0 -1
  378. package/types/plugins/google-maps/ui/map/modules/index.d.ts +0 -10
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.8.13
4
+ * Version: v4.9.2
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -4875,7 +4875,7 @@ var UIMainPanel = /*#__PURE__*/ function(UIElement) {
4875
4875
  name: 'angle-left'
4876
4876
  },
4877
4877
  size: 'small',
4878
- variant: 'default'
4878
+ variant: 'initial'
4879
4879
  });
4880
4880
  backButton.container.classList.add(this.getFullElName('back-button'));
4881
4881
  this.j.e.on(backButton, 'click', function() {
@@ -4889,7 +4889,7 @@ var UIMainPanel = /*#__PURE__*/ function(UIElement) {
4889
4889
  },
4890
4890
  size: 'small',
4891
4891
  tooltip: 'New chat',
4892
- variant: 'default'
4892
+ variant: 'initial'
4893
4893
  });
4894
4894
  newButton.container.classList.add(this.getFullElName('new-button'));
4895
4895
  this.j.e.on(newButton, 'click', function() {
@@ -4919,7 +4919,7 @@ var UIMainPanel = /*#__PURE__*/ function(UIElement) {
4919
4919
  },
4920
4920
  size: 'small',
4921
4921
  tooltip: 'Close',
4922
- variant: 'default'
4922
+ variant: 'initial'
4923
4923
  });
4924
4924
  closeButton.container.classList.add(this.getFullElName('close-button'));
4925
4925
  this.j.e.on(closeButton, 'click', function() {
@@ -5097,666 +5097,462 @@ UIMainPanel = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorat
5097
5097
 
5098
5098
  /***/ }),
5099
5099
 
5100
- /***/ 52826:
5101
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5102
-
5103
- "use strict";
5104
- __webpack_require__.r(__webpack_exports__);
5105
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5106
- /* harmony export */ description: function() { return /* binding */ description; },
5107
- /* harmony export */ name: function() { return /* binding */ name; },
5108
- /* harmony export */ parameters: function() { return /* binding */ parameters; },
5109
- /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
5110
- /* harmony export */ });
5111
- var name = 'readSelection';
5112
- var description = 'Get information about the current selection including HTML content and optional context';
5113
- var parameters = [
5114
- {
5115
- name: 'contextCharsBefore',
5116
- type: 'number',
5117
- description: 'Number of characters to include before the selection',
5118
- required: false,
5119
- default: 0
5120
- },
5121
- {
5122
- name: 'contextCharsAfter',
5123
- type: 'number',
5124
- description: 'Number of characters to include after the selection',
5125
- required: false,
5126
- default: 0
5127
- }
5128
- ];
5129
- var requiresPermission = false;
5130
-
5131
-
5132
- /***/ }),
5133
-
5134
- /***/ 53014:
5135
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5136
-
5137
- "use strict";
5138
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5139
- /* harmony export */ applyTheme: function() { return /* binding */ applyTheme; }
5140
- /* harmony export */ });
5141
- /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94899);
5142
-
5143
- var DARK_THEME = [
5144
- 'jodit_theme_dark',
5145
- 'jodit-ai-assistant-pro_theme_dark',
5146
- 'jodit-dialog_theme_dark'
5147
- ];
5148
- var LIGHT_THEME = [
5149
- 'jodit_theme_light',
5150
- 'jodit-ai-assistant-pro_theme_light',
5151
- 'jodit-dialog_theme_light'
5152
- ];
5153
- /**
5154
- * Apply theme to assistant UI
5155
- */ function applyTheme(jodit, theme, displayMode, container, dialog) {
5156
- var // Remove all theme classes
5157
- _container_classList, _container_classList1, _container_classList2;
5158
- container === null || container === void 0 ? void 0 : (_container_classList = container.classList).remove.apply(_container_classList, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(DARK_THEME));
5159
- container === null || container === void 0 ? void 0 : (_container_classList1 = container.classList).remove.apply(_container_classList1, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(LIGHT_THEME));
5160
- if (displayMode === 'dialog') {
5161
- var _dialogContainer_classList, _dialogContainer_classList1;
5162
- var dialogContainer = dialog === null || dialog === void 0 ? void 0 : dialog.container;
5163
- dialogContainer === null || dialogContainer === void 0 ? void 0 : (_dialogContainer_classList = dialogContainer.classList).remove.apply(_dialogContainer_classList, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(DARK_THEME));
5164
- dialogContainer === null || dialogContainer === void 0 ? void 0 : (_dialogContainer_classList1 = dialogContainer.classList).remove.apply(_dialogContainer_classList1, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(LIGHT_THEME));
5165
- }
5166
- var themeClasses;
5167
- if (theme === 'dark') {
5168
- themeClasses = DARK_THEME;
5169
- } else {
5170
- themeClasses = LIGHT_THEME;
5171
- }
5172
- container === null || container === void 0 ? void 0 : (_container_classList2 = container.classList).add.apply(_container_classList2, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(themeClasses));
5173
- if (displayMode === 'dialog') {
5174
- var _dialogContainer_classList2;
5175
- var dialogContainer1 = dialog === null || dialog === void 0 ? void 0 : dialog.container;
5176
- dialogContainer1 === null || dialogContainer1 === void 0 ? void 0 : (_dialogContainer_classList2 = dialogContainer1.classList).add.apply(_dialogContainer_classList2, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(themeClasses));
5177
- }
5178
- }
5179
-
5180
-
5181
- /***/ }),
5182
-
5183
- /***/ 53835:
5100
+ /***/ 51359:
5184
5101
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5185
5102
 
5186
5103
  "use strict";
5187
5104
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5188
- /* harmony export */ BUILT_IN_TOOLS: function() { return /* binding */ BUILT_IN_TOOLS; },
5189
- /* harmony export */ getToolNames: function() { return /* binding */ getToolNames; }
5105
+ /* harmony export */ UIMessageListItem: function() { return /* binding */ UIMessageListItem; }
5190
5106
  /* harmony export */ });
5191
- /* unused harmony exports getTool, hasTool */
5192
- /* harmony import */ var _apply_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39296);
5193
- /* harmony import */ var _insert_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16745);
5194
- /* harmony import */ var _read_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78717);
5195
- /* harmony import */ var _read_document__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5618);
5196
- /* harmony import */ var _read_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90991);
5197
- /* harmony import */ var _replace_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2020);
5198
- /* harmony import */ var _replace_in_document__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12570);
5199
- /* harmony import */ var _replace_selection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(95323);
5200
- /* harmony import */ var _write_document__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97603);
5201
-
5202
-
5203
-
5107
+ /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
5108
+ /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
5109
+ /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
5110
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82749);
5111
+ /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54816);
5112
+ /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84669);
5113
+ /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18766);
5114
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
5115
+ /* harmony import */ var _artifact__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81835);
5116
+ /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65478);
5117
+ /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67510);
5118
+ /* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62843);
5119
+ /* harmony import */ var jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62405);
5120
+ /* harmony import */ var jodit_esm_modules_context_menu_context_menu__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(80870);
5204
5121
 
5205
5122
 
5206
5123
 
5207
5124
 
5208
5125
 
5209
5126
 
5210
- /**
5211
- * Built-in tools collection
5212
- * Each tool contains definition and executor
5213
- */ var BUILT_IN_TOOLS = {
5214
- // Read operations
5215
- readDocument: _read_document__WEBPACK_IMPORTED_MODULE_3__["default"],
5216
- readBlocks: _read_blocks__WEBPACK_IMPORTED_MODULE_2__["default"],
5217
- readSelection: _read_selection__WEBPACK_IMPORTED_MODULE_4__["default"],
5218
- // Write operations
5219
- writeDocument: _write_document__WEBPACK_IMPORTED_MODULE_8__["default"],
5220
- replaceSelection: _replace_selection__WEBPACK_IMPORTED_MODULE_7__["default"],
5221
- replaceBlock: _replace_block__WEBPACK_IMPORTED_MODULE_5__["default"],
5222
- replaceInDocument: _replace_in_document__WEBPACK_IMPORTED_MODULE_6__["default"],
5223
- insertHTML: _insert_html__WEBPACK_IMPORTED_MODULE_1__["default"],
5224
- // Formatting operations
5225
- applyFormat: _apply_format__WEBPACK_IMPORTED_MODULE_0__["default"]
5226
- };
5227
- /**
5228
- * Get tool names
5229
- */ function getToolNames() {
5230
- return Object.keys(BUILT_IN_TOOLS);
5231
- }
5232
- /**
5233
- * Get tool by name
5234
- */ function getTool(name) {
5235
- return BUILT_IN_TOOLS[name];
5236
- }
5237
- /**
5238
- * Check if tool exists
5239
- */ function hasTool(name) {
5240
- return name in BUILT_IN_TOOLS;
5241
- }
5242
5127
 
5243
5128
 
5244
- /***/ }),
5245
5129
 
5246
- /***/ 54747:
5247
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5248
5130
 
5249
- "use strict";
5250
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5251
- /* harmony export */ UIResize: function() { return /* binding */ UIResize; }
5252
- /* harmony export */ });
5253
- /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20616);
5254
- /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67709);
5255
- /* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
5256
- /* harmony import */ var jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41180);
5257
- /*!
5258
- * Jodit Editor PRO (https://xdsoft.net/jodit/)
5259
- * See LICENSE.md in the project root for license information.
5260
- * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5261
- */
5262
5131
 
5263
5132
 
5264
5133
 
5265
5134
 
5266
- var UIResize = /*#__PURE__*/ function() {
5135
+ var UIMessageListItem = /*#__PURE__*/ function(UIElement) {
5267
5136
  "use strict";
5268
- function UIResize() {
5269
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_0__._)(this, UIResize);
5137
+ (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UIMessageListItem, UIElement);
5138
+ function UIMessageListItem(view, message, opts) {
5139
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIMessageListItem);
5140
+ var _this;
5141
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIMessageListItem, [
5142
+ view
5143
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "message", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "opts", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "artifactGroup", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "actionsButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "contextMenu", void 0), _this.message = message, _this.opts = opts, _this.artifactGroup = null, _this.actionsButton = null, _this.contextMenu = null;
5144
+ return _this;
5270
5145
  }
5271
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_1__._)(UIResize, null, [
5146
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIMessageListItem, [
5272
5147
  {
5273
- key: "remove",
5274
- value: function remove(element) {
5275
- element.container.classList.remove('jodit-ui-resize');
5276
- jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(element.container.querySelector('.jodit-ui-resize__handle'));
5148
+ key: "className",
5149
+ value: function className() {
5150
+ return 'UIMessageListItem';
5277
5151
  }
5278
5152
  },
5279
5153
  {
5280
- key: "install",
5281
- value: function install(element, direction) {
5282
- var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
5283
- var _options_onResize;
5284
- element.container.classList.add('jodit-ui-resize');
5285
- if ((0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(element.container, 'position') === 'static') {
5286
- (0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(element.container, 'position', 'relative');
5287
- }
5288
- var handle = element.j.c.div('jodit-ui-resize__handle');
5289
- handle.classList.add('jodit-ui-resize__handle_type_' + direction);
5290
- if (options.handleClassName) {
5291
- handle.classList.add(options.handleClassName);
5292
- }
5293
- element.container.appendChild(handle);
5294
- element.j.e.on(handle, 'mousedown touchstart', this.onStartResize.bind(this, element, direction, (_options_onResize = options.onResize) !== null && _options_onResize !== void 0 ? _options_onResize : function() {
5295
- return undefined;
5296
- }));
5154
+ key: "render",
5155
+ value: function render() {
5156
+ return '<div class="'.concat(this.getFullElName('message'), '"></div>');
5297
5157
  }
5298
5158
  },
5299
5159
  {
5300
- key: "onStartResize",
5301
- value: function onStartResize(element, direction, onResizeCallback, startEvent) {
5302
- var start = {
5303
- x: startEvent.clientX,
5304
- y: startEvent.clientY,
5305
- w: element.container.offsetWidth,
5306
- h: element.container.offsetHeight,
5307
- direction: direction
5308
- };
5309
- var onResize = element.j.async.throttle(this.onResize.bind(this, element, start, onResizeCallback), element.j.defaultTimeout / 10);
5310
- element.j.lock();
5311
- element.j.e.on(element.j.ow, 'mousemove touchmove', onResize).one(element.j.ow, 'mouseup touchend', this.onEndResize.bind(this, element, onResize));
5160
+ key: "onReady",
5161
+ value: function onReady() {
5162
+ this.updateContent();
5163
+ this.contextMenu = new jodit_esm_modules_context_menu_context_menu__WEBPACK_IMPORTED_MODULE_13__.ContextMenu(this.j);
5312
5164
  }
5313
5165
  },
5314
5166
  {
5315
- key: "onResize",
5316
- value: function onResize(element, start, onResizeCallback, e) {
5317
- var byWidth = [
5318
- 'left',
5319
- 'right'
5320
- ].includes(start.direction), parentElement = element.container.parentElement;
5321
- if (!parentElement) {
5322
- return;
5323
- }
5324
- var newSize;
5325
- if (byWidth) {
5326
- newSize = start.w + (e.clientX - start.x) * (start.direction === 'right' ? 1 : -1);
5327
- } else {
5328
- newSize = start.h + (e.clientY - start.y) * (start.direction === 'top' ? -1 : 1);
5329
- }
5330
- var preventResize = onResizeCallback === null || onResizeCallback === void 0 ? void 0 : onResizeCallback({
5331
- newSize: newSize
5332
- });
5333
- if (preventResize === true) {
5334
- return;
5167
+ key: "updateContent",
5168
+ value: function updateContent() {
5169
+ var _this = this;
5170
+ var container = this.container;
5171
+ container.innerHTML = '';
5172
+ container.setAttribute('data-message-id', this.message.id);
5173
+ container.setAttribute('data-role', this.message.role);
5174
+ var bubble = this.j.c.div(this.getFullElName('message-bubble'));
5175
+ bubble.classList.add(this.getFullElName('message-bubble', this.message.role, true));
5176
+ var content = this.j.c.div(this.getFullElName('message-content'));
5177
+ content.innerHTML = this.formatMessageContent(this.message.content);
5178
+ bubble.appendChild(content);
5179
+ if (this.opts.showTimestamps) {
5180
+ var timestamp = this.j.c.div(this.getFullElName('message-timestamp'));
5181
+ timestamp.textContent = this.formatTimestamp(this.message.timestamp);
5182
+ bubble.appendChild(timestamp);
5183
+ }
5184
+ // Actions button in bottom-right corner
5185
+ var actionsContainer = this.j.c.div(this.getFullElName('message-actions'));
5186
+ this.renderActionsButton(actionsContainer);
5187
+ bubble.appendChild(actionsContainer);
5188
+ container.appendChild(bubble);
5189
+ // Render tool calls
5190
+ if (this.message.toolCalls && this.message.toolCalls.length > 0) {
5191
+ var toolCallasContainer = this.j.c.div(this.getFullElName('tool-calls'));
5192
+ container.appendChild(toolCallasContainer);
5193
+ this.message.toolCalls.forEach(function(toolCall) {
5194
+ var toolElement = _this.createToolCallElement(toolCall);
5195
+ toolCallasContainer.appendChild(toolElement);
5196
+ });
5197
+ }
5198
+ // Render artifacts
5199
+ if (this.message.artifacts && this.message.artifacts.length > 0) {
5200
+ this.renderArtifacts();
5335
5201
  }
5336
- (0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(element.container, byWidth ? 'width' : 'height', newSize / (byWidth ? parentElement.offsetWidth : parentElement.offsetHeight) * 100 + '%');
5337
- }
5338
- },
5339
- {
5340
- key: "onEndResize",
5341
- value: function onEndResize(element, onResize, _) {
5342
- element.j.e.off(element.j.ow, 'mousemove touchmove', onResize);
5343
- element.j.unlock();
5344
5202
  }
5345
- }
5346
- ]);
5347
- return UIResize;
5348
- }();
5349
-
5350
-
5351
- /***/ }),
5352
-
5353
- /***/ 55487:
5354
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5355
-
5356
- "use strict";
5357
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5358
- /* harmony export */ ToolRegistry: function() { return /* binding */ ToolRegistry; }
5359
- /* harmony export */ });
5360
- /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
5361
- /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
5362
- /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
5363
- /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82749);
5364
- /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56075);
5365
- /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43284);
5366
- /* harmony import */ var _swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(61200);
5367
- /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(62361);
5368
- /* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53835);
5369
-
5370
-
5371
-
5372
-
5373
-
5374
-
5375
-
5376
-
5377
-
5378
- /**
5379
- * Tool Registry - manages available tools and their execution
5380
- */ var ToolRegistry = /*#__PURE__*/ function() {
5381
- "use strict";
5382
- function ToolRegistry(jodit) {
5383
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, ToolRegistry);
5384
- (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(this, "jodit", void 0);
5385
- (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(this, "tools", void 0);
5386
- this.jodit = jodit;
5387
- this.tools = new Map();
5388
- this.registerBuiltInTools(jodit.o.aiAssistantPro.enabledTools || []);
5389
- this.registerCustomTools(jodit.o.aiAssistantPro.customTools || []);
5390
- }
5391
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(ToolRegistry, [
5203
+ },
5392
5204
  {
5393
- key: "registerBuiltInTools",
5205
+ key: "renderActionsButton",
5394
5206
  value: /**
5395
- * Register built-in tools
5396
- */ function registerBuiltInTools(enabledTools) {
5207
+ * Render message actions button (3-dot menu)
5208
+ */ function renderActionsButton(container) {
5397
5209
  var _this = this;
5398
- enabledTools.forEach(function(toolName) {
5399
- var tool = _tools__WEBPACK_IMPORTED_MODULE_8__.BUILT_IN_TOOLS[toolName];
5400
- if (tool) {
5401
- _this.tools.set(toolName, tool);
5402
- }
5210
+ var config = this.opts;
5211
+ // Check if any action is enabled
5212
+ var hasAnyAction = config.showCopyMessageAction || config.showRestartMessageAction || config.showEditMessageAction || config.showDeleteMessageAction;
5213
+ if (!hasAnyAction) {
5214
+ return;
5215
+ }
5216
+ // Create button
5217
+ this.actionsButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.UIButton(this.j, {
5218
+ icon: {
5219
+ name: 'dots'
5220
+ },
5221
+ tooltip: 'Message actions',
5222
+ name: 'messageActions',
5223
+ size: 'tiny'
5224
+ });
5225
+ this.actionsButton.onAction(function(e) {
5226
+ _this.showActionsMenu(e);
5403
5227
  });
5228
+ container.appendChild(this.actionsButton.container);
5404
5229
  }
5405
5230
  },
5406
5231
  {
5407
- key: "registerCustomTools",
5232
+ key: "showActionsMenu",
5408
5233
  value: /**
5409
- * Register custom tools
5410
- */ function registerCustomTools(customTools) {
5234
+ * Show actions menu using ContextMenu
5235
+ */ function showActionsMenu(event) {
5411
5236
  var _this = this;
5412
- customTools.forEach(function(tool) {
5413
- _this.validateToolDefinition(tool);
5414
- _this.tools.set(tool.name, tool);
5415
- });
5237
+ if (!this.contextMenu || !this.actionsButton) return;
5238
+ var jodit = this.j;
5239
+ var config = jodit.o.aiAssistantPro;
5240
+ var actions = [];
5241
+ // Copy message action (available for all messages)
5242
+ if (config.showCopyMessageAction) {
5243
+ actions.push({
5244
+ title: 'Copy message',
5245
+ icon: 'copy',
5246
+ exec: function exec() {
5247
+ _this.j.e.fire('copyMessage.ai-assistant-pro', _this.message.id);
5248
+ }
5249
+ });
5250
+ }
5251
+ // User-only actions
5252
+ if (this.message.role === 'user') {
5253
+ // Restart from here action
5254
+ if (config.showRestartMessageAction) {
5255
+ actions.push({
5256
+ title: 'Restart from here',
5257
+ icon: 'update',
5258
+ exec: function exec() {
5259
+ _this.j.e.fire('restartFromMessage.ai-assistant-pro', _this.message.id);
5260
+ }
5261
+ });
5262
+ }
5263
+ // Edit message action
5264
+ if (config.showEditMessageAction) {
5265
+ actions.push({
5266
+ title: 'Edit message',
5267
+ icon: 'pencil',
5268
+ exec: function exec() {
5269
+ _this.j.e.fire('editMessage.ai-assistant-pro', _this.message.id);
5270
+ }
5271
+ });
5272
+ }
5273
+ }
5274
+ // Delete message action (available for all messages)
5275
+ if (config.showDeleteMessageAction) {
5276
+ actions.push({
5277
+ title: 'Delete message',
5278
+ icon: 'bin',
5279
+ exec: function exec() {
5280
+ // Show confirmation before delete
5281
+ jodit.confirm('Are you sure you want to delete this message?', 'Delete message', function(yes) {
5282
+ if (yes) {
5283
+ _this.j.e.fire('deleteMessage.ai-assistant-pro', _this.message.id);
5284
+ }
5285
+ });
5286
+ }
5287
+ });
5288
+ }
5289
+ // Get button position
5290
+ var buttonRect = this.actionsButton.container.getBoundingClientRect();
5291
+ this.contextMenu.show(buttonRect.left, buttonRect.bottom, actions);
5292
+ event.stopPropagation();
5416
5293
  }
5417
5294
  },
5418
5295
  {
5419
- key: "validateToolDefinition",
5296
+ key: "renderArtifacts",
5420
5297
  value: /**
5421
- * Validate tool definition
5422
- */ function validateToolDefinition(tool) {
5423
- if (!tool.name || typeof tool.name !== 'string') {
5424
- throw new Error('Tool must have a valid name');
5425
- }
5426
- if (!tool.description || typeof tool.description !== 'string') {
5427
- throw new Error('Tool "'.concat(tool.name, '" must have a description'));
5428
- }
5429
- if (!Array.isArray(tool.parameters)) {
5430
- throw new Error('Tool "'.concat(tool.name, '" must have a parameters array'));
5298
+ * Render artifacts
5299
+ */ function renderArtifacts() {
5300
+ var _this = this;
5301
+ if (!this.message.artifacts || this.message.artifacts.length === 0) {
5302
+ return;
5431
5303
  }
5432
- if (typeof tool.execute !== 'function') {
5433
- throw new Error('Tool "'.concat(tool.name, '" must have an execute function'));
5304
+ // Create artifact container
5305
+ var artifactContainer = this.j.c.div(this.getFullElName('artifacts'));
5306
+ this.container.appendChild(artifactContainer);
5307
+ // Create artifact group if not exists
5308
+ if (!this.artifactGroup) {
5309
+ this.artifactGroup = new jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_12__.UIGroup(this.j);
5310
+ this.artifactGroup.container.className = 'jodit-ui-artifact-group';
5434
5311
  }
5435
- // Validate parameters
5436
- tool.parameters.forEach(function(param) {
5437
- if (!param.name || typeof param.name !== 'string') {
5438
- throw new Error('Tool "'.concat(tool.name, '" has a parameter without a valid name'));
5439
- }
5440
- if (!param.type) {
5441
- throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(param.name, '" must have a type'));
5442
- }
5443
- if (typeof param.required !== 'boolean') {
5444
- throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(param.name, "\" must specify if it's required"));
5445
- }
5312
+ // Clear previous artifacts
5313
+ this.artifactGroup.clear();
5314
+ // Render each artifact
5315
+ this.message.artifacts.forEach(function(artifact) {
5316
+ var artifactElement = new _artifact__WEBPACK_IMPORTED_MODULE_8__.UIArtifact(_this.j, artifact);
5317
+ _this.artifactGroup.append(artifactElement);
5446
5318
  });
5319
+ // Append artifact group to container
5320
+ artifactContainer.appendChild(this.artifactGroup.container);
5447
5321
  }
5448
5322
  },
5449
5323
  {
5450
- /**
5451
- * Get all registered tools
5452
- */ key: "getAllTools",
5453
- value: function getAllTools() {
5454
- return Array.from(this.tools.values());
5455
- }
5456
- },
5457
- {
5458
- /**
5459
- * Get tool by name
5460
- */ key: "getTool",
5461
- value: function getTool(name) {
5462
- return this.tools.get(name);
5324
+ key: "createToolCallElement",
5325
+ value: /**
5326
+ * Create tool call element
5327
+ */ function createToolCallElement(toolCall) {
5328
+ var element = this.j.c.div(this.getFullElName('tool-call'));
5329
+ element.setAttribute('data-tool-id', toolCall.id);
5330
+ element.setAttribute('data-status', toolCall.status);
5331
+ // Main header
5332
+ var header = this.j.c.div(this.getFullElName('tool-header'));
5333
+ var icon = this.j.c.div(this.getFullElName('tool-icon'));
5334
+ icon.classList.add(this.getFullElName('tool-icon', toolCall.status, true));
5335
+ icon.textContent = '⚡';
5336
+ var name = this.j.c.div(this.getFullElName('tool-name'));
5337
+ name.textContent = this.j.i18n(toolCall.name);
5338
+ var status = this.j.c.div(this.getFullElName('tool-status'));
5339
+ status.textContent = this.getToolStatusText(toolCall.status || 'unknown');
5340
+ header.appendChild(icon);
5341
+ header.appendChild(name);
5342
+ header.appendChild(status);
5343
+ element.appendChild(header);
5344
+ // Expandable arguments section
5345
+ var argsSection = this.createExpandableSection('Arguments', JSON.stringify(toolCall.arguments || {}, null, 2));
5346
+ element.appendChild(argsSection);
5347
+ // Expandable result section (only if tool has result)
5348
+ if (toolCall.result) {
5349
+ var resultContent = toolCall.result.error ? "Error: ".concat(toolCall.result.error) : toolCall.result.result || '';
5350
+ var resultSection = this.createExpandableSection('Result', typeof resultContent === 'string' ? resultContent : JSON.stringify(resultContent, null, 2));
5351
+ element.appendChild(resultSection);
5352
+ }
5353
+ return element;
5463
5354
  }
5464
5355
  },
5465
5356
  {
5466
- /**
5467
- * Check if tool exists
5468
- */ key: "hasTool",
5469
- value: function hasTool(name) {
5470
- return this.tools.has(name);
5357
+ key: "createExpandableSection",
5358
+ value: /**
5359
+ * Create expandable section for tool details
5360
+ */ function createExpandableSection(title, content) {
5361
+ var _this = this;
5362
+ var section = this.j.c.div(this.getFullElName('tool-expandable'));
5363
+ var toggle = this.j.c.element('button', {
5364
+ type: 'button',
5365
+ class: this.getFullElName('tool-expandable-toggle')
5366
+ });
5367
+ toggle.textContent = "▶ ".concat(this.j.i18n(title));
5368
+ var contentEl = this.j.c.element('pre', {
5369
+ class: this.getFullElName('tool-expandable-content')
5370
+ });
5371
+ contentEl.textContent = content;
5372
+ contentEl.style.display = 'none';
5373
+ this.j.e.on(toggle, 'click', function() {
5374
+ var isCurrentlyExpanded = contentEl.style.display !== 'none';
5375
+ if (isCurrentlyExpanded) {
5376
+ contentEl.style.display = 'none';
5377
+ toggle.textContent = "▶ ".concat(_this.j.i18n(title));
5378
+ } else {
5379
+ contentEl.style.display = 'block';
5380
+ toggle.textContent = "▼ ".concat(_this.j.i18n(title));
5381
+ }
5382
+ });
5383
+ section.appendChild(toggle);
5384
+ section.appendChild(contentEl);
5385
+ return section;
5471
5386
  }
5472
5387
  },
5473
5388
  {
5474
- /**
5475
- * Get tool names
5476
- */ key: "getToolNames",
5477
- value: function getToolNames() {
5478
- return Array.from(this.tools.keys());
5389
+ key: "getToolStatusText",
5390
+ value: /**
5391
+ * Get tool status text
5392
+ */ function getToolStatusText(status) {
5393
+ var statusMap = {
5394
+ pending: '⏳',
5395
+ approved: '✓',
5396
+ denied: '✕',
5397
+ executing: '⚡',
5398
+ executed: '✓',
5399
+ error: '⚠'
5400
+ };
5401
+ return statusMap[status] || '●';
5479
5402
  }
5480
5403
  },
5481
5404
  {
5482
- key: "executeTool",
5405
+ key: "formatMessageContent",
5483
5406
  value: /**
5484
- * Execute a tool
5485
- */ function executeTool(toolName, args, signal) {
5486
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
5487
- var tool, resolvedArgs, result, error;
5488
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__._)(this, function(_state) {
5489
- switch(_state.label){
5490
- case 0:
5491
- tool = this.getTool(toolName);
5492
- if (!tool) {
5493
- throw new Error('Tool "'.concat(toolName, '" not found'));
5494
- }
5495
- resolvedArgs = this.applyDefaults(tool, args);
5496
- // Validate arguments
5497
- this.validateArguments(tool, resolvedArgs);
5498
- _state.label = 1;
5499
- case 1:
5500
- _state.trys.push([
5501
- 1,
5502
- 3,
5503
- ,
5504
- 4
5505
- ]);
5506
- return [
5507
- 4,
5508
- tool.execute(this.jodit, resolvedArgs, signal)
5509
- ];
5510
- case 2:
5511
- result = _state.sent();
5512
- return [
5513
- 2,
5514
- result
5515
- ];
5516
- case 3:
5517
- error = _state.sent();
5518
- if ((error === null || error === void 0 ? void 0 : error.name) === 'AbortError' || signal.aborted) {
5519
- throw new Error('Tool execution was aborted');
5520
- }
5521
- throw error;
5522
- case 4:
5523
- return [
5524
- 2
5525
- ];
5526
- }
5527
- });
5528
- }).call(this);
5407
+ * Format message content using custom formatter
5408
+ */ function formatMessageContent(content) {
5409
+ var customFormatter = this.opts.formatMessageContent;
5410
+ var messageRole = this.message.role;
5411
+ return customFormatter(content, messageRole, this.j.i18n.bind(this.j));
5529
5412
  }
5530
5413
  },
5531
5414
  {
5532
- key: "validateArguments",
5415
+ key: "formatTimestamp",
5533
5416
  value: /**
5534
- * Validate tool arguments
5535
- */ function validateArguments(tool, args) {
5536
- var provided = Object.keys(args);
5537
- var required = tool.parameters.filter(function(p) {
5538
- return p.required;
5539
- }).map(function(p) {
5540
- return p.name;
5541
- });
5542
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5543
- try {
5544
- // Check required parameters
5545
- for(var _iterator = required[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5546
- var paramName = _step.value;
5547
- if (!provided.includes(paramName)) {
5548
- throw new Error('Tool "'.concat(tool.name, '" requires parameter "').concat(paramName, '"'));
5549
- }
5550
- }
5551
- } catch (err) {
5552
- _didIteratorError = true;
5553
- _iteratorError = err;
5554
- } finally{
5555
- try {
5556
- if (!_iteratorNormalCompletion && _iterator.return != null) {
5557
- _iterator.return();
5558
- }
5559
- } finally{
5560
- if (_didIteratorError) {
5561
- throw _iteratorError;
5562
- }
5563
- }
5564
- }
5565
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
5566
- try {
5567
- var _this, _loop = function() {
5568
- var _step_value = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(_step1.value, 2), paramName = _step_value[0], value = _step_value[1];
5569
- var param = tool.parameters.find(function(p) {
5570
- return p.name === paramName;
5571
- });
5572
- if (!param) {
5573
- // Unknown parameter - log warning but don't fail
5574
- if (_this.jodit.o.aiAssistantPro.debug) {
5575
- console.warn('Tool "'.concat(tool.name, '" received unknown parameter "').concat(paramName, '"'));
5576
- }
5577
- return "continue";
5578
- }
5579
- // Type validation
5580
- var actualType = Array.isArray(value) ? 'array' : (typeof value === "undefined" ? "undefined" : (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__._)(value)) === 'object' && value != null ? 'object' : typeof value === "undefined" ? "undefined" : (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__._)(value);
5581
- if (param.type !== actualType && !(param.type === 'number' && actualType === 'string' && !isNaN(Number(value)))) {
5582
- throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(paramName, '" expects type "').concat(param.type, '" but got "').concat(actualType, '"'));
5583
- }
5584
- // Enum validation
5585
- if (param.enum && param.enum.length > 0) {
5586
- if (!param.enum.includes(value)) {
5587
- throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(paramName, '" must be one of: ').concat(param.enum.join(', ')));
5588
- }
5589
- }
5590
- };
5591
- // Validate parameter types and values
5592
- for(var _iterator1 = Object.entries(args)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_this = this, _loop();
5593
- } catch (err) {
5594
- _didIteratorError1 = true;
5595
- _iteratorError1 = err;
5596
- } finally{
5597
- try {
5598
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
5599
- _iterator1.return();
5600
- }
5601
- } finally{
5602
- if (_didIteratorError1) {
5603
- throw _iteratorError1;
5604
- }
5605
- }
5606
- }
5417
+ * Format timestamp using custom formatter
5418
+ */ function formatTimestamp(timestamp) {
5419
+ var customFormatter = this.opts.formatTimestamp;
5420
+ return customFormatter(timestamp, this.j.i18n.bind(this.j));
5607
5421
  }
5608
5422
  },
5609
5423
  {
5610
- key: "applyDefaults",
5611
- value: /**
5612
- * Apply parameter defaults defined in tool definition
5613
- */ function applyDefaults(tool, args) {
5614
- var resolved = (0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, args);
5615
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5616
- try {
5617
- for(var _iterator = tool.parameters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5618
- var param = _step.value;
5619
- if (resolved[param.name] === undefined && param.default !== undefined) {
5620
- resolved[param.name] = param.default;
5621
- }
5622
- }
5623
- } catch (err) {
5624
- _didIteratorError = true;
5625
- _iteratorError = err;
5626
- } finally{
5627
- try {
5628
- if (!_iteratorNormalCompletion && _iterator.return != null) {
5629
- _iterator.return();
5630
- }
5631
- } finally{
5632
- if (_didIteratorError) {
5633
- throw _iteratorError;
5634
- }
5635
- }
5636
- }
5637
- return resolved;
5424
+ /**
5425
+ * Update message (for streaming or updates)
5426
+ */ key: "updateMessage",
5427
+ value: function updateMessage(message) {
5428
+ this.message = message;
5429
+ this.updateContent();
5638
5430
  }
5639
5431
  },
5640
5432
  {
5641
- /**
5642
- * Destroy registry
5643
- */ key: "destruct",
5433
+ key: "destruct",
5644
5434
  value: function destruct() {
5645
- this.tools.clear();
5435
+ var _this_actionsButton, _this_contextMenu, _this_artifactGroup;
5436
+ (_this_actionsButton = this.actionsButton) === null || _this_actionsButton === void 0 ? void 0 : _this_actionsButton.destruct();
5437
+ (_this_contextMenu = this.contextMenu) === null || _this_contextMenu === void 0 ? void 0 : _this_contextMenu.destruct();
5438
+ (_this_artifactGroup = this.artifactGroup) === null || _this_artifactGroup === void 0 ? void 0 : _this_artifactGroup.destruct();
5439
+ (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIMessageListItem.prototype), "destruct", this).call(this);
5646
5440
  }
5647
5441
  }
5648
5442
  ]);
5649
- return ToolRegistry;
5650
- }();
5443
+ return UIMessageListItem;
5444
+ }(jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement);
5445
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
5446
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.hook)('ready')
5447
+ ], UIMessageListItem.prototype, "onReady", null);
5448
+ UIMessageListItem = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
5449
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.component
5450
+ ], UIMessageListItem);
5651
5451
 
5652
5452
 
5653
5453
  /***/ }),
5654
5454
 
5655
- /***/ 55790:
5656
- /***/ (function(module) {
5455
+ /***/ 52826:
5456
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5657
5457
 
5658
- module.exports = {
5659
- 'AI Assistant': 'AI Ассистент',
5660
- 'AI Assistant Pro': 'AI Ассистент Pro',
5661
- 'Welcome to AI Assistant': 'Добро пожаловать в AI Ассистент',
5662
- 'Start your first conversation': 'Начните первый диалог',
5663
- 'Tip: Select text in editor to add context': 'Подсказка: Выделите текст в редакторе для добавления контекста',
5664
- 'New chat': 'Новый чат',
5665
- 'Search conversations...': 'Поиск диалогов...',
5666
- 'No conversations yet': 'Пока нет диалогов',
5667
- 'Ask me anything...': 'Спросите меня о чем угодно...',
5668
- 'Ask a follow-up...': 'Задайте дополнительный вопрос...',
5669
- 'Reply...': 'Ответить...',
5670
- 'Type your message...': 'Введите ваше сообщение...',
5671
- Send: 'Отправить',
5672
- Cancel: 'Отмена',
5673
- Retry: 'Повторить',
5674
- Insert: 'Вставить',
5675
- Copy: 'Копировать',
5676
- Edit: 'Редактировать',
5677
- Delete: 'Удалить',
5678
- New: 'Новый',
5679
- Back: 'Назад',
5680
- 'Permission Required': 'Требуется разрешение',
5681
- Approve: 'Разрешить',
5682
- Deny: 'Отклонить',
5683
- Once: 'Один раз',
5684
- 'This conversation': 'Этот диалог',
5685
- Always: 'Всегда',
5686
- 'The AI wants to execute:': 'AI хочет выполнить:',
5687
- 'This will modify your document content.': 'Это изменит содержимое вашего документа.',
5688
- 'Executing...': 'Выполняется...',
5689
- 'Completed successfully': 'Успешно выполнено',
5690
- Failed: 'Ошибка',
5691
- 'Pending approval': 'Ожидает разрешения',
5692
- 'Denied by user': 'Отклонено пользователем',
5693
- 'Tool Result': 'Результат инструмента',
5694
- 'Tool Execution Error': 'Ошибка выполнения инструмента',
5695
- Context: 'Контекст',
5696
- Contexts: 'Контексты',
5697
- 'Add to AI Context': 'Добавить в контекст AI',
5698
- Remove: 'Удалить',
5699
- 'Clear all': 'Очистить все',
5700
- 'An error occurred': 'Произошла ошибка',
5701
- 'Request failed': 'Запрос не выполнен',
5702
- 'Connection error': 'Ошибка соединения',
5703
- 'AI Assistant is not configured': 'AI Ассистент не настроен',
5704
- 'Thinking...': 'Думаю...',
5705
- 'Generating response...': 'Генерирую ответ...',
5706
- insertHTML: 'Вставить HTML',
5707
- readDocument: 'Прочитать документ',
5708
- readBlock: 'Прочитать блок',
5709
- replaceInDocument: 'Заменить в документе',
5710
- replaceInBlock: 'Заменить в блоке',
5711
- getSelection: 'Получить выделение',
5712
- 'Just now': 'Только что',
5713
- Conversation: 'Диалог',
5714
- 'New Conversation': 'Новый диалог',
5715
- Yesterday: 'Вчера',
5716
- 'Delete conversation': 'Удалить диалог',
5717
- 'Are you sure you want to delete this conversation?': 'Вы уверены, что хотите удалить этот диалог?',
5718
- 'Failed to delete conversation': 'Не удалось удалить диалог',
5719
- // Settings
5720
- Settings: 'Настройки',
5721
- 'General Settings': 'Общие настройки',
5722
- 'Conversation Settings': 'Настройки диалога',
5723
- 'Display Mode': 'Режим отображения',
5724
- 'Panel Width': 'Ширина панели',
5725
- Theme: 'Тема',
5726
- Model: 'Модель',
5727
- Temperature: 'Температура',
5728
- Close: 'Закрыть',
5729
- // Display modes
5730
- Dialog: 'Модальное окно',
5731
- Left: 'Левая панель',
5732
- Right: 'Правая панель',
5733
- Top: 'Верхняя панель',
5734
- Bottom: 'Нижняя панель',
5735
- // Theme options
5736
- Inherit: 'Наследовать от редактора',
5737
- Light: 'Светлая тема',
5738
- Dark: 'Тёмная тема',
5739
- '%dm ago': '%dм назад',
5740
- '%dh ago': '%dч назад'
5741
- };
5458
+ "use strict";
5459
+ __webpack_require__.r(__webpack_exports__);
5460
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5461
+ /* harmony export */ description: function() { return /* binding */ description; },
5462
+ /* harmony export */ name: function() { return /* binding */ name; },
5463
+ /* harmony export */ parameters: function() { return /* binding */ parameters; },
5464
+ /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
5465
+ /* harmony export */ });
5466
+ var name = 'readSelection';
5467
+ var description = 'Get information about the current selection including HTML content and optional context';
5468
+ var parameters = [
5469
+ {
5470
+ name: 'contextCharsBefore',
5471
+ type: 'number',
5472
+ description: 'Number of characters to include before the selection',
5473
+ required: false,
5474
+ default: 0
5475
+ },
5476
+ {
5477
+ name: 'contextCharsAfter',
5478
+ type: 'number',
5479
+ description: 'Number of characters to include after the selection',
5480
+ required: false,
5481
+ default: 0
5482
+ }
5483
+ ];
5484
+ var requiresPermission = false;
5742
5485
 
5743
5486
 
5744
5487
  /***/ }),
5745
5488
 
5746
- /***/ 55885:
5489
+ /***/ 53014:
5747
5490
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5748
5491
 
5749
5492
  "use strict";
5750
5493
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5751
- /* harmony export */ UIWelcomeScreen: function() { return /* binding */ UIWelcomeScreen; }
5494
+ /* harmony export */ applyTheme: function() { return /* binding */ applyTheme; }
5752
5495
  /* harmony export */ });
5753
- /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
5754
- /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
5755
- /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
5756
- /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18766);
5757
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
5758
- /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65478);
5759
- /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67510);
5496
+ /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94899);
5497
+
5498
+ var DARK_THEME = [
5499
+ 'jodit_theme_dark',
5500
+ 'jodit-ai-assistant-pro_theme_dark',
5501
+ 'jodit-dialog_theme_dark'
5502
+ ];
5503
+ var LIGHT_THEME = [
5504
+ 'jodit_theme_light',
5505
+ 'jodit-ai-assistant-pro_theme_light',
5506
+ 'jodit-dialog_theme_light'
5507
+ ];
5508
+ /**
5509
+ * Apply theme to assistant UI
5510
+ */ function applyTheme(jodit, theme, displayMode, container, dialog) {
5511
+ var // Remove all theme classes
5512
+ _container_classList, _container_classList1, _container_classList2;
5513
+ container === null || container === void 0 ? void 0 : (_container_classList = container.classList).remove.apply(_container_classList, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(DARK_THEME));
5514
+ container === null || container === void 0 ? void 0 : (_container_classList1 = container.classList).remove.apply(_container_classList1, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(LIGHT_THEME));
5515
+ if (displayMode === 'dialog') {
5516
+ var _dialogContainer_classList, _dialogContainer_classList1;
5517
+ var dialogContainer = dialog === null || dialog === void 0 ? void 0 : dialog.container;
5518
+ dialogContainer === null || dialogContainer === void 0 ? void 0 : (_dialogContainer_classList = dialogContainer.classList).remove.apply(_dialogContainer_classList, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(DARK_THEME));
5519
+ dialogContainer === null || dialogContainer === void 0 ? void 0 : (_dialogContainer_classList1 = dialogContainer.classList).remove.apply(_dialogContainer_classList1, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(LIGHT_THEME));
5520
+ }
5521
+ var themeClasses;
5522
+ if (theme === 'dark') {
5523
+ themeClasses = DARK_THEME;
5524
+ } else {
5525
+ themeClasses = LIGHT_THEME;
5526
+ }
5527
+ container === null || container === void 0 ? void 0 : (_container_classList2 = container.classList).add.apply(_container_classList2, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(themeClasses));
5528
+ if (displayMode === 'dialog') {
5529
+ var _dialogContainer_classList2;
5530
+ var dialogContainer1 = dialog === null || dialog === void 0 ? void 0 : dialog.container;
5531
+ dialogContainer1 === null || dialogContainer1 === void 0 ? void 0 : (_dialogContainer_classList2 = dialogContainer1.classList).add.apply(_dialogContainer_classList2, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(themeClasses));
5532
+ }
5533
+ }
5534
+
5535
+
5536
+ /***/ }),
5537
+
5538
+ /***/ 53835:
5539
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5540
+
5541
+ "use strict";
5542
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5543
+ /* harmony export */ BUILT_IN_TOOLS: function() { return /* binding */ BUILT_IN_TOOLS; },
5544
+ /* harmony export */ getToolNames: function() { return /* binding */ getToolNames; }
5545
+ /* harmony export */ });
5546
+ /* unused harmony exports getTool, hasTool */
5547
+ /* harmony import */ var _apply_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39296);
5548
+ /* harmony import */ var _insert_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16745);
5549
+ /* harmony import */ var _read_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78717);
5550
+ /* harmony import */ var _read_document__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5618);
5551
+ /* harmony import */ var _read_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90991);
5552
+ /* harmony import */ var _replace_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2020);
5553
+ /* harmony import */ var _replace_in_document__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12570);
5554
+ /* harmony import */ var _replace_selection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(95323);
5555
+ /* harmony import */ var _write_document__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97603);
5760
5556
 
5761
5557
 
5762
5558
 
@@ -5764,473 +5560,1032 @@ module.exports = {
5764
5560
 
5765
5561
 
5766
5562
 
5767
- var UIWelcomeScreen = /*#__PURE__*/ function(UIElement) {
5768
- "use strict";
5769
- (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__._)(UIWelcomeScreen, UIElement);
5770
- function UIWelcomeScreen() {
5771
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIWelcomeScreen);
5772
- return (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIWelcomeScreen, arguments);
5773
- }
5774
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIWelcomeScreen, [
5775
- {
5776
- key: "className",
5777
- value: function className() {
5778
- return 'UIWelcomeScreen';
5779
- }
5780
- },
5781
- {
5782
- key: "render",
5783
- value: function render() {
5784
- return '<div class="&__container">\n <div class="&__icon">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/>\n </svg>\n </div>\n <div class="&__title">~Welcome to AI Assistant~</div>\n <div class="&__subtitle">~Start your first conversation~</div>\n <div class="&__tip">~Tip: Select text in editor to add context~</div>\n </div>';
5785
- }
5786
- }
5787
- ]);
5788
- return UIWelcomeScreen;
5789
- }(jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIElement);
5790
- UIWelcomeScreen = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
5791
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__.component
5792
- ], UIWelcomeScreen);
5563
+
5564
+
5565
+ /**
5566
+ * Built-in tools collection
5567
+ * Each tool contains definition and executor
5568
+ */ var BUILT_IN_TOOLS = {
5569
+ // Read operations
5570
+ readDocument: _read_document__WEBPACK_IMPORTED_MODULE_3__["default"],
5571
+ readBlocks: _read_blocks__WEBPACK_IMPORTED_MODULE_2__["default"],
5572
+ readSelection: _read_selection__WEBPACK_IMPORTED_MODULE_4__["default"],
5573
+ // Write operations
5574
+ writeDocument: _write_document__WEBPACK_IMPORTED_MODULE_8__["default"],
5575
+ replaceSelection: _replace_selection__WEBPACK_IMPORTED_MODULE_7__["default"],
5576
+ replaceBlock: _replace_block__WEBPACK_IMPORTED_MODULE_5__["default"],
5577
+ replaceInDocument: _replace_in_document__WEBPACK_IMPORTED_MODULE_6__["default"],
5578
+ insertHTML: _insert_html__WEBPACK_IMPORTED_MODULE_1__["default"],
5579
+ // Formatting operations
5580
+ applyFormat: _apply_format__WEBPACK_IMPORTED_MODULE_0__["default"]
5581
+ };
5582
+ /**
5583
+ * Get tool names
5584
+ */ function getToolNames() {
5585
+ return Object.keys(BUILT_IN_TOOLS);
5586
+ }
5587
+ /**
5588
+ * Get tool by name
5589
+ */ function getTool(name) {
5590
+ return BUILT_IN_TOOLS[name];
5591
+ }
5592
+ /**
5593
+ * Check if tool exists
5594
+ */ function hasTool(name) {
5595
+ return name in BUILT_IN_TOOLS;
5596
+ }
5793
5597
 
5794
5598
 
5795
5599
  /***/ }),
5796
5600
 
5797
- /***/ 56110:
5601
+ /***/ 54747:
5798
5602
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5799
5603
 
5800
5604
  "use strict";
5801
5605
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5802
- /* harmony export */ deleteConversationWithCleanup: function() { return /* binding */ deleteConversationWithCleanup; },
5803
- /* harmony export */ loadInitialData: function() { return /* binding */ loadInitialData; }
5606
+ /* harmony export */ UIResize: function() { return /* binding */ UIResize; }
5804
5607
  /* harmony export */ });
5805
- /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
5806
- /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43284);
5807
- /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62361);
5808
- /* harmony import */ var jodit_esm_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82758);
5608
+ /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20616);
5609
+ /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67709);
5610
+ /* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
5611
+ /* harmony import */ var jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41180);
5612
+ /*!
5613
+ * Jodit Editor PRO (https://xdsoft.net/jodit/)
5614
+ * See LICENSE.md in the project root for license information.
5615
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5616
+ */
5809
5617
 
5810
5618
 
5811
5619
 
5812
5620
 
5813
- /**
5814
- * Delete conversation from storage and update state
5815
- */ function deleteConversationWithCleanup(jodit, conversationId, storage, stateManager, permissionManager) {
5816
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
5817
- var currentConversation, conversations, error;
5818
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_2__._)(this, function(_state) {
5819
- switch(_state.label){
5820
- case 0:
5821
- _state.trys.push([
5822
- 0,
5823
- 3,
5824
- 4,
5825
- 5
5826
- ]);
5827
- stateManager.setLoading(true);
5828
- // Delete from storage
5829
- return [
5830
- 4,
5831
- storage.delete(conversationId)
5832
- ];
5833
- case 1:
5834
- _state.sent();
5835
- // Remove from state manager
5836
- stateManager.removeConversation(conversationId);
5837
- // Clear permissions for this conversation
5838
- permissionManager.clearConversationPermissions(conversationId);
5839
- // If this was the current conversation, clear it
5840
- currentConversation = stateManager.getCurrentConversation();
5841
- if ((currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.id) === conversationId) {
5842
- stateManager.setCurrentConversation(null);
5843
- }
5844
- return [
5845
- 4,
5846
- storage.list()
5847
- ];
5848
- case 2:
5849
- conversations = _state.sent();
5850
- stateManager.setConversations(conversations);
5851
- // Update view
5852
- stateManager.setView(conversations.length === 0 ? 'welcome' : 'conversationList');
5853
- // Fire event
5854
- jodit.e.fire('conversationDeleted.ai-assistant-pro', conversationId);
5855
- return [
5856
- 3,
5857
- 5
5858
- ];
5859
- case 3:
5860
- error = _state.sent();
5861
- jodit.alert(jodit.i18n('Failed to delete conversation') + ': ' + ((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
5862
- return [
5863
- 3,
5864
- 5
5865
- ];
5866
- case 4:
5867
- stateManager.setLoading(false);
5868
- return [
5869
- 7
5870
- ];
5871
- case 5:
5872
- return [
5873
- 2
5874
- ];
5621
+ var UIResize = /*#__PURE__*/ function() {
5622
+ "use strict";
5623
+ function UIResize() {
5624
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_0__._)(this, UIResize);
5625
+ }
5626
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_1__._)(UIResize, null, [
5627
+ {
5628
+ key: "remove",
5629
+ value: function remove(element) {
5630
+ element.container.classList.remove('jodit-ui-resize');
5631
+ jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(element.container.querySelector('.jodit-ui-resize__handle'));
5875
5632
  }
5876
- });
5877
- })();
5878
- }
5879
- /**
5880
- * Load initial data (conversations list and settings)
5881
- */ function loadInitialData(jodit, storage, stateManager) {
5882
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
5883
- var _ref, conversations, savedSettings, _conversations_find, conversation, lastConv, error;
5884
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_2__._)(this, function(_state) {
5885
- switch(_state.label){
5886
- case 0:
5887
- stateManager.setLoading(true);
5888
- _state.label = 1;
5889
- case 1:
5890
- _state.trys.push([
5891
- 1,
5892
- 7,
5893
- 8,
5894
- 9
5895
- ]);
5896
- return [
5897
- 4,
5898
- Promise.all([
5899
- storage.list().catch(function() {
5900
- return [];
5901
- }),
5902
- storage.getGlobalSettings().catch(function() {
5903
- return null;
5904
- })
5905
- ])
5906
- ];
5907
- case 2:
5908
- _ref = _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_1__._.apply(void 0, [
5909
- _state.sent(),
5910
- 2
5911
- ]), conversations = _ref[0], savedSettings = _ref[1];
5912
- stateManager.setConversations(conversations);
5913
- savedSettings && stateManager.setSavedState(savedSettings);
5914
- if (!(conversations.length === 0)) return [
5915
- 3,
5916
- 3
5917
- ];
5918
- stateManager.setView('welcome');
5919
- return [
5920
- 3,
5921
- 6
5922
- ];
5923
- case 3:
5924
- if (!(jodit.o.aiAssistantPro.rememberLastConversation && (savedSettings === null || savedSettings === void 0 ? void 0 : savedSettings.currentConversationId))) return [
5925
- 3,
5926
- 5
5927
- ];
5928
- conversation = (_conversations_find = conversations.find(function(conv) {
5929
- return conv.id === savedSettings.currentConversationId;
5930
- })) !== null && _conversations_find !== void 0 ? _conversations_find : conversations[0];
5931
- return [
5932
- 4,
5933
- storage.get(conversation.id)
5934
- ];
5935
- case 4:
5936
- lastConv = _state.sent();
5937
- if (lastConv) {
5938
- stateManager.setCurrentConversation(lastConv);
5939
- } else {
5940
- stateManager.setView('conversationList');
5941
- }
5942
- return [
5943
- 3,
5944
- 6
5945
- ];
5946
- case 5:
5947
- stateManager.setView('conversationList');
5948
- _state.label = 6;
5949
- case 6:
5950
- return [
5951
- 3,
5952
- 9
5953
- ];
5954
- case 7:
5955
- error = _state.sent();
5956
- if (!jodit_esm_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_PROD) {
5957
- console.error('Failed to load conversations:', error);
5958
- }
5959
- stateManager.setView('welcome');
5960
- return [
5961
- 3,
5962
- 9
5963
- ];
5964
- case 8:
5965
- stateManager.setLoading(false);
5966
- return [
5967
- 7
5968
- ];
5969
- case 9:
5970
- return [
5971
- 2
5972
- ];
5633
+ },
5634
+ {
5635
+ key: "install",
5636
+ value: function install(element, direction) {
5637
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
5638
+ var _options_onResize;
5639
+ element.container.classList.add('jodit-ui-resize');
5640
+ if ((0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(element.container, 'position') === 'static') {
5641
+ (0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(element.container, 'position', 'relative');
5642
+ }
5643
+ var handle = element.j.c.div('jodit-ui-resize__handle');
5644
+ handle.classList.add('jodit-ui-resize__handle_type_' + direction);
5645
+ if (options.handleClassName) {
5646
+ handle.classList.add(options.handleClassName);
5647
+ }
5648
+ element.container.appendChild(handle);
5649
+ element.j.e.on(handle, 'mousedown touchstart', this.onStartResize.bind(this, element, direction, (_options_onResize = options.onResize) !== null && _options_onResize !== void 0 ? _options_onResize : function() {
5650
+ return undefined;
5651
+ }));
5973
5652
  }
5974
- });
5975
- })();
5976
- }
5653
+ },
5654
+ {
5655
+ key: "onStartResize",
5656
+ value: function onStartResize(element, direction, onResizeCallback, startEvent) {
5657
+ var start = {
5658
+ x: startEvent.clientX,
5659
+ y: startEvent.clientY,
5660
+ w: element.container.offsetWidth,
5661
+ h: element.container.offsetHeight,
5662
+ direction: direction
5663
+ };
5664
+ var onResize = element.j.async.throttle(this.onResize.bind(this, element, start, onResizeCallback), element.j.defaultTimeout / 10);
5665
+ element.j.lock();
5666
+ element.j.e.on(element.j.ow, 'mousemove touchmove', onResize).one(element.j.ow, 'mouseup touchend', this.onEndResize.bind(this, element, onResize));
5667
+ }
5668
+ },
5669
+ {
5670
+ key: "onResize",
5671
+ value: function onResize(element, start, onResizeCallback, e) {
5672
+ var byWidth = [
5673
+ 'left',
5674
+ 'right'
5675
+ ].includes(start.direction), parentElement = element.container.parentElement;
5676
+ if (!parentElement) {
5677
+ return;
5678
+ }
5679
+ var newSize;
5680
+ if (byWidth) {
5681
+ newSize = start.w + (e.clientX - start.x) * (start.direction === 'right' ? 1 : -1);
5682
+ } else {
5683
+ newSize = start.h + (e.clientY - start.y) * (start.direction === 'top' ? -1 : 1);
5684
+ }
5685
+ var preventResize = onResizeCallback === null || onResizeCallback === void 0 ? void 0 : onResizeCallback({
5686
+ newSize: newSize
5687
+ });
5688
+ if (preventResize === true) {
5689
+ return;
5690
+ }
5691
+ (0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(element.container, byWidth ? 'width' : 'height', newSize / (byWidth ? parentElement.offsetWidth : parentElement.offsetHeight) * 100 + '%');
5692
+ }
5693
+ },
5694
+ {
5695
+ key: "onEndResize",
5696
+ value: function onEndResize(element, onResize, _) {
5697
+ element.j.e.off(element.j.ow, 'mousemove touchmove', onResize);
5698
+ element.j.unlock();
5699
+ }
5700
+ }
5701
+ ]);
5702
+ return UIResize;
5703
+ }();
5977
5704
 
5978
5705
 
5979
5706
  /***/ }),
5980
5707
 
5981
- /***/ 56293:
5708
+ /***/ 55487:
5982
5709
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5983
5710
 
5984
5711
  "use strict";
5985
5712
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5986
- /* harmony export */ execute: function() { return /* binding */ execute; }
5713
+ /* harmony export */ ToolRegistry: function() { return /* binding */ ToolRegistry; }
5987
5714
  /* harmony export */ });
5988
5715
  /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
5989
- /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62361);
5990
- /* harmony import */ var _core_abort_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
5991
- /* harmony import */ var _core_arg_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49459);
5716
+ /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
5717
+ /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
5718
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82749);
5719
+ /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56075);
5720
+ /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43284);
5721
+ /* harmony import */ var _swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(61200);
5722
+ /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(62361);
5723
+ /* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53835);
5992
5724
 
5993
5725
 
5994
5726
 
5995
5727
 
5996
- function replaceInSelectedElements(jodit, search, replace, useRegex, useSelector, signal) {
5997
- var elements = jodit.editor.querySelectorAll(useSelector);
5998
- if (elements.length === 0) {
5999
- return {
6000
- replacements: 0,
6001
- message: 'No elements found matching selector "'.concat(useSelector, '"')
6002
- };
6003
- }
6004
- var replacements = 0;
6005
- elements.forEach(function(element) {
6006
- (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6007
- var elementContent = element.innerHTML;
6008
- var originalContent = elementContent;
6009
- if (useRegex) {
6010
- try {
6011
- var regex = new RegExp(search, 'g');
6012
- elementContent = elementContent.replace(regex, function() {
6013
- replacements++;
6014
- return replace;
6015
- });
6016
- } catch (error) {
6017
- throw new Error("Invalid regex pattern: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6018
- }
6019
- } else {
6020
- var searchLength = search.length;
6021
- var pos = 0;
6022
- while((pos = elementContent.indexOf(search, pos)) !== -1){
6023
- (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6024
- elementContent = elementContent.substring(0, pos) + replace + elementContent.substring(pos + searchLength);
6025
- pos += replace.length;
6026
- replacements++;
6027
- }
6028
- }
6029
- if (elementContent !== originalContent) {
6030
- element.innerHTML = elementContent;
6031
- }
6032
- });
6033
- if (replacements > 0) {
6034
- jodit.synchronizeValues();
6035
- jodit.s.restore();
6036
- }
6037
- return {
6038
- replacements: replacements
6039
- };
6040
- }
6041
- function replaceInDocument(jodit, content, search, replace, useRegex, signal) {
6042
- var replacements = 0;
6043
- var updatedContent = content;
6044
- if (useRegex) {
6045
- try {
6046
- var regex = new RegExp(search, 'g');
6047
- updatedContent = updatedContent.replace(regex, function() {
6048
- replacements++;
6049
- return replace;
6050
- });
6051
- } catch (error) {
6052
- throw new Error("Invalid regex pattern: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6053
- }
6054
- } else {
6055
- var searchLength = search.length;
6056
- var pos = 0;
6057
- while((pos = updatedContent.indexOf(search, pos)) !== -1){
6058
- (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6059
- updatedContent = updatedContent.substring(0, pos) + replace + updatedContent.substring(pos + searchLength);
6060
- pos += replace.length;
6061
- replacements++;
6062
- }
6063
- }
6064
- if (replacements > 0) {
6065
- jodit.value = updatedContent;
6066
- jodit.s.restore();
6067
- jodit.synchronizeValues();
6068
- }
6069
- return replacements;
6070
- }
6071
- /**
6072
- * Find and replace text/HTML in entire document
6073
- */ function execute(jodit, args, signal) {
6074
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6075
- var search, replace, useRegex, useSelector, replacements, message, result;
6076
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
6077
- search = (0,_core_arg_utils__WEBPACK_IMPORTED_MODULE_3__.requireString)(args, 'search');
6078
- replace = (0,_core_arg_utils__WEBPACK_IMPORTED_MODULE_3__.requireString)(args, 'replace', {
6079
- allowEmpty: true
6080
- });
6081
- useRegex = args.useRegex, useSelector = args.useSelector;
6082
- (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6083
- try {
6084
- jodit.s.focus();
6085
- jodit.s.save();
6086
- replacements = 0;
6087
- ;
6088
- // If useSelector is provided, narrow down the scope
6089
- if (useSelector) {
6090
- result = replaceInSelectedElements(jodit, search, replace, useRegex, useSelector, signal);
6091
- replacements = result.replacements;
6092
- message = result.message;
6093
- } else {
6094
- replacements = replaceInDocument(jodit, jodit.value, search, replace, useRegex, signal);
6095
- }
6096
- return [
6097
- 2,
6098
- {
6099
- replacements: replacements,
6100
- message: message || (replacements > 0 ? "Replaced ".concat(replacements, " occurrence(s)") : 'No matches found')
6101
- }
6102
- ];
6103
- } catch (error) {
6104
- jodit.s.restore();
6105
- throw new Error("Failed to replace in document: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6106
- }
6107
- // removed by dead control flow
6108
-
6109
- });
6110
- })();
6111
- }
6112
-
6113
-
6114
- /***/ }),
6115
-
6116
- /***/ 56732:
6117
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6118
-
6119
- "use strict";
6120
- __webpack_require__.r(__webpack_exports__);
6121
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6122
- /* harmony export */ description: function() { return /* binding */ description; },
6123
- /* harmony export */ name: function() { return /* binding */ name; },
6124
- /* harmony export */ parameters: function() { return /* binding */ parameters; },
6125
- /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
6126
- /* harmony export */ });
6127
- var name = 'insertHTML';
6128
- var description = 'Insert or replace HTML content at the current cursor position in the editor';
6129
- var parameters = [
6130
- {
6131
- name: 'html',
6132
- type: 'string',
6133
- description: 'HTML content to insert',
6134
- required: true
6135
- },
6136
- {
6137
- name: 'replace',
6138
- type: 'boolean',
6139
- description: 'If true, replaces current selection. If false, inserts at cursor',
6140
- required: false,
6141
- default: false
6142
- }
6143
- ];
6144
- var requiresPermission = true;
6145
-
6146
5728
 
6147
- /***/ }),
6148
-
6149
- /***/ 61558:
6150
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6151
5729
 
6152
- "use strict";
6153
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6154
- /* harmony export */ createAIMessage: function() { return /* binding */ createAIMessage; },
6155
- /* harmony export */ createErrorMessage: function() { return /* binding */ createErrorMessage; },
6156
- /* harmony export */ createUserMessage: function() { return /* binding */ createUserMessage; },
6157
- /* harmony export */ uploadArtifacts: function() { return /* binding */ uploadArtifacts; }
6158
- /* harmony export */ });
6159
- /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
6160
- /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62361);
6161
- /* harmony import */ var _helpers_storage_webstorage_storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21064);
6162
5730
 
6163
5731
 
6164
5732
 
6165
5733
  /**
6166
- * Create user message
6167
- */ function createUserMessage(content) {
6168
- return {
6169
- id: (0,_helpers_storage_webstorage_storage__WEBPACK_IMPORTED_MODULE_2__.generateMessageId)(),
6170
- role: 'user',
6171
- content: content,
6172
- timestamp: Date.now()
6173
- };
6174
- }
6175
- /**
6176
- * Create AI message structure (will be filled during streaming/response)
6177
- */ function createAIMessage() {
6178
- return {
6179
- id: '',
6180
- role: 'assistant',
6181
- content: '',
6182
- artifacts: [],
6183
- timestamp: Date.now(),
6184
- toolCalls: []
6185
- };
6186
- }
6187
- /**
6188
- * Create error message for AI
6189
- */ function createErrorMessage(error) {
6190
- return {
6191
- id: 'error_' + (0,_helpers_storage_webstorage_storage__WEBPACK_IMPORTED_MODULE_2__.generateMessageId)(),
6192
- role: 'assistant',
6193
- content: "❌ Error: ".concat(error.message),
6194
- timestamp: Date.now(),
6195
- toolCalls: [],
6196
- artifacts: []
6197
- };
6198
- }
6199
- /**
6200
- * Upload artifacts if uploadBase64Artifact is configured
6201
- */ function uploadArtifacts(jodit, artifacts) {
6202
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6203
- var uploadFn;
6204
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
6205
- if (!artifacts || artifacts.length === 0) {
6206
- return [
6207
- 2,
6208
- artifacts
6209
- ];
5734
+ * Tool Registry - manages available tools and their execution
5735
+ */ var ToolRegistry = /*#__PURE__*/ function() {
5736
+ "use strict";
5737
+ function ToolRegistry(jodit) {
5738
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, ToolRegistry);
5739
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(this, "jodit", void 0);
5740
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(this, "tools", void 0);
5741
+ this.jodit = jodit;
5742
+ this.tools = new Map();
5743
+ this.registerBuiltInTools(jodit.o.aiAssistantPro.enabledTools || []);
5744
+ this.registerCustomTools(jodit.o.aiAssistantPro.customTools || []);
5745
+ }
5746
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(ToolRegistry, [
5747
+ {
5748
+ key: "registerBuiltInTools",
5749
+ value: /**
5750
+ * Register built-in tools
5751
+ */ function registerBuiltInTools(enabledTools) {
5752
+ var _this = this;
5753
+ enabledTools.forEach(function(toolName) {
5754
+ var tool = _tools__WEBPACK_IMPORTED_MODULE_8__.BUILT_IN_TOOLS[toolName];
5755
+ if (tool) {
5756
+ _this.tools.set(toolName, tool);
5757
+ }
5758
+ });
6210
5759
  }
6211
- uploadFn = jodit.o.aiAssistantPro.uploadBase64Artifact;
6212
- if (!uploadFn) {
6213
- return [
6214
- 2,
6215
- artifacts
6216
- ];
5760
+ },
5761
+ {
5762
+ key: "registerCustomTools",
5763
+ value: /**
5764
+ * Register custom tools
5765
+ */ function registerCustomTools(customTools) {
5766
+ var _this = this;
5767
+ customTools.forEach(function(tool) {
5768
+ _this.validateToolDefinition(tool);
5769
+ _this.tools.set(tool.name, tool);
5770
+ });
6217
5771
  }
6218
- return [
6219
- 2,
6220
- Promise.all(artifacts.map(function(artifact) {
6221
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6222
- var _uploadFn;
6223
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
6224
- return [
6225
- 2,
6226
- (_uploadFn = uploadFn(artifact, jodit)) !== null && _uploadFn !== void 0 ? _uploadFn : artifact
6227
- ];
6228
- });
6229
- })();
6230
- }))
6231
- ];
6232
- });
6233
- })();
5772
+ },
5773
+ {
5774
+ key: "validateToolDefinition",
5775
+ value: /**
5776
+ * Validate tool definition
5777
+ */ function validateToolDefinition(tool) {
5778
+ if (!tool.name || typeof tool.name !== 'string') {
5779
+ throw new Error('Tool must have a valid name');
5780
+ }
5781
+ if (!tool.description || typeof tool.description !== 'string') {
5782
+ throw new Error('Tool "'.concat(tool.name, '" must have a description'));
5783
+ }
5784
+ if (!Array.isArray(tool.parameters)) {
5785
+ throw new Error('Tool "'.concat(tool.name, '" must have a parameters array'));
5786
+ }
5787
+ if (typeof tool.execute !== 'function') {
5788
+ throw new Error('Tool "'.concat(tool.name, '" must have an execute function'));
5789
+ }
5790
+ // Validate parameters
5791
+ tool.parameters.forEach(function(param) {
5792
+ if (!param.name || typeof param.name !== 'string') {
5793
+ throw new Error('Tool "'.concat(tool.name, '" has a parameter without a valid name'));
5794
+ }
5795
+ if (!param.type) {
5796
+ throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(param.name, '" must have a type'));
5797
+ }
5798
+ if (typeof param.required !== 'boolean') {
5799
+ throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(param.name, "\" must specify if it's required"));
5800
+ }
5801
+ });
5802
+ }
5803
+ },
5804
+ {
5805
+ /**
5806
+ * Get all registered tools
5807
+ */ key: "getAllTools",
5808
+ value: function getAllTools() {
5809
+ return Array.from(this.tools.values());
5810
+ }
5811
+ },
5812
+ {
5813
+ /**
5814
+ * Get tool by name
5815
+ */ key: "getTool",
5816
+ value: function getTool(name) {
5817
+ return this.tools.get(name);
5818
+ }
5819
+ },
5820
+ {
5821
+ /**
5822
+ * Check if tool exists
5823
+ */ key: "hasTool",
5824
+ value: function hasTool(name) {
5825
+ return this.tools.has(name);
5826
+ }
5827
+ },
5828
+ {
5829
+ /**
5830
+ * Get tool names
5831
+ */ key: "getToolNames",
5832
+ value: function getToolNames() {
5833
+ return Array.from(this.tools.keys());
5834
+ }
5835
+ },
5836
+ {
5837
+ key: "executeTool",
5838
+ value: /**
5839
+ * Execute a tool
5840
+ */ function executeTool(toolName, args, signal) {
5841
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
5842
+ var tool, resolvedArgs, result, error;
5843
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__._)(this, function(_state) {
5844
+ switch(_state.label){
5845
+ case 0:
5846
+ tool = this.getTool(toolName);
5847
+ if (!tool) {
5848
+ throw new Error('Tool "'.concat(toolName, '" not found'));
5849
+ }
5850
+ resolvedArgs = this.applyDefaults(tool, args);
5851
+ // Validate arguments
5852
+ this.validateArguments(tool, resolvedArgs);
5853
+ _state.label = 1;
5854
+ case 1:
5855
+ _state.trys.push([
5856
+ 1,
5857
+ 3,
5858
+ ,
5859
+ 4
5860
+ ]);
5861
+ return [
5862
+ 4,
5863
+ tool.execute(this.jodit, resolvedArgs, signal)
5864
+ ];
5865
+ case 2:
5866
+ result = _state.sent();
5867
+ return [
5868
+ 2,
5869
+ result
5870
+ ];
5871
+ case 3:
5872
+ error = _state.sent();
5873
+ if ((error === null || error === void 0 ? void 0 : error.name) === 'AbortError' || signal.aborted) {
5874
+ throw new Error('Tool execution was aborted');
5875
+ }
5876
+ throw error;
5877
+ case 4:
5878
+ return [
5879
+ 2
5880
+ ];
5881
+ }
5882
+ });
5883
+ }).call(this);
5884
+ }
5885
+ },
5886
+ {
5887
+ key: "validateArguments",
5888
+ value: /**
5889
+ * Validate tool arguments
5890
+ */ function validateArguments(tool, args) {
5891
+ var provided = Object.keys(args);
5892
+ var required = tool.parameters.filter(function(p) {
5893
+ return p.required;
5894
+ }).map(function(p) {
5895
+ return p.name;
5896
+ });
5897
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5898
+ try {
5899
+ // Check required parameters
5900
+ for(var _iterator = required[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5901
+ var paramName = _step.value;
5902
+ if (!provided.includes(paramName)) {
5903
+ throw new Error('Tool "'.concat(tool.name, '" requires parameter "').concat(paramName, '"'));
5904
+ }
5905
+ }
5906
+ } catch (err) {
5907
+ _didIteratorError = true;
5908
+ _iteratorError = err;
5909
+ } finally{
5910
+ try {
5911
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5912
+ _iterator.return();
5913
+ }
5914
+ } finally{
5915
+ if (_didIteratorError) {
5916
+ throw _iteratorError;
5917
+ }
5918
+ }
5919
+ }
5920
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
5921
+ try {
5922
+ var _this, _loop = function() {
5923
+ var _step_value = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(_step1.value, 2), paramName = _step_value[0], value = _step_value[1];
5924
+ var param = tool.parameters.find(function(p) {
5925
+ return p.name === paramName;
5926
+ });
5927
+ if (!param) {
5928
+ // Unknown parameter - log warning but don't fail
5929
+ if (_this.jodit.o.aiAssistantPro.debug) {
5930
+ console.warn('Tool "'.concat(tool.name, '" received unknown parameter "').concat(paramName, '"'));
5931
+ }
5932
+ return "continue";
5933
+ }
5934
+ // Type validation
5935
+ var actualType = Array.isArray(value) ? 'array' : (typeof value === "undefined" ? "undefined" : (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__._)(value)) === 'object' && value != null ? 'object' : typeof value === "undefined" ? "undefined" : (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__._)(value);
5936
+ if (param.type !== actualType && !(param.type === 'number' && actualType === 'string' && !isNaN(Number(value)))) {
5937
+ throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(paramName, '" expects type "').concat(param.type, '" but got "').concat(actualType, '"'));
5938
+ }
5939
+ // Enum validation
5940
+ if (param.enum && param.enum.length > 0) {
5941
+ if (!param.enum.includes(value)) {
5942
+ throw new Error('Tool "'.concat(tool.name, '" parameter "').concat(paramName, '" must be one of: ').concat(param.enum.join(', ')));
5943
+ }
5944
+ }
5945
+ };
5946
+ // Validate parameter types and values
5947
+ for(var _iterator1 = Object.entries(args)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_this = this, _loop();
5948
+ } catch (err) {
5949
+ _didIteratorError1 = true;
5950
+ _iteratorError1 = err;
5951
+ } finally{
5952
+ try {
5953
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
5954
+ _iterator1.return();
5955
+ }
5956
+ } finally{
5957
+ if (_didIteratorError1) {
5958
+ throw _iteratorError1;
5959
+ }
5960
+ }
5961
+ }
5962
+ }
5963
+ },
5964
+ {
5965
+ key: "applyDefaults",
5966
+ value: /**
5967
+ * Apply parameter defaults defined in tool definition
5968
+ */ function applyDefaults(tool, args) {
5969
+ var resolved = (0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, args);
5970
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5971
+ try {
5972
+ for(var _iterator = tool.parameters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5973
+ var param = _step.value;
5974
+ if (resolved[param.name] === undefined && param.default !== undefined) {
5975
+ resolved[param.name] = param.default;
5976
+ }
5977
+ }
5978
+ } catch (err) {
5979
+ _didIteratorError = true;
5980
+ _iteratorError = err;
5981
+ } finally{
5982
+ try {
5983
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5984
+ _iterator.return();
5985
+ }
5986
+ } finally{
5987
+ if (_didIteratorError) {
5988
+ throw _iteratorError;
5989
+ }
5990
+ }
5991
+ }
5992
+ return resolved;
5993
+ }
5994
+ },
5995
+ {
5996
+ /**
5997
+ * Destroy registry
5998
+ */ key: "destruct",
5999
+ value: function destruct() {
6000
+ this.tools.clear();
6001
+ }
6002
+ }
6003
+ ]);
6004
+ return ToolRegistry;
6005
+ }();
6006
+
6007
+
6008
+ /***/ }),
6009
+
6010
+ /***/ 55790:
6011
+ /***/ (function(module) {
6012
+
6013
+ module.exports = {
6014
+ 'AI Assistant': 'AI Ассистент',
6015
+ 'AI Assistant Pro': 'AI Ассистент Pro',
6016
+ 'Welcome to AI Assistant': 'Добро пожаловать в AI Ассистент',
6017
+ 'Start your first conversation': 'Начните первый диалог',
6018
+ 'Tip: Select text in editor to add context': 'Подсказка: Выделите текст в редакторе для добавления контекста',
6019
+ 'New chat': 'Новый чат',
6020
+ 'Search conversations...': 'Поиск диалогов...',
6021
+ 'No conversations yet': 'Пока нет диалогов',
6022
+ 'Ask me anything...': 'Спросите меня о чем угодно...',
6023
+ 'Ask a follow-up...': 'Задайте дополнительный вопрос...',
6024
+ 'Reply...': 'Ответить...',
6025
+ 'Type your message...': 'Введите ваше сообщение...',
6026
+ Send: 'Отправить',
6027
+ Cancel: 'Отмена',
6028
+ Retry: 'Повторить',
6029
+ Insert: 'Вставить',
6030
+ Copy: 'Копировать',
6031
+ Edit: 'Редактировать',
6032
+ Delete: 'Удалить',
6033
+ New: 'Новый',
6034
+ Back: 'Назад',
6035
+ 'Permission Required': 'Требуется разрешение',
6036
+ Approve: 'Разрешить',
6037
+ Deny: 'Отклонить',
6038
+ Once: 'Один раз',
6039
+ 'This conversation': 'Этот диалог',
6040
+ Always: 'Всегда',
6041
+ 'The AI wants to execute:': 'AI хочет выполнить:',
6042
+ 'This will modify your document content.': 'Это изменит содержимое вашего документа.',
6043
+ 'Executing...': 'Выполняется...',
6044
+ 'Completed successfully': 'Успешно выполнено',
6045
+ Failed: 'Ошибка',
6046
+ 'Pending approval': 'Ожидает разрешения',
6047
+ 'Denied by user': 'Отклонено пользователем',
6048
+ 'Tool Result': 'Результат инструмента',
6049
+ 'Tool Execution Error': 'Ошибка выполнения инструмента',
6050
+ Context: 'Контекст',
6051
+ Contexts: 'Контексты',
6052
+ 'Add to AI Context': 'Добавить в контекст AI',
6053
+ Remove: 'Удалить',
6054
+ 'Clear all': 'Очистить все',
6055
+ 'An error occurred': 'Произошла ошибка',
6056
+ 'Request failed': 'Запрос не выполнен',
6057
+ 'Connection error': 'Ошибка соединения',
6058
+ 'AI Assistant is not configured': 'AI Ассистент не настроен',
6059
+ 'Thinking...': 'Думаю...',
6060
+ 'Generating response...': 'Генерирую ответ...',
6061
+ insertHTML: 'Вставить HTML',
6062
+ readDocument: 'Прочитать документ',
6063
+ readBlock: 'Прочитать блок',
6064
+ replaceInDocument: 'Заменить в документе',
6065
+ replaceInBlock: 'Заменить в блоке',
6066
+ getSelection: 'Получить выделение',
6067
+ 'Just now': 'Только что',
6068
+ Conversation: 'Диалог',
6069
+ 'New Conversation': 'Новый диалог',
6070
+ Yesterday: 'Вчера',
6071
+ 'Delete conversation': 'Удалить диалог',
6072
+ 'Are you sure you want to delete this conversation?': 'Вы уверены, что хотите удалить этот диалог?',
6073
+ 'Failed to delete conversation': 'Не удалось удалить диалог',
6074
+ // Settings
6075
+ Settings: 'Настройки',
6076
+ 'General Settings': 'Общие настройки',
6077
+ 'Conversation Settings': 'Настройки диалога',
6078
+ 'Display Mode': 'Режим отображения',
6079
+ 'Panel Width': 'Ширина панели',
6080
+ Theme: 'Тема',
6081
+ Model: 'Модель',
6082
+ Temperature: 'Температура',
6083
+ Close: 'Закрыть',
6084
+ // Display modes
6085
+ Dialog: 'Модальное окно',
6086
+ Left: 'Левая панель',
6087
+ Right: 'Правая панель',
6088
+ Top: 'Верхняя панель',
6089
+ Bottom: 'Нижняя панель',
6090
+ // Theme options
6091
+ Inherit: 'Наследовать от редактора',
6092
+ Light: 'Светлая тема',
6093
+ Dark: 'Тёмная тема',
6094
+ '%dm ago': '%dм назад',
6095
+ '%dh ago': '%dч назад'
6096
+ };
6097
+
6098
+
6099
+ /***/ }),
6100
+
6101
+ /***/ 55885:
6102
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6103
+
6104
+ "use strict";
6105
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6106
+ /* harmony export */ UIWelcomeScreen: function() { return /* binding */ UIWelcomeScreen; }
6107
+ /* harmony export */ });
6108
+ /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
6109
+ /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
6110
+ /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
6111
+ /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18766);
6112
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
6113
+ /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65478);
6114
+ /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67510);
6115
+
6116
+
6117
+
6118
+
6119
+
6120
+
6121
+
6122
+ var UIWelcomeScreen = /*#__PURE__*/ function(UIElement) {
6123
+ "use strict";
6124
+ (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__._)(UIWelcomeScreen, UIElement);
6125
+ function UIWelcomeScreen() {
6126
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIWelcomeScreen);
6127
+ return (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIWelcomeScreen, arguments);
6128
+ }
6129
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIWelcomeScreen, [
6130
+ {
6131
+ key: "className",
6132
+ value: function className() {
6133
+ return 'UIWelcomeScreen';
6134
+ }
6135
+ },
6136
+ {
6137
+ key: "render",
6138
+ value: function render() {
6139
+ return '<div class="&__container">\n <div class="&__icon">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/>\n </svg>\n </div>\n <div class="&__title">~Welcome to AI Assistant~</div>\n <div class="&__subtitle">~Start your first conversation~</div>\n <div class="&__tip">~Tip: Select text in editor to add context~</div>\n </div>';
6140
+ }
6141
+ }
6142
+ ]);
6143
+ return UIWelcomeScreen;
6144
+ }(jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIElement);
6145
+ UIWelcomeScreen = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
6146
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__.component
6147
+ ], UIWelcomeScreen);
6148
+
6149
+
6150
+ /***/ }),
6151
+
6152
+ /***/ 56110:
6153
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6154
+
6155
+ "use strict";
6156
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6157
+ /* harmony export */ deleteConversationWithCleanup: function() { return /* binding */ deleteConversationWithCleanup; },
6158
+ /* harmony export */ loadInitialData: function() { return /* binding */ loadInitialData; }
6159
+ /* harmony export */ });
6160
+ /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
6161
+ /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43284);
6162
+ /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62361);
6163
+ /* harmony import */ var jodit_esm_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82758);
6164
+
6165
+
6166
+
6167
+
6168
+ /**
6169
+ * Delete conversation from storage and update state
6170
+ */ function deleteConversationWithCleanup(jodit, conversationId, storage, stateManager, permissionManager) {
6171
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6172
+ var currentConversation, conversations, error;
6173
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_2__._)(this, function(_state) {
6174
+ switch(_state.label){
6175
+ case 0:
6176
+ _state.trys.push([
6177
+ 0,
6178
+ 3,
6179
+ 4,
6180
+ 5
6181
+ ]);
6182
+ stateManager.setLoading(true);
6183
+ // Delete from storage
6184
+ return [
6185
+ 4,
6186
+ storage.delete(conversationId)
6187
+ ];
6188
+ case 1:
6189
+ _state.sent();
6190
+ // Remove from state manager
6191
+ stateManager.removeConversation(conversationId);
6192
+ // Clear permissions for this conversation
6193
+ permissionManager.clearConversationPermissions(conversationId);
6194
+ // If this was the current conversation, clear it
6195
+ currentConversation = stateManager.getCurrentConversation();
6196
+ if ((currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.id) === conversationId) {
6197
+ stateManager.setCurrentConversation(null);
6198
+ }
6199
+ return [
6200
+ 4,
6201
+ storage.list()
6202
+ ];
6203
+ case 2:
6204
+ conversations = _state.sent();
6205
+ stateManager.setConversations(conversations);
6206
+ // Update view
6207
+ stateManager.setView(conversations.length === 0 ? 'welcome' : 'conversationList');
6208
+ // Fire event
6209
+ jodit.e.fire('conversationDeleted.ai-assistant-pro', conversationId);
6210
+ return [
6211
+ 3,
6212
+ 5
6213
+ ];
6214
+ case 3:
6215
+ error = _state.sent();
6216
+ jodit.alert(jodit.i18n('Failed to delete conversation') + ': ' + ((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6217
+ return [
6218
+ 3,
6219
+ 5
6220
+ ];
6221
+ case 4:
6222
+ stateManager.setLoading(false);
6223
+ return [
6224
+ 7
6225
+ ];
6226
+ case 5:
6227
+ return [
6228
+ 2
6229
+ ];
6230
+ }
6231
+ });
6232
+ })();
6233
+ }
6234
+ /**
6235
+ * Load initial data (conversations list and settings)
6236
+ */ function loadInitialData(jodit, storage, stateManager) {
6237
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6238
+ var _ref, conversations, savedSettings, _conversations_find, conversation, lastConv, error;
6239
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_2__._)(this, function(_state) {
6240
+ switch(_state.label){
6241
+ case 0:
6242
+ stateManager.setLoading(true);
6243
+ _state.label = 1;
6244
+ case 1:
6245
+ _state.trys.push([
6246
+ 1,
6247
+ 7,
6248
+ 8,
6249
+ 9
6250
+ ]);
6251
+ return [
6252
+ 4,
6253
+ Promise.all([
6254
+ storage.list().catch(function() {
6255
+ return [];
6256
+ }),
6257
+ storage.getGlobalSettings().catch(function() {
6258
+ return null;
6259
+ })
6260
+ ])
6261
+ ];
6262
+ case 2:
6263
+ _ref = _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_1__._.apply(void 0, [
6264
+ _state.sent(),
6265
+ 2
6266
+ ]), conversations = _ref[0], savedSettings = _ref[1];
6267
+ stateManager.setConversations(conversations);
6268
+ savedSettings && stateManager.setSavedState(savedSettings);
6269
+ if (!(conversations.length === 0)) return [
6270
+ 3,
6271
+ 3
6272
+ ];
6273
+ stateManager.setView('welcome');
6274
+ return [
6275
+ 3,
6276
+ 6
6277
+ ];
6278
+ case 3:
6279
+ if (!(jodit.o.aiAssistantPro.rememberLastConversation && (savedSettings === null || savedSettings === void 0 ? void 0 : savedSettings.currentConversationId))) return [
6280
+ 3,
6281
+ 5
6282
+ ];
6283
+ conversation = (_conversations_find = conversations.find(function(conv) {
6284
+ return conv.id === savedSettings.currentConversationId;
6285
+ })) !== null && _conversations_find !== void 0 ? _conversations_find : conversations[0];
6286
+ return [
6287
+ 4,
6288
+ storage.get(conversation.id)
6289
+ ];
6290
+ case 4:
6291
+ lastConv = _state.sent();
6292
+ if (lastConv) {
6293
+ stateManager.setCurrentConversation(lastConv);
6294
+ } else {
6295
+ stateManager.setView('conversationList');
6296
+ }
6297
+ return [
6298
+ 3,
6299
+ 6
6300
+ ];
6301
+ case 5:
6302
+ stateManager.setView('conversationList');
6303
+ _state.label = 6;
6304
+ case 6:
6305
+ return [
6306
+ 3,
6307
+ 9
6308
+ ];
6309
+ case 7:
6310
+ error = _state.sent();
6311
+ if (!jodit_esm_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_PROD) {
6312
+ console.error('Failed to load conversations:', error);
6313
+ }
6314
+ stateManager.setView('welcome');
6315
+ return [
6316
+ 3,
6317
+ 9
6318
+ ];
6319
+ case 8:
6320
+ stateManager.setLoading(false);
6321
+ return [
6322
+ 7
6323
+ ];
6324
+ case 9:
6325
+ return [
6326
+ 2
6327
+ ];
6328
+ }
6329
+ });
6330
+ })();
6331
+ }
6332
+
6333
+
6334
+ /***/ }),
6335
+
6336
+ /***/ 56293:
6337
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6338
+
6339
+ "use strict";
6340
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6341
+ /* harmony export */ execute: function() { return /* binding */ execute; }
6342
+ /* harmony export */ });
6343
+ /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
6344
+ /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62361);
6345
+ /* harmony import */ var _core_abort_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
6346
+ /* harmony import */ var _core_arg_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49459);
6347
+
6348
+
6349
+
6350
+
6351
+ function replaceInSelectedElements(jodit, search, replace, useRegex, useSelector, signal) {
6352
+ var elements = jodit.editor.querySelectorAll(useSelector);
6353
+ if (elements.length === 0) {
6354
+ return {
6355
+ replacements: 0,
6356
+ message: 'No elements found matching selector "'.concat(useSelector, '"')
6357
+ };
6358
+ }
6359
+ var replacements = 0;
6360
+ elements.forEach(function(element) {
6361
+ (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6362
+ var elementContent = element.innerHTML;
6363
+ var originalContent = elementContent;
6364
+ if (useRegex) {
6365
+ try {
6366
+ var regex = new RegExp(search, 'g');
6367
+ elementContent = elementContent.replace(regex, function() {
6368
+ replacements++;
6369
+ return replace;
6370
+ });
6371
+ } catch (error) {
6372
+ throw new Error("Invalid regex pattern: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6373
+ }
6374
+ } else {
6375
+ var searchLength = search.length;
6376
+ var pos = 0;
6377
+ while((pos = elementContent.indexOf(search, pos)) !== -1){
6378
+ (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6379
+ elementContent = elementContent.substring(0, pos) + replace + elementContent.substring(pos + searchLength);
6380
+ pos += replace.length;
6381
+ replacements++;
6382
+ }
6383
+ }
6384
+ if (elementContent !== originalContent) {
6385
+ element.innerHTML = elementContent;
6386
+ }
6387
+ });
6388
+ if (replacements > 0) {
6389
+ jodit.synchronizeValues();
6390
+ jodit.s.restore();
6391
+ }
6392
+ return {
6393
+ replacements: replacements
6394
+ };
6395
+ }
6396
+ function replaceInDocument(jodit, content, search, replace, useRegex, signal) {
6397
+ var replacements = 0;
6398
+ var updatedContent = content;
6399
+ if (useRegex) {
6400
+ try {
6401
+ var regex = new RegExp(search, 'g');
6402
+ updatedContent = updatedContent.replace(regex, function() {
6403
+ replacements++;
6404
+ return replace;
6405
+ });
6406
+ } catch (error) {
6407
+ throw new Error("Invalid regex pattern: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6408
+ }
6409
+ } else {
6410
+ var searchLength = search.length;
6411
+ var pos = 0;
6412
+ while((pos = updatedContent.indexOf(search, pos)) !== -1){
6413
+ (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6414
+ updatedContent = updatedContent.substring(0, pos) + replace + updatedContent.substring(pos + searchLength);
6415
+ pos += replace.length;
6416
+ replacements++;
6417
+ }
6418
+ }
6419
+ if (replacements > 0) {
6420
+ jodit.value = updatedContent;
6421
+ jodit.s.restore();
6422
+ jodit.synchronizeValues();
6423
+ }
6424
+ return replacements;
6425
+ }
6426
+ /**
6427
+ * Find and replace text/HTML in entire document
6428
+ */ function execute(jodit, args, signal) {
6429
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6430
+ var search, replace, useRegex, useSelector, replacements, message, result;
6431
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
6432
+ search = (0,_core_arg_utils__WEBPACK_IMPORTED_MODULE_3__.requireString)(args, 'search');
6433
+ replace = (0,_core_arg_utils__WEBPACK_IMPORTED_MODULE_3__.requireString)(args, 'replace', {
6434
+ allowEmpty: true
6435
+ });
6436
+ useRegex = args.useRegex, useSelector = args.useSelector;
6437
+ (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
6438
+ try {
6439
+ jodit.s.focus();
6440
+ jodit.s.save();
6441
+ replacements = 0;
6442
+ ;
6443
+ // If useSelector is provided, narrow down the scope
6444
+ if (useSelector) {
6445
+ result = replaceInSelectedElements(jodit, search, replace, useRegex, useSelector, signal);
6446
+ replacements = result.replacements;
6447
+ message = result.message;
6448
+ } else {
6449
+ replacements = replaceInDocument(jodit, jodit.value, search, replace, useRegex, signal);
6450
+ }
6451
+ return [
6452
+ 2,
6453
+ {
6454
+ replacements: replacements,
6455
+ message: message || (replacements > 0 ? "Replaced ".concat(replacements, " occurrence(s)") : 'No matches found')
6456
+ }
6457
+ ];
6458
+ } catch (error) {
6459
+ jodit.s.restore();
6460
+ throw new Error("Failed to replace in document: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error'));
6461
+ }
6462
+ // removed by dead control flow
6463
+
6464
+ });
6465
+ })();
6466
+ }
6467
+
6468
+
6469
+ /***/ }),
6470
+
6471
+ /***/ 56732:
6472
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6473
+
6474
+ "use strict";
6475
+ __webpack_require__.r(__webpack_exports__);
6476
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6477
+ /* harmony export */ description: function() { return /* binding */ description; },
6478
+ /* harmony export */ name: function() { return /* binding */ name; },
6479
+ /* harmony export */ parameters: function() { return /* binding */ parameters; },
6480
+ /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
6481
+ /* harmony export */ });
6482
+ var name = 'insertHTML';
6483
+ var description = 'Insert or replace HTML content at the current cursor position in the editor';
6484
+ var parameters = [
6485
+ {
6486
+ name: 'html',
6487
+ type: 'string',
6488
+ description: 'HTML content to insert',
6489
+ required: true
6490
+ },
6491
+ {
6492
+ name: 'replace',
6493
+ type: 'boolean',
6494
+ description: 'If true, replaces current selection. If false, inserts at cursor',
6495
+ required: false,
6496
+ default: false
6497
+ }
6498
+ ];
6499
+ var requiresPermission = true;
6500
+
6501
+
6502
+ /***/ }),
6503
+
6504
+ /***/ 61558:
6505
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6506
+
6507
+ "use strict";
6508
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6509
+ /* harmony export */ createAIMessage: function() { return /* binding */ createAIMessage; },
6510
+ /* harmony export */ createErrorMessage: function() { return /* binding */ createErrorMessage; },
6511
+ /* harmony export */ createUserMessage: function() { return /* binding */ createUserMessage; },
6512
+ /* harmony export */ uploadArtifacts: function() { return /* binding */ uploadArtifacts; }
6513
+ /* harmony export */ });
6514
+ /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
6515
+ /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62361);
6516
+ /* harmony import */ var _helpers_storage_webstorage_storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21064);
6517
+
6518
+
6519
+
6520
+ /**
6521
+ * Create user message
6522
+ */ function createUserMessage(content) {
6523
+ return {
6524
+ id: (0,_helpers_storage_webstorage_storage__WEBPACK_IMPORTED_MODULE_2__.generateMessageId)(),
6525
+ role: 'user',
6526
+ content: content,
6527
+ timestamp: Date.now()
6528
+ };
6529
+ }
6530
+ /**
6531
+ * Create AI message structure (will be filled during streaming/response)
6532
+ */ function createAIMessage() {
6533
+ return {
6534
+ id: '',
6535
+ role: 'assistant',
6536
+ content: '',
6537
+ artifacts: [],
6538
+ timestamp: Date.now(),
6539
+ toolCalls: []
6540
+ };
6541
+ }
6542
+ /**
6543
+ * Create error message for AI
6544
+ */ function createErrorMessage(error) {
6545
+ return {
6546
+ id: 'error_' + (0,_helpers_storage_webstorage_storage__WEBPACK_IMPORTED_MODULE_2__.generateMessageId)(),
6547
+ role: 'assistant',
6548
+ content: "❌ Error: ".concat(error.message),
6549
+ timestamp: Date.now(),
6550
+ toolCalls: [],
6551
+ artifacts: []
6552
+ };
6553
+ }
6554
+ /**
6555
+ * Upload artifacts if uploadBase64Artifact is configured
6556
+ */ function uploadArtifacts(jodit, artifacts) {
6557
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6558
+ var uploadFn;
6559
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
6560
+ if (!artifacts || artifacts.length === 0) {
6561
+ return [
6562
+ 2,
6563
+ artifacts
6564
+ ];
6565
+ }
6566
+ uploadFn = jodit.o.aiAssistantPro.uploadBase64Artifact;
6567
+ if (!uploadFn) {
6568
+ return [
6569
+ 2,
6570
+ artifacts
6571
+ ];
6572
+ }
6573
+ return [
6574
+ 2,
6575
+ Promise.all(artifacts.map(function(artifact) {
6576
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
6577
+ var _uploadFn;
6578
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
6579
+ return [
6580
+ 2,
6581
+ (_uploadFn = uploadFn(artifact, jodit)) !== null && _uploadFn !== void 0 ? _uploadFn : artifact
6582
+ ];
6583
+ });
6584
+ })();
6585
+ }))
6586
+ ];
6587
+ });
6588
+ })();
6234
6589
  }
6235
6590
 
6236
6591
 
@@ -10573,21 +10928,21 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
10573
10928
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10574
10929
 
10575
10930
  "use strict";
10576
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10577
- /* harmony export */ UISettingsButton: function() { return /* binding */ UISettingsButton; }
10578
- /* harmony export */ });
10579
- /* harmony import */ var _swc_helpers_assert_this_initialized__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77242);
10580
- /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80294);
10581
- /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20616);
10582
- /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67709);
10583
- /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82749);
10584
- /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54816);
10585
- /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(84669);
10586
- /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18766);
10587
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
10588
- /* harmony import */ var _settings_popup_settings_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(79455);
10589
- /* harmony import */ var jodit_esm_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(87325);
10590
- /* harmony import */ var jodit_esm_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(37133);
10931
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10932
+ /* harmony export */ UISettingsButton: function() { return /* binding */ UISettingsButton; }
10933
+ /* harmony export */ });
10934
+ /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
10935
+ /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
10936
+ /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
10937
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82749);
10938
+ /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54816);
10939
+ /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84669);
10940
+ /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18766);
10941
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
10942
+ /* harmony import */ var _settings_popup_settings_popup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(79455);
10943
+ /* harmony import */ var jodit_esm_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(87325);
10944
+ /* harmony import */ var jodit_esm_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(37133);
10945
+ /* harmony import */ var jodit_esm_core_ui_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48538);
10591
10946
  /* harmony import */ var jodit_esm_modules_toolbar_button_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(78644);
10592
10947
 
10593
10948
 
@@ -10602,36 +10957,42 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
10602
10957
 
10603
10958
 
10604
10959
 
10605
- var UISettingsButton = /*#__PURE__*/ function(ToolbarButton) {
10960
+ var UISettingsButton = /*#__PURE__*/ function(UIElement) {
10606
10961
  "use strict";
10607
- (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__._)(UISettingsButton, ToolbarButton);
10962
+ (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UISettingsButton, UIElement);
10608
10963
  function UISettingsButton(view, extraState, options, getConversation, updateConversation) {
10609
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_2__._)(this, UISettingsButton);
10964
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UISettingsButton);
10610
10965
  var _this;
10611
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_1__._)(this, UISettingsButton, [
10612
- view,
10613
- {
10614
- name: 'settings',
10615
- tooltip: 'Settings',
10616
- popup: function popup(j, _, close) {
10617
- (0,_swc_helpers_assert_this_initialized__WEBPACK_IMPORTED_MODULE_0__._)(_this).closeCallback = close;
10618
- return (0,_swc_helpers_assert_this_initialized__WEBPACK_IMPORTED_MODULE_0__._)(_this).openSettingsPopup();
10619
- }
10966
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UISettingsButton, [
10967
+ view
10968
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "extraState", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "options", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "getConversation", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "updateConversation", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "closeCallback", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "settingsPopup", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "button", void 0), _this.extraState = extraState, _this.options = options, _this.getConversation = getConversation, _this.updateConversation = updateConversation, _this.closeCallback = function() {}, _this.settingsPopup = null;
10969
+ _this.button = new jodit_esm_modules_toolbar_button_button__WEBPACK_IMPORTED_MODULE_12__.ToolbarButton(_this.jodit, {
10970
+ name: 'settings',
10971
+ tooltip: 'Settings',
10972
+ popup: function popup(j, _, close) {
10973
+ _this.closeCallback = close;
10974
+ return _this.openSettingsPopup();
10620
10975
  }
10621
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__._)(_this, "extraState", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__._)(_this, "options", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__._)(_this, "getConversation", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__._)(_this, "updateConversation", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__._)(_this, "closeCallback", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_4__._)(_this, "settingsPopup", void 0), _this.extraState = extraState, _this.options = options, _this.getConversation = getConversation, _this.updateConversation = updateConversation, _this.closeCallback = function() {}, _this.settingsPopup = null;
10622
- _this.hookStatus('ready', function() {
10623
- _this.state.size = 'small';
10624
- _this.state.variant = 'secondary';
10625
10976
  });
10977
+ _this.button.state.variant = 'initial';
10978
+ _this.button.state.size = 'small';
10979
+ _this.container.appendChild(_this.button.container);
10626
10980
  return _this;
10627
10981
  }
10628
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_3__._)(UISettingsButton, [
10982
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UISettingsButton, [
10983
+ {
10984
+ key: "className",
10985
+ value: function className() {
10986
+ return 'UISettingsButton';
10987
+ }
10988
+ },
10629
10989
  {
10630
10990
  key: "setParentView",
10631
10991
  value: function setParentView(view) {
10632
- var _this_settingsPopup;
10992
+ var _this_settingsPopup, _this_button;
10633
10993
  (_this_settingsPopup = this.settingsPopup) === null || _this_settingsPopup === void 0 ? void 0 : _this_settingsPopup.setParentView(view);
10634
- return (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_6__._)(UISettingsButton.prototype), "setParentView", this).call(this, view);
10994
+ (_this_button = this.button) === null || _this_button === void 0 ? void 0 : _this_button.setParentView(view);
10995
+ return (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UISettingsButton.prototype), "setParentView", this).call(this, view);
10635
10996
  }
10636
10997
  },
10637
10998
  {
@@ -10646,7 +11007,7 @@ var UISettingsButton = /*#__PURE__*/ function(ToolbarButton) {
10646
11007
  * Open settings popup
10647
11008
  */ function openSettingsPopup() {
10648
11009
  if (!this.settingsPopup) {
10649
- this.settingsPopup = new _settings_popup_settings_popup__WEBPACK_IMPORTED_MODULE_9__.UISettingsPopup(this.jodit, this.extraState, this.options, this.getConversation, this.updateConversation);
11010
+ this.settingsPopup = new _settings_popup_settings_popup__WEBPACK_IMPORTED_MODULE_8__.UISettingsPopup(this.jodit, this.extraState, this.options, this.getConversation, this.updateConversation);
10650
11011
  }
10651
11012
  this.settingsPopup.update();
10652
11013
  return this.settingsPopup;
@@ -10654,12 +11015,12 @@ var UISettingsButton = /*#__PURE__*/ function(ToolbarButton) {
10654
11015
  }
10655
11016
  ]);
10656
11017
  return UISettingsButton;
10657
- }(jodit_esm_modules_toolbar_button_button__WEBPACK_IMPORTED_MODULE_12__.ToolbarButton);
10658
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
10659
- (0,jodit_esm_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_11__.watch)('extraState.displayMode')
11018
+ }(jodit_esm_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIElement);
11019
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
11020
+ (0,jodit_esm_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_10__.watch)('extraState.displayMode')
10660
11021
  ], UISettingsButton.prototype, "onChangeOptionsClosePopup", null);
10661
- UISettingsButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
10662
- jodit_esm_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_10__.component
11022
+ UISettingsButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
11023
+ jodit_esm_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__.component
10663
11024
  ], UISettingsButton);
10664
11025
 
10665
11026
 
@@ -11114,7 +11475,7 @@ var UIConversationListItem = /*#__PURE__*/ function(UIElement) {
11114
11475
  icon: {
11115
11476
  name: 'bin'
11116
11477
  },
11117
- variant: 'default',
11478
+ variant: 'outline',
11118
11479
  size: 'tiny',
11119
11480
  tooltip: 'Delete conversation'
11120
11481
  });
@@ -11260,12 +11621,6 @@ var UIArtifact = /*#__PURE__*/ function(UIElement) {
11260
11621
  return 'UIArtifact';
11261
11622
  }
11262
11623
  },
11263
- {
11264
- key: "render",
11265
- value: function render() {
11266
- return '<div class="'.concat(this.componentName, '"></div>');
11267
- }
11268
- },
11269
11624
  {
11270
11625
  key: "onReady",
11271
11626
  value: function onReady() {
@@ -11765,648 +12120,285 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
11765
12120
  ];
11766
12121
  delay = this.calculateRetryDelay(attempt);
11767
12122
  return [
11768
- 4,
11769
- this.sleep(delay)
11770
- ];
11771
- case 9:
11772
- _state.sent();
11773
- return [
11774
- 3,
11775
- 11
11776
- ];
11777
- case 10:
11778
- throw error1;
11779
- case 11:
11780
- return [
11781
- 3,
11782
- 12
11783
- ];
11784
- case 12:
11785
- attempt++;
11786
- return [
11787
- 3,
11788
- 2
11789
- ];
11790
- case 13:
11791
- // All retries failed
11792
- throw lastError || new Error('API request failed after all retries');
11793
- case 14:
11794
- // Remove abort controller
11795
- this.abortControllers.delete(abortController);
11796
- return [
11797
- 7
11798
- ];
11799
- case 15:
11800
- return [
11801
- 2
11802
- ];
11803
- }
11804
- });
11805
- }).call(this);
11806
- }
11807
- },
11808
- {
11809
- /**
11810
- * Abort current request
11811
- */ key: "abort",
11812
- value: function abort() {
11813
- this.abortControllers.forEach(function(controller) {
11814
- controller.abort();
11815
- });
11816
- this.abortControllers.clear();
11817
- }
11818
- },
11819
- {
11820
- /**
11821
- * Check if request is in progress
11822
- */ key: "isInProgress",
11823
- value: function isInProgress() {
11824
- return this.abortControllers.size > 0;
11825
- }
11826
- },
11827
- {
11828
- key: "buildRequestContext",
11829
- value: /**
11830
- * Build request context
11831
- */ function buildRequestContext(conversationId, messages, parentMessageId, selectionContexts, conversationOptions) {
11832
- var _this_jodit_o_aiAssistantPro = this.jodit.o.aiAssistantPro, apiMode = _this_jodit_o_aiAssistantPro.apiMode, instructions = _this_jodit_o_aiAssistantPro.instructions;
11833
- var context = {
11834
- mode: apiMode,
11835
- conversationId: conversationId,
11836
- tools: this.toolRegistry.getAllTools(),
11837
- selectionContexts: selectionContexts,
11838
- conversationOptions: conversationOptions,
11839
- instructions: instructions
11840
- };
11841
- var messagesToSend = [];
11842
- if (apiMode === 'full') {
11843
- // Send entire conversation
11844
- messagesToSend = messages;
11845
- } else {
11846
- // Incremental mode - send messages since last successful response
11847
- if (parentMessageId) {
11848
- // Find index of parent message
11849
- var parentIndex = messages.findIndex(function(m) {
11850
- return m.id === parentMessageId;
11851
- });
11852
- if (parentIndex !== -1) {
11853
- // Send all messages after parent
11854
- messagesToSend = messages.slice(parentIndex + 1);
11855
- } else {
11856
- // Parent not found, send all messages
11857
- messagesToSend = messages;
11858
- }
11859
- context = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, context), {
11860
- parentMessageId: parentMessageId
11861
- });
11862
- } else {
11863
- // No parent, send all messages (first request)
11864
- messagesToSend = messages;
11865
- }
11866
- }
11867
- // Expand messages with tool calls: add tool result messages separately
11868
- context = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, context), {
11869
- messages: this.expandToolMessages(messagesToSend, messages.find(function(m) {
11870
- return m.id === parentMessageId;
11871
- }))
11872
- });
11873
- return context;
11874
- }
11875
- },
11876
- {
11877
- key: "expandToolMessages",
11878
- value: /**
11879
- * Expand messages with tool calls by adding separate tool result messages
11880
- */ function expandToolMessages(messages, parentMessage) {
11881
- var expanded = [];
11882
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
11883
- try {
11884
- for(var _iterator = messages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
11885
- var message = _step.value;
11886
- // Add the original message
11887
- expanded.push(message);
11888
- this.expandToolResultsMessage(message, expanded);
11889
- }
11890
- } catch (err) {
11891
- _didIteratorError = true;
11892
- _iteratorError = err;
11893
- } finally{
11894
- try {
11895
- if (!_iteratorNormalCompletion && _iterator.return != null) {
11896
- _iterator.return();
11897
- }
11898
- } finally{
11899
- if (_didIteratorError) {
11900
- throw _iteratorError;
11901
- }
11902
- }
11903
- }
11904
- if (parentMessage) {
11905
- this.expandToolResultsMessage(parentMessage, expanded);
11906
- }
11907
- return expanded;
11908
- }
11909
- },
11910
- {
11911
- key: "expandToolResultsMessage",
11912
- value: function expandToolResultsMessage(message, expanded) {
11913
- // If message has tool calls with results, add them as separate tool messages
11914
- if (message.toolCalls && message.toolCalls.length > 0) {
11915
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
11916
- try {
11917
- var _loop = function() {
11918
- var toolCall = _step.value;
11919
- var _toolCall_result;
11920
- var result = (_toolCall_result = toolCall.result) !== null && _toolCall_result !== void 0 ? _toolCall_result : {
11921
- error: 'result not found'
11922
- };
11923
- if (expanded.find(function(m) {
11924
- return m.id === "".concat(toolCall.id, "-result");
11925
- })) {
11926
- // Already expanded
11927
- return "continue";
11928
- }
11929
- // Create a separate tool result message
11930
- var toolResultMessage = {
11931
- id: "".concat(toolCall.id, "-result"),
11932
- role: 'tool',
11933
- content: result.error ? "Error: ".concat(result.error) : JSON.stringify(result.result),
11934
- timestamp: message.timestamp,
11935
- toolResults: [
11936
- {
11937
- toolCallId: toolCall.id,
11938
- result: result
11939
- }
11940
- ]
11941
- };
11942
- expanded.push(toolResultMessage);
11943
- };
11944
- for(var _iterator = message.toolCalls[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
11945
- } catch (err) {
11946
- _didIteratorError = true;
11947
- _iteratorError = err;
11948
- } finally{
11949
- try {
11950
- if (!_iteratorNormalCompletion && _iterator.return != null) {
11951
- _iterator.return();
11952
- }
11953
- } finally{
11954
- if (_didIteratorError) {
11955
- throw _iteratorError;
11956
- }
11957
- }
11958
- }
11959
- }
11960
- }
11961
- },
11962
- {
11963
- key: "validateResponse",
11964
- value: /**
11965
- * Validate API response
11966
- */ function validateResponse(result) {
11967
- if (result.mode !== 'final') {
11968
- // Streaming response validation can be more complex
11969
- return;
11970
- }
11971
- var response = result.response;
11972
- if (!response) {
11973
- throw new Error('API returned empty response');
11974
- }
11975
- if (!response.responseId) {
11976
- throw new Error('API response missing messageId');
11977
- }
11978
- if (response.content === undefined) {
11979
- throw new Error('API response missing content');
11980
- }
11981
- if (response.finished === undefined) {
11982
- throw new Error('API response missing finished flag');
11983
- }
11984
- // Validate tool calls if present
11985
- if (response.toolCalls) {
11986
- if (!Array.isArray(response.toolCalls)) {
11987
- throw new Error('API response toolCalls must be an array');
11988
- }
11989
- response.toolCalls.forEach(function(tc, index) {
11990
- if (!tc.id) {
11991
- throw new Error("Tool call at index ".concat(index, " is missing id"));
11992
- }
11993
- if (!tc.name) {
11994
- throw new Error("Tool call at index ".concat(index, " is missing name"));
11995
- }
11996
- if (!tc.arguments || (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__._)(tc.arguments) !== 'object') {
11997
- throw new Error("Tool call at index ".concat(index, " has invalid arguments"));
12123
+ 4,
12124
+ this.sleep(delay)
12125
+ ];
12126
+ case 9:
12127
+ _state.sent();
12128
+ return [
12129
+ 3,
12130
+ 11
12131
+ ];
12132
+ case 10:
12133
+ throw error1;
12134
+ case 11:
12135
+ return [
12136
+ 3,
12137
+ 12
12138
+ ];
12139
+ case 12:
12140
+ attempt++;
12141
+ return [
12142
+ 3,
12143
+ 2
12144
+ ];
12145
+ case 13:
12146
+ // All retries failed
12147
+ throw lastError || new Error('API request failed after all retries');
12148
+ case 14:
12149
+ // Remove abort controller
12150
+ this.abortControllers.delete(abortController);
12151
+ return [
12152
+ 7
12153
+ ];
12154
+ case 15:
12155
+ return [
12156
+ 2
12157
+ ];
11998
12158
  }
11999
12159
  });
12000
- }
12001
- }
12002
- },
12003
- {
12004
- key: "calculateRetryDelay",
12005
- value: /**
12006
- * Calculate retry delay with exponential backoff
12007
- */ function calculateRetryDelay(attempt) {
12008
- var retryDelay = this.jodit.o.aiAssistantPro.retryDelay;
12009
- // Exponential backoff: delay * 2^attempt
12010
- // With jitter to avoid thundering herd
12011
- var baseDelay = retryDelay * Math.pow(2, attempt);
12012
- var jitter = Math.random() * retryDelay;
12013
- return baseDelay + jitter;
12160
+ }).call(this);
12014
12161
  }
12015
12162
  },
12016
12163
  {
12017
- key: "sleep",
12018
- value: /**
12019
- * Sleep utility
12020
- */ function sleep(ms) {
12021
- return new Promise(function(resolve) {
12022
- return setTimeout(resolve, ms);
12164
+ /**
12165
+ * Abort current request
12166
+ */ key: "abort",
12167
+ value: function abort() {
12168
+ this.abortControllers.forEach(function(controller) {
12169
+ controller.abort();
12023
12170
  });
12171
+ this.abortControllers.clear();
12024
12172
  }
12025
12173
  },
12026
12174
  {
12027
12175
  /**
12028
- * Destroy client
12029
- */ key: "destruct",
12030
- value: function destruct() {
12031
- this.abort();
12032
- }
12033
- }
12034
- ]);
12035
- return APIClient;
12036
- }();
12037
-
12038
-
12039
- /***/ }),
12040
-
12041
- /***/ 86563:
12042
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12043
-
12044
- "use strict";
12045
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12046
- /* harmony export */ UIMessageList: function() { return /* binding */ UIMessageList; }
12047
- /* harmony export */ });
12048
- /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
12049
- /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
12050
- /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67709);
12051
- /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82749);
12052
- /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54816);
12053
- /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84669);
12054
- /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18766);
12055
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
12056
- /* harmony import */ var _core_ui_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31356);
12057
- /* harmony import */ var _message_list_item__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99359);
12058
- /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65478);
12059
- /* harmony import */ var jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62405);
12060
-
12061
-
12062
-
12063
-
12064
-
12065
-
12066
-
12067
-
12068
-
12069
-
12070
-
12071
-
12072
- var UIMessageList = /*#__PURE__*/ function(UIGroup) {
12073
- "use strict";
12074
- (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UIMessageList, UIGroup);
12075
- function UIMessageList(view, params) {
12076
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIMessageList);
12077
- var _this;
12078
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIMessageList, [
12079
- view
12080
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "params", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "messages", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "messageItems", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "scrollContainer", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "autoScrollEnabled", void 0), _this.params = params, _this.messages = [], _this.messageItems = new Map(), _this.autoScrollEnabled = true;
12081
- return _this;
12082
- }
12083
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIMessageList, [
12084
- {
12085
- key: "className",
12086
- value: function className() {
12087
- return 'UIMessageList';
12088
- }
12089
- },
12090
- {
12091
- key: "render",
12092
- value: function render() {
12093
- return '<div class="&__scroll-container"></div>';
12094
- }
12095
- },
12096
- {
12097
- key: "afterRender",
12098
- value: function afterRender() {
12099
- this.scrollContainer = this.container;
12100
- }
12101
- },
12102
- {
12103
- key: "onUserScroll",
12104
- value: /**
12105
- * Handle user scroll events - check if user has scrolled away from bottom
12106
- */ function onUserScroll() {
12107
- if (!this.scrollContainer) return;
12108
- var _this_scrollContainer = this.scrollContainer, scrollTop = _this_scrollContainer.scrollTop, scrollHeight = _this_scrollContainer.scrollHeight, clientHeight = _this_scrollContainer.clientHeight;
12109
- var isAtBottom = scrollHeight - scrollTop - clientHeight < 10;
12110
- this.autoScrollEnabled = isAtBottom;
12111
- }
12112
- },
12113
- {
12114
- key: "onMessageSent",
12115
- value: /**
12116
- * Handle message sent event - always enable auto-scroll when user sends message
12117
- */ function onMessageSent() {
12118
- this.autoScrollEnabled = true;
12119
- this.scrollToBottom();
12176
+ * Check if request is in progress
12177
+ */ key: "isInProgress",
12178
+ value: function isInProgress() {
12179
+ return this.abortControllers.size > 0;
12120
12180
  }
12121
12181
  },
12122
12182
  {
12123
- key: "appendChildToContainer",
12183
+ key: "buildRequestContext",
12124
12184
  value: /**
12125
- * Append child elements to scroll container
12126
- */ function appendChildToContainer(childContainer) {
12127
- if (this.scrollContainer) {
12128
- this.scrollContainer.appendChild(childContainer);
12129
- }
12130
- }
12131
- },
12132
- {
12133
- key: "setMessages",
12134
- value: function setMessages(messages) {
12135
- var oldMessages = this.messages.slice();
12136
- this.messages = messages.slice();
12137
- this.updateMessageList(oldMessages);
12138
- this.scrollToBottom();
12139
- }
12140
- },
12141
- {
12142
- key: "updateMessageList",
12143
- value: function updateMessageList(currentMessages) {
12144
- var _this = this;
12145
- // Reconcile the lists
12146
- var result = _core_ui_helpers__WEBPACK_IMPORTED_MODULE_8__.ListReconciler.reconcile(currentMessages, this.messages, {
12147
- getId: function getId(msg) {
12148
- return msg.id;
12149
- },
12150
- isEqual: function isEqual(a, b) {
12151
- return a.id === b.id && a.content === b.content && a.timestamp === b.timestamp && JSON.stringify(a.artifacts) === JSON.stringify(b.artifacts) && JSON.stringify(a.toolCalls) === JSON.stringify(b.toolCalls);
12152
- },
12153
- preserveOrder: true
12154
- });
12155
- // Remove old messages
12156
- result.toRemove.forEach(function(message) {
12157
- var item = _this.messageItems.get(message.id);
12158
- if (item) {
12159
- var index = _this.elements.indexOf(item);
12160
- if (index !== -1) {
12161
- _this.remove(item);
12162
- item.destruct();
12163
- }
12164
- _this.messageItems.delete(message.id);
12165
- }
12166
- });
12167
- // Update existing messages
12168
- result.toUpdate.forEach(function(param) {
12169
- var message = param.newItem, index = param.index;
12170
- var item = _this.messageItems.get(message.id);
12171
- if (item) {
12172
- item.updateMessage(message);
12173
- // Move to correct position if needed
12174
- var currentIndex = _this.elements.indexOf(item);
12175
- if (currentIndex !== index && index < _this.elements.length) {
12176
- _this.remove(item);
12177
- _this.append(item, index);
12185
+ * Build request context
12186
+ */ function buildRequestContext(conversationId, messages, parentMessageId, selectionContexts, conversationOptions) {
12187
+ var _this_jodit_o_aiAssistantPro = this.jodit.o.aiAssistantPro, apiMode = _this_jodit_o_aiAssistantPro.apiMode, instructions = _this_jodit_o_aiAssistantPro.instructions;
12188
+ var context = {
12189
+ mode: apiMode,
12190
+ conversationId: conversationId,
12191
+ tools: this.toolRegistry.getAllTools(),
12192
+ selectionContexts: selectionContexts,
12193
+ conversationOptions: conversationOptions,
12194
+ instructions: instructions
12195
+ };
12196
+ var messagesToSend = [];
12197
+ if (apiMode === 'full') {
12198
+ // Send entire conversation
12199
+ messagesToSend = messages;
12200
+ } else {
12201
+ // Incremental mode - send messages since last successful response
12202
+ if (parentMessageId) {
12203
+ // Find index of parent message
12204
+ var parentIndex = messages.findIndex(function(m) {
12205
+ return m.id === parentMessageId;
12206
+ });
12207
+ if (parentIndex !== -1) {
12208
+ // Send all messages after parent
12209
+ messagesToSend = messages.slice(parentIndex + 1);
12210
+ } else {
12211
+ // Parent not found, send all messages
12212
+ messagesToSend = messages;
12178
12213
  }
12214
+ context = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, context), {
12215
+ parentMessageId: parentMessageId
12216
+ });
12217
+ } else {
12218
+ // No parent, send all messages (first request)
12219
+ messagesToSend = messages;
12179
12220
  }
12221
+ }
12222
+ // Expand messages with tool calls: add tool result messages separately
12223
+ context = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, context), {
12224
+ messages: this.expandToolMessages(messagesToSend, messages.find(function(m) {
12225
+ return m.id === parentMessageId;
12226
+ }))
12180
12227
  });
12181
- // Create new messages
12182
- result.toCreate.forEach(function(message) {
12183
- var item = new _message_list_item__WEBPACK_IMPORTED_MODULE_9__.UIMessageListItem(_this.j, message, _this.params);
12184
- _this.messageItems.set(message.id, item);
12185
- // Find correct position
12186
- var targetIndex = _this.messages.indexOf(message);
12187
- _this.append(item, targetIndex);
12188
- });
12228
+ return context;
12189
12229
  }
12190
12230
  },
12191
12231
  {
12192
- key: "scrollToBottom",
12193
- value: function scrollToBottom() {
12194
- if (this.j.isDestructed || !this.autoScrollEnabled) return;
12195
- this.container.scrollTop = this.container.scrollHeight;
12232
+ key: "expandToolMessages",
12233
+ value: /**
12234
+ * Expand messages with tool calls by adding separate tool result messages
12235
+ */ function expandToolMessages(messages, parentMessage) {
12236
+ var expanded = [];
12237
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
12238
+ try {
12239
+ for(var _iterator = messages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
12240
+ var message = _step.value;
12241
+ // Add the original message
12242
+ expanded.push(message);
12243
+ this.expandToolResultsMessage(message, expanded);
12244
+ }
12245
+ } catch (err) {
12246
+ _didIteratorError = true;
12247
+ _iteratorError = err;
12248
+ } finally{
12249
+ try {
12250
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
12251
+ _iterator.return();
12252
+ }
12253
+ } finally{
12254
+ if (_didIteratorError) {
12255
+ throw _iteratorError;
12256
+ }
12257
+ }
12258
+ }
12259
+ if (parentMessage) {
12260
+ this.expandToolResultsMessage(parentMessage, expanded);
12261
+ }
12262
+ return expanded;
12196
12263
  }
12197
12264
  },
12198
12265
  {
12199
- key: "destruct",
12200
- value: function destruct() {
12201
- this.messageItems.clear();
12202
- this.messages = [];
12203
- (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIMessageList.prototype), "destruct", this).call(this);
12204
- }
12205
- }
12206
- ]);
12207
- return UIMessageList;
12208
- }(jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_11__.UIGroup);
12209
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12210
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.hook)('ready')
12211
- ], UIMessageList.prototype, "afterRender", null);
12212
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12213
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.watch)([
12214
- 'scrollContainer:wheel',
12215
- 'scrollContainer:scroll',
12216
- 'scrollContainer:touchmove'
12217
- ]),
12218
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.throttle)(function(j) {
12219
- return j.defaultTimeout;
12220
- })
12221
- ], UIMessageList.prototype, "onUserScroll", null);
12222
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12223
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.watch)(':messageSent.ai-assistant-pro')
12224
- ], UIMessageList.prototype, "onMessageSent", null);
12225
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12226
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
12227
- ], UIMessageList.prototype, "setMessages", null);
12228
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12229
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.throttle)(function(j) {
12230
- return j.defaultTimeout * 2;
12231
- })
12232
- ], UIMessageList.prototype, "scrollToBottom", null);
12233
- UIMessageList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12234
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_10__.component
12235
- ], UIMessageList);
12236
-
12237
-
12238
- /***/ }),
12239
-
12240
- /***/ 89929:
12241
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12242
-
12243
- "use strict";
12244
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12245
- /* harmony export */ _: function() { return /* binding */ _async_iterator; }
12246
- /* harmony export */ });
12247
- function _async_iterator(iterable) {
12248
- var method, async, sync, retry = 2;
12249
- for("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;){
12250
- if (async && null != (method = iterable[async])) return method.call(iterable);
12251
- if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
12252
- async = "@@asyncIterator", sync = "@@iterator";
12253
- }
12254
- throw new TypeError("Object is not async iterable");
12255
- }
12256
- function AsyncFromSyncIterator(s) {
12257
- function AsyncFromSyncIteratorContinuation(r) {
12258
- if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
12259
- var done = r.done;
12260
- return Promise.resolve(r.value).then(function(value) {
12261
- return {
12262
- value: value,
12263
- done: done
12264
- };
12265
- });
12266
- }
12267
- return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) {
12268
- this.s = s, this.n = s.next;
12269
- }, AsyncFromSyncIterator.prototype = {
12270
- s: null,
12271
- n: null,
12272
- next: function next() {
12273
- return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
12274
- },
12275
- return: function _return(value) {
12276
- var ret = this.s.return;
12277
- return void 0 === ret ? Promise.resolve({
12278
- value: value,
12279
- done: !0
12280
- }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
12281
- },
12282
- throw: function _throw(value) {
12283
- var thr = this.s.return;
12284
- return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
12285
- }
12286
- }, new AsyncFromSyncIterator(s);
12287
- }
12288
-
12289
-
12290
-
12291
- /***/ }),
12292
-
12293
- /***/ 90022:
12294
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12295
-
12296
- "use strict";
12297
- __webpack_require__.r(__webpack_exports__);
12298
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12299
- /* harmony export */ description: function() { return /* binding */ description; },
12300
- /* harmony export */ name: function() { return /* binding */ name; },
12301
- /* harmony export */ parameters: function() { return /* binding */ parameters; },
12302
- /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
12303
- /* harmony export */ });
12304
- var name = 'writeDocument';
12305
- var description = 'Write (replace) the entire document content with new HTML';
12306
- var parameters = [
12307
- {
12308
- name: 'html',
12309
- type: 'string',
12310
- description: 'HTML content to set as the document',
12311
- required: true
12312
- }
12313
- ];
12314
- var requiresPermission = true;
12315
-
12316
-
12317
- /***/ }),
12318
-
12319
- /***/ 90991:
12320
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12321
-
12322
- "use strict";
12323
- /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
12324
- /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
12325
- /* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(52826);
12326
- /* harmony import */ var _executor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85130);
12327
-
12328
-
12329
-
12330
-
12331
- /* harmony default export */ __webpack_exports__["default"] = ((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, _definition__WEBPACK_IMPORTED_MODULE_2__), {
12332
- execute: _executor__WEBPACK_IMPORTED_MODULE_3__.execute
12333
- }));
12334
-
12335
-
12336
- /***/ }),
12337
-
12338
- /***/ 91140:
12339
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12340
-
12341
- "use strict";
12342
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12343
- /* harmony export */ execute: function() { return /* binding */ execute; }
12344
- /* harmony export */ });
12345
- /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
12346
- /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62361);
12347
- /* harmony import */ var _core_abort_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
12348
- /* harmony import */ var jodit_esm_core_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22732);
12349
-
12350
-
12351
-
12352
-
12353
- /**
12354
- * Read blocks from the editor with optional filtering and pagination
12355
- */ function execute(jodit, args, signal) {
12356
- return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
12357
- var offset, limit, query, allBlocks, children, filteredBlocks, lowerQuery, startIndex, endIndex, paginatedBlocks;
12358
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
12359
- offset = args.offset, limit = args.limit, query = args.query;
12360
- (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
12361
- // Get all blocks
12362
- allBlocks = [];
12363
- children = Array.from(jodit.editor.children);
12364
- children.forEach(function(child, index) {
12365
- if (jodit_esm_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isElement(child)) {
12366
- var element = child;
12367
- allBlocks.push({
12368
- blockIndex: index,
12369
- tagName: element.tagName.toLowerCase(),
12370
- content: element.innerHTML,
12371
- textContent: element.textContent || '',
12372
- classList: Array.from(element.classList)
12266
+ key: "expandToolResultsMessage",
12267
+ value: function expandToolResultsMessage(message, expanded) {
12268
+ // If message has tool calls with results, add them as separate tool messages
12269
+ if (message.toolCalls && message.toolCalls.length > 0) {
12270
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
12271
+ try {
12272
+ var _loop = function() {
12273
+ var toolCall = _step.value;
12274
+ var _toolCall_result;
12275
+ var result = (_toolCall_result = toolCall.result) !== null && _toolCall_result !== void 0 ? _toolCall_result : {
12276
+ error: 'result not found'
12277
+ };
12278
+ if (expanded.find(function(m) {
12279
+ return m.id === "".concat(toolCall.id, "-result");
12280
+ })) {
12281
+ // Already expanded
12282
+ return "continue";
12283
+ }
12284
+ // Create a separate tool result message
12285
+ var toolResultMessage = {
12286
+ id: "".concat(toolCall.id, "-result"),
12287
+ role: 'tool',
12288
+ content: result.error ? "Error: ".concat(result.error) : JSON.stringify(result.result),
12289
+ timestamp: message.timestamp,
12290
+ toolResults: [
12291
+ {
12292
+ toolCallId: toolCall.id,
12293
+ result: result
12294
+ }
12295
+ ]
12296
+ };
12297
+ expanded.push(toolResultMessage);
12298
+ };
12299
+ for(var _iterator = message.toolCalls[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
12300
+ } catch (err) {
12301
+ _didIteratorError = true;
12302
+ _iteratorError = err;
12303
+ } finally{
12304
+ try {
12305
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
12306
+ _iterator.return();
12307
+ }
12308
+ } finally{
12309
+ if (_didIteratorError) {
12310
+ throw _iteratorError;
12311
+ }
12312
+ }
12313
+ }
12314
+ }
12315
+ }
12316
+ },
12317
+ {
12318
+ key: "validateResponse",
12319
+ value: /**
12320
+ * Validate API response
12321
+ */ function validateResponse(result) {
12322
+ if (result.mode !== 'final') {
12323
+ // Streaming response validation can be more complex
12324
+ return;
12325
+ }
12326
+ var response = result.response;
12327
+ if (!response) {
12328
+ throw new Error('API returned empty response');
12329
+ }
12330
+ if (!response.responseId) {
12331
+ throw new Error('API response missing messageId');
12332
+ }
12333
+ if (response.content === undefined) {
12334
+ throw new Error('API response missing content');
12335
+ }
12336
+ if (response.finished === undefined) {
12337
+ throw new Error('API response missing finished flag');
12338
+ }
12339
+ // Validate tool calls if present
12340
+ if (response.toolCalls) {
12341
+ if (!Array.isArray(response.toolCalls)) {
12342
+ throw new Error('API response toolCalls must be an array');
12343
+ }
12344
+ response.toolCalls.forEach(function(tc, index) {
12345
+ if (!tc.id) {
12346
+ throw new Error("Tool call at index ".concat(index, " is missing id"));
12347
+ }
12348
+ if (!tc.name) {
12349
+ throw new Error("Tool call at index ".concat(index, " is missing name"));
12350
+ }
12351
+ if (!tc.arguments || (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_6__._)(tc.arguments) !== 'object') {
12352
+ throw new Error("Tool call at index ".concat(index, " has invalid arguments"));
12353
+ }
12373
12354
  });
12374
12355
  }
12375
- });
12376
- // Filter blocks if query is provided
12377
- filteredBlocks = allBlocks;
12378
- if (query && typeof query === 'string') {
12379
- lowerQuery = query.toLowerCase();
12380
- filteredBlocks = allBlocks.filter(function(block) {
12381
- return block.textContent.toLowerCase().includes(lowerQuery);
12356
+ }
12357
+ },
12358
+ {
12359
+ key: "calculateRetryDelay",
12360
+ value: /**
12361
+ * Calculate retry delay with exponential backoff
12362
+ */ function calculateRetryDelay(attempt) {
12363
+ var retryDelay = this.jodit.o.aiAssistantPro.retryDelay;
12364
+ // Exponential backoff: delay * 2^attempt
12365
+ // With jitter to avoid thundering herd
12366
+ var baseDelay = retryDelay * Math.pow(2, attempt);
12367
+ var jitter = Math.random() * retryDelay;
12368
+ return baseDelay + jitter;
12369
+ }
12370
+ },
12371
+ {
12372
+ key: "sleep",
12373
+ value: /**
12374
+ * Sleep utility
12375
+ */ function sleep(ms) {
12376
+ return new Promise(function(resolve) {
12377
+ return setTimeout(resolve, ms);
12382
12378
  });
12383
12379
  }
12384
- // Apply pagination
12385
- startIndex = Math.max(0, Math.min(typeof offset === 'number' ? offset : 0, filteredBlocks.length));
12386
- endIndex = limit !== undefined ? Math.min(startIndex + limit, filteredBlocks.length) : filteredBlocks.length;
12387
- paginatedBlocks = filteredBlocks.slice(startIndex, endIndex);
12388
- return [
12389
- 2,
12390
- {
12391
- blocks: paginatedBlocks,
12392
- total: allBlocks.length,
12393
- offset: startIndex,
12394
- limit: limit !== undefined ? limit : undefined
12395
- }
12396
- ];
12397
- });
12398
- })();
12399
- }
12380
+ },
12381
+ {
12382
+ /**
12383
+ * Destroy client
12384
+ */ key: "destruct",
12385
+ value: function destruct() {
12386
+ this.abort();
12387
+ }
12388
+ }
12389
+ ]);
12390
+ return APIClient;
12391
+ }();
12400
12392
 
12401
12393
 
12402
12394
  /***/ }),
12403
12395
 
12404
- /***/ 93677:
12396
+ /***/ 86563:
12405
12397
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12406
12398
 
12407
12399
  "use strict";
12408
12400
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12409
- /* harmony export */ UIPermissionRequest: function() { return /* binding */ UIPermissionRequest; }
12401
+ /* harmony export */ UIMessageList: function() { return /* binding */ UIMessageList; }
12410
12402
  /* harmony export */ });
12411
12403
  /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
12412
12404
  /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
@@ -12415,13 +12407,11 @@ var requiresPermission = true;
12415
12407
  /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54816);
12416
12408
  /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84669);
12417
12409
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18766);
12418
- /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(43284);
12419
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
12410
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
12411
+ /* harmony import */ var _item_message_list_item__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51359);
12420
12412
  /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65478);
12421
- /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67510);
12422
- /* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62843);
12423
- /* harmony import */ var jodit_esm_core_ui_form_inputs_select_select__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(12234);
12424
-
12413
+ /* harmony import */ var jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(62405);
12414
+ /* harmony import */ var jodit_pro_core_ui_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31356);
12425
12415
 
12426
12416
 
12427
12417
 
@@ -12434,227 +12424,228 @@ var requiresPermission = true;
12434
12424
 
12435
12425
 
12436
12426
 
12437
- var UIPermissionRequest = /*#__PURE__*/ function(UIElement) {
12427
+ var UIMessageList = /*#__PURE__*/ function(UIGroup) {
12438
12428
  "use strict";
12439
- (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UIPermissionRequest, UIElement);
12440
- function UIPermissionRequest(view, state) {
12441
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIPermissionRequest);
12429
+ (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UIMessageList, UIGroup);
12430
+ function UIMessageList(view, params) {
12431
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIMessageList);
12442
12432
  var _this;
12443
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIPermissionRequest, [
12433
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIMessageList, [
12444
12434
  view
12445
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "toolCall", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "scopeSelect", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "approveButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "denyButton", void 0), _this.state = state, _this.scopeSelect = null, _this.approveButton = null, _this.denyButton = null;
12435
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "params", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "messages", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "messageItems", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "scrollContainer", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "autoScrollEnabled", void 0), _this.params = params, _this.messages = [], _this.messageItems = new Map(), _this.autoScrollEnabled = true;
12446
12436
  return _this;
12447
12437
  }
12448
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIPermissionRequest, [
12438
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIMessageList, [
12449
12439
  {
12450
12440
  key: "className",
12451
12441
  value: function className() {
12452
- return 'UIPermissionRequest';
12453
- }
12454
- },
12455
- {
12456
- key: "setToolCall",
12457
- value: function setToolCall(toolCall) {
12458
- this.toolCall = toolCall;
12459
- this.updateContent();
12460
- }
12461
- },
12462
- {
12463
- key: "setParentView",
12464
- value: function setParentView(jodit) {
12465
- var _this_scopeSelect, _this_approveButton, _this_denyButton;
12466
- (_this_scopeSelect = this.scopeSelect) === null || _this_scopeSelect === void 0 ? void 0 : _this_scopeSelect.setParentView(jodit);
12467
- (_this_approveButton = this.approveButton) === null || _this_approveButton === void 0 ? void 0 : _this_approveButton.setParentView(jodit);
12468
- (_this_denyButton = this.denyButton) === null || _this_denyButton === void 0 ? void 0 : _this_denyButton.setParentView(jodit);
12469
- return (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIPermissionRequest.prototype), "setParentView", this).call(this, jodit);
12442
+ return 'UIMessageList';
12470
12443
  }
12471
12444
  },
12472
12445
  {
12473
12446
  key: "render",
12474
12447
  value: function render() {
12475
- return '<div class="&__container">\n <div class="&__header">\n <div class="&__icon"></div>\n <div class="&__title">~Permission Required~</div>\n </div>\n <div class="&__tool-info"></div>\n <div class="&__actions"></div>\n </div>';
12448
+ return '<div class="&__scroll-container"></div>';
12476
12449
  }
12477
12450
  },
12478
12451
  {
12479
12452
  key: "afterRender",
12480
12453
  value: function afterRender() {
12481
- this.createControls();
12482
- this.updateContent();
12454
+ this.scrollContainer = this.container;
12483
12455
  }
12484
12456
  },
12485
12457
  {
12486
- key: "createControls",
12487
- value: function createControls() {
12488
- var actionsContainer = this.getElm('actions');
12489
- // Deny button
12490
- this.denyButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.UIButton(this.j, {
12491
- icon: {
12492
- name: 'cancel'
12493
- },
12494
- variant: 'danger',
12495
- size: 'small'
12496
- });
12497
- this.j.e.on(this.denyButton, 'click', this.onDeny);
12498
- // Approve button
12499
- this.approveButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.UIButton(this.j, {
12500
- icon: {
12501
- name: 'check'
12502
- },
12503
- variant: 'success',
12504
- size: 'small'
12505
- });
12506
- this.j.e.on(this.approveButton, 'click', this.onApprove);
12507
- // Scope select
12508
- this.scopeSelect = new jodit_esm_core_ui_form_inputs_select_select__WEBPACK_IMPORTED_MODULE_12__.UISelect(this.j, {
12509
- name: 'permission-scope',
12510
- options: [
12511
- {
12512
- value: 'once',
12513
- text: this.j.i18n('Once')
12514
- },
12515
- {
12516
- value: 'conversation',
12517
- text: this.j.i18n('This conversation')
12518
- },
12519
- {
12520
- value: 'forever',
12521
- text: this.j.i18n('Always')
12522
- }
12523
- ]
12524
- });
12525
- this.scopeSelect.value = this.state.defaultPermissionScope;
12526
- actionsContainer.appendChild(this.denyButton.container);
12527
- actionsContainer.appendChild(this.approveButton.container);
12528
- actionsContainer.appendChild(this.scopeSelect.container);
12458
+ key: "onUserScroll",
12459
+ value: /**
12460
+ * Handle user scroll events - check if user has scrolled away from bottom
12461
+ */ function onUserScroll() {
12462
+ if (!this.scrollContainer) return;
12463
+ var _this_scrollContainer = this.scrollContainer, scrollTop = _this_scrollContainer.scrollTop, scrollHeight = _this_scrollContainer.scrollHeight, clientHeight = _this_scrollContainer.clientHeight;
12464
+ var isAtBottom = scrollHeight - scrollTop - clientHeight < 10;
12465
+ this.autoScrollEnabled = isAtBottom;
12529
12466
  }
12530
12467
  },
12531
12468
  {
12532
- key: "updateContent",
12533
- value: function updateContent() {
12534
- if (!this.toolCall) return;
12535
- var toolInfo = this.getElm('tool-info');
12536
- toolInfo.innerHTML = '\n <div class="'.concat(this.getFullElName('tool-name'), '">').concat(this.j.i18n(this.toolCall.name), '</div>\n <div class="').concat(this.getFullElName('tool-args'), '">').concat(this.formatArguments(this.toolCall.arguments), "</div>\n ");
12469
+ key: "onMessageSent",
12470
+ value: /**
12471
+ * Handle message sent event - always enable auto-scroll when user sends message
12472
+ */ function onMessageSent() {
12473
+ this.autoScrollEnabled = true;
12474
+ this.scrollToBottom();
12537
12475
  }
12538
12476
  },
12539
12477
  {
12540
- key: "formatArguments",
12541
- value: function formatArguments(args) {
12542
- return Object.entries(args).map(function(param) {
12543
- var _param = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_7__._)(param, 2), key = _param[0], value = _param[1];
12544
- return "".concat(key, ": ").concat(JSON.stringify(value));
12545
- }).join(', ');
12478
+ key: "appendChildToContainer",
12479
+ value: /**
12480
+ * Append child elements to scroll container
12481
+ */ function appendChildToContainer(childContainer) {
12482
+ if (this.scrollContainer) {
12483
+ this.scrollContainer.appendChild(childContainer);
12484
+ }
12546
12485
  }
12547
12486
  },
12548
12487
  {
12549
- key: "onApprove",
12550
- value: function onApprove() {
12551
- var _this_scopeSelect;
12552
- var scope = (_this_scopeSelect = this.scopeSelect) === null || _this_scopeSelect === void 0 ? void 0 : _this_scopeSelect.value;
12553
- this.j.e.fire('approveToolCall.ai-assistant-pro', this.toolCall.id, scope);
12488
+ key: "setMessages",
12489
+ value: function setMessages(messages) {
12490
+ var oldMessages = this.messages.slice();
12491
+ this.messages = messages.slice();
12492
+ this.updateMessageList(oldMessages);
12493
+ this.scrollToBottom();
12494
+ }
12495
+ },
12496
+ {
12497
+ key: "updateMessageList",
12498
+ value: function updateMessageList(currentMessages) {
12499
+ var _this = this;
12500
+ // Reconcile the lists
12501
+ var result = jodit_pro_core_ui_helpers__WEBPACK_IMPORTED_MODULE_11__.ListReconciler.reconcile(currentMessages, this.messages, {
12502
+ getId: function getId(msg) {
12503
+ return msg.id;
12504
+ },
12505
+ isEqual: function isEqual(a, b) {
12506
+ return a.id === b.id && a.content === b.content && a.timestamp === b.timestamp && JSON.stringify(a.artifacts) === JSON.stringify(b.artifacts) && JSON.stringify(a.toolCalls) === JSON.stringify(b.toolCalls);
12507
+ },
12508
+ preserveOrder: true
12509
+ });
12510
+ // Remove old messages
12511
+ result.toRemove.forEach(function(message) {
12512
+ var item = _this.messageItems.get(message.id);
12513
+ if (item) {
12514
+ var index = _this.elements.indexOf(item);
12515
+ if (index !== -1) {
12516
+ _this.remove(item);
12517
+ item.destruct();
12518
+ }
12519
+ _this.messageItems.delete(message.id);
12520
+ }
12521
+ });
12522
+ // Update existing messages
12523
+ result.toUpdate.forEach(function(param) {
12524
+ var message = param.newItem, index = param.index;
12525
+ var item = _this.messageItems.get(message.id);
12526
+ if (item) {
12527
+ item.updateMessage(message);
12528
+ // Move to correct position if needed
12529
+ var currentIndex = _this.elements.indexOf(item);
12530
+ if (currentIndex !== index && index < _this.elements.length) {
12531
+ _this.remove(item);
12532
+ _this.append(item, index);
12533
+ }
12534
+ }
12535
+ });
12536
+ // Create new messages
12537
+ result.toCreate.forEach(function(message) {
12538
+ var item = new _item_message_list_item__WEBPACK_IMPORTED_MODULE_8__.UIMessageListItem(_this.j, message, _this.params);
12539
+ _this.messageItems.set(message.id, item);
12540
+ // Find correct position
12541
+ var targetIndex = _this.messages.indexOf(message);
12542
+ _this.append(item, targetIndex);
12543
+ });
12554
12544
  }
12555
12545
  },
12556
12546
  {
12557
- key: "onDeny",
12558
- value: function onDeny() {
12559
- this.j.e.fire('denyToolCall.ai-assistant-pro', this.toolCall.id);
12547
+ key: "scrollToBottom",
12548
+ value: function scrollToBottom() {
12549
+ if (this.j.isDestructed || !this.autoScrollEnabled) return;
12550
+ this.container.scrollTop = this.container.scrollHeight;
12560
12551
  }
12561
12552
  },
12562
12553
  {
12563
12554
  key: "destruct",
12564
12555
  value: function destruct() {
12565
- var _this_scopeSelect, _this_approveButton, _this_denyButton;
12566
- (_this_scopeSelect = this.scopeSelect) === null || _this_scopeSelect === void 0 ? void 0 : _this_scopeSelect.destruct();
12567
- (_this_approveButton = this.approveButton) === null || _this_approveButton === void 0 ? void 0 : _this_approveButton.destruct();
12568
- (_this_denyButton = this.denyButton) === null || _this_denyButton === void 0 ? void 0 : _this_denyButton.destruct();
12569
- (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIPermissionRequest.prototype), "destruct", this).call(this);
12556
+ this.messageItems.clear();
12557
+ this.messages = [];
12558
+ (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIMessageList.prototype), "destruct", this).call(this);
12570
12559
  }
12571
12560
  }
12572
12561
  ]);
12573
- return UIPermissionRequest;
12574
- }(jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement);
12575
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
12562
+ return UIMessageList;
12563
+ }(jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_10__.UIGroup);
12564
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12576
12565
  (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.hook)('ready')
12577
- ], UIPermissionRequest.prototype, "afterRender", null);
12578
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
12579
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
12580
- ], UIPermissionRequest.prototype, "onApprove", null);
12581
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
12566
+ ], UIMessageList.prototype, "afterRender", null);
12567
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12568
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)([
12569
+ 'scrollContainer:wheel',
12570
+ 'scrollContainer:scroll',
12571
+ 'scrollContainer:touchmove'
12572
+ ]),
12573
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.throttle)(function(j) {
12574
+ return j.defaultTimeout;
12575
+ })
12576
+ ], UIMessageList.prototype, "onUserScroll", null);
12577
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12578
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':messageSent.ai-assistant-pro')
12579
+ ], UIMessageList.prototype, "onMessageSent", null);
12580
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12582
12581
  jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
12583
- ], UIPermissionRequest.prototype, "onDeny", null);
12584
- UIPermissionRequest = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
12582
+ ], UIMessageList.prototype, "setMessages", null);
12583
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12584
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.throttle)(function(j) {
12585
+ return j.defaultTimeout * 2;
12586
+ })
12587
+ ], UIMessageList.prototype, "scrollToBottom", null);
12588
+ UIMessageList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12585
12589
  jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.component
12586
- ], UIPermissionRequest);
12590
+ ], UIMessageList);
12587
12591
 
12588
12592
 
12589
12593
  /***/ }),
12590
12594
 
12591
- /***/ 93809:
12592
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12595
+ /***/ 89929:
12596
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12593
12597
 
12594
12598
  "use strict";
12595
- __webpack_require__.r(__webpack_exports__);
12596
12599
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12597
- /* harmony export */ description: function() { return /* binding */ description; },
12598
- /* harmony export */ name: function() { return /* binding */ name; },
12599
- /* harmony export */ parameters: function() { return /* binding */ parameters; },
12600
- /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
12600
+ /* harmony export */ _: function() { return /* binding */ _async_iterator; }
12601
12601
  /* harmony export */ });
12602
- var name = 'readDocument';
12603
- var description = 'Read the entire content of the editor document in HTML format';
12604
- var parameters = [
12605
- {
12606
- name: 'start',
12607
- type: 'number',
12608
- description: 'Start character position (default: 0)',
12609
- required: false,
12610
- default: 0
12611
- },
12612
- {
12613
- name: 'end',
12614
- type: 'number',
12615
- description: 'End character position (default: length of document)',
12616
- required: false
12617
- },
12618
- {
12619
- name: 'aroundSelection',
12620
- type: 'boolean',
12621
- description: 'If true, return only the maximum block around the current selection',
12622
- required: false,
12623
- default: false
12602
+ function _async_iterator(iterable) {
12603
+ var method, async, sync, retry = 2;
12604
+ for("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;){
12605
+ if (async && null != (method = iterable[async])) return method.call(iterable);
12606
+ if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
12607
+ async = "@@asyncIterator", sync = "@@iterator";
12624
12608
  }
12625
- ];
12626
- var requiresPermission = false;
12627
-
12628
-
12629
- /***/ }),
12630
-
12631
- /***/ 94668:
12632
- /***/ (function(module) {
12633
-
12634
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <!-- Plus icon with document/context --> <path d=\"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z\"/> </svg>"
12635
-
12636
- /***/ }),
12637
-
12638
- /***/ 95323:
12639
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12640
-
12641
- "use strict";
12642
- /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
12643
- /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
12644
- /* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70750);
12645
- /* harmony import */ var _executor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36142);
12646
-
12647
-
12648
-
12609
+ throw new TypeError("Object is not async iterable");
12610
+ }
12611
+ function AsyncFromSyncIterator(s) {
12612
+ function AsyncFromSyncIteratorContinuation(r) {
12613
+ if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
12614
+ var done = r.done;
12615
+ return Promise.resolve(r.value).then(function(value) {
12616
+ return {
12617
+ value: value,
12618
+ done: done
12619
+ };
12620
+ });
12621
+ }
12622
+ return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) {
12623
+ this.s = s, this.n = s.next;
12624
+ }, AsyncFromSyncIterator.prototype = {
12625
+ s: null,
12626
+ n: null,
12627
+ next: function next() {
12628
+ return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
12629
+ },
12630
+ return: function _return(value) {
12631
+ var ret = this.s.return;
12632
+ return void 0 === ret ? Promise.resolve({
12633
+ value: value,
12634
+ done: !0
12635
+ }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
12636
+ },
12637
+ throw: function _throw(value) {
12638
+ var thr = this.s.return;
12639
+ return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
12640
+ }
12641
+ }, new AsyncFromSyncIterator(s);
12642
+ }
12649
12643
 
12650
- /* harmony default export */ __webpack_exports__["default"] = ((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, _definition__WEBPACK_IMPORTED_MODULE_2__), {
12651
- execute: _executor__WEBPACK_IMPORTED_MODULE_3__.execute
12652
- }));
12653
12644
 
12654
12645
 
12655
12646
  /***/ }),
12656
12647
 
12657
- /***/ 96675:
12648
+ /***/ 90022:
12658
12649
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12659
12650
 
12660
12651
  "use strict";
@@ -12665,25 +12656,13 @@ __webpack_require__.r(__webpack_exports__);
12665
12656
  /* harmony export */ parameters: function() { return /* binding */ parameters; },
12666
12657
  /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
12667
12658
  /* harmony export */ });
12668
- var name = 'replaceBlock';
12669
- var description = 'Replace a specific block in the document by its index or CSS selector with new HTML content';
12659
+ var name = 'writeDocument';
12660
+ var description = 'Write (replace) the entire document content with new HTML';
12670
12661
  var parameters = [
12671
- {
12672
- name: 'index',
12673
- type: 'number',
12674
- description: 'Zero-based index of the block to replace (use either index or selector, not both)',
12675
- required: false
12676
- },
12677
- {
12678
- name: 'selector',
12679
- type: 'string',
12680
- description: 'CSS selector to find the block to replace (e.g., "h1", ".my-class", "#my-id"). Use either selector or index, not both',
12681
- required: false
12682
- },
12683
12662
  {
12684
12663
  name: 'html',
12685
12664
  type: 'string',
12686
- description: 'HTML content for the new block',
12665
+ description: 'HTML content to set as the document',
12687
12666
  required: true
12688
12667
  }
12689
12668
  ];
@@ -12692,14 +12671,14 @@ var requiresPermission = true;
12692
12671
 
12693
12672
  /***/ }),
12694
12673
 
12695
- /***/ 97603:
12674
+ /***/ 90991:
12696
12675
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12697
12676
 
12698
12677
  "use strict";
12699
12678
  /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
12700
12679
  /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
12701
- /* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90022);
12702
- /* harmony import */ var _executor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79766);
12680
+ /* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(52826);
12681
+ /* harmony import */ var _executor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85130);
12703
12682
 
12704
12683
 
12705
12684
 
@@ -12711,19 +12690,78 @@ var requiresPermission = true;
12711
12690
 
12712
12691
  /***/ }),
12713
12692
 
12714
- /***/ 99219:
12715
- /***/ (function(module) {
12693
+ /***/ 91140:
12694
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12695
+
12696
+ "use strict";
12697
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12698
+ /* harmony export */ execute: function() { return /* binding */ execute; }
12699
+ /* harmony export */ });
12700
+ /* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
12701
+ /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62361);
12702
+ /* harmony import */ var _core_abort_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
12703
+ /* harmony import */ var jodit_esm_core_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22732);
12704
+
12705
+
12706
+
12707
+
12708
+ /**
12709
+ * Read blocks from the editor with optional filtering and pagination
12710
+ */ function execute(jodit, args, signal) {
12711
+ return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
12712
+ var offset, limit, query, allBlocks, children, filteredBlocks, lowerQuery, startIndex, endIndex, paginatedBlocks;
12713
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_1__._)(this, function(_state) {
12714
+ offset = args.offset, limit = args.limit, query = args.query;
12715
+ (0,_core_abort_utils__WEBPACK_IMPORTED_MODULE_2__.throwIfAborted)(signal);
12716
+ // Get all blocks
12717
+ allBlocks = [];
12718
+ children = Array.from(jodit.editor.children);
12719
+ children.forEach(function(child, index) {
12720
+ if (jodit_esm_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isElement(child)) {
12721
+ var element = child;
12722
+ allBlocks.push({
12723
+ blockIndex: index,
12724
+ tagName: element.tagName.toLowerCase(),
12725
+ content: element.innerHTML,
12726
+ textContent: element.textContent || '',
12727
+ classList: Array.from(element.classList)
12728
+ });
12729
+ }
12730
+ });
12731
+ // Filter blocks if query is provided
12732
+ filteredBlocks = allBlocks;
12733
+ if (query && typeof query === 'string') {
12734
+ lowerQuery = query.toLowerCase();
12735
+ filteredBlocks = allBlocks.filter(function(block) {
12736
+ return block.textContent.toLowerCase().includes(lowerQuery);
12737
+ });
12738
+ }
12739
+ // Apply pagination
12740
+ startIndex = Math.max(0, Math.min(typeof offset === 'number' ? offset : 0, filteredBlocks.length));
12741
+ endIndex = limit !== undefined ? Math.min(startIndex + limit, filteredBlocks.length) : filteredBlocks.length;
12742
+ paginatedBlocks = filteredBlocks.slice(startIndex, endIndex);
12743
+ return [
12744
+ 2,
12745
+ {
12746
+ blocks: paginatedBlocks,
12747
+ total: allBlocks.length,
12748
+ offset: startIndex,
12749
+ limit: limit !== undefined ? limit : undefined
12750
+ }
12751
+ ];
12752
+ });
12753
+ })();
12754
+ }
12716
12755
 
12717
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"></line> <polygon points=\"22 2 15 22 11 13 2 9 22 2\"></polygon> </svg>"
12718
12756
 
12719
12757
  /***/ }),
12720
12758
 
12721
- /***/ 99359:
12759
+ /***/ 93677:
12722
12760
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12723
12761
 
12724
12762
  "use strict";
12725
12763
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12726
- /* harmony export */ UIMessageListItem: function() { return /* binding */ UIMessageListItem; }
12764
+ /* harmony export */ UIPermissionRequest: function() { return /* binding */ UIPermissionRequest; }
12727
12765
  /* harmony export */ });
12728
12766
  /* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80294);
12729
12767
  /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20616);
@@ -12732,14 +12770,12 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
12732
12770
  /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54816);
12733
12771
  /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84669);
12734
12772
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18766);
12735
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
12736
- /* harmony import */ var _artifact__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81835);
12773
+ /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(43284);
12774
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
12737
12775
  /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65478);
12738
12776
  /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67510);
12739
12777
  /* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62843);
12740
- /* harmony import */ var jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62405);
12741
- /* harmony import */ var jodit_esm_modules_context_menu_context_menu__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(80870);
12742
-
12778
+ /* harmony import */ var jodit_esm_core_ui_form_inputs_select_select__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(12234);
12743
12779
 
12744
12780
 
12745
12781
 
@@ -12753,324 +12789,288 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
12753
12789
 
12754
12790
 
12755
12791
 
12756
- var UIMessageListItem = /*#__PURE__*/ function(UIElement) {
12792
+ var UIPermissionRequest = /*#__PURE__*/ function(UIElement) {
12757
12793
  "use strict";
12758
- (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UIMessageListItem, UIElement);
12759
- function UIMessageListItem(view, message, opts) {
12760
- (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIMessageListItem);
12794
+ (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(UIPermissionRequest, UIElement);
12795
+ function UIPermissionRequest(view, state) {
12796
+ (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UIPermissionRequest);
12761
12797
  var _this;
12762
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIMessageListItem, [
12798
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UIPermissionRequest, [
12763
12799
  view
12764
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "message", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "opts", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "artifactGroup", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "actionsButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "contextMenu", void 0), _this.message = message, _this.opts = opts, _this.artifactGroup = null, _this.actionsButton = null, _this.contextMenu = null;
12800
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "toolCall", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "scopeSelect", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "approveButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "denyButton", void 0), _this.state = state, _this.scopeSelect = null, _this.approveButton = null, _this.denyButton = null;
12765
12801
  return _this;
12766
12802
  }
12767
- (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIMessageListItem, [
12803
+ (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(UIPermissionRequest, [
12768
12804
  {
12769
12805
  key: "className",
12770
12806
  value: function className() {
12771
- return 'UIMessageList';
12772
- }
12773
- },
12774
- {
12775
- key: "render",
12776
- value: function render() {
12777
- return '<div class="'.concat(this.getFullElName('message'), '"></div>');
12807
+ return 'UIPermissionRequest';
12778
12808
  }
12779
12809
  },
12780
12810
  {
12781
- key: "onReady",
12782
- value: function onReady() {
12811
+ key: "setToolCall",
12812
+ value: function setToolCall(toolCall) {
12813
+ this.toolCall = toolCall;
12783
12814
  this.updateContent();
12784
- this.contextMenu = new jodit_esm_modules_context_menu_context_menu__WEBPACK_IMPORTED_MODULE_13__.ContextMenu(this.j);
12785
- }
12786
- },
12787
- {
12788
- key: "updateContent",
12789
- value: function updateContent() {
12790
- var _this = this;
12791
- var container = this.container;
12792
- container.innerHTML = '';
12793
- container.setAttribute('data-message-id', this.message.id);
12794
- container.setAttribute('data-role', this.message.role);
12795
- var bubble = this.j.c.div(this.getFullElName('message-bubble'));
12796
- bubble.classList.add(this.getFullElName('message-bubble', this.message.role, true));
12797
- var content = this.j.c.div(this.getFullElName('message-content'));
12798
- content.innerHTML = this.formatMessageContent(this.message.content);
12799
- bubble.appendChild(content);
12800
- if (this.opts.showTimestamps) {
12801
- var timestamp = this.j.c.div(this.getFullElName('message-timestamp'));
12802
- timestamp.textContent = this.formatTimestamp(this.message.timestamp);
12803
- bubble.appendChild(timestamp);
12804
- }
12805
- // Actions button in bottom-right corner
12806
- var actionsContainer = this.j.c.div(this.getFullElName('message-actions'));
12807
- this.renderActionsButton(actionsContainer);
12808
- bubble.appendChild(actionsContainer);
12809
- container.appendChild(bubble);
12810
- // Render tool calls
12811
- if (this.message.toolCalls && this.message.toolCalls.length > 0) {
12812
- var toolCallasContainer = this.j.c.div(this.getFullElName('tool-calls'));
12813
- container.appendChild(toolCallasContainer);
12814
- this.message.toolCalls.forEach(function(toolCall) {
12815
- var toolElement = _this.createToolCallElement(toolCall);
12816
- toolCallasContainer.appendChild(toolElement);
12817
- });
12818
- }
12819
- // Render artifacts
12820
- if (this.message.artifacts && this.message.artifacts.length > 0) {
12821
- this.renderArtifacts();
12822
- }
12823
- }
12824
- },
12825
- {
12826
- key: "renderActionsButton",
12827
- value: /**
12828
- * Render message actions button (3-dot menu)
12829
- */ function renderActionsButton(container) {
12830
- var _this = this;
12831
- var config = this.opts;
12832
- // Check if any action is enabled
12833
- var hasAnyAction = config.showCopyMessageAction || config.showRestartMessageAction || config.showEditMessageAction || config.showDeleteMessageAction;
12834
- if (!hasAnyAction) {
12835
- return;
12836
- }
12837
- // Create button
12838
- this.actionsButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.UIButton(this.j, {
12839
- icon: {
12840
- name: 'dots'
12841
- },
12842
- tooltip: 'Message actions',
12843
- name: 'messageActions',
12844
- size: 'tiny'
12845
- });
12846
- this.actionsButton.onAction(function(e) {
12847
- _this.showActionsMenu(e);
12848
- });
12849
- container.appendChild(this.actionsButton.container);
12850
12815
  }
12851
12816
  },
12852
12817
  {
12853
- key: "showActionsMenu",
12854
- value: /**
12855
- * Show actions menu using ContextMenu
12856
- */ function showActionsMenu(event) {
12857
- var _this = this;
12858
- if (!this.contextMenu || !this.actionsButton) return;
12859
- var jodit = this.j;
12860
- var config = jodit.o.aiAssistantPro;
12861
- var actions = [];
12862
- // Copy message action (available for all messages)
12863
- if (config.showCopyMessageAction) {
12864
- actions.push({
12865
- title: 'Copy message',
12866
- icon: 'copy',
12867
- exec: function exec() {
12868
- _this.j.e.fire('copyMessage.ai-assistant-pro', _this.message.id);
12869
- }
12870
- });
12871
- }
12872
- // User-only actions
12873
- if (this.message.role === 'user') {
12874
- // Restart from here action
12875
- if (config.showRestartMessageAction) {
12876
- actions.push({
12877
- title: 'Restart from here',
12878
- icon: 'update',
12879
- exec: function exec() {
12880
- _this.j.e.fire('restartFromMessage.ai-assistant-pro', _this.message.id);
12881
- }
12882
- });
12883
- }
12884
- // Edit message action
12885
- if (config.showEditMessageAction) {
12886
- actions.push({
12887
- title: 'Edit message',
12888
- icon: 'pencil',
12889
- exec: function exec() {
12890
- _this.j.e.fire('editMessage.ai-assistant-pro', _this.message.id);
12891
- }
12892
- });
12893
- }
12894
- }
12895
- // Delete message action (available for all messages)
12896
- if (config.showDeleteMessageAction) {
12897
- actions.push({
12898
- title: 'Delete message',
12899
- icon: 'bin',
12900
- exec: function exec() {
12901
- // Show confirmation before delete
12902
- jodit.confirm('Are you sure you want to delete this message?', 'Delete message', function(yes) {
12903
- if (yes) {
12904
- _this.j.e.fire('deleteMessage.ai-assistant-pro', _this.message.id);
12905
- }
12906
- });
12907
- }
12908
- });
12909
- }
12910
- // Get button position
12911
- var buttonRect = this.actionsButton.container.getBoundingClientRect();
12912
- this.contextMenu.show(buttonRect.left, buttonRect.bottom, actions);
12913
- event.stopPropagation();
12818
+ key: "setParentView",
12819
+ value: function setParentView(jodit) {
12820
+ var _this_scopeSelect, _this_approveButton, _this_denyButton;
12821
+ (_this_scopeSelect = this.scopeSelect) === null || _this_scopeSelect === void 0 ? void 0 : _this_scopeSelect.setParentView(jodit);
12822
+ (_this_approveButton = this.approveButton) === null || _this_approveButton === void 0 ? void 0 : _this_approveButton.setParentView(jodit);
12823
+ (_this_denyButton = this.denyButton) === null || _this_denyButton === void 0 ? void 0 : _this_denyButton.setParentView(jodit);
12824
+ return (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIPermissionRequest.prototype), "setParentView", this).call(this, jodit);
12914
12825
  }
12915
12826
  },
12916
12827
  {
12917
- key: "renderArtifacts",
12918
- value: /**
12919
- * Render artifacts
12920
- */ function renderArtifacts() {
12921
- var _this = this;
12922
- if (!this.message.artifacts || this.message.artifacts.length === 0) {
12923
- return;
12924
- }
12925
- // Create artifact container
12926
- var artifactContainer = this.j.c.div(this.getFullElName('artifacts'));
12927
- this.container.appendChild(artifactContainer);
12928
- // Create artifact group if not exists
12929
- if (!this.artifactGroup) {
12930
- this.artifactGroup = new jodit_esm_core_ui_group_group__WEBPACK_IMPORTED_MODULE_12__.UIGroup(this.j);
12931
- this.artifactGroup.container.className = 'jodit-ui-artifact-group';
12932
- }
12933
- // Clear previous artifacts
12934
- this.artifactGroup.clear();
12935
- // Render each artifact
12936
- this.message.artifacts.forEach(function(artifact) {
12937
- var artifactElement = new _artifact__WEBPACK_IMPORTED_MODULE_8__.UIArtifact(_this.j, artifact);
12938
- _this.artifactGroup.append(artifactElement);
12939
- });
12940
- // Append artifact group to container
12941
- artifactContainer.appendChild(this.artifactGroup.container);
12828
+ key: "render",
12829
+ value: function render() {
12830
+ return '<div class="&__container">\n <div class="&__header">\n <div class="&__icon"></div>\n <div class="&__title">~Permission Required~</div>\n </div>\n <div class="&__tool-info"></div>\n <div class="&__actions"></div>\n </div>';
12942
12831
  }
12943
12832
  },
12944
12833
  {
12945
- key: "createToolCallElement",
12946
- value: /**
12947
- * Create tool call element
12948
- */ function createToolCallElement(toolCall) {
12949
- var element = this.j.c.div(this.getFullElName('tool-call'));
12950
- element.setAttribute('data-tool-id', toolCall.id);
12951
- element.setAttribute('data-status', toolCall.status);
12952
- // Main header
12953
- var header = this.j.c.div(this.getFullElName('tool-header'));
12954
- var icon = this.j.c.div(this.getFullElName('tool-icon'));
12955
- icon.classList.add(this.getFullElName('tool-icon', toolCall.status, true));
12956
- icon.textContent = '⚡';
12957
- var name = this.j.c.div(this.getFullElName('tool-name'));
12958
- name.textContent = this.j.i18n(toolCall.name);
12959
- var status = this.j.c.div(this.getFullElName('tool-status'));
12960
- status.textContent = this.getToolStatusText(toolCall.status || 'unknown');
12961
- header.appendChild(icon);
12962
- header.appendChild(name);
12963
- header.appendChild(status);
12964
- element.appendChild(header);
12965
- // Expandable arguments section
12966
- var argsSection = this.createExpandableSection('Arguments', JSON.stringify(toolCall.arguments || {}, null, 2));
12967
- element.appendChild(argsSection);
12968
- // Expandable result section (only if tool has result)
12969
- if (toolCall.result) {
12970
- var resultContent = toolCall.result.error ? "Error: ".concat(toolCall.result.error) : toolCall.result.result || '';
12971
- var resultSection = this.createExpandableSection('Result', typeof resultContent === 'string' ? resultContent : JSON.stringify(resultContent, null, 2));
12972
- element.appendChild(resultSection);
12973
- }
12974
- return element;
12834
+ key: "afterRender",
12835
+ value: function afterRender() {
12836
+ this.createControls();
12837
+ this.updateContent();
12975
12838
  }
12976
12839
  },
12977
12840
  {
12978
- key: "createExpandableSection",
12979
- value: /**
12980
- * Create expandable section for tool details
12981
- */ function createExpandableSection(title, content) {
12982
- var _this = this;
12983
- var section = this.j.c.div(this.getFullElName('tool-expandable'));
12984
- var toggle = this.j.c.element('button', {
12985
- type: 'button',
12986
- class: this.getFullElName('tool-expandable-toggle')
12841
+ key: "createControls",
12842
+ value: function createControls() {
12843
+ var actionsContainer = this.getElm('actions');
12844
+ // Deny button
12845
+ this.denyButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.UIButton(this.j, {
12846
+ icon: {
12847
+ name: 'cancel'
12848
+ },
12849
+ variant: 'danger',
12850
+ size: 'small'
12987
12851
  });
12988
- toggle.textContent = "▶ ".concat(this.j.i18n(title));
12989
- var contentEl = this.j.c.element('pre', {
12990
- class: this.getFullElName('tool-expandable-content')
12852
+ this.j.e.on(this.denyButton, 'click', this.onDeny);
12853
+ // Approve button
12854
+ this.approveButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.UIButton(this.j, {
12855
+ icon: {
12856
+ name: 'check'
12857
+ },
12858
+ variant: 'success',
12859
+ size: 'small'
12991
12860
  });
12992
- contentEl.textContent = content;
12993
- contentEl.style.display = 'none';
12994
- this.j.e.on(toggle, 'click', function() {
12995
- var isCurrentlyExpanded = contentEl.style.display !== 'none';
12996
- if (isCurrentlyExpanded) {
12997
- contentEl.style.display = 'none';
12998
- toggle.textContent = "▶ ".concat(_this.j.i18n(title));
12999
- } else {
13000
- contentEl.style.display = 'block';
13001
- toggle.textContent = "▼ ".concat(_this.j.i18n(title));
13002
- }
12861
+ this.j.e.on(this.approveButton, 'click', this.onApprove);
12862
+ // Scope select
12863
+ this.scopeSelect = new jodit_esm_core_ui_form_inputs_select_select__WEBPACK_IMPORTED_MODULE_12__.UISelect(this.j, {
12864
+ name: 'permission-scope',
12865
+ options: [
12866
+ {
12867
+ value: 'once',
12868
+ text: this.j.i18n('Once')
12869
+ },
12870
+ {
12871
+ value: 'conversation',
12872
+ text: this.j.i18n('This conversation')
12873
+ },
12874
+ {
12875
+ value: 'forever',
12876
+ text: this.j.i18n('Always')
12877
+ }
12878
+ ]
13003
12879
  });
13004
- section.appendChild(toggle);
13005
- section.appendChild(contentEl);
13006
- return section;
12880
+ this.scopeSelect.value = this.state.defaultPermissionScope;
12881
+ actionsContainer.appendChild(this.denyButton.container);
12882
+ actionsContainer.appendChild(this.approveButton.container);
12883
+ actionsContainer.appendChild(this.scopeSelect.container);
13007
12884
  }
13008
12885
  },
13009
12886
  {
13010
- key: "getToolStatusText",
13011
- value: /**
13012
- * Get tool status text
13013
- */ function getToolStatusText(status) {
13014
- var statusMap = {
13015
- pending: '⏳',
13016
- approved: '✓',
13017
- denied: '✕',
13018
- executing: '⚡',
13019
- executed: '✓',
13020
- error: '⚠'
13021
- };
13022
- return statusMap[status] || '●';
12887
+ key: "updateContent",
12888
+ value: function updateContent() {
12889
+ if (!this.toolCall) return;
12890
+ var toolInfo = this.getElm('tool-info');
12891
+ toolInfo.innerHTML = '\n <div class="'.concat(this.getFullElName('tool-name'), '">').concat(this.j.i18n(this.toolCall.name), '</div>\n <div class="').concat(this.getFullElName('tool-args'), '">').concat(this.formatArguments(this.toolCall.arguments), "</div>\n ");
13023
12892
  }
13024
12893
  },
13025
12894
  {
13026
- key: "formatMessageContent",
13027
- value: /**
13028
- * Format message content using custom formatter
13029
- */ function formatMessageContent(content) {
13030
- var customFormatter = this.opts.formatMessageContent;
13031
- var messageRole = this.message.role;
13032
- return customFormatter(content, messageRole, this.j.i18n.bind(this.j));
12895
+ key: "formatArguments",
12896
+ value: function formatArguments(args) {
12897
+ return Object.entries(args).map(function(param) {
12898
+ var _param = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_7__._)(param, 2), key = _param[0], value = _param[1];
12899
+ return "".concat(key, ": ").concat(JSON.stringify(value));
12900
+ }).join(', ');
13033
12901
  }
13034
12902
  },
13035
12903
  {
13036
- key: "formatTimestamp",
13037
- value: /**
13038
- * Format timestamp using custom formatter
13039
- */ function formatTimestamp(timestamp) {
13040
- var customFormatter = this.opts.formatTimestamp;
13041
- return customFormatter(timestamp, this.j.i18n.bind(this.j));
12904
+ key: "onApprove",
12905
+ value: function onApprove() {
12906
+ var _this_scopeSelect;
12907
+ var scope = (_this_scopeSelect = this.scopeSelect) === null || _this_scopeSelect === void 0 ? void 0 : _this_scopeSelect.value;
12908
+ this.j.e.fire('approveToolCall.ai-assistant-pro', this.toolCall.id, scope);
13042
12909
  }
13043
12910
  },
13044
12911
  {
13045
- /**
13046
- * Update message (for streaming or updates)
13047
- */ key: "updateMessage",
13048
- value: function updateMessage(message) {
13049
- this.message = message;
13050
- this.updateContent();
12912
+ key: "onDeny",
12913
+ value: function onDeny() {
12914
+ this.j.e.fire('denyToolCall.ai-assistant-pro', this.toolCall.id);
13051
12915
  }
13052
12916
  },
13053
12917
  {
13054
12918
  key: "destruct",
13055
12919
  value: function destruct() {
13056
- var _this_actionsButton, _this_contextMenu, _this_artifactGroup;
13057
- (_this_actionsButton = this.actionsButton) === null || _this_actionsButton === void 0 ? void 0 : _this_actionsButton.destruct();
13058
- (_this_contextMenu = this.contextMenu) === null || _this_contextMenu === void 0 ? void 0 : _this_contextMenu.destruct();
13059
- (_this_artifactGroup = this.artifactGroup) === null || _this_artifactGroup === void 0 ? void 0 : _this_artifactGroup.destruct();
13060
- (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIMessageListItem.prototype), "destruct", this).call(this);
12920
+ var _this_scopeSelect, _this_approveButton, _this_denyButton;
12921
+ (_this_scopeSelect = this.scopeSelect) === null || _this_scopeSelect === void 0 ? void 0 : _this_scopeSelect.destruct();
12922
+ (_this_approveButton = this.approveButton) === null || _this_approveButton === void 0 ? void 0 : _this_approveButton.destruct();
12923
+ (_this_denyButton = this.denyButton) === null || _this_denyButton === void 0 ? void 0 : _this_denyButton.destruct();
12924
+ (0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__._)(UIPermissionRequest.prototype), "destruct", this).call(this);
13061
12925
  }
13062
12926
  }
13063
12927
  ]);
13064
- return UIMessageListItem;
12928
+ return UIPermissionRequest;
13065
12929
  }(jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement);
13066
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12930
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
13067
12931
  (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.hook)('ready')
13068
- ], UIMessageListItem.prototype, "onReady", null);
13069
- UIMessageListItem = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
12932
+ ], UIPermissionRequest.prototype, "afterRender", null);
12933
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
12934
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
12935
+ ], UIPermissionRequest.prototype, "onApprove", null);
12936
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
12937
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
12938
+ ], UIPermissionRequest.prototype, "onDeny", null);
12939
+ UIPermissionRequest = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
13070
12940
  jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_9__.component
13071
- ], UIMessageListItem);
12941
+ ], UIPermissionRequest);
12942
+
12943
+
12944
+ /***/ }),
12945
+
12946
+ /***/ 93809:
12947
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12948
+
12949
+ "use strict";
12950
+ __webpack_require__.r(__webpack_exports__);
12951
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12952
+ /* harmony export */ description: function() { return /* binding */ description; },
12953
+ /* harmony export */ name: function() { return /* binding */ name; },
12954
+ /* harmony export */ parameters: function() { return /* binding */ parameters; },
12955
+ /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
12956
+ /* harmony export */ });
12957
+ var name = 'readDocument';
12958
+ var description = 'Read the entire content of the editor document in HTML format';
12959
+ var parameters = [
12960
+ {
12961
+ name: 'start',
12962
+ type: 'number',
12963
+ description: 'Start character position (default: 0)',
12964
+ required: false,
12965
+ default: 0
12966
+ },
12967
+ {
12968
+ name: 'end',
12969
+ type: 'number',
12970
+ description: 'End character position (default: length of document)',
12971
+ required: false
12972
+ },
12973
+ {
12974
+ name: 'aroundSelection',
12975
+ type: 'boolean',
12976
+ description: 'If true, return only the maximum block around the current selection',
12977
+ required: false,
12978
+ default: false
12979
+ }
12980
+ ];
12981
+ var requiresPermission = false;
12982
+
12983
+
12984
+ /***/ }),
12985
+
12986
+ /***/ 94668:
12987
+ /***/ (function(module) {
12988
+
12989
+ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <!-- Plus icon with document/context --> <path d=\"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z\"/> </svg>"
12990
+
12991
+ /***/ }),
12992
+
12993
+ /***/ 95323:
12994
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12995
+
12996
+ "use strict";
12997
+ /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
12998
+ /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
12999
+ /* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70750);
13000
+ /* harmony import */ var _executor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36142);
13001
+
13002
+
13003
+
13004
+
13005
+ /* harmony default export */ __webpack_exports__["default"] = ((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, _definition__WEBPACK_IMPORTED_MODULE_2__), {
13006
+ execute: _executor__WEBPACK_IMPORTED_MODULE_3__.execute
13007
+ }));
13072
13008
 
13073
13009
 
13010
+ /***/ }),
13011
+
13012
+ /***/ 96675:
13013
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13014
+
13015
+ "use strict";
13016
+ __webpack_require__.r(__webpack_exports__);
13017
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13018
+ /* harmony export */ description: function() { return /* binding */ description; },
13019
+ /* harmony export */ name: function() { return /* binding */ name; },
13020
+ /* harmony export */ parameters: function() { return /* binding */ parameters; },
13021
+ /* harmony export */ requiresPermission: function() { return /* binding */ requiresPermission; }
13022
+ /* harmony export */ });
13023
+ var name = 'replaceBlock';
13024
+ var description = 'Replace a specific block in the document by its index or CSS selector with new HTML content';
13025
+ var parameters = [
13026
+ {
13027
+ name: 'index',
13028
+ type: 'number',
13029
+ description: 'Zero-based index of the block to replace (use either index or selector, not both)',
13030
+ required: false
13031
+ },
13032
+ {
13033
+ name: 'selector',
13034
+ type: 'string',
13035
+ description: 'CSS selector to find the block to replace (e.g., "h1", ".my-class", "#my-id"). Use either selector or index, not both',
13036
+ required: false
13037
+ },
13038
+ {
13039
+ name: 'html',
13040
+ type: 'string',
13041
+ description: 'HTML content for the new block',
13042
+ required: true
13043
+ }
13044
+ ];
13045
+ var requiresPermission = true;
13046
+
13047
+
13048
+ /***/ }),
13049
+
13050
+ /***/ 97603:
13051
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13052
+
13053
+ "use strict";
13054
+ /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
13055
+ /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
13056
+ /* harmony import */ var _definition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90022);
13057
+ /* harmony import */ var _executor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79766);
13058
+
13059
+
13060
+
13061
+
13062
+ /* harmony default export */ __webpack_exports__["default"] = ((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, _definition__WEBPACK_IMPORTED_MODULE_2__), {
13063
+ execute: _executor__WEBPACK_IMPORTED_MODULE_3__.execute
13064
+ }));
13065
+
13066
+
13067
+ /***/ }),
13068
+
13069
+ /***/ 99219:
13070
+ /***/ (function(module) {
13071
+
13072
+ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"></line> <polygon points=\"22 2 15 22 11 13 2 9 22 2\"></polygon> </svg>"
13073
+
13074
13074
  /***/ })
13075
13075
 
13076
13076
  },