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
  */
@@ -18,7 +18,7 @@ ${r}`.trim();s?await this.__executeQuickCommandSilent(l,r):await this.__executeQ
18
18
  <div class="&__loading-spinner"></div>
19
19
  </div>
20
20
  <div class="&__footer"></div>
21
- </div>`}addResize(){}afterRender(){this.content=this.getElm("content"),this.createComponents(),this.createHeaderButtons(),this.__updateView("welcome")}async __onChangeView(){this.__updateView(this.state.currentView,this.state.currentConversation)}createComponents(){this.welcomeScreen=new h.UIWelcomeScreen(this.j),this.conversationList=new r.UIConversationList(this.j,this.options),this.messageList=new o.UIMessageList(this.j,this.options),this.inputArea=new a.UIInputArea(this.j,this.options),this.getElm("footer").appendChild(this.inputArea.container)}createHeaderButtons(){let e=this.getElm("header-left"),t=this.getElm("header-right"),s=new g.UIButton(this.j,{icon:{name:"angle-left"},size:"small",variant:"default"});s.container.classList.add(this.getFullElName("back-button")),this.j.e.on(s,"click",()=>{this.j.e.fire("backToList.ai-assistant-pro")}),e.appendChild(s.container);let i=new g.UIButton(this.j,{icon:{name:"plus"},size:"small",tooltip:"New chat",variant:"default"});if(i.container.classList.add(this.getFullElName("new-button")),this.j.e.on(i,"click",()=>{this.j.e.fire("newConversation.ai-assistant-pro")}),t.appendChild(i.container),this.shouldShowSettings()&&(this.settingsButton=new c.UISettingsButton(this.j,this.state,this.options,()=>this.state.currentConversation,this.updateConversation),this.settingsButton.container.classList.add(this.getFullElName("settings-button")),t.appendChild(this.settingsButton.container)),"dialog"===this.mods.displayMode||!1===this.mods.allowClose)return;let n=new g.UIButton(this.j,{icon:{name:"cancel"},size:"small",tooltip:"Close",variant:"default"});n.container.classList.add(this.getFullElName("close-button")),this.j.e.on(n,"click",()=>{this.j.e.fire("closeAIAssistantPro.ai-assistant-pro")}),t.appendChild(n.container)}isFlightMode(){return"flight"===this.mods.displayMode}shouldShowSettings(){let e=this.options,t=e.allowEditDisplayMode||e.allowEditPanelWidth,s=e.allowEditDialogSettings;return t||s}__updateView(e,t=null){var s;null==(s=this.settingsButton)||s.update();let i=this.getElm("header-title");this.setMod("view",e);let n=this.isFlightMode();switch(e){case"welcome":i.textContent=this.j.i18n("AI Assistant"),d.Dom.safeRemove(this.conversationList.container),d.Dom.safeRemove(this.messageList.container),this.content.appendChild(this.welcomeScreen.container),this.inputArea.focus();break;case"conversationList":i.textContent=this.j.i18n("AI Assistant"),d.Dom.safeRemove(this.welcomeScreen.container),d.Dom.safeRemove(this.messageList.container),this.conversationList.container.isConnected||this.content.appendChild(this.conversationList.container);break;case"conversation":i.textContent=n?this.j.i18n("AI Assistant"):(null==t?void 0:t.title)||this.j.i18n("Conversation"),d.Dom.safeRemove(this.welcomeScreen.container),d.Dom.safeRemove(this.conversationList.container),this.messageList.container.isConnected||this.content.appendChild(this.messageList.container),t&&this.messageList.setMessages(t.messages),this.inputArea.focus()}}onChangeCurrentConversation(){let{currentConversation:e}=this.state;e&&(this.conversationList.setActiveConversation(e.id),this.messageList.setMessages(e.messages))}onChangeConversations(){this.conversationList.setConversations(this.state.conversations)}onChangeSelectionContexts(){this.inputArea.setContexts(this.state.selectionContexts)}onChangeLoading(){this.inputArea.setLoading(this.state.isLoading)}onChangePendingToolCalls(){this.state.pendingToolCalls&&this.state.pendingToolCalls.length>0?this.showPermissionRequest(this.state.pendingToolCalls[0]):this.hidePermissionRequest()}showPermissionRequest(e){this.permissionRequest||(this.permissionRequest=new l.UIPermissionRequest(this.j,this.options)),this.permissionRequest.setToolCall(e);let t=this.getElm("footer");t.contains(this.permissionRequest.container)||t.insertBefore(this.permissionRequest.container,this.inputArea.container)}hidePermissionRequest(){this.permissionRequest&&this.permissionRequest.container.parentNode&&this.permissionRequest.container.parentNode.removeChild(this.permissionRequest.container)}destruct(){var e,t,s,i,n,r;null==(e=this.welcomeScreen)||e.destruct(),null==(t=this.conversationList)||t.destruct(),null==(s=this.messageList)||s.destruct(),null==(i=this.inputArea)||i.destruct(),null==(n=this.permissionRequest)||n.destruct(),null==(r=this.settingsButton)||r.destruct(),super.destruct()}constructor(e,t,s,n){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"updateConversation",void 0),(0,i._)(this,"permissionRequest",void 0),(0,i._)(this,"settingsButton",void 0),(0,i._)(this,"content",void 0),this.state=t,this.options=s,this.updateConversation=n,this.permissionRequest=null,this.settingsButton=null}}(0,n.__decorate)([(0,u.hook)("ready")],m.prototype,"afterRender",null),(0,n.__decorate)([(0,u.watch)(["state.currentView","state.currentConversation"])],m.prototype,"__onChangeView",null),(0,n.__decorate)([(0,u.watch)("state.currentConversation")],m.prototype,"onChangeCurrentConversation",null),(0,n.__decorate)([(0,u.watch)("state.conversations")],m.prototype,"onChangeConversations",null),(0,n.__decorate)([(0,u.watch)("state.selectionContexts")],m.prototype,"onChangeSelectionContexts",null),(0,n.__decorate)([(0,u.watch)("state.isLoading")],m.prototype,"onChangeLoading",null),(0,n.__decorate)([(0,u.watch)("state.pendingToolCalls")],m.prototype,"onChangePendingToolCalls",null),m=(0,n.__decorate)([u.component],m)},52826:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="readSelection",n="Get information about the current selection including HTML content and optional context",r=[{name:"contextCharsBefore",type:"number",description:"Number of characters to include before the selection",required:!1,default:0},{name:"contextCharsAfter",type:"number",description:"Number of characters to include after the selection",required:!1,default:0}],a=!1},53014:function(e,t,s){"use strict";s.d(t,{applyTheme:function(){return r}});let i=["jodit_theme_dark","jodit-ai-assistant-pro_theme_dark","jodit-dialog_theme_dark"],n=["jodit_theme_light","jodit-ai-assistant-pro_theme_light","jodit-dialog_theme_light"];function r(e,t,s,r,a){let o;if(null==r||r.classList.remove(...i),null==r||r.classList.remove(...n),"dialog"===s){let e=null==a?void 0:a.container;null==e||e.classList.remove(...i),null==e||e.classList.remove(...n)}if(o="dark"===t?i:n,null==r||r.classList.add(...o),"dialog"===s){let e=null==a?void 0:a.container;null==e||e.classList.add(...o)}}},53835:function(e,t,s){"use strict";s.d(t,{BUILT_IN_TOOLS:function(){return d},getToolNames:function(){return p}});var i=s(39296),n=s(16745),r=s(78717),a=s(5618),o=s(90991),l=s(2020),c=s(12570),h=s(95323),u=s(97603);let d={readDocument:a.default,readBlocks:r.default,readSelection:o.default,writeDocument:u.default,replaceSelection:h.default,replaceBlock:l.default,replaceInDocument:c.default,insertHTML:n.default,applyFormat:i.default};function p(){return Object.keys(d)}},54747:function(e,t,s){"use strict";s.d(t,{UIResize:function(){return r}});var i=s(2748),n=s(41180);class r{static remove(e){e.container.classList.remove("jodit-ui-resize"),i.Dom.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))}static install(e,t,s={}){var i;e.container.classList.add("jodit-ui-resize"),"static"===(0,n.css)(e.container,"position")&&(0,n.css)(e.container,"position","relative");let r=e.j.c.div("jodit-ui-resize__handle");r.classList.add("jodit-ui-resize__handle_type_"+t),s.handleClassName&&r.classList.add(s.handleClassName),e.container.appendChild(r),e.j.e.on(r,"mousedown touchstart",this.onStartResize.bind(this,e,t,null!=(i=s.onResize)?i:()=>void 0))}static onStartResize(e,t,s,i){let n={x:i.clientX,y:i.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t},r=e.j.async.throttle(this.onResize.bind(this,e,n,s),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",r).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,r))}static onResize(e,t,s,i){let r,a=["left","right"].includes(t.direction),o=e.container.parentElement;o&&(r=a?t.w+(i.clientX-t.x)*("right"===t.direction?1:-1):t.h+(i.clientY-t.y)*("top"===t.direction?-1:1),!0!==(null==s?void 0:s({newSize:r}))&&(0,n.css)(e.container,a?"width":"height",r/(a?o.offsetWidth:o.offsetHeight)*100+"%"))}static onEndResize(e,t,s){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()}}},55487:function(e,t,s){"use strict";s.d(t,{ToolRegistry:function(){return r}});var i=s(82749),n=s(53835);class r{registerBuiltInTools(e){e.forEach(e=>{let t=n.BUILT_IN_TOOLS[e];t&&this.tools.set(e,t)})}registerCustomTools(e){e.forEach(e=>{this.validateToolDefinition(e),this.tools.set(e.name,e)})}validateToolDefinition(e){if(!e.name||"string"!=typeof e.name)throw Error("Tool must have a valid name");if(!e.description||"string"!=typeof e.description)throw Error(`Tool "${e.name}" must have a description`);if(!Array.isArray(e.parameters))throw Error(`Tool "${e.name}" must have a parameters array`);if("function"!=typeof e.execute)throw Error(`Tool "${e.name}" must have an execute function`);e.parameters.forEach(t=>{if(!t.name||"string"!=typeof t.name)throw Error(`Tool "${e.name}" has a parameter without a valid name`);if(!t.type)throw Error(`Tool "${e.name}" parameter "${t.name}" must have a type`);if("boolean"!=typeof t.required)throw Error(`Tool "${e.name}" parameter "${t.name}" must specify if it's required`)})}getAllTools(){return Array.from(this.tools.values())}getTool(e){return this.tools.get(e)}hasTool(e){return this.tools.has(e)}getToolNames(){return Array.from(this.tools.keys())}async executeTool(e,t,s){let i=this.getTool(e);if(!i)throw Error(`Tool "${e}" not found`);let n=this.applyDefaults(i,t);this.validateArguments(i,n);try{return await i.execute(this.jodit,n,s)}catch(e){if((null==e?void 0:e.name)==="AbortError"||s.aborted)throw Error("Tool execution was aborted");throw e}}validateArguments(e,t){let s=Object.keys(t);for(let t of e.parameters.filter(e=>e.required).map(e=>e.name))if(!s.includes(t))throw Error(`Tool "${e.name}" requires parameter "${t}"`);for(let[s,i]of Object.entries(t)){let t=e.parameters.find(e=>e.name===s);if(!t){this.jodit.o.aiAssistantPro.debug;continue}let n=Array.isArray(i)?"array":"object"==typeof i&&null!=i?"object":typeof i;if(t.type!==n&&!("number"===t.type&&"string"===n&&!isNaN(Number(i))))throw Error(`Tool "${e.name}" parameter "${s}" expects type "${t.type}" but got "${n}"`);if(t.enum&&t.enum.length>0&&!t.enum.includes(i))throw Error(`Tool "${e.name}" parameter "${s}" must be one of: ${t.enum.join(", ")}`)}}applyDefaults(e,t){let s={...t};for(let t of e.parameters)void 0===s[t.name]&&void 0!==t.default&&(s[t.name]=t.default);return s}destruct(){this.tools.clear()}constructor(e){(0,i._)(this,"jodit",void 0),(0,i._)(this,"tools",void 0),this.jodit=e,this.tools=new Map,this.registerBuiltInTools(e.o.aiAssistantPro.enabledTools||[]),this.registerCustomTools(e.o.aiAssistantPro.customTools||[])}}},55790:function(e){e.exports={"AI Assistant":"AI Ассистент","AI Assistant Pro":"AI Ассистент Pro","Welcome to AI Assistant":"Добро пожаловать в AI Ассистент","Start your first conversation":"Начните первый диалог","Tip: Select text in editor to add context":"Подсказка: Выделите текст в редакторе для добавления контекста","New chat":"Новый чат","Search conversations...":"Поиск диалогов...","No conversations yet":"Пока нет диалогов","Ask me anything...":"Спросите меня о чем угодно...","Ask a follow-up...":"Задайте дополнительный вопрос...","Reply...":"Ответить...","Type your message...":"Введите ваше сообщение...",Send:"Отправить",Cancel:"Отмена",Retry:"Повторить",Insert:"Вставить",Copy:"Копировать",Edit:"Редактировать",Delete:"Удалить",New:"Новый",Back:"Назад","Permission Required":"Требуется разрешение",Approve:"Разрешить",Deny:"Отклонить",Once:"Один раз","This conversation":"Этот диалог",Always:"Всегда","The AI wants to execute:":"AI хочет выполнить:","This will modify your document content.":"Это изменит содержимое вашего документа.","Executing...":"Выполняется...","Completed successfully":"Успешно выполнено",Failed:"Ошибка","Pending approval":"Ожидает разрешения","Denied by user":"Отклонено пользователем","Tool Result":"Результат инструмента","Tool Execution Error":"Ошибка выполнения инструмента",Context:"Контекст",Contexts:"Контексты","Add to AI Context":"Добавить в контекст AI",Remove:"Удалить","Clear all":"Очистить все","An error occurred":"Произошла ошибка","Request failed":"Запрос не выполнен","Connection error":"Ошибка соединения","AI Assistant is not configured":"AI Ассистент не настроен","Thinking...":"Думаю...","Generating response...":"Генерирую ответ...",insertHTML:"Вставить HTML",readDocument:"Прочитать документ",readBlock:"Прочитать блок",replaceInDocument:"Заменить в документе",replaceInBlock:"Заменить в блоке",getSelection:"Получить выделение","Just now":"Только что",Conversation:"Диалог","New Conversation":"Новый диалог",Yesterday:"Вчера","Delete conversation":"Удалить диалог","Are you sure you want to delete this conversation?":"Вы уверены, что хотите удалить этот диалог?","Failed to delete conversation":"Не удалось удалить диалог",Settings:"Настройки","General Settings":"Общие настройки","Conversation Settings":"Настройки диалога","Display Mode":"Режим отображения","Panel Width":"Ширина панели",Theme:"Тема",Model:"Модель",Temperature:"Температура",Close:"Закрыть",Dialog:"Модальное окно",Left:"Левая панель",Right:"Правая панель",Top:"Верхняя панель",Bottom:"Нижняя панель",Inherit:"Наследовать от редактора",Light:"Светлая тема",Dark:"Тёмная тема","%dm ago":"%dм назад","%dh ago":"%dч назад"}},55885:function(e,t,s){"use strict";s.d(t,{UIWelcomeScreen:function(){return a}});var i=s(31635),n=s(65478),r=s(67510);class a extends r.UIElement{className(){return"UIWelcomeScreen"}render(){return`<div class="&__container">
21
+ </div>`}addResize(){}afterRender(){this.content=this.getElm("content"),this.createComponents(),this.createHeaderButtons(),this.__updateView("welcome")}async __onChangeView(){this.__updateView(this.state.currentView,this.state.currentConversation)}createComponents(){this.welcomeScreen=new h.UIWelcomeScreen(this.j),this.conversationList=new r.UIConversationList(this.j,this.options),this.messageList=new o.UIMessageList(this.j,this.options),this.inputArea=new a.UIInputArea(this.j,this.options),this.getElm("footer").appendChild(this.inputArea.container)}createHeaderButtons(){let e=this.getElm("header-left"),t=this.getElm("header-right"),s=new g.UIButton(this.j,{icon:{name:"angle-left"},size:"small",variant:"initial"});s.container.classList.add(this.getFullElName("back-button")),this.j.e.on(s,"click",()=>{this.j.e.fire("backToList.ai-assistant-pro")}),e.appendChild(s.container);let i=new g.UIButton(this.j,{icon:{name:"plus"},size:"small",tooltip:"New chat",variant:"initial"});if(i.container.classList.add(this.getFullElName("new-button")),this.j.e.on(i,"click",()=>{this.j.e.fire("newConversation.ai-assistant-pro")}),t.appendChild(i.container),this.shouldShowSettings()&&(this.settingsButton=new c.UISettingsButton(this.j,this.state,this.options,()=>this.state.currentConversation,this.updateConversation),this.settingsButton.container.classList.add(this.getFullElName("settings-button")),t.appendChild(this.settingsButton.container)),"dialog"===this.mods.displayMode||!1===this.mods.allowClose)return;let n=new g.UIButton(this.j,{icon:{name:"cancel"},size:"small",tooltip:"Close",variant:"initial"});n.container.classList.add(this.getFullElName("close-button")),this.j.e.on(n,"click",()=>{this.j.e.fire("closeAIAssistantPro.ai-assistant-pro")}),t.appendChild(n.container)}isFlightMode(){return"flight"===this.mods.displayMode}shouldShowSettings(){let e=this.options,t=e.allowEditDisplayMode||e.allowEditPanelWidth,s=e.allowEditDialogSettings;return t||s}__updateView(e,t=null){var s;null==(s=this.settingsButton)||s.update();let i=this.getElm("header-title");this.setMod("view",e);let n=this.isFlightMode();switch(e){case"welcome":i.textContent=this.j.i18n("AI Assistant"),d.Dom.safeRemove(this.conversationList.container),d.Dom.safeRemove(this.messageList.container),this.content.appendChild(this.welcomeScreen.container),this.inputArea.focus();break;case"conversationList":i.textContent=this.j.i18n("AI Assistant"),d.Dom.safeRemove(this.welcomeScreen.container),d.Dom.safeRemove(this.messageList.container),this.conversationList.container.isConnected||this.content.appendChild(this.conversationList.container);break;case"conversation":i.textContent=n?this.j.i18n("AI Assistant"):(null==t?void 0:t.title)||this.j.i18n("Conversation"),d.Dom.safeRemove(this.welcomeScreen.container),d.Dom.safeRemove(this.conversationList.container),this.messageList.container.isConnected||this.content.appendChild(this.messageList.container),t&&this.messageList.setMessages(t.messages),this.inputArea.focus()}}onChangeCurrentConversation(){let{currentConversation:e}=this.state;e&&(this.conversationList.setActiveConversation(e.id),this.messageList.setMessages(e.messages))}onChangeConversations(){this.conversationList.setConversations(this.state.conversations)}onChangeSelectionContexts(){this.inputArea.setContexts(this.state.selectionContexts)}onChangeLoading(){this.inputArea.setLoading(this.state.isLoading)}onChangePendingToolCalls(){this.state.pendingToolCalls&&this.state.pendingToolCalls.length>0?this.showPermissionRequest(this.state.pendingToolCalls[0]):this.hidePermissionRequest()}showPermissionRequest(e){this.permissionRequest||(this.permissionRequest=new l.UIPermissionRequest(this.j,this.options)),this.permissionRequest.setToolCall(e);let t=this.getElm("footer");t.contains(this.permissionRequest.container)||t.insertBefore(this.permissionRequest.container,this.inputArea.container)}hidePermissionRequest(){this.permissionRequest&&this.permissionRequest.container.parentNode&&this.permissionRequest.container.parentNode.removeChild(this.permissionRequest.container)}destruct(){var e,t,s,i,n,r;null==(e=this.welcomeScreen)||e.destruct(),null==(t=this.conversationList)||t.destruct(),null==(s=this.messageList)||s.destruct(),null==(i=this.inputArea)||i.destruct(),null==(n=this.permissionRequest)||n.destruct(),null==(r=this.settingsButton)||r.destruct(),super.destruct()}constructor(e,t,s,n){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"updateConversation",void 0),(0,i._)(this,"permissionRequest",void 0),(0,i._)(this,"settingsButton",void 0),(0,i._)(this,"content",void 0),this.state=t,this.options=s,this.updateConversation=n,this.permissionRequest=null,this.settingsButton=null}}(0,n.__decorate)([(0,u.hook)("ready")],m.prototype,"afterRender",null),(0,n.__decorate)([(0,u.watch)(["state.currentView","state.currentConversation"])],m.prototype,"__onChangeView",null),(0,n.__decorate)([(0,u.watch)("state.currentConversation")],m.prototype,"onChangeCurrentConversation",null),(0,n.__decorate)([(0,u.watch)("state.conversations")],m.prototype,"onChangeConversations",null),(0,n.__decorate)([(0,u.watch)("state.selectionContexts")],m.prototype,"onChangeSelectionContexts",null),(0,n.__decorate)([(0,u.watch)("state.isLoading")],m.prototype,"onChangeLoading",null),(0,n.__decorate)([(0,u.watch)("state.pendingToolCalls")],m.prototype,"onChangePendingToolCalls",null),m=(0,n.__decorate)([u.component],m)},51359:function(e,t,s){"use strict";s.d(t,{UIMessageListItem:function(){return u}});var i=s(82749),n=s(31635),r=s(81835),a=s(65478),o=s(67510),l=s(62843),c=s(62405),h=s(80870);class u extends o.UIElement{className(){return"UIMessageListItem"}render(){return`<div class="${this.getFullElName("message")}"></div>`}onReady(){this.updateContent(),this.contextMenu=new h.ContextMenu(this.j)}updateContent(){let e=this.container;e.innerHTML="",e.setAttribute("data-message-id",this.message.id),e.setAttribute("data-role",this.message.role);let t=this.j.c.div(this.getFullElName("message-bubble"));t.classList.add(this.getFullElName("message-bubble",this.message.role,!0));let s=this.j.c.div(this.getFullElName("message-content"));if(s.innerHTML=this.formatMessageContent(this.message.content),t.appendChild(s),this.opts.showTimestamps){let e=this.j.c.div(this.getFullElName("message-timestamp"));e.textContent=this.formatTimestamp(this.message.timestamp),t.appendChild(e)}let i=this.j.c.div(this.getFullElName("message-actions"));if(this.renderActionsButton(i),t.appendChild(i),e.appendChild(t),this.message.toolCalls&&this.message.toolCalls.length>0){let t=this.j.c.div(this.getFullElName("tool-calls"));e.appendChild(t),this.message.toolCalls.forEach(e=>{let s=this.createToolCallElement(e);t.appendChild(s)})}this.message.artifacts&&this.message.artifacts.length>0&&this.renderArtifacts()}renderActionsButton(e){let t=this.opts;(t.showCopyMessageAction||t.showRestartMessageAction||t.showEditMessageAction||t.showDeleteMessageAction)&&(this.actionsButton=new l.UIButton(this.j,{icon:{name:"dots"},tooltip:"Message actions",name:"messageActions",size:"tiny"}),this.actionsButton.onAction(e=>{this.showActionsMenu(e)}),e.appendChild(this.actionsButton.container))}showActionsMenu(e){if(!this.contextMenu||!this.actionsButton)return;let t=this.j,s=t.o.aiAssistantPro,i=[];s.showCopyMessageAction&&i.push({title:"Copy message",icon:"copy",exec:()=>{this.j.e.fire("copyMessage.ai-assistant-pro",this.message.id)}}),"user"===this.message.role&&(s.showRestartMessageAction&&i.push({title:"Restart from here",icon:"update",exec:()=>{this.j.e.fire("restartFromMessage.ai-assistant-pro",this.message.id)}}),s.showEditMessageAction&&i.push({title:"Edit message",icon:"pencil",exec:()=>{this.j.e.fire("editMessage.ai-assistant-pro",this.message.id)}})),s.showDeleteMessageAction&&i.push({title:"Delete message",icon:"bin",exec:()=>{t.confirm("Are you sure you want to delete this message?","Delete message",e=>{e&&this.j.e.fire("deleteMessage.ai-assistant-pro",this.message.id)})}});let n=this.actionsButton.container.getBoundingClientRect();this.contextMenu.show(n.left,n.bottom,i),e.stopPropagation()}renderArtifacts(){if(!this.message.artifacts||0===this.message.artifacts.length)return;let e=this.j.c.div(this.getFullElName("artifacts"));this.container.appendChild(e),this.artifactGroup||(this.artifactGroup=new c.UIGroup(this.j),this.artifactGroup.container.className="jodit-ui-artifact-group"),this.artifactGroup.clear(),this.message.artifacts.forEach(e=>{let t=new r.UIArtifact(this.j,e);this.artifactGroup.append(t)}),e.appendChild(this.artifactGroup.container)}createToolCallElement(e){let t=this.j.c.div(this.getFullElName("tool-call"));t.setAttribute("data-tool-id",e.id),t.setAttribute("data-status",e.status);let s=this.j.c.div(this.getFullElName("tool-header")),i=this.j.c.div(this.getFullElName("tool-icon"));i.classList.add(this.getFullElName("tool-icon",e.status,!0)),i.textContent="⚡";let n=this.j.c.div(this.getFullElName("tool-name"));n.textContent=this.j.i18n(e.name);let r=this.j.c.div(this.getFullElName("tool-status"));r.textContent=this.getToolStatusText(e.status||"unknown"),s.appendChild(i),s.appendChild(n),s.appendChild(r),t.appendChild(s);let a=this.createExpandableSection("Arguments",JSON.stringify(e.arguments||{},null,2));if(t.appendChild(a),e.result){let s=e.result.error?`Error: ${e.result.error}`:e.result.result||"",i=this.createExpandableSection("Result","string"==typeof s?s:JSON.stringify(s,null,2));t.appendChild(i)}return t}createExpandableSection(e,t){let s=this.j.c.div(this.getFullElName("tool-expandable")),i=this.j.c.element("button",{type:"button",class:this.getFullElName("tool-expandable-toggle")});i.textContent=`▶ ${this.j.i18n(e)}`;let n=this.j.c.element("pre",{class:this.getFullElName("tool-expandable-content")});return n.textContent=t,n.style.display="none",this.j.e.on(i,"click",()=>{"none"!==n.style.display?(n.style.display="none",i.textContent=`▶ ${this.j.i18n(e)}`):(n.style.display="block",i.textContent=`▼ ${this.j.i18n(e)}`)}),s.appendChild(i),s.appendChild(n),s}getToolStatusText(e){return({pending:"⏳",approved:"✓",denied:"✕",executing:"⚡",executed:"✓",error:"⚠"})[e]||"●"}formatMessageContent(e){return(0,this.opts.formatMessageContent)(e,this.message.role,this.j.i18n.bind(this.j))}formatTimestamp(e){return(0,this.opts.formatTimestamp)(e,this.j.i18n.bind(this.j))}updateMessage(e){this.message=e,this.updateContent()}destruct(){var e,t,s;null==(e=this.actionsButton)||e.destruct(),null==(t=this.contextMenu)||t.destruct(),null==(s=this.artifactGroup)||s.destruct(),super.destruct()}constructor(e,t,s){super(e),(0,i._)(this,"message",void 0),(0,i._)(this,"opts",void 0),(0,i._)(this,"artifactGroup",void 0),(0,i._)(this,"actionsButton",void 0),(0,i._)(this,"contextMenu",void 0),this.message=t,this.opts=s,this.artifactGroup=null,this.actionsButton=null,this.contextMenu=null}}(0,n.__decorate)([(0,a.hook)("ready")],u.prototype,"onReady",null),u=(0,n.__decorate)([a.component],u)},52826:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="readSelection",n="Get information about the current selection including HTML content and optional context",r=[{name:"contextCharsBefore",type:"number",description:"Number of characters to include before the selection",required:!1,default:0},{name:"contextCharsAfter",type:"number",description:"Number of characters to include after the selection",required:!1,default:0}],a=!1},53014:function(e,t,s){"use strict";s.d(t,{applyTheme:function(){return r}});let i=["jodit_theme_dark","jodit-ai-assistant-pro_theme_dark","jodit-dialog_theme_dark"],n=["jodit_theme_light","jodit-ai-assistant-pro_theme_light","jodit-dialog_theme_light"];function r(e,t,s,r,a){let o;if(null==r||r.classList.remove(...i),null==r||r.classList.remove(...n),"dialog"===s){let e=null==a?void 0:a.container;null==e||e.classList.remove(...i),null==e||e.classList.remove(...n)}if(o="dark"===t?i:n,null==r||r.classList.add(...o),"dialog"===s){let e=null==a?void 0:a.container;null==e||e.classList.add(...o)}}},53835:function(e,t,s){"use strict";s.d(t,{BUILT_IN_TOOLS:function(){return d},getToolNames:function(){return p}});var i=s(39296),n=s(16745),r=s(78717),a=s(5618),o=s(90991),l=s(2020),c=s(12570),h=s(95323),u=s(97603);let d={readDocument:a.default,readBlocks:r.default,readSelection:o.default,writeDocument:u.default,replaceSelection:h.default,replaceBlock:l.default,replaceInDocument:c.default,insertHTML:n.default,applyFormat:i.default};function p(){return Object.keys(d)}},54747:function(e,t,s){"use strict";s.d(t,{UIResize:function(){return r}});var i=s(2748),n=s(41180);class r{static remove(e){e.container.classList.remove("jodit-ui-resize"),i.Dom.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))}static install(e,t,s={}){var i;e.container.classList.add("jodit-ui-resize"),"static"===(0,n.css)(e.container,"position")&&(0,n.css)(e.container,"position","relative");let r=e.j.c.div("jodit-ui-resize__handle");r.classList.add("jodit-ui-resize__handle_type_"+t),s.handleClassName&&r.classList.add(s.handleClassName),e.container.appendChild(r),e.j.e.on(r,"mousedown touchstart",this.onStartResize.bind(this,e,t,null!=(i=s.onResize)?i:()=>void 0))}static onStartResize(e,t,s,i){let n={x:i.clientX,y:i.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t},r=e.j.async.throttle(this.onResize.bind(this,e,n,s),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",r).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,r))}static onResize(e,t,s,i){let r,a=["left","right"].includes(t.direction),o=e.container.parentElement;o&&(r=a?t.w+(i.clientX-t.x)*("right"===t.direction?1:-1):t.h+(i.clientY-t.y)*("top"===t.direction?-1:1),!0!==(null==s?void 0:s({newSize:r}))&&(0,n.css)(e.container,a?"width":"height",r/(a?o.offsetWidth:o.offsetHeight)*100+"%"))}static onEndResize(e,t,s){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()}}},55487:function(e,t,s){"use strict";s.d(t,{ToolRegistry:function(){return r}});var i=s(82749),n=s(53835);class r{registerBuiltInTools(e){e.forEach(e=>{let t=n.BUILT_IN_TOOLS[e];t&&this.tools.set(e,t)})}registerCustomTools(e){e.forEach(e=>{this.validateToolDefinition(e),this.tools.set(e.name,e)})}validateToolDefinition(e){if(!e.name||"string"!=typeof e.name)throw Error("Tool must have a valid name");if(!e.description||"string"!=typeof e.description)throw Error(`Tool "${e.name}" must have a description`);if(!Array.isArray(e.parameters))throw Error(`Tool "${e.name}" must have a parameters array`);if("function"!=typeof e.execute)throw Error(`Tool "${e.name}" must have an execute function`);e.parameters.forEach(t=>{if(!t.name||"string"!=typeof t.name)throw Error(`Tool "${e.name}" has a parameter without a valid name`);if(!t.type)throw Error(`Tool "${e.name}" parameter "${t.name}" must have a type`);if("boolean"!=typeof t.required)throw Error(`Tool "${e.name}" parameter "${t.name}" must specify if it's required`)})}getAllTools(){return Array.from(this.tools.values())}getTool(e){return this.tools.get(e)}hasTool(e){return this.tools.has(e)}getToolNames(){return Array.from(this.tools.keys())}async executeTool(e,t,s){let i=this.getTool(e);if(!i)throw Error(`Tool "${e}" not found`);let n=this.applyDefaults(i,t);this.validateArguments(i,n);try{return await i.execute(this.jodit,n,s)}catch(e){if((null==e?void 0:e.name)==="AbortError"||s.aborted)throw Error("Tool execution was aborted");throw e}}validateArguments(e,t){let s=Object.keys(t);for(let t of e.parameters.filter(e=>e.required).map(e=>e.name))if(!s.includes(t))throw Error(`Tool "${e.name}" requires parameter "${t}"`);for(let[s,i]of Object.entries(t)){let t=e.parameters.find(e=>e.name===s);if(!t){this.jodit.o.aiAssistantPro.debug;continue}let n=Array.isArray(i)?"array":"object"==typeof i&&null!=i?"object":typeof i;if(t.type!==n&&!("number"===t.type&&"string"===n&&!isNaN(Number(i))))throw Error(`Tool "${e.name}" parameter "${s}" expects type "${t.type}" but got "${n}"`);if(t.enum&&t.enum.length>0&&!t.enum.includes(i))throw Error(`Tool "${e.name}" parameter "${s}" must be one of: ${t.enum.join(", ")}`)}}applyDefaults(e,t){let s={...t};for(let t of e.parameters)void 0===s[t.name]&&void 0!==t.default&&(s[t.name]=t.default);return s}destruct(){this.tools.clear()}constructor(e){(0,i._)(this,"jodit",void 0),(0,i._)(this,"tools",void 0),this.jodit=e,this.tools=new Map,this.registerBuiltInTools(e.o.aiAssistantPro.enabledTools||[]),this.registerCustomTools(e.o.aiAssistantPro.customTools||[])}}},55790:function(e){e.exports={"AI Assistant":"AI Ассистент","AI Assistant Pro":"AI Ассистент Pro","Welcome to AI Assistant":"Добро пожаловать в AI Ассистент","Start your first conversation":"Начните первый диалог","Tip: Select text in editor to add context":"Подсказка: Выделите текст в редакторе для добавления контекста","New chat":"Новый чат","Search conversations...":"Поиск диалогов...","No conversations yet":"Пока нет диалогов","Ask me anything...":"Спросите меня о чем угодно...","Ask a follow-up...":"Задайте дополнительный вопрос...","Reply...":"Ответить...","Type your message...":"Введите ваше сообщение...",Send:"Отправить",Cancel:"Отмена",Retry:"Повторить",Insert:"Вставить",Copy:"Копировать",Edit:"Редактировать",Delete:"Удалить",New:"Новый",Back:"Назад","Permission Required":"Требуется разрешение",Approve:"Разрешить",Deny:"Отклонить",Once:"Один раз","This conversation":"Этот диалог",Always:"Всегда","The AI wants to execute:":"AI хочет выполнить:","This will modify your document content.":"Это изменит содержимое вашего документа.","Executing...":"Выполняется...","Completed successfully":"Успешно выполнено",Failed:"Ошибка","Pending approval":"Ожидает разрешения","Denied by user":"Отклонено пользователем","Tool Result":"Результат инструмента","Tool Execution Error":"Ошибка выполнения инструмента",Context:"Контекст",Contexts:"Контексты","Add to AI Context":"Добавить в контекст AI",Remove:"Удалить","Clear all":"Очистить все","An error occurred":"Произошла ошибка","Request failed":"Запрос не выполнен","Connection error":"Ошибка соединения","AI Assistant is not configured":"AI Ассистент не настроен","Thinking...":"Думаю...","Generating response...":"Генерирую ответ...",insertHTML:"Вставить HTML",readDocument:"Прочитать документ",readBlock:"Прочитать блок",replaceInDocument:"Заменить в документе",replaceInBlock:"Заменить в блоке",getSelection:"Получить выделение","Just now":"Только что",Conversation:"Диалог","New Conversation":"Новый диалог",Yesterday:"Вчера","Delete conversation":"Удалить диалог","Are you sure you want to delete this conversation?":"Вы уверены, что хотите удалить этот диалог?","Failed to delete conversation":"Не удалось удалить диалог",Settings:"Настройки","General Settings":"Общие настройки","Conversation Settings":"Настройки диалога","Display Mode":"Режим отображения","Panel Width":"Ширина панели",Theme:"Тема",Model:"Модель",Temperature:"Температура",Close:"Закрыть",Dialog:"Модальное окно",Left:"Левая панель",Right:"Правая панель",Top:"Верхняя панель",Bottom:"Нижняя панель",Inherit:"Наследовать от редактора",Light:"Светлая тема",Dark:"Тёмная тема","%dm ago":"%dм назад","%dh ago":"%dч назад"}},55885:function(e,t,s){"use strict";s.d(t,{UIWelcomeScreen:function(){return a}});var i=s(31635),n=s(65478),r=s(67510);class a extends r.UIElement{className(){return"UIWelcomeScreen"}render(){return`<div class="&__container">
22
22
  <div class="&__icon">
23
23
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
24
24
  <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"/>
@@ -45,7 +45,7 @@ ${r}`.trim();s?await this.__executeQuickCommandSilent(l,r):await this.__executeQ
45
45
  </div>
46
46
  <div class="&__list"></div>
47
47
  </div>`}afterRender(){this.createControls(),this.listContainer=this.getElm("list")}appendChildToContainer(e){this.listContainer&&this.listContainer.appendChild(e)}createControls(){let e=this.getElm("search");this.searchInput=new l.UIInput(this.j,{name:"search",placeholder:"Search conversations...",icon:"search",clearButton:!0}),this.j.e.on(this.searchInput.nativeInput,"input",this.onSearch),e.appendChild(this.searchInput.container)}setConversations(e){this.buildList(e)}setActiveConversation(e){this.activeConversationId=e,this.elements.forEach(t=>{t.setActive(t.conversation.id===e)})}onSearch(){let e=this.searchInput.value.trim();this.j.e.fire("searchConversations.ai-assistant-pro",e)}buildList(e){let t=this.elements.map(e=>e.conversation),s=r.ListReconciler.reconcile(t,e,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.updated===t.updated,preserveOrder:!0});s.toRemove.forEach(e=>{let t=this.conversationItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.conversationItems.delete(e.id))}),s.toUpdate.forEach(({newItem:e,index:t})=>{let s=this.conversationItems.get(e.id);if(s){let i=e.id===this.activeConversationId;s.setActive(i),this.elements.indexOf(s)!==t&&t<this.elements.length&&(this.remove(s),this.append(s,t))}}),s.toCreate.forEach(t=>{let s=t.id===this.activeConversationId,i=new a.UIConversationListItem(this.j,t,s,this.opts);this.conversationItems.set(t.id,i);let n=e.indexOf(t);this.append(i,n)}),s.unchanged.forEach(e=>{let t=this.conversationItems.get(e.id);if(t){let s=e.id===this.activeConversationId;t.setActive(s)}})}setLoading(e){this.setMod("loading",e)}setParentView(e){var t;return null==(t=this.searchInput)||t.setParentView(e),super.setParentView(e)}destruct(){var e;null==(e=this.searchInput)||e.destruct(),super.destruct()}constructor(e,t){super(e),(0,i._)(this,"opts",void 0),(0,i._)(this,"searchInput",void 0),(0,i._)(this,"activeConversationId",void 0),(0,i._)(this,"listContainer",void 0),(0,i._)(this,"conversationItems",void 0),this.opts=t,this.searchInput=null,this.activeConversationId=null,this.conversationItems=new Map}}(0,n.__decorate)([(0,o.hook)("ready")],h.prototype,"afterRender",null),(0,n.__decorate)([(0,o.debounce)()],h.prototype,"onSearch",null),h=(0,n.__decorate)([o.component],h)},70308:function(e,t,s){"use strict";s.d(t,{areAllToolCallsExecuted:function(){return a},createNewConversation:function(){return n},findParentMessageId:function(){return r}});var i=s(21064);function n(e,t,s,r=[]){let a=e.o.aiAssistantPro,o={id:(0,i.generateConversationId)(),created:Date.now(),updated:Date.now(),messages:r,permissions:[],options:{model:null!=t?t:a.defaultModel,temperature:null!=s?s:a.defaultTemperature}};return e.e.fire("conversationCreated.ai-assistant-pro",o),o}function r(e){for(let t=e.messages.length-1;t>=0;t--){let s=e.messages[t];if("assistant"===s.role&&!s.id.startsWith("error_"))return s.id}return null}function a(e){let t=e.messages[e.messages.length-1];return!!(null==t?void 0:t.toolCalls)&&t.toolCalls.every(e=>"executed"===e.status||"denied"===e.status||"error"===e.status)}},70750:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="replaceSelection",n="Replace the current selection with new HTML content",r=[{name:"html",type:"string",description:"HTML content to insert in place of the selection",required:!0},{name:"collapseToEnd",type:"boolean",description:"Move cursor to the end of the inserted content",required:!1,default:!0}],a=!0},71050:function(e,t,s){"use strict";function i(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top"}}function n(e,t,s,n){var r,a,o;"dialog"!==t&&"flight"!==t&&(("left"===t||"right"===t)&&(null==(a=e.currentPlace.slots[i(t)])||a.style.setProperty(`--jd-slot-${i(t)}-width`,"auto"),null==(o=e.currentPlace.slots[t])||o.style.setProperty(`--jd-slot-${t}-width`,`${s}px`)),null==(r=e.currentPlace.slots[t])||r.style.setProperty("min-height",`${n}px`))}s.d(t,{invertMode:function(){return i},resizeInPanelView:function(){return n}})},71102:function(e,t,s){"use strict";s.d(t,{UIGlobalSettings:function(){return c}});var i=s(82749),n=s(31635),r=s(65478),a=s(67510),o=s(80256),l=s(12234);class c extends a.UIElement{className(){return"UIGlobalSettings"}setParentView(e){var t,s,i;return null==(t=this.displayModeSelect)||t.setParentView(e),null==(s=this.panelWidthInput)||s.setParentView(e),null==(i=this.themeSelect)||i.setParentView(e),super.setParentView(e)}async build(){var e,t,s,i,n,r;let a=this.container;this.options.allowEditDisplayMode&&(this.displayModeSelect=new l.UISelect(this.j,{label:"Display Mode",name:"displayMode",value:null!=(e=null==(t=this.state)?void 0:t.displayMode)?e:"right",options:[{text:"Dialog",value:"dialog"},{text:"Flight",value:"flight"},{text:"Left",value:"left"},{text:"Right",value:"right"},{text:"Top",value:"top"},{text:"Bottom",value:"bottom"}],onChange:()=>{this.onDisplayModeChange()}}),a.appendChild(this.displayModeSelect.container)),this.options.allowEditPanelWidth&&(this.panelWidthInput=new o.UIInput(this.j,{label:"Panel Width",name:"panelWidth",type:"number",value:String(null!=(s=null==(i=this.state)?void 0:i.panelWidth)?s:400),onChange:()=>{this.onPanelWidthChange()}}),this.panelWidthInput.nativeInput.setAttribute("min","200"),this.panelWidthInput.nativeInput.setAttribute("max","800"),this.panelWidthInput.nativeInput.setAttribute("step","10"),a.appendChild(this.panelWidthInput.container)),this.options.allowEditTheme&&(this.themeSelect=new l.UISelect(this.j,{label:"Theme",name:"theme",value:null!=(n=null==(r=this.state)?void 0:r.theme)?n:"parent",options:[{text:"Inherit",value:"parent"},{text:"Light",value:"light"},{text:"Dark",value:"dark"}],onChange:()=>{this.onThemeChange()}}),a.appendChild(this.themeSelect.container))}async onDisplayModeChange(){this.displayModeSelect&&(this.state.displayMode=this.displayModeSelect.value,this.j.async.setTimeout(async()=>{this.j.e.fire("closeAIAssistantPro.ai-assistant-pro"),await this.j.async.requestIdlePromise(),this.j.e.fire("openAIAssistantPro.ai-assistant-pro")},100))}async onPanelWidthChange(){if(!this.panelWidthInput)return;let e=parseInt(this.panelWidthInput.value,10);isNaN(e)||e<200||e>800||(this.state.panelWidth=e)}async onThemeChange(){this.themeSelect&&(this.state.theme=this.themeSelect.value)}destruct(){var e,t,s;null==(e=this.displayModeSelect)||e.destruct(),null==(t=this.panelWidthInput)||t.destruct(),null==(s=this.themeSelect)||s.destruct(),super.destruct()}onStateDisplayModeChange(){this.displayModeSelect&&(this.displayModeSelect.value=this.state.displayMode)}onStatePanelWidthChange(){this.panelWidthInput&&this.panelWidthInput.value!==String(this.state.panelWidth)&&(this.panelWidthInput.value=String(this.state.panelWidth))}onStateThemeChange(){this.themeSelect&&(this.themeSelect.value=this.state.theme)}constructor(e,t,s){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"displayModeSelect",void 0),(0,i._)(this,"panelWidthInput",void 0),(0,i._)(this,"themeSelect",void 0),this.state=t,this.options=s,this.displayModeSelect=null,this.panelWidthInput=null,this.themeSelect=null,this.build()}}(0,n.__decorate)([(0,r.watch)("state.displayMode")],c.prototype,"onStateDisplayModeChange",null),(0,n.__decorate)([(0,r.watch)("state.panelWidth")],c.prototype,"onStatePanelWidthChange",null),(0,n.__decorate)([(0,r.watch)("state.theme")],c.prototype,"onStateThemeChange",null),c=(0,n.__decorate)([r.component],c)},72573:function(e,t,s){"use strict";function i(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function n(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}s.d(t,{marked:function(){return ew}});var r,a=n(),o={exec:()=>null};function l(e,t=""){let s="string"==typeof e?e:e.source,i={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(h.caret,"$1"),s=s.replace(e,n),i},getRegex:()=>new RegExp(s,t)};return i}var c=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch(e){return!1}})(),h={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},u=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d=/(?:[*+-]|\d{1,9}[.)])/,p=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,g=l(p).replace(/bull/g,d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),m=l(p).replace(/bull/g,d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),f=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,w=l(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",v).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),C=l(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,d).getRegex(),x="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,k=l("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",y).replace("tag",x).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),b=l(f).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex(),_={blockquote:l(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",b).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:w,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:u,html:k,lheading:g,list:C,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:b,table:o,text:/^[^\n]+/},S=l("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex(),I={..._,lheading:m,table:S,paragraph:l(f).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",S).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex()},A={..._,html:l("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",y).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:l(f).replace("hr",u).replace("heading",` *#{1,6} *[^
48
- ]`).replace("lheading",g).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},M=/^( {2,}|\\)\n(?!\s*$)/,T=/[\p{P}\p{S}]/u,E=/[\s\p{P}\p{S}]/u,P=/[^\s\p{P}\p{S}]/u,j=l(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,E).getRegex(),R=/(?!~)[\p{P}\p{S}]/u,L=l(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",c?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,D=l($,"u").replace(/punct/g,T).getRegex(),N=l($,"u").replace(/punct/g,R).getRegex(),B="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",q=l(B,"gu").replace(/notPunctSpace/g,P).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),z=l(B,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,R).getRegex(),F=l("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,P).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),U=l(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),O=l(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),V=l(y).replace("(?:--\x3e|$)","--\x3e").getRegex(),H=l("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",V).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,G=l(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",W).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Z=l(/^!?\[(label)\]\[(ref)\]/).replace("label",W).replace("ref",v).getRegex(),Q=l(/^!?\[(ref)\](?:\[\])?/).replace("ref",v).getRegex(),K=l("reflink|nolink(?!\\()","g").replace("reflink",Z).replace("nolink",Q).getRegex(),J=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:o,anyPunctuation:U,autolink:O,blockSkip:L,br:M,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:o,emStrongLDelim:D,emStrongRDelimAst:q,emStrongRDelimUnd:F,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:G,nolink:Q,punctuation:j,reflink:Z,reflinkSearch:K,tag:H,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:o},Y={...X,link:l(/^!?\[(label)\]\((.*?)\)/).replace("label",W).getRegex(),reflink:l(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W).getRegex()},ee={...X,emStrongRDelimAst:z,emStrongLDelim:N,url:l(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",J).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:l(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",J).getRegex()},et={...ee,br:l(M).replace("{2,}","*").getRegex(),text:l(ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},es={normal:_,gfm:I,pedantic:A},ei={normal:X,gfm:ee,breaks:et,pedantic:Y},en={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},er=e=>en[e];function ea(e,t){if(t){if(h.escapeTest.test(e))return e.replace(h.escapeReplace,er)}else if(h.escapeTestNoEncode.test(e))return e.replace(h.escapeReplaceNoEncode,er);return e}function eo(e){try{e=encodeURI(e).replace(h.percentDecode,"%")}catch(e){return null}return e}function el(e,t){var s;let i=e.replace(h.findPipe,(e,t,s)=>{let i=!1,n=t;for(;--n>=0&&"\\"===s[n];)i=!i;return i?"|":" |"}).split(h.splitPipe),n=0;if(i[0].trim()||i.shift(),!(i.length>0)||(null==(s=i.at(-1))?void 0:s.trim())||i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(h.slashPipe,"|");return i}function ec(e,t,s){let i=e.length;if(0===i)return"";let n=0;for(;n<i;){let r=e.charAt(i-n-1);if(r!==t||s)if(r!==t&&s)n++;else break;else n++}return e.slice(0,i-n)}function eh(e,t,s,i,n){let r=t.href,a=t.title||null,o=e[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:s,href:r,title:a,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,l}var eu=class{space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ec(e,`
48
+ ]`).replace("lheading",g).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},M=/^( {2,}|\\)\n(?!\s*$)/,T=/[\p{P}\p{S}]/u,E=/[\s\p{P}\p{S}]/u,P=/[^\s\p{P}\p{S}]/u,j=l(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,E).getRegex(),R=/(?!~)[\p{P}\p{S}]/u,L=l(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",c?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,D=l($,"u").replace(/punct/g,T).getRegex(),B=l($,"u").replace(/punct/g,R).getRegex(),N="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",q=l(N,"gu").replace(/notPunctSpace/g,P).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),z=l(N,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,R).getRegex(),F=l("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,P).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),U=l(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),O=l(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),V=l(y).replace("(?:--\x3e|$)","--\x3e").getRegex(),H=l("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",V).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,G=l(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",W).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Z=l(/^!?\[(label)\]\[(ref)\]/).replace("label",W).replace("ref",v).getRegex(),Q=l(/^!?\[(ref)\](?:\[\])?/).replace("ref",v).getRegex(),K=l("reflink|nolink(?!\\()","g").replace("reflink",Z).replace("nolink",Q).getRegex(),J=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:o,anyPunctuation:U,autolink:O,blockSkip:L,br:M,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:o,emStrongLDelim:D,emStrongRDelimAst:q,emStrongRDelimUnd:F,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:G,nolink:Q,punctuation:j,reflink:Z,reflinkSearch:K,tag:H,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:o},Y={...X,link:l(/^!?\[(label)\]\((.*?)\)/).replace("label",W).getRegex(),reflink:l(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W).getRegex()},ee={...X,emStrongRDelimAst:z,emStrongLDelim:B,url:l(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",J).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:l(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",J).getRegex()},et={...ee,br:l(M).replace("{2,}","*").getRegex(),text:l(ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},es={normal:_,gfm:I,pedantic:A},ei={normal:X,gfm:ee,breaks:et,pedantic:Y},en={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},er=e=>en[e];function ea(e,t){if(t){if(h.escapeTest.test(e))return e.replace(h.escapeReplace,er)}else if(h.escapeTestNoEncode.test(e))return e.replace(h.escapeReplaceNoEncode,er);return e}function eo(e){try{e=encodeURI(e).replace(h.percentDecode,"%")}catch(e){return null}return e}function el(e,t){var s;let i=e.replace(h.findPipe,(e,t,s)=>{let i=!1,n=t;for(;--n>=0&&"\\"===s[n];)i=!i;return i?"|":" |"}).split(h.splitPipe),n=0;if(i[0].trim()||i.shift(),!(i.length>0)||(null==(s=i.at(-1))?void 0:s.trim())||i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(h.slashPipe,"|");return i}function ec(e,t,s){let i=e.length;if(0===i)return"";let n=0;for(;n<i;){let r=e.charAt(i-n-1);if(r!==t||s)if(r!==t&&s)n++;else break;else n++}return e.slice(0,i-n)}function eh(e,t,s,i,n){let r=t.href,a=t.title||null,o=e[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:s,href:r,title:a,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,l}var eu=class{space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ec(e,`
49
49
  `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],s=function(e,t,s){let i=e.match(s.other.indentCodeCompensation);if(null===i)return t;let n=i[1];return t.split(`
50
50
  `).map(e=>{let t=e.match(s.other.beginningSpace);if(null===t)return e;let[i]=t;return i.length>=n.length?e.slice(n.length):e}).join(`
51
51
  `)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ec(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ec(t[0],`
@@ -102,12 +102,12 @@ ${this.parser.parse(e)}</blockquote>
102
102
  ${e}</tr>
103
103
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
104
104
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ea(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){let i=this.parser.parseInline(s),n=eo(e);if(null===n)return i;let r='<a href="'+(e=n)+'"';return t&&(r+=' title="'+ea(t)+'"'),r+=">"+i+"</a>"}image({href:e,title:t,text:s,tokens:i}){i&&(s=this.parser.parseInline(i,this.parser.textRenderer));let n=eo(e);if(null===n)return ea(s);e=n;let r=`<img src="${e}" alt="${s}"`;return t&&(r+=` title="${ea(t)}"`),r+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ea(e.text)}constructor(e){i(this,"options",void 0),i(this,"parser",void 0),this.options=e||a}},eg=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},em=class e{static parse(t,s){return new e(s).parse(t)}static parseInline(t,s){return new e(s).parseInline(t)}parse(e){let t="";for(let n=0;n<e.length;n++){var s,i;let r=e[n];if(null==(i=this.options.extensions)||null==(s=i.renderers)?void 0:s[r.type]){let e=this.options.extensions.renderers[r.type].call({parser:this},r);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){t+=e||"";continue}}switch(r.type){case"space":t+=this.renderer.space(r);break;case"hr":t+=this.renderer.hr(r);break;case"heading":t+=this.renderer.heading(r);break;case"code":t+=this.renderer.code(r);break;case"table":t+=this.renderer.table(r);break;case"blockquote":t+=this.renderer.blockquote(r);break;case"list":t+=this.renderer.list(r);break;case"checkbox":t+=this.renderer.checkbox(r);break;case"html":t+=this.renderer.html(r);break;case"def":t+=this.renderer.def(r);break;case"paragraph":t+=this.renderer.paragraph(r);break;case"text":t+=this.renderer.text(r);break;default:{let e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return"";throw Error(e)}}}return t}parseInline(e,t=this.renderer){let s="";for(let r=0;r<e.length;r++){var i,n;let a=e[r];if(null==(n=this.options.extensions)||null==(i=n.renderers)?void 0:i[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=e||"";continue}}switch(a.type){case"escape":case"text":s+=t.text(a);break;case"html":s+=t.html(a);break;case"link":s+=t.link(a);break;case"image":s+=t.image(a);break;case"checkbox":s+=t.checkbox(a);break;case"strong":s+=t.strong(a);break;case"em":s+=t.em(a);break;case"codespan":s+=t.codespan(a);break;case"br":s+=t.br(a);break;case"del":s+=t.del(a);break;default:{let e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return"";throw Error(e)}}}return s}constructor(e){i(this,"options",void 0),i(this,"renderer",void 0),i(this,"textRenderer",void 0),this.options=e||a,this.options.renderer=this.options.renderer||new ep,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new eg}},ef=(r=class{preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ed.lex:ed.lexInline}provideParser(){return this.block?em.parse:em.parseInline}constructor(e){i(this,"options",void 0),i(this,"block",void 0),this.options=e||a}},i(r,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),i(r,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),r),ev=new class{walkTokens(e,t){let s=[];for(let r of e)switch(s=s.concat(t.call(this,r)),r.type){case"table":for(let e of r.header)s=s.concat(this.walkTokens(e.tokens,t));for(let e of r.rows)for(let i of e)s=s.concat(this.walkTokens(i.tokens,t));break;case"list":s=s.concat(this.walkTokens(r.items,t));break;default:{var i,n;let e=r;(null==(n=this.defaults.extensions)||null==(i=n.childTokens)?void 0:i[e.type])?this.defaults.extensions.childTokens[e.type].forEach(i=>{let n=e[i].flat(1/0);s=s.concat(this.walkTokens(n,t))}):e.tokens&&(s=s.concat(this.walkTokens(e.tokens,t)))}}return s}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let s={...e};if(s.async=this.defaults.async||s.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let s=t.renderers[e.name];s?t.renderers[e.name]=function(...t){let i=e.renderer.apply(this,t);return!1===i&&(i=s.apply(this,t)),i}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let s=t[e.level];s?s.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),s.extensions=t),e.renderer){let t=this.defaults.renderer||new ep(this.defaults);for(let s in e.renderer){if(!(s in t))throw Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let i=e.renderer[s],n=t[s];t[s]=(...e)=>{let s=i.apply(t,e);return!1===s&&(s=n.apply(t,e)),s||""}}s.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new eu(this.defaults);for(let s in e.tokenizer){if(!(s in t))throw Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let i=e.tokenizer[s],n=t[s];t[s]=(...e)=>{let s=i.apply(t,e);return!1===s&&(s=n.apply(t,e)),s}}s.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ef;for(let s in e.hooks){if(!(s in t))throw Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let i=e.hooks[s],n=t[s];ef.passThroughHooks.has(s)?t[s]=e=>{if(this.defaults.async&&ef.passThroughHooksRespectAsync.has(s))return(async()=>{let s=await i.call(t,e);return n.call(t,s)})();let r=i.call(t,e);return n.call(t,r)}:t[s]=(...e)=>{if(this.defaults.async)return(async()=>{let s=await i.apply(t,e);return!1===s&&(s=await n.apply(t,e)),s})();let s=i.apply(t,e);return!1===s&&(s=n.apply(t,e)),s}}s.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,i=e.walkTokens;s.walkTokens=function(e){let s=[];return s.push(i.call(this,e)),t&&(s=s.concat(t.call(this,e))),s}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ed.lex(e,null!=t?t:this.defaults)}parser(e,t){return em.parse(e,null!=t?t:this.defaults)}parseMarkdown(e){return(t,s)=>{let i={...s},n={...this.defaults,...i},r=this.onError(!!n.silent,!!n.async);if(!0===this.defaults.async&&!1===i.async)return r(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return r(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return r(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=e),n.async)return(async()=>{let s=n.hooks?await n.hooks.preprocess(t):t,i=await (n.hooks?await n.hooks.provideLexer():e?ed.lex:ed.lexInline)(s,n),r=n.hooks?await n.hooks.processAllTokens(i):i;n.walkTokens&&await Promise.all(this.walkTokens(r,n.walkTokens));let a=await (n.hooks?await n.hooks.provideParser():e?em.parse:em.parseInline)(r,n);return n.hooks?await n.hooks.postprocess(a):a})().catch(r);try{n.hooks&&(t=n.hooks.preprocess(t));let s=(n.hooks?n.hooks.provideLexer():e?ed.lex:ed.lexInline)(t,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let i=(n.hooks?n.hooks.provideParser():e?em.parse:em.parseInline)(s,n);return n.hooks&&(i=n.hooks.postprocess(i)),i}catch(e){return r(e)}}}onError(e,t){return s=>{if(s.message+=`
105
- Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+ea(s.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(s);throw s}}constructor(...e){i(this,"defaults",n()),i(this,"options",this.setOptions),i(this,"parse",this.parseMarkdown(!0)),i(this,"parseInline",this.parseMarkdown(!1)),i(this,"Parser",em),i(this,"Renderer",ep),i(this,"TextRenderer",eg),i(this,"Lexer",ed),i(this,"Tokenizer",eu),i(this,"Hooks",ef),this.use(...e)}};function ew(e,t){return ev.parse(e,t)}ew.options=ew.setOptions=function(e){return ev.setOptions(e),ew.defaults=ev.defaults,a=ew.defaults,ew},ew.getDefaults=n,ew.defaults=a,ew.use=function(...e){return ev.use(...e),ew.defaults=ev.defaults,a=ew.defaults,ew},ew.walkTokens=function(e,t){return ev.walkTokens(e,t)},ew.parseInline=ev.parseInline,ew.Parser=em,ew.parser=em.parse,ew.Renderer=ep,ew.TextRenderer=eg,ew.Lexer=ed,ew.lexer=ed.lex,ew.Tokenizer=eu,ew.Hooks=ef,ew.parse=ew,ew.options,ew.setOptions,ew.use,ew.walkTokens,ew.parseInline,em.parse,ed.lex},73943:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="applyFormat",n="Apply or remove inline formatting to the current selection (bold, italic, underline, etc.) or to a specific block",r=[{name:"element",type:"string",description:'HTML element to wrap selection (e.g., "strong", "em", "u", "span")',required:!1},{name:"attributes",type:"object",description:'Attributes to apply (e.g., {"className": "highlight"}, {"style": {"color": "red"}})',required:!1},{name:"remove",type:"boolean",description:"If true, remove the formatting instead of applying it",required:!1,default:!1},{name:"blockIndex",type:"number",description:"Zero-based index of the block to format (if not using current selection)",required:!1},{name:"selector",type:"string",description:"CSS selector to find the block to format (if not using current selection)",required:!1}],a=!0},75352:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="readBlocks",n="Read blocks from the editor with optional filtering and pagination",r=[{name:"offset",type:"number",description:"Number of blocks to skip from the beginning (default: 0)",required:!1,default:0},{name:"limit",type:"number",description:"Maximum number of blocks to return (default: all)",required:!1},{name:"query",type:"string",description:"Filter blocks by text content",required:!1}],a=!1},75966:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Wand handle - diagonal line --\x3e <rect x="12" y="10" width="13" height="3.5" rx="0.5" transform="rotate(45 12 12)"/> \x3c!-- Wand tip - diamond --\x3e <rect x="3" y="3" width="6" height="6" rx="1" transform="rotate(45 6 6)"/> \x3c!-- Large sparkle - top --\x3e <polygon points="15,0 16,4 15,8 14,4"/> <polygon points="11,4 15,5 19,4 15,3"/> \x3c!-- Medium sparkle - left --\x3e <polygon points="1,11 2,14 1,17 0,14"/> <polygon points="-2,14 1,15 4,14 1,13"/> \x3c!-- Small sparkle - middle --\x3e <polygon points="8,14 8.5,16 8,18 7.5,16"/> <polygon points="6,16 8,16.5 10,16 8,15.5"/> </svg>'},76697:function(e,t,s){"use strict";s.d(t,{UISettingsButton:function(){return c}});var i=s(82749),n=s(31635),r=s(79455),a=s(87325),o=s(37133),l=s(78644);class c extends l.ToolbarButton{setParentView(e){var t;return null==(t=this.settingsPopup)||t.setParentView(e),super.setParentView(e)}onChangeOptionsClosePopup(e){this.closeCallback()}openSettingsPopup(){return this.settingsPopup||(this.settingsPopup=new r.UISettingsPopup(this.jodit,this.extraState,this.options,this.getConversation,this.updateConversation)),this.settingsPopup.update(),this.settingsPopup}constructor(e,t,s,n,r){super(e,{name:"settings",tooltip:"Settings",popup:(e,t,s)=>(this.closeCallback=s,this.openSettingsPopup())}),(0,i._)(this,"extraState",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"getConversation",void 0),(0,i._)(this,"updateConversation",void 0),(0,i._)(this,"closeCallback",void 0),(0,i._)(this,"settingsPopup",void 0),this.extraState=t,this.options=s,this.getConversation=n,this.updateConversation=r,this.closeCallback=()=>{},this.settingsPopup=null,this.hookStatus("ready",()=>{this.state.size="small",this.state.variant="secondary"})}}(0,n.__decorate)([(0,o.watch)("extraState.displayMode")],c.prototype,"onChangeOptionsClosePopup",null),c=(0,n.__decorate)([a.component],c)},78717:function(e,t,s){"use strict";var i=s(75352),n=s(91140);t.default={...i,execute:n.execute}},79078:function(e,t,s){"use strict";async function i(e,t,s){let i={...t};try{let e=new AbortController().signal,n=await s.executeTool(t.name,t.arguments,e);i={...t,result:{result:n},status:"executed"}}catch(s){i={...t,result:{error:s instanceof Error?s.message:String(s)},status:"error"},e.e.fire("toolCallFailed.ai-assistant-pro",i)}return e.e.fire("toolCallExecuted.ai-assistant-pro",i,{toolCallId:i.id,result:i.result}),i}function n(e,t){var s,i;let n=null==(i=e.toolCalls)?void 0:i.findIndex(e=>e.id===t.id);if(null==n||-1===n)return e;let r=[...null!=(s=null==e?void 0:e.toolCalls)?s:[]];return r[n]=t,{...e,toolCalls:r}}s.d(t,{executeToolCall:function(){return i},updateToolCallInMessage:function(){return n}})},79455:function(e,t,s){"use strict";s.d(t,{UISettingsPopup:function(){return c}});var i=s(82749),n=s(31635),r=s(16015),a=s(71102),o=s(65478),l=s(67510);class c extends l.UIElement{className(){return"UISettingsPopup"}async onChangeTheme(){var e,t,s;let i=(null==(e=this.state)?void 0:e.theme)&&(null==(t=this.state)?void 0:t.theme)!=="parent"?null==(s=this.state)?void 0:s.theme:this.j.o.theme;this.container.classList.remove("jodit_theme_dark","jodit_theme_light"),this.container.classList.add("jodit_theme_"+i)}update(){var e,t;return null==(e=this.dialogSettings)||e.update(),null==(t=this.globalSettings)||t.update(),this.updateContent(),super.update()}setParentView(e){var t,s;return null==(t=this.globalSettings)||t.setParentView(e),null==(s=this.dialogSettings)||s.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
105
+ Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+ea(s.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(s);throw s}}constructor(...e){i(this,"defaults",n()),i(this,"options",this.setOptions),i(this,"parse",this.parseMarkdown(!0)),i(this,"parseInline",this.parseMarkdown(!1)),i(this,"Parser",em),i(this,"Renderer",ep),i(this,"TextRenderer",eg),i(this,"Lexer",ed),i(this,"Tokenizer",eu),i(this,"Hooks",ef),this.use(...e)}};function ew(e,t){return ev.parse(e,t)}ew.options=ew.setOptions=function(e){return ev.setOptions(e),ew.defaults=ev.defaults,a=ew.defaults,ew},ew.getDefaults=n,ew.defaults=a,ew.use=function(...e){return ev.use(...e),ew.defaults=ev.defaults,a=ew.defaults,ew},ew.walkTokens=function(e,t){return ev.walkTokens(e,t)},ew.parseInline=ev.parseInline,ew.Parser=em,ew.parser=em.parse,ew.Renderer=ep,ew.TextRenderer=eg,ew.Lexer=ed,ew.lexer=ed.lex,ew.Tokenizer=eu,ew.Hooks=ef,ew.parse=ew,ew.options,ew.setOptions,ew.use,ew.walkTokens,ew.parseInline,em.parse,ed.lex},73943:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="applyFormat",n="Apply or remove inline formatting to the current selection (bold, italic, underline, etc.) or to a specific block",r=[{name:"element",type:"string",description:'HTML element to wrap selection (e.g., "strong", "em", "u", "span")',required:!1},{name:"attributes",type:"object",description:'Attributes to apply (e.g., {"className": "highlight"}, {"style": {"color": "red"}})',required:!1},{name:"remove",type:"boolean",description:"If true, remove the formatting instead of applying it",required:!1,default:!1},{name:"blockIndex",type:"number",description:"Zero-based index of the block to format (if not using current selection)",required:!1},{name:"selector",type:"string",description:"CSS selector to find the block to format (if not using current selection)",required:!1}],a=!0},75352:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="readBlocks",n="Read blocks from the editor with optional filtering and pagination",r=[{name:"offset",type:"number",description:"Number of blocks to skip from the beginning (default: 0)",required:!1,default:0},{name:"limit",type:"number",description:"Maximum number of blocks to return (default: all)",required:!1},{name:"query",type:"string",description:"Filter blocks by text content",required:!1}],a=!1},75966:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Wand handle - diagonal line --\x3e <rect x="12" y="10" width="13" height="3.5" rx="0.5" transform="rotate(45 12 12)"/> \x3c!-- Wand tip - diamond --\x3e <rect x="3" y="3" width="6" height="6" rx="1" transform="rotate(45 6 6)"/> \x3c!-- Large sparkle - top --\x3e <polygon points="15,0 16,4 15,8 14,4"/> <polygon points="11,4 15,5 19,4 15,3"/> \x3c!-- Medium sparkle - left --\x3e <polygon points="1,11 2,14 1,17 0,14"/> <polygon points="-2,14 1,15 4,14 1,13"/> \x3c!-- Small sparkle - middle --\x3e <polygon points="8,14 8.5,16 8,18 7.5,16"/> <polygon points="6,16 8,16.5 10,16 8,15.5"/> </svg>'},76697:function(e,t,s){"use strict";s.d(t,{UISettingsButton:function(){return h}});var i=s(82749),n=s(31635),r=s(79455),a=s(87325),o=s(37133),l=s(48538),c=s(78644);class h extends l.UIElement{className(){return"UISettingsButton"}setParentView(e){var t,s;return null==(t=this.settingsPopup)||t.setParentView(e),null==(s=this.button)||s.setParentView(e),super.setParentView(e)}onChangeOptionsClosePopup(e){this.closeCallback()}openSettingsPopup(){return this.settingsPopup||(this.settingsPopup=new r.UISettingsPopup(this.jodit,this.extraState,this.options,this.getConversation,this.updateConversation)),this.settingsPopup.update(),this.settingsPopup}constructor(e,t,s,n,r){super(e),(0,i._)(this,"extraState",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"getConversation",void 0),(0,i._)(this,"updateConversation",void 0),(0,i._)(this,"closeCallback",void 0),(0,i._)(this,"settingsPopup",void 0),(0,i._)(this,"button",void 0),this.extraState=t,this.options=s,this.getConversation=n,this.updateConversation=r,this.closeCallback=()=>{},this.settingsPopup=null,this.button=new c.ToolbarButton(this.jodit,{name:"settings",tooltip:"Settings",popup:(e,t,s)=>(this.closeCallback=s,this.openSettingsPopup())}),this.button.state.variant="initial",this.button.state.size="small",this.container.appendChild(this.button.container)}}(0,n.__decorate)([(0,o.watch)("extraState.displayMode")],h.prototype,"onChangeOptionsClosePopup",null),h=(0,n.__decorate)([a.component],h)},78717:function(e,t,s){"use strict";var i=s(75352),n=s(91140);t.default={...i,execute:n.execute}},79078:function(e,t,s){"use strict";async function i(e,t,s){let i={...t};try{let e=new AbortController().signal,n=await s.executeTool(t.name,t.arguments,e);i={...t,result:{result:n},status:"executed"}}catch(s){i={...t,result:{error:s instanceof Error?s.message:String(s)},status:"error"},e.e.fire("toolCallFailed.ai-assistant-pro",i)}return e.e.fire("toolCallExecuted.ai-assistant-pro",i,{toolCallId:i.id,result:i.result}),i}function n(e,t){var s,i;let n=null==(i=e.toolCalls)?void 0:i.findIndex(e=>e.id===t.id);if(null==n||-1===n)return e;let r=[...null!=(s=null==e?void 0:e.toolCalls)?s:[]];return r[n]=t,{...e,toolCalls:r}}s.d(t,{executeToolCall:function(){return i},updateToolCallInMessage:function(){return n}})},79455:function(e,t,s){"use strict";s.d(t,{UISettingsPopup:function(){return c}});var i=s(82749),n=s(31635),r=s(16015),a=s(71102),o=s(65478),l=s(67510);class c extends l.UIElement{className(){return"UISettingsPopup"}async onChangeTheme(){var e,t,s;let i=(null==(e=this.state)?void 0:e.theme)&&(null==(t=this.state)?void 0:t.theme)!=="parent"?null==(s=this.state)?void 0:s.theme:this.j.o.theme;this.container.classList.remove("jodit_theme_dark","jodit_theme_light"),this.container.classList.add("jodit_theme_"+i)}update(){var e,t;return null==(e=this.dialogSettings)||e.update(),null==(t=this.globalSettings)||t.update(),this.updateContent(),super.update()}setParentView(e){var t,s;return null==(t=this.globalSettings)||t.setParentView(e),null==(s=this.dialogSettings)||s.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
106
106
  <div class="&__header">
107
107
  <h3 class="&__title">~Settings~</h3>
108
108
  </div>
109
109
  <div class="&__content"></div>
110
- </div>`}async updateContent(){let e=this.getElm("content");if(!e)return;e.innerHTML="";let t=this.options,s=t.allowEditDisplayMode||t.allowEditPanelWidth||t.allowEditTheme,i=t.allowEditDialogSettings;if(s){let t=document.createElement("div");t.className=this.getFullElName("section");let s=document.createElement("h4");s.className=this.getFullElName("section-title"),s.textContent=this.j.i18n("General Settings"),t.appendChild(s),this.globalSettings=new a.UIGlobalSettings(this.j,this.state,this.options),t.appendChild(this.globalSettings.container),e.appendChild(t)}let n=this.getConversation();if(i&&n){let t=document.createElement("div");t.className=this.getFullElName("section");let s=document.createElement("h4");s.className=this.getFullElName("section-title"),s.textContent=this.j.i18n("Conversation Settings"),t.appendChild(s),this.dialogSettings=new r.UIDialogSettings(this.j,()=>this.getConversation(),this.updateConversation,this.state,this.options),t.appendChild(this.dialogSettings.container),e.appendChild(t)}}destruct(){var e,t;null==(e=this.globalSettings)||e.destruct(),null==(t=this.dialogSettings)||t.destruct(),super.destruct()}constructor(e,t,s,n,r){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"getConversation",void 0),(0,i._)(this,"updateConversation",void 0),(0,i._)(this,"globalSettings",void 0),(0,i._)(this,"dialogSettings",void 0),this.state=t,this.options=s,this.getConversation=n,this.updateConversation=r,this.globalSettings=null,this.dialogSettings=null}}(0,n.__decorate)([(0,o.watch)("state.theme"),(0,o.hook)("ready")],c.prototype,"onChangeTheme",null),c=(0,n.__decorate)([o.component],c)},79766:function(e,t,s){"use strict";s.d(t,{execute:function(){return r}});var i=s(6689),n=s(49459);async function r(e,t,s){let r=(0,n.requireString)(t,"html",{allowEmpty:!0});(0,i.throwIfAborted)(s);try{return e.s.focus(),e.value=r,e.synchronizeValues(),{success:!0,message:`Document content was replaced with provided HTML(${r.length} characters)`}}catch(e){throw Error(`Failed to replace HTML: ${(null==e?void 0:e.message)||"Unknown error"}`)}}},80453:function(e,t,s){"use strict";s.d(t,{UIConversationListItem:function(){return c}});var i=s(82749),n=s(31635),r=s(65478),a=s(67510),o=s(62843),l=s(26866);class c extends a.UIElement{className(){return"UIConversationListItem"}render(){return'<div class="jodit-ui-conversation-list__item"></div>'}setActive(e){this.isActive=e,this.updateContent()}updateContent(){let e=this.container;e.innerHTML="",e.setAttribute("data-id",this.conversation.id),this.isActive?e.classList.add("jodit-ui-conversation-list__item_active"):e.classList.remove("jodit-ui-conversation-list__item_active");let t=this.j.c.div("jodit-ui-conversation-list__item-avatar");t.textContent="AI",e.appendChild(t);let s=this.j.c.div("jodit-ui-conversation-list__item-wrapper"),i=this.j.c.div("jodit-ui-conversation-list__item-content"),n=this.j.c.div("jodit-ui-conversation-list__item-title");if(n.textContent=this.conversation.title,i.appendChild(n),this.opts.showTimestamps){let e=this.j.c.div("jodit-ui-conversation-list__item-meta");e.textContent=this.opts.formatTimestamp(this.conversation.updated,this.j.i18n.bind(this.j)),i.appendChild(e)}if(s.appendChild(i),this.conversation.messageCount>0){let e=this.j.c.div("jodit-ui-conversation-list__item-badge");e.textContent=String(this.conversation.messageCount),s.appendChild(e)}e.appendChild(s),this.deleteButton||(this.deleteButton=new o.UIButton(this.j,{icon:{name:"bin"},variant:"default",size:"tiny",tooltip:"Delete conversation"}),this.deleteButton.container.classList.add("jodit-ui-conversation-list__item-delete"),this.deleteButton.onAction(e=>{e.stopPropagation(),this.onDelete()})),e.appendChild(this.deleteButton.container)}onClick(){this.j.e.fire("selectConversation.ai-assistant-pro",this.conversation.id)}onDelete(){l.Confirm.call(void 0,this.j.i18n("Are you sure you want to delete this conversation?"),this.j.i18n("Delete conversation"),e=>{e&&this.j.e.fire("deleteConversation.ai-assistant-pro",this.conversation.id)})}destruct(){var e;null==(e=this.deleteButton)||e.destruct(),super.destruct()}constructor(e,t,s=!1,n){super(e),(0,i._)(this,"opts",void 0),(0,i._)(this,"conversation",void 0),(0,i._)(this,"isActive",void 0),(0,i._)(this,"deleteButton",void 0),this.opts=n,this.conversation=t,this.isActive=s,this.updateContent()}}(0,n.__decorate)([(0,r.watch)("container:click")],c.prototype,"onClick",null),(0,n.__decorate)([r.autobind],c.prototype,"onDelete",null),c=(0,n.__decorate)([r.component],c)},81835:function(e,t,s){"use strict";s.d(t,{UIArtifact:function(){return l}});var i=s(82749),n=s(31635),r=s(65478),a=s(29960),o=s(67510);class l extends o.UIElement{className(){return"UIArtifact"}render(){return`<div class="${this.componentName}"></div>`}onReady(){this.renderArtifact()}renderArtifact(){let e=this.container;e.innerHTML="",(0,a.attr)(e,{"data-type":this.artifact.type,"data-status":this.artifact.status});let t=this.createStatusIndicator();if(e.appendChild(t),"pending"===this.artifact.status||"generating"===this.artifact.status)return void this.renderLoading();if("failed"===this.artifact.status)return void this.renderError();switch(this.artifact.type){case"image":this.renderImage();break;case"audio":this.renderAudio();break;case"file":this.renderFile();break;case"json":this.renderJSON();break;default:this.renderOther()}}createStatusIndicator(){let e=this.j.c.div(this.getFullElName("status"));e.setAttribute("data-status",this.artifact.status);let t=this.j.c.span(this.getFullElName("status-icon")),s=this.j.c.span(this.getFullElName("status-text"));switch(this.artifact.status){case"pending":t.textContent="⏳",s.textContent=this.j.i18n("Pending");break;case"generating":t.textContent="\uD83D\uDD04",s.textContent=this.j.i18n("Generating...");break;case"ready":t.textContent="✅",s.textContent=this.j.i18n("Ready");break;case"failed":t.textContent="❌",s.textContent=this.j.i18n("Failed")}return e.appendChild(t),e.appendChild(s),e}renderLoading(){let e=this.j.c.div(this.getFullElName("loader")),t=this.j.c.div(this.getFullElName("spinner")),s=this.j.c.div(this.getFullElName("loader-message"));s.textContent=this.j.i18n("Generating artifact..."),e.appendChild(t),e.appendChild(s),this.container.appendChild(e)}renderError(){var e;let t=this.j.c.div(this.getFullElName("error")),s=this.j.c.div(this.getFullElName("error-icon"));s.textContent="❌";let i=this.j.c.div(this.getFullElName("error-message"));i.textContent=(null==(e=this.artifact.metadata)?void 0:e.error)||this.j.i18n("Failed to generate artifact"),t.appendChild(s),t.appendChild(i),this.container.appendChild(t)}renderImage(){var e,t;if(!this.artifact.data)return;let s=this.j.c.div(this.getFullElName("content")),i=this.j.c.element("img",{class:this.getFullElName("image")});if("url"===this.artifact.data.kind)i.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"image/png";i.src=`data:${e};base64,${this.artifact.data.base64}`}if(i.alt=(null==(e=this.artifact.metadata)?void 0:e.alt)||"AI Generated Image",s.appendChild(i),null==(t=this.artifact.metadata)?void 0:t.caption){let e=this.j.c.div(this.getFullElName("caption"));e.textContent=this.artifact.metadata.caption,s.appendChild(e)}this.container.appendChild(s)}renderAudio(){if(!this.artifact.data)return;let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.element("audio",{class:this.getFullElName("audio"),controls:"controls"});if("url"===this.artifact.data.kind)t.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"audio/mpeg";t.src=`data:${e};base64,${this.artifact.data.base64}`}e.appendChild(t),this.container.appendChild(e)}renderFile(){var e,t,s;if(!this.artifact.data)return;let i=this.j.c.div(this.getFullElName("content")),n=this.j.c.div(this.getFullElName("file-card")),r=this.j.c.div(this.getFullElName("file-icon"));r.textContent="\uD83D\uDCC4";let a=this.j.c.div(this.getFullElName("file-info")),o=this.j.c.div(this.getFullElName("file-name"));o.textContent=(null==(e=this.artifact.metadata)?void 0:e.filename)||"download.file";let l=this.j.c.div(this.getFullElName("file-size"));(null==(t=this.artifact.metadata)?void 0:t.size)&&(l.textContent=this.formatFileSize(this.artifact.metadata.size)),a.appendChild(o),a.appendChild(l);let c=this.j.c.element("a",{class:this.getFullElName("download-btn"),download:(null==(s=this.artifact.metadata)?void 0:s.filename)||"download.file"});if(c.textContent=this.j.i18n("Download"),"url"===this.artifact.data.kind)c.href=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"application/octet-stream";c.href=`data:${e};base64,${this.artifact.data.base64}`}n.appendChild(r),n.appendChild(a),n.appendChild(c),i.appendChild(n),this.container.appendChild(i)}renderJSON(){let e;if(!this.artifact.data)return;let t=this.j.c.div(this.getFullElName("content")),s=this.j.c.element("pre",{class:this.getFullElName("json")}),i=this.j.c.element("code");if("url"===this.artifact.data.kind)i.textContent=this.j.i18n("JSON data at URL");else if("base64"===this.artifact.data.kind)try{let t=atob(this.artifact.data.base64);e=JSON.parse(t),i.textContent=JSON.stringify(e,null,2)}catch(e){i.textContent=this.j.i18n("Invalid JSON data")}s.appendChild(i),t.appendChild(s),this.container.appendChild(t)}renderOther(){let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.div(this.getFullElName("placeholder")),s=this.j.c.div(this.getFullElName("placeholder-icon"));s.textContent="\uD83D\uDCE6";let i=this.j.c.div(this.getFullElName("placeholder-text"));i.textContent=this.j.i18n("Unknown artifact type"),t.appendChild(s),t.appendChild(i),e.appendChild(t),this.container.appendChild(e)}formatFileSize(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(2)} KB`:e<0x40000000?`${(e/1048576).toFixed(2)} MB`:`${(e/0x40000000).toFixed(2)} GB`}updateArtifact(e){this.artifact=e,this.renderArtifact()}constructor(e,t){super(e),(0,i._)(this,"artifact",void 0),this.artifact=t}}(0,n.__decorate)([(0,r.hook)("ready")],l.prototype,"onReady",null),l=(0,n.__decorate)([r.component],l)},85130:function(e,t,s){"use strict";s.d(t,{execute:function(){return n}});var i=s(6689);async function n(e,t,s){let{contextCharsBefore:n,contextCharsAfter:r}=t;if((0,i.throwIfAborted)(s),e.s.restore(),e.s.isCollapsed())return{hasSelection:!1};let a=e.s.html,o=e.s.range,l=o.toString(),c={hasSelection:!0,html:a,text:l,startContainer:o.startContainer.nodeName,endContainer:o.endContainer.nodeName};if(n>0||r>0){let t=e.editor.textContent||"",s=t.substring(0,t.indexOf(l)),i=t.substring(t.indexOf(l)+l.length);n>0&&(c.contextBefore=s.slice(-n)),r>0&&(c.contextAfter=i.slice(0,r))}return c}},86428:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Background rounded rect --\x3e <rect x="1" y="1" width="22" height="22" rx="3"/> \x3c!-- Letter A - outer shape --\x3e <polygon points="8,5 2,19 5,19 6.5,16 11.5,16 13,19 16,19 10,5" fill="white"/> \x3c!-- Letter A - inner triangle (hole) --\x3e <polygon points="9,9 7.5,13 10.5,13" fill="currentColor"/> \x3c!-- Letter I --\x3e <rect x="17" y="5" width="3" height="14" fill="white"/> </svg>'},86449:function(e,t,s){"use strict";s.d(t,{APIClient:function(){return a}});var i=s(82749),n=s(82758),r=s(21537);class a{async sendRequest(e,t,s,i,a){let{apiRequest:o,requestTimeout:l,maxRetries:c}=this.jodit.o.aiAssistantPro;if(!o)throw Error("AI Assistant Pro callback is not configured");let h=new AbortController;this.abortControllers.add(h);try{let u=this.buildRequestContext(e,t,s,i,a),d=null;for(let e=0;c>=e;e++)try{if(h.signal.aborted)throw(0,r.abort)();let e=setTimeout(()=>{h.abort()},l);try{let t=await o(u,h.signal);return clearTimeout(e),this.validateResponse(t),t}catch(t){throw clearTimeout(e),t}}catch(t){if(d=t,n.IS_PROD,c>e){let t=this.calculateRetryDelay(e);await this.sleep(t)}else throw t}throw d||Error("API request failed after all retries")}finally{this.abortControllers.delete(h)}}abort(){this.abortControllers.forEach(e=>{e.abort()}),this.abortControllers.clear()}isInProgress(){return this.abortControllers.size>0}buildRequestContext(e,t,s,i,n){let{apiMode:r,instructions:a}=this.jodit.o.aiAssistantPro,o={mode:r,conversationId:e,tools:this.toolRegistry.getAllTools(),selectionContexts:i,conversationOptions:n,instructions:a},l=[];if("full"===r)l=t;else if(s){let e=t.findIndex(e=>e.id===s);l=-1!==e?t.slice(e+1):t,o={...o,parentMessageId:s}}else l=t;return{...o,messages:this.expandToolMessages(l,t.find(e=>e.id===s))}}expandToolMessages(e,t){let s=[];for(let t of e)s.push(t),this.expandToolResultsMessage(t,s);return t&&this.expandToolResultsMessage(t,s),s}expandToolResultsMessage(e,t){if(e.toolCalls&&e.toolCalls.length>0)for(let i of e.toolCalls){var s;let n=null!=(s=i.result)?s:{error:"result not found"};if(t.find(e=>e.id===`${i.id}-result`))continue;let r={id:`${i.id}-result`,role:"tool",content:n.error?`Error: ${n.error}`:JSON.stringify(n.result),timestamp:e.timestamp,toolResults:[{toolCallId:i.id,result:n}]};t.push(r)}}validateResponse(e){if("final"!==e.mode)return;let t=e.response;if(!t)throw Error("API returned empty response");if(!t.responseId)throw Error("API response missing messageId");if(void 0===t.content)throw Error("API response missing content");if(void 0===t.finished)throw Error("API response missing finished flag");if(t.toolCalls){if(!Array.isArray(t.toolCalls))throw Error("API response toolCalls must be an array");t.toolCalls.forEach((e,t)=>{if(!e.id)throw Error(`Tool call at index ${t} is missing id`);if(!e.name)throw Error(`Tool call at index ${t} is missing name`);if(!e.arguments||"object"!=typeof e.arguments)throw Error(`Tool call at index ${t} has invalid arguments`)})}}calculateRetryDelay(e){let{retryDelay:t}=this.jodit.o.aiAssistantPro;return t*Math.pow(2,e)+Math.random()*t}sleep(e){return new Promise(t=>setTimeout(t,e))}destruct(){this.abort()}constructor(e,t){(0,i._)(this,"jodit",void 0),(0,i._)(this,"toolRegistry",void 0),(0,i._)(this,"abortControllers",void 0),this.jodit=e,this.toolRegistry=t,this.abortControllers=new Set}}},86563:function(e,t,s){"use strict";s.d(t,{UIMessageList:function(){return c}});var i=s(82749),n=s(31635),r=s(31356),a=s(99359),o=s(65478),l=s(62405);class c extends l.UIGroup{className(){return"UIMessageList"}render(){return'<div class="&__scroll-container"></div>'}afterRender(){this.scrollContainer=this.container}onUserScroll(){if(!this.scrollContainer)return;let{scrollTop:e,scrollHeight:t,clientHeight:s}=this.scrollContainer;this.autoScrollEnabled=t-e-s<10}onMessageSent(){this.autoScrollEnabled=!0,this.scrollToBottom()}appendChildToContainer(e){this.scrollContainer&&this.scrollContainer.appendChild(e)}setMessages(e){let t=this.messages.slice();this.messages=e.slice(),this.updateMessageList(t),this.scrollToBottom()}updateMessageList(e){let t=r.ListReconciler.reconcile(e,this.messages,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.content===t.content&&e.timestamp===t.timestamp&&JSON.stringify(e.artifacts)===JSON.stringify(t.artifacts)&&JSON.stringify(e.toolCalls)===JSON.stringify(t.toolCalls),preserveOrder:!0});t.toRemove.forEach(e=>{let t=this.messageItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.messageItems.delete(e.id))}),t.toUpdate.forEach(({newItem:e,index:t})=>{let s=this.messageItems.get(e.id);s&&(s.updateMessage(e),this.elements.indexOf(s)!==t&&t<this.elements.length&&(this.remove(s),this.append(s,t)))}),t.toCreate.forEach(e=>{let t=new a.UIMessageListItem(this.j,e,this.params);this.messageItems.set(e.id,t);let s=this.messages.indexOf(e);this.append(t,s)})}scrollToBottom(){!this.j.isDestructed&&this.autoScrollEnabled&&(this.container.scrollTop=this.container.scrollHeight)}destruct(){this.messageItems.clear(),this.messages=[],super.destruct()}constructor(e,t){super(e),(0,i._)(this,"params",void 0),(0,i._)(this,"messages",void 0),(0,i._)(this,"messageItems",void 0),(0,i._)(this,"scrollContainer",void 0),(0,i._)(this,"autoScrollEnabled",void 0),this.params=t,this.messages=[],this.messageItems=new Map,this.autoScrollEnabled=!0}}(0,n.__decorate)([(0,o.hook)("ready")],c.prototype,"afterRender",null),(0,n.__decorate)([(0,o.watch)(["scrollContainer:wheel","scrollContainer:scroll","scrollContainer:touchmove"]),(0,o.throttle)(e=>e.defaultTimeout)],c.prototype,"onUserScroll",null),(0,n.__decorate)([(0,o.watch)(":messageSent.ai-assistant-pro")],c.prototype,"onMessageSent",null),(0,n.__decorate)([o.autobind],c.prototype,"setMessages",null),(0,n.__decorate)([(0,o.throttle)(e=>2*e.defaultTimeout)],c.prototype,"scrollToBottom",null),c=(0,n.__decorate)([o.component],c)},90022:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="writeDocument",n="Write (replace) the entire document content with new HTML",r=[{name:"html",type:"string",description:"HTML content to set as the document",required:!0}],a=!0},90991:function(e,t,s){"use strict";var i=s(52826),n=s(85130);t.default={...i,execute:n.execute}},91140:function(e,t,s){"use strict";s.d(t,{execute:function(){return r}});var i=s(6689),n=s(22732);async function r(e,t,s){let{offset:r,limit:a,query:o}=t;(0,i.throwIfAborted)(s);let l=[];Array.from(e.editor.children).forEach((e,t)=>{n.Dom.isElement(e)&&l.push({blockIndex:t,tagName:e.tagName.toLowerCase(),content:e.innerHTML,textContent:e.textContent||"",classList:Array.from(e.classList)})});let c=l;if(o&&"string"==typeof o){let e=o.toLowerCase();c=l.filter(t=>t.textContent.toLowerCase().includes(e))}let h=Math.max(0,Math.min("number"==typeof r?r:0,c.length)),u=void 0!==a?Math.min(h+a,c.length):c.length;return{blocks:c.slice(h,u),total:l.length,offset:h,limit:void 0!==a?a:void 0}}},93677:function(e,t,s){"use strict";s.d(t,{UIPermissionRequest:function(){return c}});var i=s(82749),n=s(31635),r=s(65478),a=s(67510),o=s(62843),l=s(12234);class c extends a.UIElement{className(){return"UIPermissionRequest"}setToolCall(e){this.toolCall=e,this.updateContent()}setParentView(e){var t,s,i;return null==(t=this.scopeSelect)||t.setParentView(e),null==(s=this.approveButton)||s.setParentView(e),null==(i=this.denyButton)||i.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
110
+ </div>`}async updateContent(){let e=this.getElm("content");if(!e)return;e.innerHTML="";let t=this.options,s=t.allowEditDisplayMode||t.allowEditPanelWidth||t.allowEditTheme,i=t.allowEditDialogSettings;if(s){let t=document.createElement("div");t.className=this.getFullElName("section");let s=document.createElement("h4");s.className=this.getFullElName("section-title"),s.textContent=this.j.i18n("General Settings"),t.appendChild(s),this.globalSettings=new a.UIGlobalSettings(this.j,this.state,this.options),t.appendChild(this.globalSettings.container),e.appendChild(t)}let n=this.getConversation();if(i&&n){let t=document.createElement("div");t.className=this.getFullElName("section");let s=document.createElement("h4");s.className=this.getFullElName("section-title"),s.textContent=this.j.i18n("Conversation Settings"),t.appendChild(s),this.dialogSettings=new r.UIDialogSettings(this.j,()=>this.getConversation(),this.updateConversation,this.state,this.options),t.appendChild(this.dialogSettings.container),e.appendChild(t)}}destruct(){var e,t;null==(e=this.globalSettings)||e.destruct(),null==(t=this.dialogSettings)||t.destruct(),super.destruct()}constructor(e,t,s,n,r){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"getConversation",void 0),(0,i._)(this,"updateConversation",void 0),(0,i._)(this,"globalSettings",void 0),(0,i._)(this,"dialogSettings",void 0),this.state=t,this.options=s,this.getConversation=n,this.updateConversation=r,this.globalSettings=null,this.dialogSettings=null}}(0,n.__decorate)([(0,o.watch)("state.theme"),(0,o.hook)("ready")],c.prototype,"onChangeTheme",null),c=(0,n.__decorate)([o.component],c)},79766:function(e,t,s){"use strict";s.d(t,{execute:function(){return r}});var i=s(6689),n=s(49459);async function r(e,t,s){let r=(0,n.requireString)(t,"html",{allowEmpty:!0});(0,i.throwIfAborted)(s);try{return e.s.focus(),e.value=r,e.synchronizeValues(),{success:!0,message:`Document content was replaced with provided HTML(${r.length} characters)`}}catch(e){throw Error(`Failed to replace HTML: ${(null==e?void 0:e.message)||"Unknown error"}`)}}},80453:function(e,t,s){"use strict";s.d(t,{UIConversationListItem:function(){return c}});var i=s(82749),n=s(31635),r=s(65478),a=s(67510),o=s(62843),l=s(26866);class c extends a.UIElement{className(){return"UIConversationListItem"}render(){return'<div class="jodit-ui-conversation-list__item"></div>'}setActive(e){this.isActive=e,this.updateContent()}updateContent(){let e=this.container;e.innerHTML="",e.setAttribute("data-id",this.conversation.id),this.isActive?e.classList.add("jodit-ui-conversation-list__item_active"):e.classList.remove("jodit-ui-conversation-list__item_active");let t=this.j.c.div("jodit-ui-conversation-list__item-avatar");t.textContent="AI",e.appendChild(t);let s=this.j.c.div("jodit-ui-conversation-list__item-wrapper"),i=this.j.c.div("jodit-ui-conversation-list__item-content"),n=this.j.c.div("jodit-ui-conversation-list__item-title");if(n.textContent=this.conversation.title,i.appendChild(n),this.opts.showTimestamps){let e=this.j.c.div("jodit-ui-conversation-list__item-meta");e.textContent=this.opts.formatTimestamp(this.conversation.updated,this.j.i18n.bind(this.j)),i.appendChild(e)}if(s.appendChild(i),this.conversation.messageCount>0){let e=this.j.c.div("jodit-ui-conversation-list__item-badge");e.textContent=String(this.conversation.messageCount),s.appendChild(e)}e.appendChild(s),this.deleteButton||(this.deleteButton=new o.UIButton(this.j,{icon:{name:"bin"},variant:"outline",size:"tiny",tooltip:"Delete conversation"}),this.deleteButton.container.classList.add("jodit-ui-conversation-list__item-delete"),this.deleteButton.onAction(e=>{e.stopPropagation(),this.onDelete()})),e.appendChild(this.deleteButton.container)}onClick(){this.j.e.fire("selectConversation.ai-assistant-pro",this.conversation.id)}onDelete(){l.Confirm.call(void 0,this.j.i18n("Are you sure you want to delete this conversation?"),this.j.i18n("Delete conversation"),e=>{e&&this.j.e.fire("deleteConversation.ai-assistant-pro",this.conversation.id)})}destruct(){var e;null==(e=this.deleteButton)||e.destruct(),super.destruct()}constructor(e,t,s=!1,n){super(e),(0,i._)(this,"opts",void 0),(0,i._)(this,"conversation",void 0),(0,i._)(this,"isActive",void 0),(0,i._)(this,"deleteButton",void 0),this.opts=n,this.conversation=t,this.isActive=s,this.updateContent()}}(0,n.__decorate)([(0,r.watch)("container:click")],c.prototype,"onClick",null),(0,n.__decorate)([r.autobind],c.prototype,"onDelete",null),c=(0,n.__decorate)([r.component],c)},81835:function(e,t,s){"use strict";s.d(t,{UIArtifact:function(){return l}});var i=s(82749),n=s(31635),r=s(65478),a=s(29960),o=s(67510);class l extends o.UIElement{className(){return"UIArtifact"}onReady(){this.renderArtifact()}renderArtifact(){let e=this.container;e.innerHTML="",(0,a.attr)(e,{"data-type":this.artifact.type,"data-status":this.artifact.status});let t=this.createStatusIndicator();if(e.appendChild(t),"pending"===this.artifact.status||"generating"===this.artifact.status)return void this.renderLoading();if("failed"===this.artifact.status)return void this.renderError();switch(this.artifact.type){case"image":this.renderImage();break;case"audio":this.renderAudio();break;case"file":this.renderFile();break;case"json":this.renderJSON();break;default:this.renderOther()}}createStatusIndicator(){let e=this.j.c.div(this.getFullElName("status"));e.setAttribute("data-status",this.artifact.status);let t=this.j.c.span(this.getFullElName("status-icon")),s=this.j.c.span(this.getFullElName("status-text"));switch(this.artifact.status){case"pending":t.textContent="⏳",s.textContent=this.j.i18n("Pending");break;case"generating":t.textContent="\uD83D\uDD04",s.textContent=this.j.i18n("Generating...");break;case"ready":t.textContent="✅",s.textContent=this.j.i18n("Ready");break;case"failed":t.textContent="❌",s.textContent=this.j.i18n("Failed")}return e.appendChild(t),e.appendChild(s),e}renderLoading(){let e=this.j.c.div(this.getFullElName("loader")),t=this.j.c.div(this.getFullElName("spinner")),s=this.j.c.div(this.getFullElName("loader-message"));s.textContent=this.j.i18n("Generating artifact..."),e.appendChild(t),e.appendChild(s),this.container.appendChild(e)}renderError(){var e;let t=this.j.c.div(this.getFullElName("error")),s=this.j.c.div(this.getFullElName("error-icon"));s.textContent="❌";let i=this.j.c.div(this.getFullElName("error-message"));i.textContent=(null==(e=this.artifact.metadata)?void 0:e.error)||this.j.i18n("Failed to generate artifact"),t.appendChild(s),t.appendChild(i),this.container.appendChild(t)}renderImage(){var e,t;if(!this.artifact.data)return;let s=this.j.c.div(this.getFullElName("content")),i=this.j.c.element("img",{class:this.getFullElName("image")});if("url"===this.artifact.data.kind)i.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"image/png";i.src=`data:${e};base64,${this.artifact.data.base64}`}if(i.alt=(null==(e=this.artifact.metadata)?void 0:e.alt)||"AI Generated Image",s.appendChild(i),null==(t=this.artifact.metadata)?void 0:t.caption){let e=this.j.c.div(this.getFullElName("caption"));e.textContent=this.artifact.metadata.caption,s.appendChild(e)}this.container.appendChild(s)}renderAudio(){if(!this.artifact.data)return;let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.element("audio",{class:this.getFullElName("audio"),controls:"controls"});if("url"===this.artifact.data.kind)t.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"audio/mpeg";t.src=`data:${e};base64,${this.artifact.data.base64}`}e.appendChild(t),this.container.appendChild(e)}renderFile(){var e,t,s;if(!this.artifact.data)return;let i=this.j.c.div(this.getFullElName("content")),n=this.j.c.div(this.getFullElName("file-card")),r=this.j.c.div(this.getFullElName("file-icon"));r.textContent="\uD83D\uDCC4";let a=this.j.c.div(this.getFullElName("file-info")),o=this.j.c.div(this.getFullElName("file-name"));o.textContent=(null==(e=this.artifact.metadata)?void 0:e.filename)||"download.file";let l=this.j.c.div(this.getFullElName("file-size"));(null==(t=this.artifact.metadata)?void 0:t.size)&&(l.textContent=this.formatFileSize(this.artifact.metadata.size)),a.appendChild(o),a.appendChild(l);let c=this.j.c.element("a",{class:this.getFullElName("download-btn"),download:(null==(s=this.artifact.metadata)?void 0:s.filename)||"download.file"});if(c.textContent=this.j.i18n("Download"),"url"===this.artifact.data.kind)c.href=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"application/octet-stream";c.href=`data:${e};base64,${this.artifact.data.base64}`}n.appendChild(r),n.appendChild(a),n.appendChild(c),i.appendChild(n),this.container.appendChild(i)}renderJSON(){let e;if(!this.artifact.data)return;let t=this.j.c.div(this.getFullElName("content")),s=this.j.c.element("pre",{class:this.getFullElName("json")}),i=this.j.c.element("code");if("url"===this.artifact.data.kind)i.textContent=this.j.i18n("JSON data at URL");else if("base64"===this.artifact.data.kind)try{let t=atob(this.artifact.data.base64);e=JSON.parse(t),i.textContent=JSON.stringify(e,null,2)}catch(e){i.textContent=this.j.i18n("Invalid JSON data")}s.appendChild(i),t.appendChild(s),this.container.appendChild(t)}renderOther(){let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.div(this.getFullElName("placeholder")),s=this.j.c.div(this.getFullElName("placeholder-icon"));s.textContent="\uD83D\uDCE6";let i=this.j.c.div(this.getFullElName("placeholder-text"));i.textContent=this.j.i18n("Unknown artifact type"),t.appendChild(s),t.appendChild(i),e.appendChild(t),this.container.appendChild(e)}formatFileSize(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(2)} KB`:e<0x40000000?`${(e/1048576).toFixed(2)} MB`:`${(e/0x40000000).toFixed(2)} GB`}updateArtifact(e){this.artifact=e,this.renderArtifact()}constructor(e,t){super(e),(0,i._)(this,"artifact",void 0),this.artifact=t}}(0,n.__decorate)([(0,r.hook)("ready")],l.prototype,"onReady",null),l=(0,n.__decorate)([r.component],l)},85130:function(e,t,s){"use strict";s.d(t,{execute:function(){return n}});var i=s(6689);async function n(e,t,s){let{contextCharsBefore:n,contextCharsAfter:r}=t;if((0,i.throwIfAborted)(s),e.s.restore(),e.s.isCollapsed())return{hasSelection:!1};let a=e.s.html,o=e.s.range,l=o.toString(),c={hasSelection:!0,html:a,text:l,startContainer:o.startContainer.nodeName,endContainer:o.endContainer.nodeName};if(n>0||r>0){let t=e.editor.textContent||"",s=t.substring(0,t.indexOf(l)),i=t.substring(t.indexOf(l)+l.length);n>0&&(c.contextBefore=s.slice(-n)),r>0&&(c.contextAfter=i.slice(0,r))}return c}},86428:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Background rounded rect --\x3e <rect x="1" y="1" width="22" height="22" rx="3"/> \x3c!-- Letter A - outer shape --\x3e <polygon points="8,5 2,19 5,19 6.5,16 11.5,16 13,19 16,19 10,5" fill="white"/> \x3c!-- Letter A - inner triangle (hole) --\x3e <polygon points="9,9 7.5,13 10.5,13" fill="currentColor"/> \x3c!-- Letter I --\x3e <rect x="17" y="5" width="3" height="14" fill="white"/> </svg>'},86449:function(e,t,s){"use strict";s.d(t,{APIClient:function(){return a}});var i=s(82749),n=s(82758),r=s(21537);class a{async sendRequest(e,t,s,i,a){let{apiRequest:o,requestTimeout:l,maxRetries:c}=this.jodit.o.aiAssistantPro;if(!o)throw Error("AI Assistant Pro callback is not configured");let h=new AbortController;this.abortControllers.add(h);try{let u=this.buildRequestContext(e,t,s,i,a),d=null;for(let e=0;c>=e;e++)try{if(h.signal.aborted)throw(0,r.abort)();let e=setTimeout(()=>{h.abort()},l);try{let t=await o(u,h.signal);return clearTimeout(e),this.validateResponse(t),t}catch(t){throw clearTimeout(e),t}}catch(t){if(d=t,n.IS_PROD,c>e){let t=this.calculateRetryDelay(e);await this.sleep(t)}else throw t}throw d||Error("API request failed after all retries")}finally{this.abortControllers.delete(h)}}abort(){this.abortControllers.forEach(e=>{e.abort()}),this.abortControllers.clear()}isInProgress(){return this.abortControllers.size>0}buildRequestContext(e,t,s,i,n){let{apiMode:r,instructions:a}=this.jodit.o.aiAssistantPro,o={mode:r,conversationId:e,tools:this.toolRegistry.getAllTools(),selectionContexts:i,conversationOptions:n,instructions:a},l=[];if("full"===r)l=t;else if(s){let e=t.findIndex(e=>e.id===s);l=-1!==e?t.slice(e+1):t,o={...o,parentMessageId:s}}else l=t;return{...o,messages:this.expandToolMessages(l,t.find(e=>e.id===s))}}expandToolMessages(e,t){let s=[];for(let t of e)s.push(t),this.expandToolResultsMessage(t,s);return t&&this.expandToolResultsMessage(t,s),s}expandToolResultsMessage(e,t){if(e.toolCalls&&e.toolCalls.length>0)for(let i of e.toolCalls){var s;let n=null!=(s=i.result)?s:{error:"result not found"};if(t.find(e=>e.id===`${i.id}-result`))continue;let r={id:`${i.id}-result`,role:"tool",content:n.error?`Error: ${n.error}`:JSON.stringify(n.result),timestamp:e.timestamp,toolResults:[{toolCallId:i.id,result:n}]};t.push(r)}}validateResponse(e){if("final"!==e.mode)return;let t=e.response;if(!t)throw Error("API returned empty response");if(!t.responseId)throw Error("API response missing messageId");if(void 0===t.content)throw Error("API response missing content");if(void 0===t.finished)throw Error("API response missing finished flag");if(t.toolCalls){if(!Array.isArray(t.toolCalls))throw Error("API response toolCalls must be an array");t.toolCalls.forEach((e,t)=>{if(!e.id)throw Error(`Tool call at index ${t} is missing id`);if(!e.name)throw Error(`Tool call at index ${t} is missing name`);if(!e.arguments||"object"!=typeof e.arguments)throw Error(`Tool call at index ${t} has invalid arguments`)})}}calculateRetryDelay(e){let{retryDelay:t}=this.jodit.o.aiAssistantPro;return t*Math.pow(2,e)+Math.random()*t}sleep(e){return new Promise(t=>setTimeout(t,e))}destruct(){this.abort()}constructor(e,t){(0,i._)(this,"jodit",void 0),(0,i._)(this,"toolRegistry",void 0),(0,i._)(this,"abortControllers",void 0),this.jodit=e,this.toolRegistry=t,this.abortControllers=new Set}}},86563:function(e,t,s){"use strict";s.d(t,{UIMessageList:function(){return c}});var i=s(82749),n=s(31635),r=s(51359),a=s(65478),o=s(62405),l=s(31356);class c extends o.UIGroup{className(){return"UIMessageList"}render(){return'<div class="&__scroll-container"></div>'}afterRender(){this.scrollContainer=this.container}onUserScroll(){if(!this.scrollContainer)return;let{scrollTop:e,scrollHeight:t,clientHeight:s}=this.scrollContainer;this.autoScrollEnabled=t-e-s<10}onMessageSent(){this.autoScrollEnabled=!0,this.scrollToBottom()}appendChildToContainer(e){this.scrollContainer&&this.scrollContainer.appendChild(e)}setMessages(e){let t=this.messages.slice();this.messages=e.slice(),this.updateMessageList(t),this.scrollToBottom()}updateMessageList(e){let t=l.ListReconciler.reconcile(e,this.messages,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.content===t.content&&e.timestamp===t.timestamp&&JSON.stringify(e.artifacts)===JSON.stringify(t.artifacts)&&JSON.stringify(e.toolCalls)===JSON.stringify(t.toolCalls),preserveOrder:!0});t.toRemove.forEach(e=>{let t=this.messageItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.messageItems.delete(e.id))}),t.toUpdate.forEach(({newItem:e,index:t})=>{let s=this.messageItems.get(e.id);s&&(s.updateMessage(e),this.elements.indexOf(s)!==t&&t<this.elements.length&&(this.remove(s),this.append(s,t)))}),t.toCreate.forEach(e=>{let t=new r.UIMessageListItem(this.j,e,this.params);this.messageItems.set(e.id,t);let s=this.messages.indexOf(e);this.append(t,s)})}scrollToBottom(){!this.j.isDestructed&&this.autoScrollEnabled&&(this.container.scrollTop=this.container.scrollHeight)}destruct(){this.messageItems.clear(),this.messages=[],super.destruct()}constructor(e,t){super(e),(0,i._)(this,"params",void 0),(0,i._)(this,"messages",void 0),(0,i._)(this,"messageItems",void 0),(0,i._)(this,"scrollContainer",void 0),(0,i._)(this,"autoScrollEnabled",void 0),this.params=t,this.messages=[],this.messageItems=new Map,this.autoScrollEnabled=!0}}(0,n.__decorate)([(0,a.hook)("ready")],c.prototype,"afterRender",null),(0,n.__decorate)([(0,a.watch)(["scrollContainer:wheel","scrollContainer:scroll","scrollContainer:touchmove"]),(0,a.throttle)(e=>e.defaultTimeout)],c.prototype,"onUserScroll",null),(0,n.__decorate)([(0,a.watch)(":messageSent.ai-assistant-pro")],c.prototype,"onMessageSent",null),(0,n.__decorate)([a.autobind],c.prototype,"setMessages",null),(0,n.__decorate)([(0,a.throttle)(e=>2*e.defaultTimeout)],c.prototype,"scrollToBottom",null),c=(0,n.__decorate)([a.component],c)},90022:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="writeDocument",n="Write (replace) the entire document content with new HTML",r=[{name:"html",type:"string",description:"HTML content to set as the document",required:!0}],a=!0},90991:function(e,t,s){"use strict";var i=s(52826),n=s(85130);t.default={...i,execute:n.execute}},91140:function(e,t,s){"use strict";s.d(t,{execute:function(){return r}});var i=s(6689),n=s(22732);async function r(e,t,s){let{offset:r,limit:a,query:o}=t;(0,i.throwIfAborted)(s);let l=[];Array.from(e.editor.children).forEach((e,t)=>{n.Dom.isElement(e)&&l.push({blockIndex:t,tagName:e.tagName.toLowerCase(),content:e.innerHTML,textContent:e.textContent||"",classList:Array.from(e.classList)})});let c=l;if(o&&"string"==typeof o){let e=o.toLowerCase();c=l.filter(t=>t.textContent.toLowerCase().includes(e))}let h=Math.max(0,Math.min("number"==typeof r?r:0,c.length)),u=void 0!==a?Math.min(h+a,c.length):c.length;return{blocks:c.slice(h,u),total:l.length,offset:h,limit:void 0!==a?a:void 0}}},93677:function(e,t,s){"use strict";s.d(t,{UIPermissionRequest:function(){return c}});var i=s(82749),n=s(31635),r=s(65478),a=s(67510),o=s(62843),l=s(12234);class c extends a.UIElement{className(){return"UIPermissionRequest"}setToolCall(e){this.toolCall=e,this.updateContent()}setParentView(e){var t,s,i;return null==(t=this.scopeSelect)||t.setParentView(e),null==(s=this.approveButton)||s.setParentView(e),null==(i=this.denyButton)||i.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
111
111
  <div class="&__header">
112
112
  <div class="&__icon"></div>
113
113
  <div class="&__title">~Permission Required~</div>
@@ -117,4 +117,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error
117
117
  </div>`}afterRender(){this.createControls(),this.updateContent()}createControls(){let e=this.getElm("actions");this.denyButton=new o.UIButton(this.j,{icon:{name:"cancel"},variant:"danger",size:"small"}),this.j.e.on(this.denyButton,"click",this.onDeny),this.approveButton=new o.UIButton(this.j,{icon:{name:"check"},variant:"success",size:"small"}),this.j.e.on(this.approveButton,"click",this.onApprove),this.scopeSelect=new l.UISelect(this.j,{name:"permission-scope",options:[{value:"once",text:this.j.i18n("Once")},{value:"conversation",text:this.j.i18n("This conversation")},{value:"forever",text:this.j.i18n("Always")}]}),this.scopeSelect.value=this.state.defaultPermissionScope,e.appendChild(this.denyButton.container),e.appendChild(this.approveButton.container),e.appendChild(this.scopeSelect.container)}updateContent(){this.toolCall&&(this.getElm("tool-info").innerHTML=`
118
118
  <div class="${this.getFullElName("tool-name")}">${this.j.i18n(this.toolCall.name)}</div>
119
119
  <div class="${this.getFullElName("tool-args")}">${this.formatArguments(this.toolCall.arguments)}</div>
120
- `)}formatArguments(e){return Object.entries(e).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(", ")}onApprove(){var e;let t=null==(e=this.scopeSelect)?void 0:e.value;this.j.e.fire("approveToolCall.ai-assistant-pro",this.toolCall.id,t)}onDeny(){this.j.e.fire("denyToolCall.ai-assistant-pro",this.toolCall.id)}destruct(){var e,t,s;null==(e=this.scopeSelect)||e.destruct(),null==(t=this.approveButton)||t.destruct(),null==(s=this.denyButton)||s.destruct(),super.destruct()}constructor(e,t){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"toolCall",void 0),(0,i._)(this,"scopeSelect",void 0),(0,i._)(this,"approveButton",void 0),(0,i._)(this,"denyButton",void 0),this.state=t,this.scopeSelect=null,this.approveButton=null,this.denyButton=null}}(0,n.__decorate)([(0,r.hook)("ready")],c.prototype,"afterRender",null),(0,n.__decorate)([r.autobind],c.prototype,"onApprove",null),(0,n.__decorate)([r.autobind],c.prototype,"onDeny",null),c=(0,n.__decorate)([r.component],c)},93809:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="readDocument",n="Read the entire content of the editor document in HTML format",r=[{name:"start",type:"number",description:"Start character position (default: 0)",required:!1,default:0},{name:"end",type:"number",description:"End character position (default: length of document)",required:!1},{name:"aroundSelection",type:"boolean",description:"If true, return only the maximum block around the current selection",required:!1,default:!1}],a=!1},94668:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Plus icon with document/context --\x3e <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>'},95323:function(e,t,s){"use strict";var i=s(70750),n=s(36142);t.default={...i,execute:n.execute}},96675:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="replaceBlock",n="Replace a specific block in the document by its index or CSS selector with new HTML content",r=[{name:"index",type:"number",description:"Zero-based index of the block to replace (use either index or selector, not both)",required:!1},{name:"selector",type:"string",description:'CSS selector to find the block to replace (e.g., "h1", ".my-class", "#my-id"). Use either selector or index, not both',required:!1},{name:"html",type:"string",description:"HTML content for the new block",required:!0}],a=!0},97603:function(e,t,s){"use strict";var i=s(90022),n=s(79766);t.default={...i,execute:n.execute}},99219:function(e){e.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>'},99359:function(e,t,s){"use strict";s.d(t,{UIMessageListItem:function(){return u}});var i=s(82749),n=s(31635),r=s(81835),a=s(65478),o=s(67510),l=s(62843),c=s(62405),h=s(80870);class u extends o.UIElement{className(){return"UIMessageList"}render(){return`<div class="${this.getFullElName("message")}"></div>`}onReady(){this.updateContent(),this.contextMenu=new h.ContextMenu(this.j)}updateContent(){let e=this.container;e.innerHTML="",e.setAttribute("data-message-id",this.message.id),e.setAttribute("data-role",this.message.role);let t=this.j.c.div(this.getFullElName("message-bubble"));t.classList.add(this.getFullElName("message-bubble",this.message.role,!0));let s=this.j.c.div(this.getFullElName("message-content"));if(s.innerHTML=this.formatMessageContent(this.message.content),t.appendChild(s),this.opts.showTimestamps){let e=this.j.c.div(this.getFullElName("message-timestamp"));e.textContent=this.formatTimestamp(this.message.timestamp),t.appendChild(e)}let i=this.j.c.div(this.getFullElName("message-actions"));if(this.renderActionsButton(i),t.appendChild(i),e.appendChild(t),this.message.toolCalls&&this.message.toolCalls.length>0){let t=this.j.c.div(this.getFullElName("tool-calls"));e.appendChild(t),this.message.toolCalls.forEach(e=>{let s=this.createToolCallElement(e);t.appendChild(s)})}this.message.artifacts&&this.message.artifacts.length>0&&this.renderArtifacts()}renderActionsButton(e){let t=this.opts;(t.showCopyMessageAction||t.showRestartMessageAction||t.showEditMessageAction||t.showDeleteMessageAction)&&(this.actionsButton=new l.UIButton(this.j,{icon:{name:"dots"},tooltip:"Message actions",name:"messageActions",size:"tiny"}),this.actionsButton.onAction(e=>{this.showActionsMenu(e)}),e.appendChild(this.actionsButton.container))}showActionsMenu(e){if(!this.contextMenu||!this.actionsButton)return;let t=this.j,s=t.o.aiAssistantPro,i=[];s.showCopyMessageAction&&i.push({title:"Copy message",icon:"copy",exec:()=>{this.j.e.fire("copyMessage.ai-assistant-pro",this.message.id)}}),"user"===this.message.role&&(s.showRestartMessageAction&&i.push({title:"Restart from here",icon:"update",exec:()=>{this.j.e.fire("restartFromMessage.ai-assistant-pro",this.message.id)}}),s.showEditMessageAction&&i.push({title:"Edit message",icon:"pencil",exec:()=>{this.j.e.fire("editMessage.ai-assistant-pro",this.message.id)}})),s.showDeleteMessageAction&&i.push({title:"Delete message",icon:"bin",exec:()=>{t.confirm("Are you sure you want to delete this message?","Delete message",e=>{e&&this.j.e.fire("deleteMessage.ai-assistant-pro",this.message.id)})}});let n=this.actionsButton.container.getBoundingClientRect();this.contextMenu.show(n.left,n.bottom,i),e.stopPropagation()}renderArtifacts(){if(!this.message.artifacts||0===this.message.artifacts.length)return;let e=this.j.c.div(this.getFullElName("artifacts"));this.container.appendChild(e),this.artifactGroup||(this.artifactGroup=new c.UIGroup(this.j),this.artifactGroup.container.className="jodit-ui-artifact-group"),this.artifactGroup.clear(),this.message.artifacts.forEach(e=>{let t=new r.UIArtifact(this.j,e);this.artifactGroup.append(t)}),e.appendChild(this.artifactGroup.container)}createToolCallElement(e){let t=this.j.c.div(this.getFullElName("tool-call"));t.setAttribute("data-tool-id",e.id),t.setAttribute("data-status",e.status);let s=this.j.c.div(this.getFullElName("tool-header")),i=this.j.c.div(this.getFullElName("tool-icon"));i.classList.add(this.getFullElName("tool-icon",e.status,!0)),i.textContent="⚡";let n=this.j.c.div(this.getFullElName("tool-name"));n.textContent=this.j.i18n(e.name);let r=this.j.c.div(this.getFullElName("tool-status"));r.textContent=this.getToolStatusText(e.status||"unknown"),s.appendChild(i),s.appendChild(n),s.appendChild(r),t.appendChild(s);let a=this.createExpandableSection("Arguments",JSON.stringify(e.arguments||{},null,2));if(t.appendChild(a),e.result){let s=e.result.error?`Error: ${e.result.error}`:e.result.result||"",i=this.createExpandableSection("Result","string"==typeof s?s:JSON.stringify(s,null,2));t.appendChild(i)}return t}createExpandableSection(e,t){let s=this.j.c.div(this.getFullElName("tool-expandable")),i=this.j.c.element("button",{type:"button",class:this.getFullElName("tool-expandable-toggle")});i.textContent=`▶ ${this.j.i18n(e)}`;let n=this.j.c.element("pre",{class:this.getFullElName("tool-expandable-content")});return n.textContent=t,n.style.display="none",this.j.e.on(i,"click",()=>{"none"!==n.style.display?(n.style.display="none",i.textContent=`▶ ${this.j.i18n(e)}`):(n.style.display="block",i.textContent=`▼ ${this.j.i18n(e)}`)}),s.appendChild(i),s.appendChild(n),s}getToolStatusText(e){return({pending:"⏳",approved:"✓",denied:"✕",executing:"⚡",executed:"✓",error:"⚠"})[e]||"●"}formatMessageContent(e){return(0,this.opts.formatMessageContent)(e,this.message.role,this.j.i18n.bind(this.j))}formatTimestamp(e){return(0,this.opts.formatTimestamp)(e,this.j.i18n.bind(this.j))}updateMessage(e){this.message=e,this.updateContent()}destruct(){var e,t,s;null==(e=this.actionsButton)||e.destruct(),null==(t=this.contextMenu)||t.destruct(),null==(s=this.artifactGroup)||s.destruct(),super.destruct()}constructor(e,t,s){super(e),(0,i._)(this,"message",void 0),(0,i._)(this,"opts",void 0),(0,i._)(this,"artifactGroup",void 0),(0,i._)(this,"actionsButton",void 0),(0,i._)(this,"contextMenu",void 0),this.message=t,this.opts=s,this.artifactGroup=null,this.actionsButton=null,this.contextMenu=null}}(0,n.__decorate)([(0,a.hook)("ready")],u.prototype,"onReady",null),u=(0,n.__decorate)([a.component],u)}},function(e){return e(e.s=41810)}])});
120
+ `)}formatArguments(e){return Object.entries(e).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(", ")}onApprove(){var e;let t=null==(e=this.scopeSelect)?void 0:e.value;this.j.e.fire("approveToolCall.ai-assistant-pro",this.toolCall.id,t)}onDeny(){this.j.e.fire("denyToolCall.ai-assistant-pro",this.toolCall.id)}destruct(){var e,t,s;null==(e=this.scopeSelect)||e.destruct(),null==(t=this.approveButton)||t.destruct(),null==(s=this.denyButton)||s.destruct(),super.destruct()}constructor(e,t){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"toolCall",void 0),(0,i._)(this,"scopeSelect",void 0),(0,i._)(this,"approveButton",void 0),(0,i._)(this,"denyButton",void 0),this.state=t,this.scopeSelect=null,this.approveButton=null,this.denyButton=null}}(0,n.__decorate)([(0,r.hook)("ready")],c.prototype,"afterRender",null),(0,n.__decorate)([r.autobind],c.prototype,"onApprove",null),(0,n.__decorate)([r.autobind],c.prototype,"onDeny",null),c=(0,n.__decorate)([r.component],c)},93809:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="readDocument",n="Read the entire content of the editor document in HTML format",r=[{name:"start",type:"number",description:"Start character position (default: 0)",required:!1,default:0},{name:"end",type:"number",description:"End character position (default: length of document)",required:!1},{name:"aroundSelection",type:"boolean",description:"If true, return only the maximum block around the current selection",required:!1,default:!1}],a=!1},94668:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Plus icon with document/context --\x3e <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>'},95323:function(e,t,s){"use strict";var i=s(70750),n=s(36142);t.default={...i,execute:n.execute}},96675:function(e,t,s){"use strict";s.r(t),s.d(t,{description:function(){return n},name:function(){return i},parameters:function(){return r},requiresPermission:function(){return a}});let i="replaceBlock",n="Replace a specific block in the document by its index or CSS selector with new HTML content",r=[{name:"index",type:"number",description:"Zero-based index of the block to replace (use either index or selector, not both)",required:!1},{name:"selector",type:"string",description:'CSS selector to find the block to replace (e.g., "h1", ".my-class", "#my-id"). Use either selector or index, not both',required:!1},{name:"html",type:"string",description:"HTML content for the new block",required:!0}],a=!0},97603:function(e,t,s){"use strict";var i=s(90022),n=s(79766);t.default={...i,execute:n.execute}},99219:function(e){e.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>'}},function(e){return e(e.s=41810)}])});
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -1,14 +1,14 @@
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
  */
8
8
  !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[916],{4278:function(e,t,s){"use strict";s.d(t,{UIBrowserPanel:function(){return p}});var i=s(82749),o=s(31635),r=s(65478),n=s(21537),a=s(67510),l=s(8358),h=s(60062),c=s(70950),d=s(59198),u=s(17234),m=s(43778);class p extends a.UIGroup{className(){return"UIBrowserPanel"}get countInRow(){if("list"===this.state.view||!this.items.elements.length)return 1;let{container:e}=this.items.elements[0],t=(0,n.css)(e,"marginLeft");return Math.floor(this.items.container.offsetWidth/(e.offsetWidth+((0,n.isNumber)(t)?t:0)))}get countInColumn(){if(!this.items.elements.length)return 1;let{container:e}=this.items.elements[0],t=(0,n.css)(e,"marginTop");return Math.floor(this.items.container.offsetHeight/(e.offsetHeight+((0,n.isNumber)(t)?t:0)))}render(){return`<div>
9
9
  <div class='&__content'></div>
10
10
  <div class='&__footer'></div>
11
- </div>`}onChangeTheme(){this.setMod("theme",this.stateManager.state.theme)}onChangeElements(){this.items.build(this.stateManager.state.elements)}onChangeActiveElements(){this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach(e=>{e.setMod("active",!!this.stateManager.isActive(e.item))}),this.j.e.fire("changeSelection")}onChangeFavorites(){this.items.elements.forEach(e=>{e.setMod("favorite",!!this.stateManager.isFavorite(e.item))})}onChangeSources(){this.sources.build(this.stateManager.state.tree)}onChangeLastSelectedIndex(){var e;let t=null==(e=this.items.elements[this.stateManager.state.lastSelectedIndex])?void 0:e.container;t&&((0,n.scrollIntoViewIfNeeded)(t,this.items.container,this.j.od),t.focus())}onChangeInfo(){this.statusbar.value(this.state.info,"center")}onChangePathOrSource(){this.statusbar.value(this.state.currentPath?`${this.state.currentPath} (${this.state.currentSource})`:this.i18n("Home"),"left")}onChangeShowSettings(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)}onChangeShowPreview(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)}onChangeShowSideBar(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)}onChangeView(){this.items.setMod("view",this.stateManager.state.view)}onChangeTileSize(){this.items.setMod("size",this.stateManager.state.tileSize)}onChangeShowFavorites(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)}onItemDblClick(){return this.j.e.fire("select.filebrowser"),!1}onItemClick(e,t){this.stateManager.addActive(e,t)}onTogglePreview(){return this.state.showPreview=!this.state.showPreview,!1}onToggleFavoriteItem(e){this.stateManager.toggleFavorite(e)}onFolderClick(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")}constructor(e,t){super(e),(0,i._)(this,"stateManager",void 0),(0,i._)(this,"syncMod",void 0),(0,i._)(this,"state",void 0),(0,i._)(this,"sources",void 0),(0,i._)(this,"sidebar",void 0),(0,i._)(this,"preview",void 0),(0,i._)(this,"statusbar",void 0),(0,i._)(this,"items",void 0),(0,i._)(this,"settings",void 0),this.stateManager=t,this.syncMod=!0,this.sources=new d.UIBrowserSources(this.j),this.sidebar=new c.UISidebar(this.jodit,[this.sources],this.stateManager.state),this.preview=new l.UIPreview(this.jodit,this.stateManager.state),this.statusbar=new u.UIBrowserStatusBar(this.j),this.items=new m.UIVirtualScroll(this.j,this.stateManager),this.settings=new h.UIBrowserSettings(this.jodit,this.stateManager.state),this.state=t.state,this.append(this.sidebar,"content"),this.append(this.items,"content"),this.append(this.settings,"content"),this.append(this.preview,"content"),this.append(this.statusbar,"footer"),this.onChangeElements(),this.onChangeSources(),this.onChangeView(),this.onChangeTileSize(),this.onChangeShowFavorites(),this.onChangeActiveElements(),this.onChangeFavorites(),this.onChangeShowSideBar(),this.onChangeShowSettings(),this.onChangeShowPreview(),this.onChangeTheme()}}(0,o.__decorate)([(0,r.watch)("state.theme")],p.prototype,"onChangeTheme",null),(0,o.__decorate)([(0,r.watch)("state.elements")],p.prototype,"onChangeElements",null),(0,o.__decorate)([(0,r.watch)("state.activeElements")],p.prototype,"onChangeActiveElements",null),(0,o.__decorate)([(0,r.watch)(["state.favorites","state.elements"])],p.prototype,"onChangeFavorites",null),(0,o.__decorate)([(0,r.watch)("state.sources")],p.prototype,"onChangeSources",null),(0,o.__decorate)([(0,r.watch)("state.lastSelectedIndex")],p.prototype,"onChangeLastSelectedIndex",null),(0,o.__decorate)([(0,r.watch)("state.info")],p.prototype,"onChangeInfo",null),(0,o.__decorate)([(0,r.watch)(["state.currentPath","state.currentSource"])],p.prototype,"onChangePathOrSource",null),(0,o.__decorate)([(0,r.watch)("state.showSettings")],p.prototype,"onChangeShowSettings",null),(0,o.__decorate)([(0,r.watch)("state.showPreview")],p.prototype,"onChangeShowPreview",null),(0,o.__decorate)([(0,r.watch)("state.showSideBar")],p.prototype,"onChangeShowSideBar",null),(0,o.__decorate)([(0,r.watch)("state.view")],p.prototype,"onChangeView",null),(0,o.__decorate)([(0,r.watch)("state.tileSize")],p.prototype,"onChangeTileSize",null),(0,o.__decorate)([(0,r.watch)("state.showFavorites")],p.prototype,"onChangeShowFavorites",null),(0,o.__decorate)([(0,r.watch)(":dblclickItem.filebrowser")],p.prototype,"onItemDblClick",null),(0,o.__decorate)([(0,r.watch)(":clickItem.filebrowser")],p.prototype,"onItemClick",null),(0,o.__decorate)([(0,r.watch)(":togglePreview.filebrowser")],p.prototype,"onTogglePreview",null),(0,o.__decorate)([(0,r.watch)(":toggleFavoriteItem")],p.prototype,"onToggleFavoriteItem",null),(0,o.__decorate)([(0,r.watch)(":openFolder")],p.prototype,"onFolderClick",null),p=(0,o.__decorate)([r.component],p)},5422:function(e,t,s){"use strict";s.d(t,{FileBrowserPro:function(){return P}});var i=s(82749),o=s(31635);s(34042);var r=s(8087),n=s(77841),a=s(17578),l=s(97770),h=s(42663),c=s(55535),d=s(18250),u=s(69277),m=s(4278),p=s(95002),v=s(6441),g=s(82758),f=s(65478),w=s(21537),_=s(70231),y=s(41409),I=s(638),C=s(63399),b=s(50050),S=s(2692),x=s(21246);class P extends I.Dialog{className(){return"FileBrowserPro"}lock(e="any"){return this.container.classList.add("jodit_disabled"),super.lock(e)}unlock(){return this.container.classList.remove("jodit_disabled"),super.unlock()}status(e,t=!(e instanceof Error)){(0,w.isAbort)(e)||(g.IS_PROD||(0,w.isString)(e),this.message.message((0,w.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg))}get progressbar(){return new p.UIProgress(this,this.stateManager.state)}addDisclaimer(e){this.dialog.appendChild(e)}async open(e=this.o.defaultCallback,t){return this.state.onlyImages=!!t,this.prepareOpening(e),super.open(this.panel.container),this.e.fire("update.filebrowser")}onResizeWindow(){(0,w.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})}onChangePath(){let{currentPath:e,currentSource:t}=this.state;this.uploader.setPath(e),this.uploader.setSource(t)}onChangeTheme(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme}onToggleSettings(){this.state.showSettings=!this.state.showSettings}prepareOpening(e){this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=t=>{this.close(),e(t)}),this.persistent.syncWithState()}registerGlobalListeners(){this.e.on(this.ow,"keydown",this.onKeyPress)}onKeyPress(e){let{activeElement:t}=this.od;if(!this.state.activeElements.length||!t||!y.Dom.isOrContains(this.panel.items.container,t))return;let s=this.state.elements;switch(e.key){case g.KEY_ENTER:return this.onChooseItems();case g.KEY_DELETE:return this.onFileRemove();case g.KEY_RIGHT:case g.KEY_LEFT:case g.KEY_DOWN:case g.KEY_UP:{let t,i=e.key===g.KEY_RIGHT||e.key===g.KEY_DOWN,o=this.state.lastSelectedIndex;if([g.KEY_RIGHT,g.KEY_LEFT].includes(e.key))t=i?s[o+1]?o+1:0:s[o-1]?o-1:s.length-1;else{let{countInRow:e}=this.panel;t=Math.round(((o+1)/e+(i?1:-1))*e-1)}return s[t]&&this.stateManager.addActive(s[t],e.shiftKey),!1}}}removeGlobalListeners(){this.e.off(this.ow,"keydown",this.onKeyPress)}onFileRemove(){this.state.activeElements.length&&this.confirm("Are you sure?","Delete",e=>{e&&this.__itemsRemove(this.state.activeElements)}).bindDestruct(this)}__itemsRemove(e){if(!e.length)return Promise.resolve();let t=[];return e.forEach(e=>{var s;t.push("folder"===e.type?this.__folderRemove((0,n.parentPath)(e.path),null!=(s=e.name)?s:"",e.sourceName):this.__removeFile(e.file||e.name||"",e.sourceName))}),this.state.activeElements.forEach(e=>{this.stateManager.isFavorite(e)&&this.stateManager.toggleFavorite(e)}),this.state.activeElements=[],Promise.allSettled(t).then(()=>Promise.allSettled([this.loadingManager.loadItems(),this.loadingManager.loadFolders()]))}__removeFile(e,t){return this.dataProvider.fileRemove(this.state.currentPath,e,t).then(t=>{this.status(t||this.i18n('File "%s" was deleted',e),!0)}).catch(this.status)}__folderRemove(e,t,s){return this.dataProvider.folderRemove(e,t,s).then(i=>{this.status(i||this.i18n('Folder "%s" was deleted',t),!0),this.state.currentPath===e&&(this.state.currentPath=(0,n.parentPath)(e),this.state.currentSource=s)}).catch(this.status)}onFileEdit(){if(1===this.state.activeElements.length){let[e]=this.state.activeElements;b.openImageEditor.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}}onFolderRename(e){this.prompt("Enter new name","Rename",t=>{if(!(0,w.isValidName)(t)||t===e.name)return this.status(this.i18n("Enter new name")),!1;this.dataProvider.folderRename((0,n.parentPath)(e.path),e.name,t,e.sourceName).then(s=>{this.state.activeElements=[],this.status(s,!0),this.state.currentPath=(0,n.parentPath)(e.path)+"/"+t,this.state.currentSource=e.sourceName,this.historyManager.updateCurrent(),this.loadingManager.loadFolders()}).catch(this.status)},this.i18n("type name"),e.name).bindDestruct(this)}onFolderRemove(e){this.confirm("Are you sure?","Delete",t=>{t&&this.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])}).bindDestruct(this)}onFolderCreate(e){this.prompt("Enter Directory name","Create directory",t=>{let s=e.path||"/";this.dataProvider.createFolder(t,e.path||"/",e.sourceName).then(()=>{this.state.currentSource===e.sourceName&&this.state.currentPath===s?this.e.fire("update.filebrowser"):(this.state.currentSource=e.sourceName,this.state.currentPath=s),this.historyManager.updateCurrent()},this.status)},this.i18n("type name")).bindDestruct(this)}onFileRename(e){let t=e.file||e.name||"";1===this.state.activeElements.length&&t&&this.prompt("Enter new name","Rename",e=>{if(!(0,w.isValidName)(e))return this.status(this.i18n("Enter new name")),!1;this.dataProvider.fileRename(this.state.currentPath,t,e,this.state.currentSource).then(e=>{this.state.activeElements=[],this.status(e,!0),this.loadingManager.loadItems()}).catch(this.status)},this.i18n("type name"),t).bindDestruct(this)}onChooseItems(){let e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type){this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,this.e.fire("afterOpenFolder.filebrowser");return}this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}}onOpenLightBox(e){u.UILightBox.open(this,e,this.state.elements)}initUploader(){let e=this,t=(0,w.ConfigProto)(e.o.uploader||{},v.Config.defaultOptions.uploader),s=()=>this.loadingManager.loadItems();e.uploader=e.getInstance("Uploader",t),e.uploader.bind(e.panel.container,s,e.status),e.e.on("bindUploader.filebrowser",t=>{e.uploader.bind(t,s,e.status)})}destruct(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),super.destruct()}fullFillOptions(){["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach(e=>{null!=this.options[e]&&(this.options[e]=(0,w.ConfigProto)(this.options[e],this.o.ajax))})}constructor(e){super((0,w.ConfigProto)(Object.assign(e||{},{resizable:!0,draggable:!0,toolbarButtons:(null==e?void 0:e.toolbarButtons)||v.Config.defaultOptions.filebrowser.buttons,buttons:S.JoditPro.atom(["filebrowser.settings","fullsize","dialog.close"])}),v.Config.defaultOptions.filebrowser)),(0,i._)(this,"dataProvider",(0,C.makeDataProvider)(this,this.options)),(0,i._)(this,"state",(0,y.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1})),(0,i._)(this,"persistent",new h.PersistentStore(this,this.state)),(0,i._)(this,"loadingManager",new l.LoadingManager(this,this.state)),(0,i._)(this,"stateManager",new c.StateManager(this.state)),(0,i._)(this,"historyManager",new a.HistoryManager(this,this.state)),(0,i._)(this,"contextMenuManager",new r.ContextMenuManager(this)),(0,i._)(this,"header",new d.UIBrowserHeader(this,this.options,this.stateManager)),(0,i._)(this,"panel",new m.UIBrowserPanel(this,this.stateManager)),(0,i._)(this,"files",this.panel),(0,i._)(this,"tree",this.panel),(0,i._)(this,"uploader",void 0),x.license.make(this),!this.persistent.theme&&this.options.theme&&(this.persistent.theme=this.options.theme),this.panel.append(this.progressbar),this.toolbar.setMod("mode","header"),this.setSize(Math.min(this.options.width,screen.width),Math.min(this.options.height,screen.height)).setHeader(this.header),this.onResizeWindow(),this.initUploader(),this.onChangeTheme(),this.fullFillOptions(),this.dataProvider.onProgress(e=>{0===e&&(e=30),this.state.progress=e}),this.e.on("beforeClose",this.removeGlobalListeners),this.e.fire("afterInit"),S.JoditPro.prototype.afterInitHook.call(this)}}(0,o.__decorate)([f.autobind],P.prototype,"status",null),(0,o.__decorate)([f.cache],P.prototype,"progressbar",null),(0,o.__decorate)([(0,f.watch)(":resize",{context:window})],P.prototype,"onResizeWindow",null),(0,o.__decorate)([(0,f.watch)(["state.currentPath","state.currentSource"])],P.prototype,"onChangePath",null),(0,o.__decorate)([(0,f.watch)("state.theme")],P.prototype,"onChangeTheme",null),(0,o.__decorate)([(0,f.watch)(":toggleSettings.filebrowser")],P.prototype,"onToggleSettings",null),(0,o.__decorate)([f.autobind],P.prototype,"onKeyPress",null),(0,o.__decorate)([f.autobind],P.prototype,"removeGlobalListeners",null),(0,o.__decorate)([(0,f.watch)(":fileRemove.filebrowser")],P.prototype,"onFileRemove",null),(0,o.__decorate)([(0,f.watch)(":edit.filebrowser")],P.prototype,"onFileEdit",null),(0,o.__decorate)([(0,f.watch)(":folderRename.filebrowser")],P.prototype,"onFolderRename",null),(0,o.__decorate)([(0,f.watch)(":folderRemove.filebrowser")],P.prototype,"onFolderRemove",null),(0,o.__decorate)([(0,f.watch)(":folderCreate.filebrowser")],P.prototype,"onFolderCreate",null),(0,o.__decorate)([(0,f.watch)(":fileRename.filebrowser")],P.prototype,"onFileRename",null),(0,o.__decorate)([(0,f.watch)(":select.filebrowser")],P.prototype,"onChooseItems",null),(0,o.__decorate)([(0,f.watch)(":openLightBox.filebrowser")],P.prototype,"onOpenLightBox",null),P=(0,o.__decorate)([f.component,(0,f.derive)(_.Dlgs)],P),Object.defineProperty(S.JoditPro.modules,"FileBrowserPro",{value:P,writable:!1,enumerable:!0,configurable:!0})},7307:function(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},8087:function(e,t,s){"use strict";s.d(t,{ContextMenuManager:function(){return a}});var i=s(31635),o=s(80480),r=s(65478),n=s(63399);class a extends o.ViewComponent{className(){return"ContextMenuManager"}onFolderContext(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1}onItemContext(e,t,s){return this.buildContextItemMenu(this.getItemContextActions(e),s),!1}onSourceContext(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1}buildContextItemMenu(e,t){if(!this.j.o.contextMenu)return;let s=(0,n.makeContextMenu)(this.j).setMod("theme",this.j.state.theme);s.show(t.clientX,t.clientY,e.filter(e=>e&&!1!==e.enabled)),this.j.e.on(this.j,"afterClose",()=>{s.isOpened&&s.close()})}getItemContextActions(e){if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});let t=this.j.options,s=this.j.dataProvider,i=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:!!e.isImage&&t.editImage&&i&&(s.canI("ImageResize")||s.canI("ImageCrop")),exec:()=>{this.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:s.canI("FileRename")&&i,exec:()=>this.j.e.fire("fileRename.filebrowser",e)},{icon:"bin",title:"Delete",enabled:s.canI("FileRemove"),exec:()=>this.j.e.fire("fileRemove.filebrowser",e)},{icon:"eye",title:"Preview",enabled:!!(e.isImage||"file"===e.type)&&t.preview&&i,exec:()=>this.j.e.fire("openLightBox.filebrowser",e)},{icon:"upload",title:"Download",exec:()=>{e.fileURL&&this.j.ow.open(e.fileURL)}}]}getFolderContextActions(e){let t=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:()=>{this.j.e.fire("folderRename.filebrowser",e)},enabled:t.canI("FolderRename")},{icon:"bin",title:"Delete",exec:()=>{this.j.e.fire("folderRemove.filebrowser",e)},enabled:t.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)},enabled:t.canI("FolderCreate")}]}getSourceContextActions(e){return[{icon:"plus",title:"Create folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)}}]}}(0,i.__decorate)([(0,r.watch)(":contextmenuFolder.filebrowser")],a.prototype,"onFolderContext",null),(0,i.__decorate)([(0,r.watch)(":contextmenuItem.filebrowser")],a.prototype,"onItemContext",null),(0,i.__decorate)([(0,r.watch)(":contextmenuSource.filebrowser")],a.prototype,"onSourceContext",null),a=(0,i.__decorate)([r.component],a)},8358:function(e,t,s){"use strict";s.d(t,{UIPreview:function(){return u}});var i=s(82749),o=s(31635),r=s(65478),n=s(2748),a=s(43555),l=s(38837),h=s(62405),c=s(21130),d=s(54747);class u extends h.UIGroup{className(){return"UIPreview"}addResize(){(0,a.css)(this.container,{width:null,height:null}),d.UIResize.remove(this),d.UIResize.install(this,screen.width>450?"left":"top")}render(){return`<div>
11
+ </div>`}onChangeTheme(){this.setMod("theme",this.stateManager.state.theme)}onChangeElements(){this.items.build(this.stateManager.state.elements)}onChangeActiveElements(){this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach(e=>{e.setMod("active",!!this.stateManager.isActive(e.item))}),this.j.e.fire("changeSelection")}onChangeFavorites(){this.items.elements.forEach(e=>{e.setMod("favorite",!!this.stateManager.isFavorite(e.item))})}onChangeSources(){this.sources.build(this.stateManager.state.tree)}onChangeLastSelectedIndex(){var e;let t=null==(e=this.items.elements[this.stateManager.state.lastSelectedIndex])?void 0:e.container;t&&((0,n.scrollIntoViewIfNeeded)(t,this.items.container,this.j.od),t.focus())}onChangeInfo(){this.statusbar.value(this.state.info,"center")}onChangePathOrSource(){this.statusbar.value(this.state.currentPath?`${this.state.currentPath} (${this.state.currentSource})`:this.i18n("Home"),"left")}onChangeShowSettings(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)}onChangeShowPreview(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)}onChangeShowSideBar(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)}onChangeView(){this.items.setMod("view",this.stateManager.state.view)}onChangeTileSize(){this.items.setMod("size",this.stateManager.state.tileSize)}onChangeShowFavorites(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)}onItemDblClick(){return this.j.e.fire("select.filebrowser"),!1}onItemClick(e,t){this.stateManager.addActive(e,t)}onTogglePreview(){return this.state.showPreview=!this.state.showPreview,!1}onToggleFavoriteItem(e){this.stateManager.toggleFavorite(e)}onFolderClick(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")}constructor(e,t){super(e),(0,i._)(this,"stateManager",void 0),(0,i._)(this,"syncMod",void 0),(0,i._)(this,"state",void 0),(0,i._)(this,"sources",void 0),(0,i._)(this,"sidebar",void 0),(0,i._)(this,"preview",void 0),(0,i._)(this,"statusbar",void 0),(0,i._)(this,"items",void 0),(0,i._)(this,"settings",void 0),this.stateManager=t,this.syncMod=!0,this.sources=new d.UIBrowserSources(this.j),this.sidebar=new c.UISidebar(this.jodit,[this.sources],this.stateManager.state),this.preview=new l.UIPreview(this.jodit,this.stateManager.state),this.statusbar=new u.UIBrowserStatusBar(this.j),this.items=new m.UIVirtualScroll(this.j,this.stateManager),this.settings=new h.UIBrowserSettings(this.jodit,this.stateManager.state),this.state=t.state,this.append(this.sidebar,"content"),this.append(this.items,"content"),this.append(this.settings,"content"),this.append(this.preview,"content"),this.append(this.statusbar,"footer"),this.onChangeElements(),this.onChangeSources(),this.onChangeView(),this.onChangeTileSize(),this.onChangeShowFavorites(),this.onChangeActiveElements(),this.onChangeFavorites(),this.onChangeShowSideBar(),this.onChangeShowSettings(),this.onChangeShowPreview(),this.onChangeTheme()}}(0,o.__decorate)([(0,r.watch)("state.theme")],p.prototype,"onChangeTheme",null),(0,o.__decorate)([(0,r.watch)("state.elements")],p.prototype,"onChangeElements",null),(0,o.__decorate)([(0,r.watch)("state.activeElements")],p.prototype,"onChangeActiveElements",null),(0,o.__decorate)([(0,r.watch)(["state.favorites","state.elements"])],p.prototype,"onChangeFavorites",null),(0,o.__decorate)([(0,r.watch)("state.sources")],p.prototype,"onChangeSources",null),(0,o.__decorate)([(0,r.watch)("state.lastSelectedIndex")],p.prototype,"onChangeLastSelectedIndex",null),(0,o.__decorate)([(0,r.watch)("state.info")],p.prototype,"onChangeInfo",null),(0,o.__decorate)([(0,r.watch)(["state.currentPath","state.currentSource"])],p.prototype,"onChangePathOrSource",null),(0,o.__decorate)([(0,r.watch)("state.showSettings")],p.prototype,"onChangeShowSettings",null),(0,o.__decorate)([(0,r.watch)("state.showPreview")],p.prototype,"onChangeShowPreview",null),(0,o.__decorate)([(0,r.watch)("state.showSideBar")],p.prototype,"onChangeShowSideBar",null),(0,o.__decorate)([(0,r.watch)("state.view")],p.prototype,"onChangeView",null),(0,o.__decorate)([(0,r.watch)("state.tileSize")],p.prototype,"onChangeTileSize",null),(0,o.__decorate)([(0,r.watch)("state.showFavorites")],p.prototype,"onChangeShowFavorites",null),(0,o.__decorate)([(0,r.watch)(":dblclickItem.filebrowser")],p.prototype,"onItemDblClick",null),(0,o.__decorate)([(0,r.watch)(":clickItem.filebrowser")],p.prototype,"onItemClick",null),(0,o.__decorate)([(0,r.watch)(":togglePreview.filebrowser")],p.prototype,"onTogglePreview",null),(0,o.__decorate)([(0,r.watch)(":toggleFavoriteItem")],p.prototype,"onToggleFavoriteItem",null),(0,o.__decorate)([(0,r.watch)(":openFolder")],p.prototype,"onFolderClick",null),p=(0,o.__decorate)([r.component],p)},5422:function(e,t,s){"use strict";s.d(t,{FileBrowserPro:function(){return P}});var i=s(82749),o=s(31635);s(34042);var r=s(8087),n=s(77841),a=s(17578),l=s(97770),h=s(42663),c=s(55535),d=s(18250),u=s(69277),m=s(4278),p=s(95002),v=s(6441),g=s(82758),f=s(65478),w=s(21537),_=s(70231),y=s(41409),I=s(638),C=s(63399),b=s(50050),S=s(2692),x=s(21246);class P extends I.Dialog{className(){return"FileBrowserPro"}lock(e="any"){return this.container.classList.add("jodit_disabled"),super.lock(e)}unlock(){return this.container.classList.remove("jodit_disabled"),super.unlock()}status(e,t=!(e instanceof Error)){(0,w.isAbortError)(e)||(g.IS_PROD||(0,w.isString)(e),this.message.message((0,w.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg))}get progressbar(){return new p.UIProgress(this,this.stateManager.state)}addDisclaimer(e){this.dialog.appendChild(e)}async open(e=this.o.defaultCallback,t){return this.state.onlyImages=!!t,this.prepareOpening(e),super.open(this.panel.container),this.e.fire("update.filebrowser")}onResizeWindow(){(0,w.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})}onChangePath(){let{currentPath:e,currentSource:t}=this.state;this.uploader.setPath(e),this.uploader.setSource(t)}onChangeTheme(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme}onToggleSettings(){this.state.showSettings=!this.state.showSettings}prepareOpening(e){this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=t=>{this.close(),e(t)}),this.persistent.syncWithState()}registerGlobalListeners(){this.e.on(this.ow,"keydown",this.onKeyPress)}onKeyPress(e){let{activeElement:t}=this.od;if(!this.state.activeElements.length||!t||!y.Dom.isOrContains(this.panel.items.container,t))return;let s=this.state.elements;switch(e.key){case g.KEY_ENTER:return this.onChooseItems();case g.KEY_DELETE:return this.onFileRemove();case g.KEY_RIGHT:case g.KEY_LEFT:case g.KEY_DOWN:case g.KEY_UP:{let t,i=e.key===g.KEY_RIGHT||e.key===g.KEY_DOWN,o=this.state.lastSelectedIndex;if([g.KEY_RIGHT,g.KEY_LEFT].includes(e.key))t=i?s[o+1]?o+1:0:s[o-1]?o-1:s.length-1;else{let{countInRow:e}=this.panel;t=Math.round(((o+1)/e+(i?1:-1))*e-1)}return s[t]&&this.stateManager.addActive(s[t],e.shiftKey),!1}}}removeGlobalListeners(){this.e.off(this.ow,"keydown",this.onKeyPress)}onFileRemove(){this.state.activeElements.length&&this.confirm("Are you sure?","Delete",e=>{e&&this.__itemsRemove(this.state.activeElements)}).bindDestruct(this)}__itemsRemove(e){if(!e.length)return Promise.resolve();let t=[];return e.forEach(e=>{var s;t.push("folder"===e.type?this.__folderRemove((0,n.parentPath)(e.path),null!=(s=e.name)?s:"",e.sourceName):this.__removeFile(e.file||e.name||"",e.sourceName))}),this.state.activeElements.forEach(e=>{this.stateManager.isFavorite(e)&&this.stateManager.toggleFavorite(e)}),this.state.activeElements=[],Promise.allSettled(t).then(()=>Promise.allSettled([this.loadingManager.loadItems(),this.loadingManager.loadFolders()]))}__removeFile(e,t){return this.dataProvider.fileRemove(this.state.currentPath,e,t).then(t=>{this.status(t||this.i18n('File "%s" was deleted',e),!0)}).catch(this.status)}__folderRemove(e,t,s){return this.dataProvider.folderRemove(e,t,s).then(i=>{this.status(i||this.i18n('Folder "%s" was deleted',t),!0),this.state.currentPath===e&&(this.state.currentPath=(0,n.parentPath)(e),this.state.currentSource=s)}).catch(this.status)}onFileEdit(){if(1===this.state.activeElements.length){let[e]=this.state.activeElements;b.openImageEditor.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}}onFolderRename(e){this.prompt("Enter new name","Rename",t=>{if(!(0,w.isValidName)(t)||t===e.name)return this.status(this.i18n("Enter new name")),!1;this.dataProvider.folderRename((0,n.parentPath)(e.path),e.name,t,e.sourceName).then(s=>{this.state.activeElements=[],this.status(s,!0),this.state.currentPath=(0,n.parentPath)(e.path)+"/"+t,this.state.currentSource=e.sourceName,this.historyManager.updateCurrent(),this.loadingManager.loadFolders()}).catch(this.status)},this.i18n("type name"),e.name).bindDestruct(this)}onFolderRemove(e){this.confirm("Are you sure?","Delete",t=>{t&&this.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])}).bindDestruct(this)}onFolderCreate(e){this.prompt("Enter Directory name","Create directory",t=>{let s=e.path||"/";this.dataProvider.createFolder(t,e.path||"/",e.sourceName).then(()=>{this.state.currentSource===e.sourceName&&this.state.currentPath===s?this.e.fire("update.filebrowser"):(this.state.currentSource=e.sourceName,this.state.currentPath=s),this.historyManager.updateCurrent()},this.status)},this.i18n("type name")).bindDestruct(this)}onFileRename(e){let t=e.file||e.name||"";1===this.state.activeElements.length&&t&&this.prompt("Enter new name","Rename",e=>{if(!(0,w.isValidName)(e))return this.status(this.i18n("Enter new name")),!1;this.dataProvider.fileRename(this.state.currentPath,t,e,this.state.currentSource).then(e=>{this.state.activeElements=[],this.status(e,!0),this.loadingManager.loadItems()}).catch(this.status)},this.i18n("type name"),t).bindDestruct(this)}onChooseItems(){let e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type){this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,this.e.fire("afterOpenFolder.filebrowser");return}this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}}onOpenLightBox(e){u.UILightBox.open(this,e,this.state.elements)}initUploader(){let e=this,t=(0,w.ConfigProto)(e.o.uploader||{},v.Config.defaultOptions.uploader),s=()=>this.loadingManager.loadItems();e.uploader=e.getInstance("Uploader",t),e.uploader.bind(e.panel.container,s,e.status),e.e.on("bindUploader.filebrowser",t=>{e.uploader.bind(t,s,e.status)})}destruct(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),super.destruct()}fullFillOptions(){["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach(e=>{null!=this.options[e]&&(this.options[e]=(0,w.ConfigProto)(this.options[e],this.o.ajax))})}constructor(e){super((0,w.ConfigProto)(Object.assign(e||{},{resizable:!0,draggable:!0,toolbarButtons:(null==e?void 0:e.toolbarButtons)||v.Config.defaultOptions.filebrowser.buttons,buttons:S.JoditPro.atom(["filebrowser.settings","fullsize","dialog.close"])}),v.Config.defaultOptions.filebrowser)),(0,i._)(this,"dataProvider",(0,C.makeDataProvider)(this,this.options)),(0,i._)(this,"state",(0,y.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1})),(0,i._)(this,"persistent",new h.PersistentStore(this,this.state)),(0,i._)(this,"loadingManager",new l.LoadingManager(this,this.state)),(0,i._)(this,"stateManager",new c.StateManager(this.state)),(0,i._)(this,"historyManager",new a.HistoryManager(this,this.state)),(0,i._)(this,"contextMenuManager",new r.ContextMenuManager(this)),(0,i._)(this,"header",new d.UIBrowserHeader(this,this.options,this.stateManager)),(0,i._)(this,"panel",new m.UIBrowserPanel(this,this.stateManager)),(0,i._)(this,"files",this.panel),(0,i._)(this,"tree",this.panel),(0,i._)(this,"uploader",void 0),x.license.make(this),!this.persistent.theme&&this.options.theme&&(this.persistent.theme=this.options.theme),this.panel.append(this.progressbar),this.toolbar.setMod("mode","header"),this.setSize(Math.min(this.options.width,screen.width),Math.min(this.options.height,screen.height)).setHeader(this.header),this.onResizeWindow(),this.initUploader(),this.onChangeTheme(),this.fullFillOptions(),this.dataProvider.onProgress(e=>{0===e&&(e=30),this.state.progress=e}),this.e.on("beforeClose",this.removeGlobalListeners),this.e.fire("afterInit"),S.JoditPro.prototype.afterInitHook.call(this)}}(0,o.__decorate)([f.autobind],P.prototype,"status",null),(0,o.__decorate)([f.cache],P.prototype,"progressbar",null),(0,o.__decorate)([(0,f.watch)(":resize",{context:window})],P.prototype,"onResizeWindow",null),(0,o.__decorate)([(0,f.watch)(["state.currentPath","state.currentSource"])],P.prototype,"onChangePath",null),(0,o.__decorate)([(0,f.watch)("state.theme")],P.prototype,"onChangeTheme",null),(0,o.__decorate)([(0,f.watch)(":toggleSettings.filebrowser")],P.prototype,"onToggleSettings",null),(0,o.__decorate)([f.autobind],P.prototype,"onKeyPress",null),(0,o.__decorate)([f.autobind],P.prototype,"removeGlobalListeners",null),(0,o.__decorate)([(0,f.watch)(":fileRemove.filebrowser")],P.prototype,"onFileRemove",null),(0,o.__decorate)([(0,f.watch)(":edit.filebrowser")],P.prototype,"onFileEdit",null),(0,o.__decorate)([(0,f.watch)(":folderRename.filebrowser")],P.prototype,"onFolderRename",null),(0,o.__decorate)([(0,f.watch)(":folderRemove.filebrowser")],P.prototype,"onFolderRemove",null),(0,o.__decorate)([(0,f.watch)(":folderCreate.filebrowser")],P.prototype,"onFolderCreate",null),(0,o.__decorate)([(0,f.watch)(":fileRename.filebrowser")],P.prototype,"onFileRename",null),(0,o.__decorate)([(0,f.watch)(":select.filebrowser")],P.prototype,"onChooseItems",null),(0,o.__decorate)([(0,f.watch)(":openLightBox.filebrowser")],P.prototype,"onOpenLightBox",null),P=(0,o.__decorate)([f.component,(0,f.derive)(_.Dlgs)],P),Object.defineProperty(S.JoditPro.modules,"FileBrowserPro",{value:P,writable:!1,enumerable:!0,configurable:!0})},7307:function(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},8087:function(e,t,s){"use strict";s.d(t,{ContextMenuManager:function(){return a}});var i=s(31635),o=s(80480),r=s(65478),n=s(63399);class a extends o.ViewComponent{className(){return"ContextMenuManager"}onFolderContext(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1}onItemContext(e,t,s){return this.buildContextItemMenu(this.getItemContextActions(e),s),!1}onSourceContext(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1}buildContextItemMenu(e,t){if(!this.j.o.contextMenu)return;let s=(0,n.makeContextMenu)(this.j).setMod("theme",this.j.state.theme);s.show(t.clientX,t.clientY,e.filter(e=>e&&!1!==e.enabled)),this.j.e.on(this.j,"afterClose",()=>{s.isOpened&&s.close()})}getItemContextActions(e){if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});let t=this.j.options,s=this.j.dataProvider,i=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:!!e.isImage&&t.editImage&&i&&(s.canI("ImageResize")||s.canI("ImageCrop")),exec:()=>{this.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:s.canI("FileRename")&&i,exec:()=>this.j.e.fire("fileRename.filebrowser",e)},{icon:"bin",title:"Delete",enabled:s.canI("FileRemove"),exec:()=>this.j.e.fire("fileRemove.filebrowser",e)},{icon:"eye",title:"Preview",enabled:!!(e.isImage||"file"===e.type)&&t.preview&&i,exec:()=>this.j.e.fire("openLightBox.filebrowser",e)},{icon:"upload",title:"Download",exec:()=>{e.fileURL&&this.j.ow.open(e.fileURL)}}]}getFolderContextActions(e){let t=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:()=>{this.j.e.fire("folderRename.filebrowser",e)},enabled:t.canI("FolderRename")},{icon:"bin",title:"Delete",exec:()=>{this.j.e.fire("folderRemove.filebrowser",e)},enabled:t.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)},enabled:t.canI("FolderCreate")}]}getSourceContextActions(e){return[{icon:"plus",title:"Create folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)}}]}}(0,i.__decorate)([(0,r.watch)(":contextmenuFolder.filebrowser")],a.prototype,"onFolderContext",null),(0,i.__decorate)([(0,r.watch)(":contextmenuItem.filebrowser")],a.prototype,"onItemContext",null),(0,i.__decorate)([(0,r.watch)(":contextmenuSource.filebrowser")],a.prototype,"onSourceContext",null),a=(0,i.__decorate)([r.component],a)},8358:function(e,t,s){"use strict";s.d(t,{UIPreview:function(){return u}});var i=s(82749),o=s(31635),r=s(65478),n=s(2748),a=s(43555),l=s(38837),h=s(62405),c=s(21130),d=s(54747);class u extends h.UIGroup{className(){return"UIPreview"}addResize(){(0,a.css)(this.container,{width:null,height:null}),d.UIResize.remove(this),d.UIResize.install(this,screen.width>450?"left":"top")}render(){return`<div>
12
12
  <div class="&__image"></div>
13
13
  <div class="&__info"></div>
14
14
  <div class="&__loader"></div>