jodit-pro 4.13.4 → 4.13.7

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 (361) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.css +1 -1
  3. package/es2015/jodit.fat.min.js +10 -10
  4. package/es2015/jodit.js +19 -5
  5. package/es2015/jodit.min.js +3 -3
  6. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  7. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  8. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  9. package/es2015/plugins/autocomplete/autocomplete.css +1 -1
  10. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  11. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  12. package/es2015/plugins/backup/backup.css +1 -1
  13. package/es2015/plugins/backup/backup.js +1 -1
  14. package/es2015/plugins/backup/backup.min.js +1 -1
  15. package/es2015/plugins/button-generator/button-generator.css +1 -1
  16. package/es2015/plugins/button-generator/button-generator.js +1 -1
  17. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  18. package/es2015/plugins/change-case/change-case.js +1 -1
  19. package/es2015/plugins/change-case/change-case.min.js +1 -1
  20. package/es2015/plugins/color-picker/color-picker.css +1 -1
  21. package/es2015/plugins/color-picker/color-picker.js +1 -1
  22. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  23. package/es2015/plugins/emoji/emoji.css +1 -1
  24. package/es2015/plugins/emoji/emoji.js +1 -1
  25. package/es2015/plugins/emoji/emoji.min.js +1 -1
  26. package/es2015/plugins/export-docs/export-docs.js +1 -1
  27. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  28. package/es2015/plugins/finder/finder.css +4 -1
  29. package/es2015/plugins/finder/finder.js +503 -112
  30. package/es2015/plugins/finder/finder.min.css +1 -1
  31. package/es2015/plugins/finder/finder.min.js +7 -7
  32. package/es2015/plugins/google-maps/google-maps.css +1 -1
  33. package/es2015/plugins/google-maps/google-maps.js +1 -1
  34. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  35. package/es2015/plugins/google-search/google-search.js +1 -1
  36. package/es2015/plugins/google-search/google-search.min.js +1 -1
  37. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  38. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  39. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  40. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  41. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  42. package/es2015/plugins/image-editor-pro/image-editor-pro.css +1 -1
  43. package/es2015/plugins/image-editor-pro/image-editor-pro.js +29 -11
  44. package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +2 -2
  45. package/es2015/plugins/keyboard/keyboard.css +1 -1
  46. package/es2015/plugins/keyboard/keyboard.js +1 -1
  47. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  48. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  49. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  50. package/es2015/plugins/page-break/page-break.js +1 -1
  51. package/es2015/plugins/page-break/page-break.min.js +1 -1
  52. package/es2015/plugins/paste-code/paste-code.css +1 -1
  53. package/es2015/plugins/paste-code/paste-code.js +1 -1
  54. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  55. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  56. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  57. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  58. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  59. package/es2015/plugins/style/style.css +1 -1
  60. package/es2015/plugins/style/style.js +1 -1
  61. package/es2015/plugins/style/style.min.js +1 -1
  62. package/es2015/plugins/templates/templates.css +1 -1
  63. package/es2015/plugins/templates/templates.js +1 -1
  64. package/es2015/plugins/templates/templates.min.js +1 -1
  65. package/es2015/plugins/todo-list/todo-list.css +1 -1
  66. package/es2015/plugins/todo-list/todo-list.js +1 -1
  67. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  68. package/es2015/plugins/translate/translate.css +1 -1
  69. package/es2015/plugins/translate/translate.js +1 -1
  70. package/es2015/plugins/translate/translate.min.js +1 -1
  71. package/es2015/plugins/tune-block/tune-block.css +1 -1
  72. package/es2015/plugins/tune-block/tune-block.js +1 -1
  73. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  74. package/es2018/jodit.fat.min.css +1 -1
  75. package/es2018/jodit.fat.min.js +21 -21
  76. package/es2018/jodit.min.js +3 -3
  77. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  78. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  79. package/es2018/plugins/backup/backup.min.js +1 -1
  80. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  81. package/es2018/plugins/change-case/change-case.min.js +1 -1
  82. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  83. package/es2018/plugins/emoji/emoji.min.js +1 -1
  84. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  85. package/es2018/plugins/finder/finder.min.css +1 -1
  86. package/es2018/plugins/finder/finder.min.js +13 -13
  87. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  88. package/es2018/plugins/google-search/google-search.min.js +1 -1
  89. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  90. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  91. package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +2 -2
  92. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  93. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  94. package/es2018/plugins/page-break/page-break.min.js +1 -1
  95. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  96. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  97. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  98. package/es2018/plugins/style/style.min.js +1 -1
  99. package/es2018/plugins/templates/templates.min.js +1 -1
  100. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  101. package/es2018/plugins/translate/translate.min.js +1 -1
  102. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  103. package/es2021/jodit.css +1 -1
  104. package/es2021/jodit.fat.min.css +1 -1
  105. package/es2021/jodit.fat.min.js +20 -20
  106. package/es2021/jodit.js +19 -5
  107. package/es2021/jodit.min.js +4 -4
  108. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  109. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  110. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  111. package/es2021/plugins/autocomplete/autocomplete.css +1 -1
  112. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  113. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  114. package/es2021/plugins/backup/backup.css +1 -1
  115. package/es2021/plugins/backup/backup.js +1 -1
  116. package/es2021/plugins/backup/backup.min.js +1 -1
  117. package/es2021/plugins/button-generator/button-generator.css +1 -1
  118. package/es2021/plugins/button-generator/button-generator.js +1 -1
  119. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  120. package/es2021/plugins/change-case/change-case.js +1 -1
  121. package/es2021/plugins/change-case/change-case.min.js +1 -1
  122. package/es2021/plugins/color-picker/color-picker.css +1 -1
  123. package/es2021/plugins/color-picker/color-picker.js +1 -1
  124. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  125. package/es2021/plugins/emoji/emoji.css +1 -1
  126. package/es2021/plugins/emoji/emoji.js +1 -1
  127. package/es2021/plugins/emoji/emoji.min.js +1 -1
  128. package/es2021/plugins/export-docs/export-docs.js +1 -1
  129. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  130. package/es2021/plugins/finder/finder.css +4 -1
  131. package/es2021/plugins/finder/finder.js +501 -112
  132. package/es2021/plugins/finder/finder.min.css +1 -1
  133. package/es2021/plugins/finder/finder.min.js +13 -13
  134. package/es2021/plugins/google-maps/google-maps.css +1 -1
  135. package/es2021/plugins/google-maps/google-maps.js +1 -1
  136. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  137. package/es2021/plugins/google-search/google-search.js +1 -1
  138. package/es2021/plugins/google-search/google-search.min.js +1 -1
  139. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  140. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  141. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  142. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  143. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  144. package/es2021/plugins/image-editor-pro/image-editor-pro.css +1 -1
  145. package/es2021/plugins/image-editor-pro/image-editor-pro.js +29 -11
  146. package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +4 -4
  147. package/es2021/plugins/keyboard/keyboard.css +1 -1
  148. package/es2021/plugins/keyboard/keyboard.js +1 -1
  149. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  150. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  151. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  152. package/es2021/plugins/page-break/page-break.js +1 -1
  153. package/es2021/plugins/page-break/page-break.min.js +1 -1
  154. package/es2021/plugins/paste-code/paste-code.css +1 -1
  155. package/es2021/plugins/paste-code/paste-code.js +1 -1
  156. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  157. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  158. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  159. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  160. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  161. package/es2021/plugins/style/style.css +1 -1
  162. package/es2021/plugins/style/style.js +1 -1
  163. package/es2021/plugins/style/style.min.js +1 -1
  164. package/es2021/plugins/templates/templates.css +1 -1
  165. package/es2021/plugins/templates/templates.js +1 -1
  166. package/es2021/plugins/templates/templates.min.js +1 -1
  167. package/es2021/plugins/todo-list/todo-list.css +1 -1
  168. package/es2021/plugins/todo-list/todo-list.js +1 -1
  169. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  170. package/es2021/plugins/translate/translate.css +1 -1
  171. package/es2021/plugins/translate/translate.js +1 -1
  172. package/es2021/plugins/translate/translate.min.js +1 -1
  173. package/es2021/plugins/tune-block/tune-block.css +1 -1
  174. package/es2021/plugins/tune-block/tune-block.js +1 -1
  175. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  176. package/es2021.en/jodit.css +1 -1
  177. package/es2021.en/jodit.fat.min.css +1 -1
  178. package/es2021.en/jodit.fat.min.js +11 -11
  179. package/es2021.en/jodit.js +19 -5
  180. package/es2021.en/jodit.min.js +4 -4
  181. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  182. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  183. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  184. package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
  185. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  186. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  187. package/es2021.en/plugins/backup/backup.css +1 -1
  188. package/es2021.en/plugins/backup/backup.js +1 -1
  189. package/es2021.en/plugins/backup/backup.min.js +1 -1
  190. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  191. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  192. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  193. package/es2021.en/plugins/change-case/change-case.js +1 -1
  194. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  195. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  196. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  197. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  198. package/es2021.en/plugins/emoji/emoji.css +1 -1
  199. package/es2021.en/plugins/emoji/emoji.js +1 -1
  200. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  201. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  202. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  203. package/es2021.en/plugins/finder/finder.css +4 -1
  204. package/es2021.en/plugins/finder/finder.js +491 -110
  205. package/es2021.en/plugins/finder/finder.min.css +1 -1
  206. package/es2021.en/plugins/finder/finder.min.js +13 -13
  207. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  208. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  209. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  210. package/es2021.en/plugins/google-search/google-search.js +1 -1
  211. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  212. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  213. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  214. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  215. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  216. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  217. package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +1 -1
  218. package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +29 -11
  219. package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +4 -4
  220. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  221. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  222. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  223. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  224. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  225. package/es2021.en/plugins/page-break/page-break.js +1 -1
  226. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  227. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  228. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  229. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  230. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  231. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  232. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  233. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  234. package/es2021.en/plugins/style/style.css +1 -1
  235. package/es2021.en/plugins/style/style.js +1 -1
  236. package/es2021.en/plugins/style/style.min.js +1 -1
  237. package/es2021.en/plugins/templates/templates.css +1 -1
  238. package/es2021.en/plugins/templates/templates.js +1 -1
  239. package/es2021.en/plugins/templates/templates.min.js +1 -1
  240. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  241. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  242. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  243. package/es2021.en/plugins/translate/translate.css +1 -1
  244. package/es2021.en/plugins/translate/translate.js +1 -1
  245. package/es2021.en/plugins/translate/translate.min.js +1 -1
  246. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  247. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  248. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  249. package/es5/jodit.css +2 -2
  250. package/es5/jodit.fat.min.css +1 -1
  251. package/es5/jodit.fat.min.js +2 -2
  252. package/es5/jodit.js +19 -5
  253. package/es5/jodit.min.css +2 -2
  254. package/es5/jodit.min.js +2 -2
  255. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  256. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  257. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  258. package/es5/plugins/autocomplete/autocomplete.css +1 -1
  259. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  260. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  261. package/es5/plugins/backup/backup.css +1 -1
  262. package/es5/plugins/backup/backup.js +1 -1
  263. package/es5/plugins/backup/backup.min.js +1 -1
  264. package/es5/plugins/button-generator/button-generator.css +1 -1
  265. package/es5/plugins/button-generator/button-generator.js +1 -1
  266. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  267. package/es5/plugins/change-case/change-case.js +1 -1
  268. package/es5/plugins/change-case/change-case.min.js +1 -1
  269. package/es5/plugins/color-picker/color-picker.css +1 -1
  270. package/es5/plugins/color-picker/color-picker.js +1 -1
  271. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  272. package/es5/plugins/emoji/emoji.css +1 -1
  273. package/es5/plugins/emoji/emoji.js +1 -1
  274. package/es5/plugins/emoji/emoji.min.js +1 -1
  275. package/es5/plugins/export-docs/export-docs.js +1 -1
  276. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  277. package/es5/plugins/finder/finder.css +4 -1
  278. package/es5/plugins/finder/finder.js +691 -116
  279. package/es5/plugins/finder/finder.min.css +1 -1
  280. package/es5/plugins/finder/finder.min.js +2 -2
  281. package/es5/plugins/google-maps/google-maps.css +1 -1
  282. package/es5/plugins/google-maps/google-maps.js +1 -1
  283. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  284. package/es5/plugins/google-search/google-search.js +1 -1
  285. package/es5/plugins/google-search/google-search.min.js +1 -1
  286. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  287. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  288. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  289. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  290. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  291. package/es5/plugins/image-editor-pro/image-editor-pro.css +1 -1
  292. package/es5/plugins/image-editor-pro/image-editor-pro.js +30 -12
  293. package/es5/plugins/image-editor-pro/image-editor-pro.min.js +2 -2
  294. package/es5/plugins/keyboard/keyboard.css +1 -1
  295. package/es5/plugins/keyboard/keyboard.js +1 -1
  296. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  297. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  298. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  299. package/es5/plugins/page-break/page-break.js +1 -1
  300. package/es5/plugins/page-break/page-break.min.js +1 -1
  301. package/es5/plugins/paste-code/paste-code.css +1 -1
  302. package/es5/plugins/paste-code/paste-code.js +1 -1
  303. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  304. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  305. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  306. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  307. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  308. package/es5/plugins/style/style.css +1 -1
  309. package/es5/plugins/style/style.js +1 -1
  310. package/es5/plugins/style/style.min.js +1 -1
  311. package/es5/plugins/templates/templates.css +1 -1
  312. package/es5/plugins/templates/templates.js +1 -1
  313. package/es5/plugins/templates/templates.min.js +1 -1
  314. package/es5/plugins/todo-list/todo-list.css +1 -1
  315. package/es5/plugins/todo-list/todo-list.js +1 -1
  316. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  317. package/es5/plugins/translate/translate.css +1 -1
  318. package/es5/plugins/translate/translate.js +1 -1
  319. package/es5/plugins/translate/translate.min.js +1 -1
  320. package/es5/plugins/tune-block/tune-block.css +1 -1
  321. package/es5/plugins/tune-block/tune-block.js +1 -1
  322. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  323. package/es5/polyfills.fat.min.js +1 -1
  324. package/es5/polyfills.js +1 -1
  325. package/es5/polyfills.min.js +1 -1
  326. package/esm/plugins/finder/browser.d.ts +21 -3
  327. package/esm/plugins/finder/browser.js +1 -1
  328. package/esm/plugins/finder/config.js +1 -1
  329. package/esm/plugins/finder/helpers/context-menu.d.ts +6 -0
  330. package/esm/plugins/finder/helpers/context-menu.js +1 -1
  331. package/esm/plugins/finder/helpers/data-provider.d.ts +26 -0
  332. package/esm/plugins/finder/helpers/data-provider.js +1 -0
  333. package/esm/plugins/finder/helpers/helpers.d.ts +27 -0
  334. package/esm/plugins/finder/helpers/helpers.js +1 -1
  335. package/esm/plugins/finder/helpers/persistent-store.d.ts +13 -8
  336. package/esm/plugins/finder/helpers/persistent-store.js +1 -1
  337. package/esm/plugins/finder/interface.d.ts +24 -1
  338. package/esm/plugins/finder/langs/de.d.ts +4 -0
  339. package/esm/plugins/finder/langs/de.js +1 -1
  340. package/esm/plugins/finder/langs/ru.d.ts +4 -0
  341. package/esm/plugins/finder/langs/ru.js +1 -1
  342. package/esm/plugins/finder/ui/header/header.d.ts +7 -1
  343. package/esm/plugins/finder/ui/header/header.js +1 -1
  344. package/esm/plugins/finder/ui/panel/panel.d.ts +5 -0
  345. package/esm/plugins/finder/ui/panel/panel.js +2 -2
  346. package/esm/plugins/finder/ui/virtual-scroll/virtual-scroll.d.ts +5 -0
  347. package/esm/plugins/finder/ui/virtual-scroll/virtual-scroll.js +2 -2
  348. package/esm/plugins/image-editor-pro/adapter.js +1 -1
  349. package/esm/plugins/image-editor-pro/image-editor-pro.js +1 -1
  350. package/package.json +1 -1
  351. package/types/plugins/finder/browser.d.ts +21 -3
  352. package/types/plugins/finder/helpers/context-menu.d.ts +6 -0
  353. package/types/plugins/finder/helpers/data-provider.d.ts +26 -0
  354. package/types/plugins/finder/helpers/helpers.d.ts +27 -0
  355. package/types/plugins/finder/helpers/persistent-store.d.ts +13 -8
  356. package/types/plugins/finder/interface.d.ts +24 -1
  357. package/types/plugins/finder/langs/de.d.ts +4 -0
  358. package/types/plugins/finder/langs/ru.d.ts +4 -0
  359. package/types/plugins/finder/ui/header/header.d.ts +7 -1
  360. package/types/plugins/finder/ui/panel/panel.d.ts +5 -0
  361. package/types/plugins/finder/ui/virtual-scroll/virtual-scroll.d.ts +5 -0
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.4
4
+ * Version: v4.13.7
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
8
- "use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[918],{76542:function(e,t,n){n.d(t,{ProImageEditor:function(){return d}});var i=n(82749),r=n(85013),a=n(6441),o=n(91907),s=n(10830),l=n(78584);class d extends o.ViewComponent{className(){return"ImageEditorPro"}async open(e,t){let n=this.j,i=a.Config.defaultOptions.imageEditorPro,o=n.c.div("jodit-image-editor-pro");o.style.width="100%",o.style.height="100%";let s=new l.Dialog({language:n.o.language});s.setSize(i.dialog.width,i.dialog.height),s.setContent(o),s.open();let d=null,h=null,c=()=>{null==h||h(),h=null,null==d||d.destroy(),d=null,s.close()};s.e.on("beforeClose",()=>{null==h||h(),h=null,null==d||d.destroy(),d=null}),d=new r.ImageEditor({container:o,state:{showToolbar:!1,status:"loading"},onSave:n=>{this.persist(d,e,void 0,n,t,c)},onSaveAs:n=>{this.saveAs(d,e,n,t,c)}}),h=this.mountToolbar(s,d);try{let t=await this.loadImage(e);await d.fromBlob(t)}catch(e){null==d||d.update({status:"error",error:e instanceof Error?e.message:String(e)}),this.error(e)}}mountToolbar(e,t){let n=this.j,i=(0,s.Button)(n,{icon:{name:"save"},text:n.i18n("Save")},"primary"),a=(0,s.Button)(n,{icon:{name:"save"},name:"save-as",text:n.i18n("Save as")}),o=n.c.span("jodit-image-editor-pro__size"),l=(0,s.Button)(n,r.ICONS.minus),d=n.c.span("jodit-image-editor-pro__zoom"),h=(0,s.Button)(n,r.ICONS.plus),c=(0,s.Button)(n,"update",n.i18n("Reset")),u=(0,s.Button)(n,"undo",n.i18n("Undo")),p=(0,s.Button)(n,"redo",n.i18n("Redo"));l.setState({tooltip:"Zoom out"}),h.setState({tooltip:"Zoom in"});let g=null;i.onAction(()=>{g=i,t.save()}),a.onAction(()=>{g=a,t.saveAs()}),l.onAction(()=>t.update({zoom:t.state.zoom/1.2})),h.onAction(()=>t.update({zoom:1.2*t.state.zoom})),c.onAction(()=>t.reset()),u.onAction(()=>t.update({history:{step:-1}})),p.onAction(()=>t.update({history:{step:1}}));let f=(...e)=>{let t=n.c.div("jodit-image-editor-pro__group");return t.style.display="flex",t.style.alignItems="center",t.style.gap="4px",e.forEach(e=>t.appendChild(e)),t},m=n.c.div("jodit-image-editor-pro__toolbar");m.style.display="flex",m.style.alignItems="center",m.style.gap="12px",m.style.width="100%",o.style.opacity="0.75",d.style.minWidth="3.5em",d.style.textAlign="center",m.appendChild(f(i.container,a.container)),m.appendChild(f(o,l.container,d,h.container));let b=f(c.container,u.container,p.container);b.style.marginLeft="auto",m.appendChild(b),e.setHeader(m);let x="jodit-image-editor-pro__button_busy",y=e=>{let t=r.selectors.selectOutputSize(e),n="exporting"===e.status,s=n||"loading"===e.status,l=e.busyVisible,h=n&&(null==l||l);n||(g=null),i.setState({disabled:!e.source||s}),a.setState({disabled:!e.source||s}),i.container.classList.toggle(x,h&&g!==a),a.container.classList.toggle(x,h&&g===a),c.setState({disabled:!r.selectors.selectIsDirty(e)}),u.setState({disabled:!r.selectors.selectCanUndo(e)}),p.setState({disabled:!r.selectors.selectCanRedo(e)}),o.textContent=t?`${t.width} \xd7 ${t.height}`:"";let f=r.selectors.selectViewportFit(e),m=f?Math.round(100*f.scale):Math.round(100*e.zoom);d.textContent=`${m}%`};y(t.state);let w=t.store.subscribe(y);return()=>{w(),[i,a,l,h,c,u,p].forEach(e=>e.destruct())}}saveAs(e,t,n,i,r){this.j.prompt("Enter new name","Save in new file",a=>{let o=(a||"").trim();if(!o)return this.j.alert("The name should not be empty"),!1;this.persist(e,t,o,n,i,r)})}async persist(e,t,n,i,r,a){null==e||e.update({status:"exporting"});try{let{w:e,h:o}=await this.blobSize(i),s=await this.uploadEdited(t,i,n),l=()=>{a(),this.j.e.fire("update.filebrowser")};r(n,this.coreSupportsSaved()?{action:"saved",box:{w:e,h:o},newPath:s||void 0}:{action:"resize",box:{w:e,h:o}},l,e=>{a(),this.error(e)})}catch(e){a(),this.error(e)}}async uploadEdited(e,t,n){var i,r;let{source:a,path:o,name:s}=await this.j.dataProvider.getPathByUrl(e),l=this.connectorUrl();if(!l)throw Error("No connector configured for imageSave");let d=String(n||s||"image.png"),h=new FormData;h.append("action","imageSave"),h.append("source",String(null!=a?a:"")),h.append("path",String(null!=o?o:"")),h.append("name",d),h.append("files[0]",t,d);let c=l.includes("?")?"&":"?",u=await fetch(`${l}${c}action=imageSave`,{method:"POST",body:h,credentials:"include"}),p=await u.json();if(!p.success)throw Error(p.message||"Failed to save the edited image");return null!=(i=null==(r=p.data)?void 0:r.newPath)?i:""}coreSupportsSaved(){let[e=0,t=0,n=0]=(this.j.getVersion?this.j.getVersion():"").split(".").map(e=>parseInt(e,10)||0);return e>4||4===e&&(t>12||12===t&&n>=34)}connectorUrl(){var e,t;let n=null==(e=this.j.o.ajax)?void 0:e.url,i=null==(t=this.j.o.uploader)?void 0:t.url;return"string"==typeof n&&n?n:"string"==typeof i&&i?i:""}async loadImage(e){let t=this.connectorUrl();if(t)try{return await this.loadViaConnector(t,e)}catch(e){}let n=e.includes("?")?"&":"?",i=await fetch(`${e}${n}_tst=${Date.now()}`,{credentials:"include"});if(!i.ok)throw Error(`Failed to load image (${i.status})`);return i.blob()}async loadViaConnector(e,t){var n;let{source:i,path:r,name:a}=await this.j.dataProvider.getPathByUrl(t),o=new FormData;o.append("action","imageLoad"),o.append("source",String(null!=i?i:"")),o.append("path",String(null!=r?r:"")),o.append("name",String(null!=a?a:""));let s=e.includes("?")?"&":"?",l=await fetch(`${e}${s}action=imageLoad`,{method:"POST",body:o,credentials:"include"}),d=await l.json();if(!d.success||!(null==(n=d.data)?void 0:n.content))throw Error(d.message||"Failed to load the image");return(await fetch(d.data.content)).blob()}async blobSize(e){let t=await createImageBitmap(e),n={w:t.width,h:t.height};return t.close(),n}error(e){this.j.e.fire("errorMessage",e.message)}constructor(...e){super(...e),(0,i._)(this,"isProImageEditor",!0)}}},45719:function(e,t,n){n(6441).Config.prototype.imageEditorPro={dialog:{width:"90%",height:"90%"}}},98270:function(e,t,n){n.r(t),n.d(t,{imageEditorPro:function(){return s}});var i=n(82749);n(45719);var r=n(76542),a=n(50911),o=n(2692);class s extends a.Plugin{afterInit(e){o.JoditPro.modules.ImageEditor=r.ProImageEditor}beforeDestruct(e){}}(0,i._)(s,"requires",["license"]),o.JoditPro.plugins.add("imageEditorPro",s)},85013:function(e,t,n){function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{ICONS:function(){return ek},ImageEditor:function(){return eq},selectors:function(){return R}});try{if("u">typeof document){var r=document.createElement("style");r.appendChild(document.createTextNode("/*\n * Jodit Image Editor — design system & layout.\n *\n * Everything is scoped under `.jie` so the stylesheet can be injected into any\n * page without leaking. Tokens are CSS custom properties; switching `data-theme`\n * re-themes the whole tree. PostCSS handles nesting + autoprefixing.\n */\n\n.jie {\n /* palette */\n --jie-accent: #5b5fc7;\n --jie-accent-soft: #eceefb;\n --jie-bg: #ffffff;\n --jie-surface: #ffffff;\n --jie-stage: #f3f4f8;\n --jie-border: #e6e8ef;\n --jie-text: #1f2430;\n --jie-text-dim: #8a90a2;\n --jie-danger: #e0533d;\n --jie-shadow: 0 1px 2px rgba(20, 24, 40, 0.06), 0 8px 24px rgba(20, 24, 40, 0.06);\n\n /* sizing scale — one system for every control */\n --jie-control-h: 38px; /* shared height: buttons, inputs, selects, color, slider row */\n --jie-control-px: 12px; /* horizontal padding inside controls */\n --jie-icon: 20px; /* inline icon size (rail icons override to 24) */\n --jie-radius: 12px; /* cards / panels */\n --jie-radius-sm: 8px; /* controls */\n --jie-gap: 16px; /* between groups */\n --jie-gap-sm: 8px; /* between controls in a row */\n --jie-font-sm: 13px;\n --jie-font-md: 14px;\n --jie-rail-w: 92px;\n --jie-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 420px;\n box-sizing: border-box;\n font-family: var(--jie-font);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n overflow: hidden;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.jie *,.jie *::before,.jie *::after {\n box-sizing: border-box;\n }\n\n.jie[data-theme='dark'] {\n --jie-accent: #8a8df0;\n --jie-accent-soft: #2a2d44;\n --jie-bg: #14161f;\n --jie-surface: #1b1e2a;\n --jie-stage: #0f1118;\n --jie-border: #2a2e3d;\n --jie-text: #e7e9f3;\n --jie-text-dim: #8b91a7;\n --jie-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);\n }\n\n/* ---- top bar ------------------------------------------------------------ */\n.jie-topbar {\n display: flex;\n align-items: center;\n gap: var(--jie-gap);\n padding: 12px 16px;\n border-bottom: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n.jie-topbar__save {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.jie-topbar__meta {\n display: flex;\n align-items: center;\n gap: 12px;\n margin: 0 auto;\n color: var(--jie-text-dim);\n font-size: 14px;\n}\n\n.jie-zoom {\n display: flex;\n align-items: center;\n gap: 6px;\n font-variant-numeric: tabular-nums;\n}\n\n.jie-topbar__actions {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n/* ---- buttons ------------------------------------------------------------ */\n.jie-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: var(--jie-control-h); /* single-char buttons (B / I) stay square */\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n font-weight: 600;\n line-height: 1;\n white-space: nowrap;\n color: var(--jie-text);\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease,\n border-color 0.12s ease;\n}\n.jie-btn:hover:not(:disabled) {\n background: var(--jie-accent-soft);\n }\n.jie-btn:disabled {\n opacity: 0.4;\n cursor: default;\n }\n/* inline icons are smaller than the standalone rail icons */\n.jie-btn .jie-icon {\n width: var(--jie-icon);\n height: var(--jie-icon);\n }\n\n.jie-btn--primary {\n color: #fff;\n background: var(--jie-accent);\n padding-inline: 18px;\n}\n\n.jie-btn--primary:hover:not(:disabled) {\n background: color-mix(in srgb, var(--jie-accent) 88%, #000);\n }\n\n.jie-btn--icon {\n width: var(--jie-control-h);\n padding: 0;\n color: var(--jie-text-dim);\n}\n\n.jie-btn--icon:hover:not(:disabled) {\n color: var(--jie-text);\n }\n\n.jie-btn--active {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n}\n\n/* text-style modifiers (the B / I annotation toggles) */\n.jie-btn--bold {\n font-weight: 800;\n}\n.jie-btn--italic {\n font-style: italic;\n font-family: Georgia, 'Times New Roman', serif;\n}\n\n.jie-icon {\n display: inline-flex;\n width: 24px;\n height: 24px;\n}\n\n.jie-icon svg {\n width: 100%;\n height: 100%;\n }\n\n/* ---- body / rail -------------------------------------------------------- */\n.jie-body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n\n.jie-rail {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: var(--jie-rail-w);\n padding: 14px 10px;\n border-right: 1px solid var(--jie-border);\n background: var(--jie-surface);\n overflow-y: auto;\n}\n\n.jie-tab {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n padding: 12px 6px;\n font-size: 12px;\n font-weight: 600;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease;\n}\n\n.jie-tab:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-tab[aria-selected='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n/* ---- stage / preview ---------------------------------------------------- */\n.jie-stage {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n background: var(--jie-bg);\n}\n\n.jie-canvas-wrap {\n position: relative;\n flex: 1;\n margin: 16px;\n border-radius: var(--jie-radius);\n background: var(--jie-stage);\n overflow: hidden;\n touch-action: none;\n}\n\n.jie-canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* ---- transient status (loading / saving / error) ------------------------- */\n\n.jie-spinner {\n display: inline-block;\n flex: 0 0 auto;\n width: var(--jie-icon);\n height: var(--jie-icon);\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: jie-spin 0.8s linear infinite;\n}\n\n@keyframes jie-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Covers the canvas while the image is loading, or shows the load error. */\n.jie-overlay {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--jie-gap-sm);\n font-size: var(--jie-font-md);\n color: var(--jie-text-dim);\n background: var(--jie-stage);\n}\n.jie-overlay .jie-spinner {\n width: 32px;\n height: 32px;\n border-width: 3px;\n color: var(--jie-accent);\n }\n\n.jie-overlay--error {\n color: var(--jie-danger);\n}\n\n.jie-overlay__detail {\n max-width: 80%;\n font-size: var(--jie-font-sm);\n text-align: center;\n color: var(--jie-text-dim);\n}\n\n/* crop overlay */\n.jie-crop {\n position: absolute;\n border: 1.5px dashed var(--jie-accent);\n box-shadow: 0 0 0 100vmax var(--jie-scrim, rgba(17, 24, 39, 0.45));\n transform-origin: center;\n cursor: move;\n}\n\n/*\n * Rotation knob, centred *above* the frame and connected by a short stem. The\n * preview keeps `VIEWPORT_PADDING` around the image, so the knob has room and is\n * never clipped — even for a full-image crop.\n */\n.jie-crop__rotate {\n position: absolute;\n left: 50%;\n top: -34px;\n width: 18px;\n height: 18px;\n margin-left: -9px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.3);\n cursor: grab;\n touch-action: none;\n\n /* stem runs from the knob's bottom (-16px) toward the frame, stopping ~5px\n short of the edge so it never touches/overlaps the dashed border */\n}\n.jie-crop__rotate::before {\n content: '';\n position: absolute;\n left: 50%;\n top: 18px;\n width: 2px;\n height: 11px;\n margin-left: -1px;\n background: var(--jie-accent);\n }\n.jie-crop__rotate:active {\n cursor: grabbing;\n }\n\n.jie-crop__handle {\n position: absolute;\n width: 14px;\n height: 14px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n}\n\n.jie-crop__handle[data-h='nw'] {\n top: -7px;\n left: -7px;\n cursor: nwse-resize;\n }\n\n.jie-crop__handle[data-h='ne'] {\n top: -7px;\n right: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='sw'] {\n bottom: -7px;\n left: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='se'] {\n bottom: -7px;\n right: -7px;\n cursor: nwse-resize;\n }\n\n/* ---- bottom panel ------------------------------------------------------- */\n.jie-panel {\n display: flex;\n flex-direction: column;\n gap: 14px;\n align-items: center;\n padding: 14px 16px 20px;\n border-top: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n/* a row of equal-height controls, centred on a shared baseline */\n.jie-toolrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap-sm);\n align-items: center;\n justify-content: center;\n}\n\n/* a row of labelled (label-above) fields; inputs and buttons share a height,\n so aligning their bottoms keeps everything tidy */\n.jie-fieldrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap);\n align-items: flex-end;\n justify-content: center;\n}\n\n.jie-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n}\n\n.jie-input,\n.jie-select {\n height: var(--jie-control-h);\n width: 120px;\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n:is(.jie-input,.jie-select):focus {\n outline: 2px solid var(--jie-accent-soft);\n border-color: var(--jie-accent);\n }\n\n/* native colour input, normalised to the control height as a rounded swatch */\n/* colour picker: a swatch button that opens a popover of preset swatches */\n.jie-colorpicker {\n position: relative;\n display: inline-flex;\n}\n\n/* the trigger swatch (shows the current colour via inline `background`) */\n.jie-color {\n width: var(--jie-control-h);\n height: var(--jie-control-h);\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-bg);\n cursor: pointer;\n}\n\n.jie-popover__backdrop {\n position: fixed;\n inset: 0;\n z-index: 50;\n}\n\n.jie-popover {\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n z-index: 51;\n padding: 10px;\n background: var(--jie-surface);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n box-shadow: var(--jie-shadow);\n}\n\n.jie-swatches {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 8px;\n}\n\n/* 3\xd73 position anchor grid */\n.jie-posgrid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 2px;\n padding: 3px;\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n.jie-posgrid__cell {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n}\n\n.jie-posgrid__cell .jie-icon {\n width: 16px;\n height: 16px;\n }\n\n.jie-posgrid__cell:hover {\n background: var(--jie-accent-soft);\n color: var(--jie-text);\n }\n\n.jie-posgrid__cell[aria-pressed='true'] {\n background: var(--jie-accent);\n color: #fff;\n }\n\n/* font selector */\n.jie-fontselect {\n position: relative;\n display: inline-flex;\n}\n\n.jie-fontselect__trigger {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: 130px;\n padding: 0 10px;\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontselect__trigger > span {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n.jie-fontselect__trigger .jie-icon {\n width: 16px;\n height: 16px;\n color: var(--jie-text-dim);\n flex: none;\n }\n\n.jie-fontlist {\n min-width: 180px;\n max-height: 260px;\n overflow-y: auto;\n padding: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.jie-fontlist__item {\n padding: 8px 10px;\n font-size: 15px;\n text-align: left;\n color: var(--jie-text);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontlist__item:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-fontlist__item[aria-pressed='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n.jie-swatch {\n width: 28px;\n height: 28px;\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-surface);\n cursor: pointer;\n transition:\n transform 0.1s ease,\n box-shadow 0.1s ease;\n}\n\n.jie-swatch:hover {\n transform: scale(1.08);\n }\n\n.jie-swatch[aria-pressed='true'] {\n box-shadow:\n inset 0 0 0 2px var(--jie-surface),\n 0 0 0 2px var(--jie-accent);\n }\n\n/* slider — the whole control occupies the shared height and centres its track */\n.jie-slider {\n display: flex;\n align-items: center;\n gap: 10px;\n height: var(--jie-control-h);\n width: clamp(180px, 28vw, 300px);\n}\n\n.jie-slider__label {\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n white-space: nowrap;\n}\n\n.jie-slider__value {\n min-width: 2.5ch;\n text-align: right;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n}\n\n/*\n * Fully custom range so it looks identical across evergreen browsers (the\n * native `accent-color` only themes the colour, not the track/thumb shapes).\n * The filled portion is driven by `--jie-range-fill` (set per render by the\n * slider component) on WebKit, and by the native `::-moz-range-progress` on\n * Firefox.\n */\n.jie-range {\n --jie-range-fill: 50%;\n appearance: none;\n flex: 1;\n min-width: 0;\n height: 16px; /* hit area */\n background: transparent;\n cursor: pointer;\n}\n.jie-range::-webkit-slider-runnable-track {\n height: 4px;\n border-radius: 999px;\n background: linear-gradient(\n to right,\n var(--jie-accent) var(--jie-range-fill),\n var(--jie-border) var(--jie-range-fill)\n );\n }\n.jie-range::-webkit-slider-thumb {\n appearance: none;\n margin-top: -6px; /* centre the 16px thumb on the 4px track */\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range::-moz-range-track {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-border);\n }\n.jie-range::-moz-range-progress {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-accent);\n }\n.jie-range::-moz-range-thumb {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range:focus-visible {\n outline: none;\n }\n.jie-range:focus-visible::-webkit-slider-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n.jie-range:focus-visible::-moz-range-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n\n/* filter thumbnails */\n.jie-thumbs {\n display: flex;\n gap: 12px;\n width: 100%;\n padding-bottom: 4px;\n overflow-x: auto;\n justify-content: flex-start;\n}\n\n.jie-thumb {\n display: flex;\n flex-direction: column;\n gap: 6px;\n align-items: center;\n padding: 4px;\n font-size: 12px;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.jie-thumb canvas,.jie-thumb .jie-thumb__swatch {\n width: 76px;\n height: 56px;\n border-radius: var(--jie-radius-sm);\n border: 2px solid transparent;\n object-fit: cover;\n background: var(--jie-stage);\n }\n\n.jie-thumb[aria-pressed='true'] {\n color: var(--jie-accent);\n }\n\n.jie-thumb[aria-pressed='true'] canvas,.jie-thumb[aria-pressed='true'] .jie-thumb__swatch {\n border-color: var(--jie-accent);\n }\n\n/* ---- responsive / mobile ------------------------------------------------ */\n@media (max-width: 720px) {\n .jie {\n --jie-rail-w: 100%;\n }\n\n .jie-topbar__meta {\n display: none;\n }\n\n .jie-body {\n flex-direction: column-reverse;\n }\n\n .jie-rail {\n flex-direction: row;\n width: 100%;\n border-right: 0;\n border-top: 1px solid var(--jie-border);\n overflow-x: auto;\n }\n\n .jie-tab {\n flex: 0 0 auto;\n min-width: 72px;\n }\n\n .jie-canvas-wrap {\n margin: 10px;\n }\n\n .jie-input {\n width: 100px;\n }\n}\n\n@media (hover: none) {\n .jie-crop__handle {\n width: 22px;\n height: 22px;\n }\n}")),document.head.appendChild(r)}}catch(e){}let a=Object.freeze([{label:"Arial",value:"Arial, Helvetica, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Verdana",value:"Verdana, Geneva, sans-serif"},{label:"Tahoma",value:"Tahoma, Geneva, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", Helvetica, sans-serif'},{label:"Times New Roman",value:'"Times New Roman", Times, serif'},{label:"Georgia",value:'Georgia, "Times New Roman", serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Impact",value:"Impact, Haettenschweiler, sans-serif"}]),o=Object.freeze({brightness:0,contrast:0,saturation:0,warmth:0,blur:0}),s=Object.freeze(["#ffffff","#1a1a1a","#9e9689","#4a90e2","#54b98a","#f2c94c","#eb5757","#a29bfe","#8b5cf6","#f178b6","#f2994a","#b8e454","#7ec8f0","#5b6470","#d8d2c8","#eeeeee"]);function l(){return{flip:{horizontal:!1,vertical:!1},rotate:0,angle:0,crop:null,resize:null,finetune:{...o},filter:"original",annotations:[],focus:null}}function d(){return{source:null,status:"idle",busyVisible:!1,error:null,activeTab:"adjust",activeTool:"crop",zoom:1,history:{entries:[l()],index:0},selectedAnnotationId:null,theme:"light",showToolbar:!0,locale:"en",minCropSize:8,minResizeSize:1,palette:[...s],fonts:a.map(e=>({...e})),activePopover:null,viewport:null}}function h(e){let t=e.entries[e.index];if(void 0===t)throw RangeError(`history index ${e.index} is out of bounds`);return t}function c(e,t){let n=e.entries.slice(0,e.index+1);n.push(t);let i=Math.max(0,n.length-100),r=i>0?n.slice(i):n;return{entries:r,index:r.length-1}}function u(e,t){let n=Math.min(Math.max(t,0),e.entries.length-1);return n===e.index?e:{...e,index:n}}function p(e,t){var n,i,r,a,o,s;let d=e;if(void 0!==t.activeTab&&(d=g(d,{activeTab:t.activeTab})),void 0!==t.activeTool&&(d=g(d,{activeTool:t.activeTool})),void 0!==t.zoom&&(d=g(d,{zoom:!Number.isFinite(a=t.zoom)||a<=0?1:Math.min(Math.max(a,.01),64)})),void 0!==t.theme&&(d=g(d,{theme:t.theme})),void 0!==t.showToolbar&&(d=g(d,{showToolbar:t.showToolbar})),void 0!==t.locale&&(d=g(d,{locale:t.locale})),void 0!==t.minCropSize&&(d=g(d,{minCropSize:Math.max(1,t.minCropSize)})),void 0!==t.minResizeSize&&(d=g(d,{minResizeSize:Math.max(1,t.minResizeSize)})),void 0!==t.palette&&(d=g(d,{palette:t.palette})),void 0!==t.fonts&&(d=g(d,{fonts:t.fonts})),void 0!==t.activePopover&&(d=g(d,{activePopover:t.activePopover})),void 0!==t.status&&(d=g(d,{status:t.status}),"exporting"!==t.status&&d.busyVisible&&(d=g(d,{busyVisible:!1}))),void 0!==t.busyVisible&&(d=g(d,{busyVisible:t.busyVisible})),void 0!==t.error&&(d=g(d,{error:t.error})),void 0!==t.source&&(d=g(d,{source:t.source})),void 0!==t.viewport&&(d=g(d,{viewport:t.viewport})),void 0!==t.selectedAnnotationId&&(d=g(d,{selectedAnnotationId:t.selectedAnnotationId})),t.resetHistory&&(d=g(d,{history:{entries:[l()],index:0}})),t.resetDesign&&(d=g(d,{history:c(d.history,l())})),void 0!==t.design){let e,i=(o=h(d.history),s=t.design,{...o,...s,flip:s.flip?{...o.flip,...s.flip}:o.flip,finetune:s.finetune?{...o.finetune,...s.finetune}:o.finetune,rotate:void 0!==s.rotate?(90*Math.round(s.rotate/90)%360+360)%360:o.rotate}),r=!1===t.commit?((e=(n=d.history).entries.slice())[n.index]=i,{entries:e,index:n.index}):c(d.history,i);d=g(d,{history:r})}if(void 0!==t.history){let e=t.history,n="step"in e?(i=d.history,r=e.step,u(i,i.index+r)):u(d.history,e.index);d=g(d,{history:n})}return d}function g(e,t){for(let n of Object.keys(t))if(e[n]!==t[n])return{...e,...t};return e}class f{request(e){this.pending=e,null===this.handle&&(this.handle=this.schedule(()=>this.flush()))}flush(){null!==this.handle&&(this.clear(this.handle),this.handle=null);let e=this.pending;this.pending=null,e&&e()}cancel(){null!==this.handle&&(this.clear(this.handle),this.handle=null),this.pending=null}constructor(e,t){i(this,"pending",null),i(this,"handle",null),this.schedule=e,this.clear=t}}class m{request(e){this.pending=e,this.flush()}flush(){let e=this.pending;this.pending=null,e&&e()}cancel(){this.pending=null}constructor(){i(this,"pending",null)}}class b{getState(){return this.state}update(e){let t=this.reducer(this.state,e);return t!==this.state&&(this.state=t,this.scheduler.request(()=>this.notify())),this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}flush(){this.scheduler.flush()}destroy(){this.scheduler.cancel(),this.listeners.clear()}notify(){if(!this.notifying){this.notifying=!0;try{for(let e of this.listeners)e(this.state)}finally{this.notifying=!1}}}constructor(e={}){var t,n,r;i(this,"state",void 0),i(this,"reducer",void 0),i(this,"scheduler",void 0),i(this,"listeners",new Set),i(this,"notifying",!1),this.state=null!=(t=e.initialState)?t:d(),this.reducer=null!=(n=e.reducer)?n:p,this.scheduler=null!=(r=e.scheduler)?r:new m}}function x(e,t,n){return Math.min(Math.max(e,t),n)}function y(e,t){let n=x(e.width,1,t.width),i=x(e.height,1,t.height);return{x:x(e.x,0,t.width-n),y:x(e.y,0,t.height-i),width:n,height:i}}function w(e){return h(e.history)}function j(e){return"adjust"===e.activeTab&&"crop"===e.activeTool}function M(e){let t=w(e);return j(e)?{...t,crop:null,angle:0}:t}function S(e){return e.history.index>0}function k(e){var t;return(t=e.history).index<t.entries.length-1}function z(e){return e.history.index>0||e.history.entries.length>1}function C(e){if(!e.source)return null;let t=w(e),{width:n,height:i}=e.source;return 90===t.rotate||270===t.rotate?{width:i,height:n}:{width:n,height:i}}function _(e){let t=w(e);return t.resize?t.resize:t.crop?{width:Math.round(t.crop.width),height:Math.round(t.crop.height)}:C(e)}function T(e){return j(e)?C(e):_(e)}function P(e){let t,n,i,r=T(e);if(!r||!e.viewport)return null;let a={width:Math.max(1,e.viewport.width-88),height:Math.max(1,e.viewport.height-88)},o=(t=Math.min(a.width/r.width,a.height/r.height)||0,n=r.width*t,i=r.height*t,{scale:t,width:n,height:i,offsetX:(a.width-n)/2,offsetY:(a.height-i)/2}).scale*e.zoom,s=r.width*o,l=r.height*o;return{scale:o,width:s,height:l,offsetX:(e.viewport.width-s)/2,offsetY:(e.viewport.height-l)/2,content:r}}function E(e){return w(e).angle}function A(e){let t=w(e);if(t.crop)return t.crop;let n=C(e);return n?{x:0,y:0,width:n.width,height:n.height}:null}let R=Object.freeze(Object.defineProperty({__proto__:null,VIEWPORT_PADDING:44,selectCanRedo:k,selectCanUndo:S,selectCropAngle:E,selectDesign:w,selectEffectiveCrop:A,selectIsCropping:j,selectIsDirty:z,selectOrientedSize:C,selectOutputSize:_,selectPreviewContentSize:T,selectPreviewDesign:M,selectViewportFit:P},Symbol.toStringTag,{value:"Module"})),I=Math.PI/180,B={nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]};function $(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function O(e,t,n,i){let r=$(e),a=t*I,o=Math.cos(a),s=Math.sin(a),l=n*e.width/2,d=i*e.height/2;return{x:r.x+l*o-d*s,y:r.y+l*s+d*o}}function D(e,t,n,i){return Math.atan2(i-t,n-e)/I}function L(e,t,n){F(e,"width"),F(t,"height");let i=e*t*4;if(n&&n.length!==i)throw RangeError(`data length ${n.length} does not match ${e}x${t} (${i})`);return{width:e,height:t,data:null!=n?n:new Uint8ClampedArray(i)}}function V(e,t,n){return(n*e.width+t)*4}function F(e,t){if(!Number.isInteger(e)||e<=0)throw RangeError(`${t} must be a positive integer, got ${e}`)}function N(e,t){let n=L(e.width,e.height),{width:i,height:r}=e;for(let a=0;a<r;a++)for(let o=0;o<i;o++)q(e,V(e,"horizontal"===t?i-1-o:o,"vertical"===t?r-1-a:a),n,V(n,o,a));return n}function U(e,t){let n=Math.max(1,Math.round(t.width)),i=Math.max(1,Math.round(t.height));if(n===e.width&&i===e.height)return L(n,i,new Uint8ClampedArray(e.data));let r=e;for(;r.width>=2*n;)r=function(e){let t=Math.ceil(e.width/2),n=L(t,e.height);for(let i=0;i<e.height;i++)for(let r=0;r<t;r++){let t=V(e,2*r,i),a=V(e,Math.min(2*r+1,e.width-1),i),o=V(n,r,i);for(let i=0;i<4;i++)n.data[o+i]=(e.data[t+i]+e.data[a+i])/2}return n}(r);for(;r.height>=2*i;)r=function(e){let t=Math.ceil(e.height/2),n=L(e.width,t);for(let i=0;i<t;i++)for(let t=0;t<e.width;t++){let r=V(e,t,2*i),a=V(e,t,Math.min(2*i+1,e.height-1)),o=V(n,t,i);for(let t=0;t<4;t++)n.data[o+t]=(e.data[r+t]+e.data[a+t])/2}return n}(r);return r.width===n&&r.height===i?L(n,i,new Uint8ClampedArray(r.data)):function(e,t,n){let i=L(t,n),r=e.width/t,a=e.height/n;for(let c=0;c<n;c++){let n=(c+.5)*a-.5,u=Math.floor(n),p=n-u,g=H(u,e.height),f=H(u+1,e.height);for(let n=0;n<t;n++){let t=(n+.5)*r-.5,a=Math.floor(t),u=t-a,m=H(a,e.width),b=H(a+1,e.width),x=V(e,m,g),y=V(e,b,g),w=V(e,m,f),j=V(e,b,f),M=V(i,n,c);for(let t=0;t<4;t++){var o,s,l,d,h;let n=(o=e.data[x+t],s=e.data[y+t],o+(s-o)*u),r=(l=e.data[w+t],d=e.data[j+t],l+(d-l)*u);i.data[M+t]=(h=n)+(r-h)*p}}}return i}(r,n,i)}function q(e,t,n,i){n.data[i]=e.data[t],n.data[i+1]=e.data[t+1],n.data[i+2]=e.data[t+2],n.data[i+3]=e.data[t+3]}function H(e,t){return e<0?0:e>=t?t-1:e}function X(e,t){let n=L(e.width,e.height,new Uint8ClampedArray(e.data));for(let e=0;e<n.data.length;e+=4)n.data[e]=t(n.data[e],0),n.data[e+1]=t(n.data[e+1],1),n.data[e+2]=t(n.data[e+2],2);return n}function Y(e,t){if(0===t)return et(e);let n=t/100*255;return X(e,e=>e+n)}function Z(e,t){if(0===t)return et(e);let n=t/100*255,i=259*(n+255)/(255*(259-n));return X(e,e=>i*(e-128)+128)}function W(e,t){if(0===t)return et(e);let n=1+t/100,i=L(e.width,e.height,new Uint8ClampedArray(e.data));for(let e=0;e<i.data.length;e+=4){let t=i.data[e],r=i.data[e+1],a=i.data[e+2],o=.299*t+.587*r+.114*a;i.data[e]=o+(t-o)*n,i.data[e+1]=o+(r-o)*n,i.data[e+2]=o+(a-o)*n}return i}function G(e,t){if(0===t)return et(e);let n=t/100*40;return X(e,(e,t)=>0===t?e+n:2===t?e-n:e)}function K(e,t,n=20){let i=Math.round(Math.max(0,Math.min(100,t))/100*n);return i<=0?et(e):Q(Q(e,i,"horizontal"),i,"vertical")}function J(e,t){let n=e;return K(n=G(n=W(n=Z(n=Y(n,t.brightness),t.contrast),t.saturation),t.warmth),t.blur)}function Q(e,t,n){let i=L(e.width,e.height),{width:r,height:a,data:o}=e,s="horizontal"===n,l=s?a:r,d=s?r:a,h=2*t+1;for(let e=0;l>e;e++)for(let n=0;n<4;n++){let l=0;for(let i=-t;t>=i;i++)l+=ee(o,r,a,s,e,i,n);for(let c=0;d>c;c++){let d=(s?e*r+c:c*r+e)*4+n;i.data[d]=l/h;let u=ee(o,r,a,s,e,c-t,n);l+=ee(o,r,a,s,e,c+t+1,n)-u}}return i}function ee(e,t,n,i,r,a,o){let s=(i?t:n)-1,l=a<0?0:a>s?s:a;return e[(i?r*t+l:l*t+r)*4+o]}function et(e){return L(e.width,e.height,new Uint8ClampedArray(e.data))}function en(e,t){let n=L(e.width,e.height,new Uint8ClampedArray(e.data));for(let e=0;e<n.data.length;e+=4){let[i,r,a]=t(n.data[e],n.data[e+1],n.data[e+2]);n.data[e]=i,n.data[e+1]=r,n.data[e+2]=a}return n}Object.freeze(Object.defineProperty({__proto__:null,applyFinetune:J,blur:K,brightness:Y,contrast:Z,saturation:W,warmth:G},Symbol.toStringTag,{value:"Module"}));let ei=e=>L(e.width,e.height,new Uint8ClampedArray(e.data)),er=new Map;function ea(e){return er.set(e.id,e),()=>{er.get(e.id)===e&&er.delete(e.id)}}function eo(e,t){let n=er.get(t);return n?n.apply(e):ei(e)}function es(e){return new ImageData(e.data,e.width,e.height)}[{id:"original",label:"Original",apply:ei},{id:"invert",label:"Invert",apply:e=>en(e,(e,t,n)=>[255-e,255-t,255-n])},{id:"grayscale",label:"Black & White",apply:e=>en(e,(e,t,n)=>{let i=.299*e+.587*t+.114*n;return[i,i,i]})},{id:"sepia",label:"Sepia",apply:e=>en(e,(e,t,n)=>[.393*e+.769*t+.189*n,.349*e+.686*t+.168*n,.272*e+.534*t+.131*n])},{id:"solarize",label:"Solarize",apply:e=>en(e,(e,t,n)=>[e<128?e:255-e,t<128?t:255-t,n<128?n:255-n])},{id:"clarendon",label:"Clarendon",apply:e=>G(W(Z(e,20),25),-10)},{id:"gingham",label:"Gingham",apply:e=>G(W(Z(e,-10),-15),12)}].forEach(ea);class el{register(e){let t=this.locales.get(e.id);return this.locales.set(e.id,{...null!=t?t:{},...e.messages}),()=>{t?this.locales.set(e.id,t):this.locales.delete(e.id)}}has(e){return this.locales.has(e)}get(e){return this.locales.get(e)}list(){return[...this.locales.keys()]}translator(e){var t;return function(e={},t={}){return(n,i)=>{var r,a;let o=null!=(r=null!=(a=e[n])?a:t[n])?r:n;return i?o.replace(/\{(\w+)\}/g,(e,t)=>t in i?String(i[t]):e):o}}(null!=(t=this.locales.get(e))?t:{})}constructor(){i(this,"locales",new Map)}}let ed=new Set(["value","checked","disabled","selected","innerHTML"]);function eh(e,t={},n=[]){return{kind:"element",tag:e,key:t.key,props:t,children:function(e){let t=Array.isArray(e)?e:[e],n=[];for(let e of t)null!=e&&!1!==e&&!0!==e&&n.push("object"==typeof e?e:{kind:"text",text:String(e)});return n}(n)}}function ec(e){return"element"===e.kind}let eu={};class ep{render(e){if(null===this.prev){let t=this.mount(e);this.host.insert(this.container,t,null)}else if(eg(this.prev,e))this.patch(this.prev,e);else{let t=this.mount(e),n=this.prev.node;this.host.insert(this.container,t,this.host.nextSibling(n)),this.host.remove(this.container,n)}this.prev=e}unmount(){this.prev&&(this.host.remove(this.container,this.prev.node),this.prev=null)}mount(e){if(!ec(e)){let t=this.host.createText(e.text);return e.node=t,t}let t=this.host.createElement(e.tag);for(let n of(e.node=t,this.applyProps(t,eu,e.props),e.children))this.host.insert(t,this.mount(n),null);return t}patch(e,t){let n=e.node;return(t.node=n,ec(t)&&ec(e))?(this.applyProps(n,e.props,t.props),this.patchChildren(n,e.children,t.children)):ec(t)||t.text===e.text||this.host.setText(n,t.text),n}applyProps(e,t,n){var i,r,a,o;for(let s of(this.applyClass(e,t.class,n.class),this.applyStyle(e,null!=(i=t.style)?i:{},null!=(r=n.style)?r:{}),this.applyEvents(e,null!=(a=t.on)?a:{},null!=(o=n.on)?o:{}),Object.keys(n))){if(ef(s))continue;let i=n[s];i!==t[s]&&this.applyAttr(e,s,i)}for(let i of Object.keys(t))ef(i)||i in n||(ed.has(i)?this.host.setProperty(e,i,""):this.host.removeAttribute(e,i))}applyAttr(e,t,n){var i;ed.has(t)?this.host.setProperty(e,t,n):!1===n||null==n?this.host.removeAttribute(e,t):this.host.setAttribute(e,t,!0===n?"":"string"==typeof n?n:"number"==typeof n||"boolean"==typeof n||"bigint"==typeof n?String(n):null!=(i=JSON.stringify(n))?i:"")}applyClass(e,t,n){t!==n&&(n?this.host.setAttribute(e,"class",n):this.host.removeAttribute(e,"class"))}applyStyle(e,t,n){for(let i of Object.keys(n))n[i]!==t[i]&&this.host.setStyle(e,i,String(n[i]));for(let i of Object.keys(t))i in n||this.host.removeStyle(e,i)}applyEvents(e,t,n){let i=this.events.get(e);for(let r of Object.keys(t))!(r in n)&&(null==i?void 0:i.has(r))&&(this.host.removeEventListener(e,r,i.get(r).wrapper),i.delete(r));for(let t of Object.keys(n)){let r=n[t],a=null==i?void 0:i.get(t);if(a){a.handler=r;continue}i||(i=new Map,this.events.set(e,i));let o={handler:r,wrapper:e=>o.handler(e)};i.set(t,o),this.host.addEventListener(e,t,o.wrapper)}}patchChildren(e,t,n){let i=0,r=t.length-1,a=0,o=n.length-1,s=null;for(;i<=r&&a<=o;){let l=t[i],d=t[r],h=n[a],c=n[o];if(eg(l,h)){this.patch(l,h),i++,a++;continue}if(eg(d,c)){this.patch(d,c),r--,o--;continue}if(eg(l,c)){this.patch(l,c),this.host.insert(e,l.node,this.host.nextSibling(d.node)),i++,o--;continue}if(eg(d,h)){this.patch(d,h),this.host.insert(e,d.node,l.node),r--,a++;continue}null!=s||(s=function(e,t,n){let i=new Map;for(let r=t;r<=n;r++){let t=e[r].key;void 0!==t&&i.set(t,r)}return i}(t,i,r));let u=void 0!==h.key?s.get(h.key):void 0;if(void 0===u)this.host.insert(e,this.mount(h),l.node);else{let n=t[u];this.patch(n,h),n.node=void 0,this.host.insert(e,h.node,l.node)}a++}if(i>r){var l,d;let t=null!=(l=null==(d=n[o+1])?void 0:d.node)?l:null;for(let i=a;o>=i;i++)this.host.insert(e,this.mount(n[i]),t)}else if(a>o)for(let n=i;r>=n;n++){let i=t[n].node;i&&this.host.remove(e,i)}}constructor(e,t){i(this,"events",new WeakMap),i(this,"prev",null),this.host=e,this.container=t}}function eg(e,t){return e.kind===t.kind&&("text"===e.kind||e.tag===t.tag&&e.key===t.key)}function ef(e){return"key"===e||"class"===e||"style"===e||"on"===e}class ev{createElement(e){return this.doc.createElement(e)}createText(e){return this.doc.createTextNode(e)}setText(e,t){e.textContent=t}insert(e,t,n){e.insertBefore(t,n)}remove(e,t){t.parentNode===e&&e.removeChild(t)}parent(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n){e.setAttribute(t,n)}removeAttribute(e,t){e.removeAttribute(t)}setProperty(e,t,n){e[t]=n}setStyle(e,t,n){e.style.setProperty(t,n)}removeStyle(e,t){e.style.removeProperty(t)}addEventListener(e,t,n){e.addEventListener(t,n)}removeEventListener(e,t,n){e.removeEventListener(t,n)}constructor(e=document){this.doc=e}}class em{register(e){var t;return this.tools.set(e.id,e),this.order.set(e.id,null!=(t=e.order)?t:em.UNORDERED_BASE+this.seq++),()=>{this.tools.get(e.id)===e&&(this.tools.delete(e.id),this.order.delete(e.id))}}get(e){return this.tools.get(e)}has(e){return this.tools.has(e)}list(){return[...this.tools.values()].sort((e,t)=>{var n,i;return(null!=(n=this.order.get(e.id))?n:0)-(null!=(i=this.order.get(t.id))?i:0)})}first(){return this.list()[0]}constructor(){i(this,"tools",new Map),i(this,"seq",0),i(this,"order",new Map)}}function eb(e){return eh("span",{class:"jie-icon",innerHTML:e})}function ex(){return eh("span",{class:"jie-spinner"})}function ey(e){var t,n,i;let r=["jie-btn"];"primary"===e.variant&&r.push("jie-btn--primary"),"icon"===e.variant&&r.push("jie-btn--icon"),e.active&&r.push("jie-btn--active"),e.busy&&r.push("jie-btn--busy"),e.className&&r.push(e.className);let a=[];return e.busy?a.push(ex()):e.icon&&a.push(eb(e.icon)),e.label&&a.push(eh("span",{},e.label)),eh("button",{key:e.key,class:r.join(" "),type:"button",disabled:null!=(t=e.disabled)&&t,title:null!=(n=null!=(i=e.title)?i:e.label)?n:"",on:{click:e.onClick}},a)}function ew(e){var t;let n=e.onStart,i={input:t=>e.onInput(Number(t.target.value))};n&&(i.pointerdown=()=>n());let r=e.max-e.min||1,a=Math.min(100,Math.max(0,(e.value-e.min)/r*100));return eh("div",{class:"jie-slider"},[eh("span",{class:"jie-slider__label"},e.label),eh("input",{class:"jie-range",type:"range",min:String(e.min),max:String(e.max),step:String(null!=(t=e.step)?t:1),value:String(e.value),style:{"--jie-range-fill":`${a}%`},on:i}),eh("span",{class:"jie-slider__value"},String(Math.round(e.value)))])}function ej(e){return eh("label",{class:"jie-field"},[eh("span",{},e.label),eh("span",{style:{display:"flex","align-items":"center",gap:"6px"}},[eh("input",{class:"jie-input",type:"number",value:String(e.value),on:{change:t=>{let n=Number(t.target.value);Number.isFinite(n)&&e.onChange(n)}}}),e.suffix?eh("span",{},e.suffix):null])])}function eM(e,t,n){return eh("div",{class:"jie-toolrow"},e.map(e=>ey({key:e.id,label:e.label,icon:e.icon,active:e.id===t,onClick:()=>n(e.id)})))}i(em,"UNORDERED_BASE",1e6);let eS=e=>`<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`,ek={adjust:eS('<path d="M4 8h2M9 8h11M4 16h11M18 16h2"/><circle cx="7.5" cy="8" r="1.6"/><circle cx="16.5" cy="16" r="1.6"/>'),finetune:eS('<path d="M4 7h12M4 12h16M4 17h8"/><circle cx="18" cy="7" r="1.6"/><circle cx="12" cy="17" r="1.6"/>'),filters:eS('<circle cx="9" cy="9" r="5"/><circle cx="15" cy="9" r="5"/><circle cx="12" cy="15" r="5"/>'),watermark:eS('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 15l5-4 4 3 3-2 6 4"/><circle cx="8.5" cy="9.5" r="1.4"/>'),annotate:eS('<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>'),resize:eS('<path d="M9 3H5a2 2 0 0 0-2 2v4M21 15v4a2 2 0 0 1-2 2h-4"/><path d="M8 16l8-8M16 8h-4M16 8v4"/>'),crop:eS('<path d="M6 2v14a2 2 0 0 0 2 2h14"/><path d="M2 6h14a2 2 0 0 1 2 2v14"/>'),rotate:eS('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),flipX:eS('<path d="M12 3v18"/><path d="M8 7 4 12l4 5Z"/><path d="M16 7l4 5-4 5Z"/>'),flipY:eS('<path d="M3 12h18"/><path d="M7 8 12 4l5 4Z"/><path d="M7 16l5 4 5-4Z"/>'),undo:eS('<path d="M9 7 4 12l5 5"/><path d="M4 12h11a5 5 0 0 1 0 10h-1"/>'),redo:eS('<path d="m15 7 5 5-5 5"/><path d="M20 12H9a5 5 0 0 0 0 10h1"/>'),reset:eS('<path d="M3 12a9 9 0 1 1 2.6 6.3"/><path d="M3 21v-5h5"/>'),trash:eS('<path d="M4 7h16M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13M10 11v6M14 11v6"/>'),plus:eS('<path d="M12 5v14M5 12h14"/>'),minus:eS('<path d="M5 12h14"/>'),zoomIn:eS('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M10.5 7.5v6M7.5 10.5h6"/>'),zoomOut:eS('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M7.5 10.5h6"/>'),posTopLeft:eS('<path d="M17 17 7 7M7 13V7h6"/>'),posTop:eS('<path d="M12 19V6M7 11l5-5 5 5"/>'),posTopRight:eS('<path d="M7 17 17 7M11 7h6v6"/>'),posLeft:eS('<path d="M19 12H6M11 7l-5 5 5 5"/>'),posCenter:eS('<circle cx="12" cy="12" r="6.5"/><circle cx="12" cy="12" r="2" fill="currentColor" stroke="none"/>'),posRight:eS('<path d="M5 12h13M13 7l5 5-5 5"/>'),posBottomLeft:eS('<path d="M17 7 7 17M7 11v6h6"/>'),posBottom:eS('<path d="M12 5v13M7 13l5 5 5-5"/>'),posBottomRight:eS('<path d="M7 7l10 10M17 11v6h-6"/>'),font:eS('<path d="M4 20 9.5 6h1L16 20M6 15h8M17 20l3-9h.5l3 9M18 17h4"/>'),focus:eS('<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3.5"/>'),lock:eS('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>'),unlock:eS('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.5-2"/>'),text:eS('<path d="M5 5h14M12 5v14M9 19h6"/>'),brightness:eS('<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19"/>'),contrast:eS('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18Z" fill="currentColor" stroke="none"/>'),blur:eS('<path d="M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11Z"/>'),book:eS('<path d="M4 5a2 2 0 0 1 2-2h5v18H6a2 2 0 0 1-2-2Z"/><path d="M20 5a2 2 0 0 0-2-2h-5v18h5a2 2 0 0 0 2-2Z"/>')},ez={id:"adjust",label:"Adjust",icon:ek.adjust,order:0,defaultTool:"crop",renderPanel({state:e,update:t,t:n}){let i=w(e),r=j(e);return eh("div",{class:"jie-toolrow"},[ey({label:n("Crop"),icon:ek.crop,active:r,onClick:()=>t({activeTab:"adjust",activeTool:r?null:"crop"})}),ey({label:n("Rotate"),icon:ek.rotate,onClick:()=>t({design:{rotate:i.rotate+90}})}),ey({label:n("Flip X"),icon:ek.flipX,onClick:()=>t({design:{flip:{horizontal:!i.flip.horizontal}}})}),ey({label:n("Flip Y"),icon:ek.flipY,onClick:()=>t({design:{flip:{vertical:!i.flip.vertical}}})})])}},eC=[{id:"brightness",label:"Brightness",icon:ek.brightness,min:-100,max:100},{id:"contrast",label:"Contrast",icon:ek.contrast,min:-100,max:100},{id:"saturation",label:"Saturation",icon:ek.filters,min:-100,max:100},{id:"blur",label:"Blur",icon:ek.blur,min:0,max:100},{id:"warmth",label:"Warmth",icon:ek.brightness,min:-100,max:100}],e_={id:"finetune",label:"Finetune",icon:ek.finetune,order:1,defaultTool:"brightness",renderPanel({state:e,update:t,t:n}){var i,r;let a=(i=e.activeTool,null!=(r=eC.find(e=>e.id===i))?r:eC[0]),o=w(e).finetune[a.id],s=(e,n)=>{t({design:{finetune:{[a.id]:e}},commit:n})};return eh("div",{class:"jie-panel-stack",style:{display:"contents"}},[ew({label:n(a.label),value:o,min:a.min,max:a.max,onStart:()=>s(o,!0),onInput:e=>s(e,!1)}),eM(eC.map(e=>({id:e.id,label:n(e.label),icon:e.icon})),a.id,e=>t({activeTab:"finetune",activeTool:e}))])}},eT={id:"filters",label:"Filters",icon:ek.filters,order:2,renderPanel({state:e,update:t,t:n}){let i=w(e).filter;return eh("div",{class:"jie-thumbs"},[...er.values()].map(e=>eh("button",{key:e.id,class:"jie-thumb",type:"button","aria-pressed":String(e.id===i),on:{click:()=>t({design:{filter:e.id}})}},[eh("canvas",{class:"jie-thumb__swatch","data-jie-filter-thumb":e.id}),eh("span",{},n(e.label))])))}},eP={id:"focus",label:"Focus",icon:ek.focus,order:3,defaultTool:"radial",renderPanel({state:e,update:t,t:n}){var i;let r=null!=(i=w(e).focus)?i:{shape:"radial",x:.5,y:.5,radius:.28,angle:0,amount:60},a=null!==w(e).focus,o=(e,n)=>t({design:{focus:{...r,...e}},commit:n});return eh("div",{class:"jie-panel-stack",style:{display:"contents"}},[eh("div",{class:"jie-toolrow"},[ew({label:n("Intensity"),value:r.amount,min:0,max:100,onStart:()=>o({amount:r.amount},!0),onInput:e=>o({amount:e},!1)}),ew({label:n("Radius"),value:Math.round(100*r.radius),min:5,max:90,onStart:()=>o({radius:r.radius},!0),onInput:e=>o({radius:e/100},!1)}),a?ey({variant:"icon",icon:ek.trash,title:n("Reset"),onClick:()=>t({design:{focus:null}})}):null]),eM([{id:"radial",label:n("Radial")},{id:"linear",label:n("Linear")}],r.shape,e=>o({shape:e},!0))])}},eE=[{align:"left",valign:"top",icon:ek.posTopLeft},{align:"center",valign:"top",icon:ek.posTop},{align:"right",valign:"top",icon:ek.posTopRight},{align:"left",valign:"middle",icon:ek.posLeft},{align:"center",valign:"middle",icon:ek.posCenter},{align:"right",valign:"middle",icon:ek.posRight},{align:"left",valign:"bottom",icon:ek.posBottomLeft},{align:"center",valign:"bottom",icon:ek.posBottom},{align:"right",valign:"bottom",icon:ek.posBottomRight}],eA=function(e="id"){let t=0;return()=>`${e}-${++t}`}("jie"),eR="text-color",eI="text-font",eB={id:"annotate",label:"Text",icon:ek.text,order:4,defaultTool:"text",renderPanel({state:e,update:t,t:n}){var i,r,o,s,l,d;let h,c,u,p=w(e),g=p.annotations[0];if(!g)return eh("div",{class:"jie-toolrow"},[ey({label:n("Add text"),icon:ek.text,variant:"primary",onClick:()=>{let e=function(e,t={}){return{id:e,type:"text",text:"Text",x:.5,y:.5,fontSize:.06,fontFamily:a[0].value,color:"#eb5757",bold:!1,italic:!1,align:"center",valign:"middle",...t}}(eA());t({design:{annotations:[e]},selectedAnnotationId:e.id})}})]);let f=e=>{var n,i;return t({design:{annotations:(n=p.annotations,i=g.id,n.map(t=>t.id===i?{...t,...e}:t))}})};return eh("div",{class:"jie-toolrow"},[eh("input",{class:"jie-input",type:"text",value:g.text,on:{input:e=>f({text:e.target.value})}}),(h=(i={value:g.fontFamily,fonts:e.fonts,title:n("Font"),open:e.activePopover===eI,onToggle:()=>t({activePopover:e.activePopover===eI?null:eI}),onPick:e=>{f({fontFamily:e}),t({activePopover:null})}}).fonts.find(e=>e.value===i.value),c=[eh("button",{class:"jie-fontselect__trigger",type:"button",title:null!=(r=i.title)?r:"Font","aria-haspopup":"listbox","aria-expanded":String(i.open),on:{click:()=>i.onToggle()}},[eb(ek.font),eh("span",{style:{"font-family":i.value}},null!=(o=null==h?void 0:h.label)?o:"Font"),eb(ek.book)])],i.open&&c.push(eh("div",{class:"jie-popover__backdrop",on:{click:()=>i.onToggle()}}),eh("div",{class:"jie-popover jie-fontlist",role:"listbox"},i.fonts.map(e=>eh("button",{key:e.value,class:"jie-fontlist__item",type:"button","aria-pressed":String(e.value===i.value),style:{"font-family":e.value},on:{click:()=>i.onPick(e.value)}},e.label)))),eh("div",{class:"jie-fontselect"},c)),(u=[eh("button",{class:"jie-color",type:"button",title:null!=(l=(s={value:g.color,palette:e.palette,title:n("Colour"),open:e.activePopover===eR,onToggle:()=>t({activePopover:e.activePopover===eR?null:eR}),onPick:e=>{f({color:e}),t({activePopover:null})}}).title)?l:"Colour",style:{background:s.value},"aria-haspopup":"true","aria-expanded":String(s.open),on:{click:()=>s.onToggle()}})],s.open&&u.push(eh("div",{class:"jie-popover__backdrop",on:{click:()=>s.onToggle()}}),eh("div",{class:"jie-popover jie-swatches",role:"listbox"},s.palette.map(e=>eh("button",{key:e,class:"jie-swatch",type:"button",title:e,style:{background:e},"aria-pressed":String(e.toLowerCase()===s.value.toLowerCase()),on:{click:()=>s.onPick(e)}})))),eh("div",{class:"jie-colorpicker"},u)),ey({label:"B",className:"jie-btn--bold",active:g.bold,onClick:()=>f({bold:!g.bold})}),ey({label:"I",className:"jie-btn--italic",active:g.italic,onClick:()=>f({italic:!g.italic})}),ew({label:n("Size"),value:Math.round(100*g.fontSize),min:1,max:40,onInput:e=>f({fontSize:e/100})}),(d={align:g.align,valign:g.valign,onPick:(e,t)=>f({align:e,valign:t,x:"left"===e?.04:"right"===e?.96:.5,y:"top"===t?.04:"bottom"===t?.96:.5})},eh("div",{class:"jie-posgrid",role:"group"},eE.map(e=>eh("button",{key:`${e.valign}-${e.align}`,class:"jie-posgrid__cell",type:"button","data-pos":`${e.valign}-${e.align}`,"aria-pressed":String(e.align===d.align&&e.valign===d.valign),on:{click:()=>d.onPick(e.align,e.valign)}},[eb(e.icon)])))),ey({variant:"icon",icon:ek.trash,title:n("Delete"),onClick:()=>{var e,n;return t({design:{annotations:(e=p.annotations,n=g.id,e.filter(e=>e.id!==n))},selectedAnnotationId:null})}})])}},e$={id:"resize",label:"Resize",icon:ek.resize,order:5,renderPanel({state:e,update:t,t:n}){let i=_(e);if(!i)return null;let r="unlocked"!==e.activeTool,a=n=>t({design:{resize:function(e,t,n,i=1){let r=e.width/e.height;if(!n){var a,o;return{width:Math.max(i,Math.round(null!=(a=t.width)?a:e.width)),height:Math.max(i,Math.round(null!=(o=t.height)?o:e.height))}}if(void 0!==t.width){let e=Math.max(i,Math.round(t.width));return{width:e,height:Math.max(i,Math.round(e/r))}}if(void 0!==t.height){let e=Math.max(i,Math.round(t.height));return{width:Math.max(i,Math.round(e*r)),height:e}}return{...e}}(i,n,r,e.minResizeSize)}});return eh("div",{class:"jie-fieldrow"},[ej({label:n("Width"),value:i.width,suffix:n("px"),onChange:e=>a({width:e})}),ey({variant:"icon",icon:r?ek.lock:ek.unlock,title:r?n("Aspect ratio locked"):n("Aspect ratio unlocked"),onClick:()=>t({activeTab:"resize",activeTool:r?"unlocked":"locked"})}),ej({label:n("Height"),value:i.height,suffix:n("px"),onChange:e=>a({height:e})}),ey({variant:"icon",icon:ek.reset,title:n("Reset size"),onClick:()=>t({design:{resize:null}})})])}};function eO(e){return parseInt(e+e,16)}function eD(e,t){return parseInt(e.slice(t,t+2),16)}let eL=/image\/(jpe?g|bmp)/i;function eV(e,t){if("u"<typeof document)throw Error("No DOM available: provide a CanvasFactory to the codec");let n=document.createElement("canvas");return n.width=e,n.height=t,{get width(){return n.width},set width(v){n.width=v},get height(){return n.height},set height(v){n.height=v},getContext:e=>n.getContext(e),toBlobAsync:(e,t)=>new Promise((i,r)=>{n.toBlob(e=>e?i(e):r(Error("canvas.toBlob returned null")),e,t)})}}class eF{async decode(e){var t,n,i;let r,a=await this.toBitmap(e),o=(t=a.width,n=a.height,i={maxSize:this.maxSize,maxPixels:this.maxPixels},r=1,i.maxSize&&i.maxSize>0&&(r=Math.min(r,i.maxSize/Math.max(t,n))),i.maxPixels&&i.maxPixels>0&&(r=Math.min(r,Math.sqrt(i.maxPixels/(t*n)))),Math.min(1,r)),s=Math.max(1,Math.round(a.width*o)),l=Math.max(1,Math.round(a.height*o)),d=this.createCanvas(s,l),h=this.context(d);h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.drawImage(a,0,0,s,l),"close"in a&&"function"==typeof a.close&&a.close();let c=h.getImageData(0,0,s,l);return L(c.width,c.height,c.data)}async encode(e,t={}){let n,{type:i="image/png",quality:r=.92,background:a}=t,o=void 0!==a||eL.test(i)?function(e,[t,n,i]){let r=L(e.width,e.height);for(let a=0;a<e.data.length;a+=4){let o=e.data[a+3]/255,s=1-o;r.data[a]=e.data[a]*o+t*s,r.data[a+1]=e.data[a+1]*o+n*s,r.data[a+2]=e.data[a+2]*o+i*s,r.data[a+3]=255}return r}(e,(n=(null!=a?a:"#ffffff").trim().replace(/^#/,""),/^[0-9a-f]{3}$/i.test(n)?[eO(n[0]),eO(n[1]),eO(n[2])]:/^[0-9a-f]{6}$/i.test(n)?[eD(n,0),eD(n,2),eD(n,4)]:[255,255,255])):e,s=this.createCanvas(o.width,o.height);return this.context(s).putImageData(es(o),0,0),s.toBlobAsync(i,r)}context(e){let t=e.getContext("2d");if(!t)throw Error("Unable to acquire a 2D canvas context");return t}async toBitmap(e){return"function"==typeof createImageBitmap?createImageBitmap(e,{imageOrientation:"from-image"}):new Promise((t,n)=>{let i=URL.createObjectURL(e),r=new Image;r.style.imageOrientation="from-image",r.onload=()=>{URL.revokeObjectURL(i),t(r)},r.onerror=()=>{URL.revokeObjectURL(i),n(Error("Failed to decode image blob"))},r.src=i})}constructor(e=eV,t={}){var n;i(this,"maxPixels",void 0),i(this,"maxSize",void 0),this.createCanvas=e,this.maxPixels=null!=(n=t.maxPixels)?n:0x1000000,this.maxSize=t.maxSize}}class eN{decode(e){return this.codec.decode(e)}render(e,t){let n=function(e,t){let n=e;if(t.flip.horizontal&&(n=N(n,"horizontal")),t.flip.vertical&&(n=N(n,"vertical")),0!==t.rotate&&(n=function(e,t){let n=(Math.round(t/90)%4+4)%4;if(0===n)return L(e.width,e.height,new Uint8ClampedArray(e.data));let{width:i,height:r}=e,a=1===n||3===n,o=L(a?r:i,a?i:r);for(let t=0;t<r;t++)for(let a=0;a<i;a++){let s,l;1===n?(s=r-1-t,l=a):2===n?(s=i-1-a,l=r-1-t):(s=t,l=i-1-a),q(e,V(e,a,t),o,V(o,s,l))}return o}(n,t.rotate)),0!==t.angle){var i;let e=null!=(i=t.crop)?i:{x:0,y:0,width:n.width,height:n.height};n=function(e,t,n){let i=Math.max(1,Math.round(t.width)),r=Math.max(1,Math.round(t.height)),a=L(i,r),o=t.x+t.width/2,s=t.y+t.height/2,l=n*Math.PI/180,d=Math.cos(l),h=Math.sin(l);for(let t=0;t<r;t++){let n=t+.5-r/2;for(let r=0;i>r;r++){let l=r+.5-i/2;!function(e,t,n,i,r){if(t<=-1||n<=-1||t>=e.width||n>=e.height){i.data[r]=0,i.data[r+1]=0,i.data[r+2]=0,i.data[r+3]=0;return}let a=Math.floor(t),o=Math.floor(n),s=t-a,l=n-o,d=H(a,e.width),h=H(a+1,e.width),c=H(o,e.height),u=H(o+1,e.height),p=V(e,d,c),g=V(e,h,c),f=V(e,d,u),m=V(e,h,u);for(let t=0;t<4;t++){var b,x;let n=(b=e.data[p+t],b+(e.data[g+t]-b)*s),a=(x=e.data[f+t],x+(e.data[m+t]-x)*s);i.data[r+t]=n+(a-n)*l}}(e,o+l*d-n*h-.5,s+l*h+n*d-.5,a,V(a,r,t))}}return a}(n,e,t.angle)}else t.crop&&(n=function(e,t){let n,i,r=y({x:n=Math.round(t.x),y:i=Math.round(t.y),width:Math.round(t.x+t.width)-n,height:Math.round(t.y+t.height)-i},e),a=L(r.width,r.height);for(let t=0;t<r.height;t++){let n=V(e,r.x,r.y+t),i=V(a,0,t);a.data.set(e.data.subarray(n,n+4*r.width),i)}return a}(n,t.crop));return t.resize&&(n=U(n,t.resize)),n=eo(n=J(n,t.finetune),t.filter),t.focus&&(n=function(e,t){if(t.amount<=0)return L(e.width,e.height,new Uint8ClampedArray(e.data));let n=K(e,t.amount,32),{width:i,height:r}=e,a=L(i,r),o=Math.min(i,r),s=t.x*i,l=t.y*r,d=t.radius*o,h=Math.max(.06*o,.9*d),c=t.angle*Math.PI/180,u=-Math.sin(c),p=Math.cos(c);for(let o=0;o<r;o++)for(let r=0;r<i;r++){let i=r-s,c=o-l,g=function(e,t,n){if(t<=e)return+(n>=t);let i=Math.min(1,Math.max(0,(n-e)/(t-e)));return i*i*(3-2*i)}(d,d+h,"radial"===t.shape?Math.hypot(i,c):Math.abs(i*u+c*p)),f=V(a,r,o);for(let t=0;t<4;t++)a.data[f+t]=e.data[f+t]+(n.data[f+t]-e.data[f+t])*g}return a}(n,t.focus)),n}(e,t);return function(e,t,n){if(0===n.length)return t;let i=e(t.width,t.height).getContext("2d");if(!i)throw Error("Unable to acquire a 2D canvas context");for(let e of(i.putImageData(es(t),0,0),n)){if("text"!==e.type)continue;let n=function(e,t){let n=Math.max(1,Math.round(e.fontSize*t.height)),i=e.bold?"bold":"normal",r=e.italic?"italic":"normal";return{text:e.text,x:Math.round(e.x*t.width),y:Math.round(e.y*t.height),fontPx:n,font:`${r} ${i} ${n}px ${e.fontFamily}`,color:e.color,align:e.align,baseline:e.valign}}(e,t);i.font=n.font,i.fillStyle=n.color,i.textAlign=n.align,i.textBaseline=n.baseline,function(e,t){let n=t.text.split("\n"),i=1.2*t.fontPx,r=(n.length-1)*i,a="middle"===t.baseline?t.y-r/2:"bottom"===t.baseline?t.y-r:t.y;n.forEach((n,r)=>e.fillText(n,t.x,a+r*i))}(i,n)}let r=i.getImageData(0,0,t.width,t.height);return L(r.width,r.height,r.data)}(this.createCanvas,n,t.annotations)}async toBlob(e,t,n){return this.codec.encode(this.render(e,t),n)}constructor(e){i(this,"codec",void 0),i(this,"createCanvas",void 0),this.codec=e.codec,this.createCanvas=e.createCanvas}}function eU(e,t,n){e.update({zoom:t.zoom*n})}class eq{get state(){return this.store.getState()}update(e){return this.store.update(e),this}async save(){return this.handleSave()}async saveAs(){return this.handleSaveAs()}reset(){return this.handleReset(),this}use(e){let t=e.setup(this.api());return"function"==typeof t&&this.disposers.push(t),this}async fromBlob(e){this.store.update({status:"loading",error:null});try{let t=await this.processor.decode(e);if(this.destroyed)return this;this.source=t,this.previewSource=eH(t,this.previewMaxSize),this.thumbSource=eH(t,160),this.thumbVersion++,this.store.update({source:{width:t.width,height:t.height,name:e instanceof File?e.name:null,mimeType:e.type||"image/png"},resetHistory:!0,status:"ready"})}catch(e){this.store.update({status:"error",error:e instanceof Error?e.message:String(e)})}return this}async toBlob(e){if(!this.source)throw Error("No image loaded — call fromBlob() first");let t=w(this.store.getState());this.store.update({status:"exporting"});try{return t.annotations.length>0&&"u">typeof document&&document.fonts&&await document.fonts.ready,await this.processor.toBlob(this.source,t,e)}finally{this.store.update({status:"ready"})}}destroy(){var e,t;if(!this.destroyed){for(let n of(this.destroyed=!0,this.clearBusyTimer(),null==(e=this.dragCleanup)||e.call(this),null==(t=this.resizeObserver)||t.disconnect(),this.disposers.splice(0)))n();this.renderer.unmount(),this.store.destroy()}}api(){return{registerTool:e=>this.registry.register(e),registerFilter:e=>ea(e),registerLocale:e=>this.locales.register(e),getState:()=>this.store.getState(),update:e=>this.store.update(e)}}translator(){return this.locales.translator(this.store.getState().locale)}appContext(){return{update:e=>this.store.update(e),tools:this.registry.list(),t:this.translator(),onSave:()=>void this.handleSave(),onSaveAs:()=>void this.handleSaveAs(),onReset:()=>this.handleReset(),beginCropDrag:(e,t)=>this.beginCropDrag(e,t),beginCropRotate:e=>this.beginCropRotate(e)}}handleReset(){z(this.store.getState())&&this.confirm(this.translator()("Reset all changes? You can still undo afterwards."))&&this.store.update({resetDesign:!0})}render(){if(!this.destroyed){var e,t,n,i;let r,a,o,s,l,d,h,c;this.renderer.render((e=this.store.getState(),t=this.appContext(),eh("div",{class:"jie","data-theme":e.theme},[e.showToolbar?(r=_(e),o=(a=P(e))?Math.round(100*a.scale):Math.round(100*e.zoom),s=t.t,l="loading"===e.status||"exporting"===e.status,d="exporting"===e.status&&e.busyVisible,eh("header",{class:"jie-topbar"},[eh("div",{class:"jie-topbar__save"},[ey({label:s("Save"),variant:"primary",onClick:()=>t.onSave(),disabled:!e.source||l,busy:d}),ey({label:s("Save as"),onClick:()=>t.onSaveAs(),disabled:!e.source||l,busy:d})]),eh("div",{class:"jie-topbar__meta"},[r?eh("span",{},`${r.width} x ${r.height} px`):null,eb(ek.book),eh("div",{class:"jie-zoom"},[ey({variant:"icon",icon:ek.zoomOut,title:s("Zoom out"),onClick:()=>eU(t,e,1/1.2)}),eh("span",{},`${o}%`),ey({variant:"icon",icon:ek.zoomIn,title:s("Zoom in"),onClick:()=>eU(t,e,1.2)})])]),eh("div",{class:"jie-topbar__actions"},[ey({variant:"icon",icon:ek.reset,title:s("Reset"),disabled:!z(e),onClick:()=>t.onReset()}),ey({variant:"icon",icon:ek.undo,title:s("Undo"),disabled:!S(e),onClick:()=>t.update({history:{step:-1}})}),ey({variant:"icon",icon:ek.redo,title:s("Redo"),disabled:!k(e),onClick:()=>t.update({history:{step:1}})})])])):null,eh("div",{class:"jie-body"},[eh("nav",{class:"jie-rail"},t.tools.map(n=>eh("button",{key:n.id,class:"jie-tab",type:"button","aria-selected":String(e.activeTab===n.id),on:{click:()=>{var e;return t.update({activeTab:n.id,activeTool:null!=(e=n.defaultTool)?e:null})}}},[eb(n.icon),eh("span",{},t.t(n.label))]))),(c=null!=(i=null==(h=null!=(n=t.tools.find(t=>t.id===e.activeTab))?n:t.tools[0])?void 0:h.renderPanel({state:e,update:t.update,t:t.t}))?i:null,eh("div",{class:"jie-stage"},[eh("div",{class:"jie-canvas-wrap","data-jie-canvas-wrap":""},[eh("canvas",{class:"jie-canvas","data-jie-canvas":""}),function(e,t){if(!j(e))return null;let n=P(e),i=A(e);if(!n||!i)return null;let r=E(e);return eh("div",{class:"jie-crop",style:{left:`${n.offsetX+i.x*n.scale}px`,top:`${n.offsetY+i.y*n.scale}px`,width:`${i.width*n.scale}px`,height:`${i.height*n.scale}px`,transform:`rotate(${r}deg)`},on:{pointerdown:e=>t.beginCropDrag("move",e)}},[eh("div",{key:"rotate",class:"jie-crop__rotate",title:"Rotate",on:{pointerdown:e=>{e.stopPropagation(),t.beginCropRotate(e)}}}),...["nw","ne","sw","se"].map(e=>eh("div",{key:e,class:"jie-crop__handle","data-h":e,on:{pointerdown:n=>{n.stopPropagation(),t.beginCropDrag(e,n)}}}))])}(e,t),"loading"===e.status?eh("div",{class:"jie-overlay","data-jie-loading":""},[ex()]):"error"===e.status&&e.error?eh("div",{class:"jie-overlay jie-overlay--error","data-jie-error":""},[eh("span",{},t.t("Failed to load the image")),eh("span",{class:"jie-overlay__detail"},e.error)]):null]),c?eh("div",{class:"jie-panel"},[c]):null]))])]))),this.ensureViewportObserver(),this.paint(),this.paintFilterThumbs()}}async handleSave(){var e;if(!this.canExport())return;let t=await this.toBlob();null==(e=this.onSaveCb)||e.call(this,t,this),this.container.dispatchEvent(new CustomEvent("jie:save",{detail:{blob:t},bubbles:!0}))}async handleSaveAs(){var e;if(!this.canExport())return;let t=await this.toBlob();null==(e=this.onSaveAsCb)||e.call(this,t,this),this.container.dispatchEvent(new CustomEvent("jie:saveas",{detail:{blob:t},bubbles:!0}))}canExport(){let{status:e}=this.store.getState();return null!==this.source&&"exporting"!==e&&"loading"!==e}syncBusyTimer(e){"exporting"!==e.status?this.clearBusyTimer():e.busyVisible||null!==this.busyTimer||(this.busyTimer=setTimeout(()=>{this.busyTimer=null,this.destroyed||"exporting"!==this.store.getState().status||this.store.update({busyVisible:!0})},this.spinnerDelay))}clearBusyTimer(){null!==this.busyTimer&&(clearTimeout(this.busyTimer),this.busyTimer=null)}ensureViewportObserver(){var e;let t=this.container.querySelector("[data-jie-canvas-wrap]");if(t&&t!==this.observedWrap){if(null==(e=this.resizeObserver)||e.disconnect(),this.observedWrap=t,"u"<typeof ResizeObserver)return void this.measureViewport(t);this.resizeObserver=new ResizeObserver(()=>this.measureViewport(t)),this.resizeObserver.observe(t),this.measureViewport(t)}}measureViewport(e){let{clientWidth:t,clientHeight:n}=e,i=this.store.getState().viewport;t<=0||n<=0||i&&i.width===t&&i.height===n||this.store.update({viewport:{width:t,height:n}})}paint(){let e=this.store.getState(),t=this.container.querySelector("[data-jie-canvas]");if(!t||!this.previewSource||!e.viewport)return;let n=P(e);if(!n)return;let i=M(e),r=`${this.thumbVersion}:${JSON.stringify(i)}`;r===this.cachedRasterKey&&this.cachedRaster||(this.cachedRaster=this.processor.render(this.previewSource,i),this.cachedRasterKey=r);let a=`${r}@${e.viewport.width}x${e.viewport.height}:${n.scale}:${n.offsetX},${n.offsetY}`;a!==this.lastPaintKey&&(this.lastPaintKey=a,function(e,t,n,i){let r="u">typeof window&&window.devicePixelRatio||1;e.width=Math.max(1,Math.round(n.width*r)),e.height=Math.max(1,Math.round(n.height*r));let a=e.getContext("2d");if(!a)return;a.setTransform(r,0,0,r,0,0),a.clearRect(0,0,n.width,n.height);let o=document.createElement("canvas");o.width=t.width,o.height=t.height;let s=o.getContext("2d");s&&(s.putImageData(es(t),0,0),a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(o,i.offsetX,i.offsetY,i.width,i.height))}(t,this.cachedRaster,e.viewport,n))}paintFilterThumbs(){let e=this.thumbSource;if(e)for(let t of this.container.querySelectorAll("canvas[data-jie-filter-thumb]")){let n=t.dataset.jieFilterThumb;if(!n)continue;let i=`${this.thumbVersion}:${n}`;if(t.dataset.key===i)continue;let r=eo(e,n);t.width=r.width,t.height=r.height;let a=t.getContext("2d");a&&(a.putImageData(es(r),0,0),t.dataset.key=i)}}beginCropDrag(e,t){let n=this.store.getState(),i=P(n),r=A(n),a=C(n);if(!i||!r||!a)return;let o=E(n),s=n.minCropSize,l=t.clientX,d=t.clientY;this.runPointerGesture(t,t=>{let n=(t.clientX-l)/i.scale,h=(t.clientY-d)/i.scale;return{crop:0!==o?function(e,t,n,i,r,a=8){if("move"===n)return{...e,x:e.x+i,y:e.y+r};let[o,s]=B[n],l=O(e,t,o,s),d=O(e,t,-o,-s),h={x:l.x+i,y:l.y+r},c=(h.x+d.x)/2,u=(h.y+d.y)/2,p=t*I,g=Math.cos(p),f=Math.sin(p),m=h.x-d.x,b=h.y-d.y,x=Math.max(a,Math.abs(m*g+b*f)),y=Math.max(a,Math.abs(-(m*f)+b*g));return{x:c-x/2,y:u-y/2,width:x,height:y}}(r,o,e,n,h,s):function(e,t,n,i,r,a=null,o=8){var s;let l,d;if("move"===t)return y({...e,x:e.x+n,y:e.y+i},r);let{x:h,y:c,width:u,height:p}=e;if("nw"===t||"sw"===t){let e=x(h+n,0,h+u-o);u+=h-e,h=e}else u=x(u+n,o,r.width-h);if("nw"===t||"ne"===t){let e=x(c+i,0,c+p-o);p+=c-e,c=e}else p=x(p+i,o,r.height-c);let g={x:h,y:c,width:u,height:p};return null!==a&&a>0&&(l=(s=g).width/a,d="sw"===t||"se"===t?s.y:s.y+s.height-l,g={...s,height:l,y:d}),y(g,r)}(r,e,n,h,a,null,s)}})}beginCropRotate(e){var t;let n=this.store.getState(),i=P(n),r=A(n),a=null!=(t=this.observedWrap)?t:this.container.querySelector("[data-jie-canvas-wrap]");if(!i||!r||!a)return;let o=a.getBoundingClientRect(),s=$(r),l=o.left+i.offsetX+s.x*i.scale,d=o.top+i.offsetY+s.y*i.scale,h=E(n),c=D(l,d,e.clientX,e.clientY);this.runPointerGesture(e,e=>{let t=h+(D(l,d,e.clientX,e.clientY)-c);return 2>Math.abs(t)&&(t=0),{angle:Math.round(10*t)/10}})}runPointerGesture(e,t){e.preventDefault();let n=!1,i=e=>{this.store.update({design:t(e),commit:!n}),n=!0},r=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",r),this.dragCleanup=null};window.addEventListener("pointermove",i),window.addEventListener("pointerup",r),this.dragCleanup=r}constructor(e){var t,n,r,a,o,s,l,h;for(const s of(i(this,"store",void 0),i(this,"container",void 0),i(this,"renderer",void 0),i(this,"registry",new em),i(this,"locales",new el),i(this,"processor",void 0),i(this,"previewMaxSize",void 0),i(this,"spinnerDelay",void 0),i(this,"busyTimer",null),i(this,"onSaveCb",void 0),i(this,"onSaveAsCb",void 0),i(this,"confirm",void 0),i(this,"source",null),i(this,"previewSource",null),i(this,"thumbSource",null),i(this,"thumbVersion",0),i(this,"cachedRaster",null),i(this,"cachedRasterKey",""),i(this,"lastPaintKey",""),i(this,"disposers",[]),i(this,"resizeObserver",null),i(this,"observedWrap",null),i(this,"dragCleanup",null),i(this,"destroyed",!1),this.container=function(e){if("string"!=typeof e)return e;let t=document.querySelector(e);if(!t)throw Error(`Container not found: ${e}`);return t}(e.container),this.processor=null!=(t=e.processor)?t:function(e=eV,t){return new eN({codec:new eF(e,t),createCanvas:e})}(void 0,{maxPixels:e.maxSourcePixels,maxSize:e.maxSourceSize}),this.previewMaxSize=null!=(n=e.previewMaxSize)?n:1600,this.spinnerDelay=Math.max(0,null!=(r=e.spinnerDelay)?r:250),this.onSaveCb=e.onSave,this.onSaveAsCb=e.onSaveAs,this.confirm=null!=(a=e.confirm)?a:e=>"u"<typeof window||window.confirm(e),null!=(o=e.locales)?o:[]))this.locales.register(s);for(const t of(this.store=new b({scheduler:null!=(s=e.scheduler)?s:function(){if("function"!=typeof requestAnimationFrame)return new f(e=>setTimeout(e,16),e=>clearTimeout(e));let e=e=>{cancelAnimationFrame(e.raf),null!==e.timer&&(clearTimeout(e.timer),e.timer=null)};return new f(t=>{let n={raf:0,timer:null},i=()=>{e(n),t()};return n.raf=requestAnimationFrame(i),n.timer=setTimeout(i,100),n},e)}(),initialState:{...d(),...e.state,...e.locale?{locale:e.locale}:{},...void 0!==e.minCropSize?{minCropSize:Math.max(1,e.minCropSize)}:{},...void 0!==e.minResizeSize?{minResizeSize:Math.max(1,e.minResizeSize)}:{},...e.palette?{palette:e.palette}:{},...e.fonts?{fonts:e.fonts}:{}}}),null!=(l=e.tools)?l:[ez,e_,eT,eP,eB,e$]))this.registry.register(t);for(const t of null!=(h=e.plugins)?h:[])this.use(t);this.renderer=new ep(new ev(document),this.container),this.disposers.push(this.store.subscribe(()=>this.render())),this.disposers.push(this.store.subscribe(e=>this.syncBusyTimer(e))),this.render(),e.image&&this.fromBlob(e.image)}}function eH(e,t){let n=Math.max(e.width,e.height);if(t>=n)return e;let i=t/n;return U(e,{width:Math.round(e.width*i),height:Math.round(e.height*i)})}}},function(e){return e(e.s=98270)}])});
8
+ "use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[918],{76542:function(e,t,n){n.d(t,{ProImageEditor:function(){return d}});var i=n(82749),r=n(85013),a=n(6441),o=n(91907),s=n(10830),l=n(78584);class d extends o.ViewComponent{className(){return"ImageEditorPro"}async open(e,t){let n=this.j,i=a.Config.defaultOptions.imageEditorPro,o=n.c.div("jodit-image-editor-pro");o.style.width="100%",o.style.height="100%";let s=new l.Dialog({language:n.o.language});s.setSize(i.dialog.width,i.dialog.height),s.setContent(o),s.open();let d=null,h=null,c=()=>{null==h||h(),h=null,null==d||d.destroy(),d=null,s.close()};s.e.on("beforeClose",()=>{null==h||h(),h=null,null==d||d.destroy(),d=null}),d=new r.ImageEditor({container:o,state:{showToolbar:!1,status:"loading"},onSave:n=>{this.persist(d,e,void 0,n,t,c)},onSaveAs:n=>{this.saveAs(d,e,n,t,c)}}),h=this.mountToolbar(s,d);try{let t=await this.loadImage(e);await d.fromBlob(t),n.e.fire("afterImageEditor")}catch(e){null==d||d.update({status:"error",error:e instanceof Error?e.message:String(e)}),this.error(e)}}mountToolbar(e,t){let n=this.j,i=(0,s.Button)(n,{icon:{name:"save"},text:n.i18n("Save")},"primary"),a=(0,s.Button)(n,{icon:{name:"save"},name:"save-as",text:n.i18n("Save as")}),o=n.c.span("jodit-image-editor-pro__size"),l=(0,s.Button)(n,r.ICONS.minus),d=n.c.span("jodit-image-editor-pro__zoom"),h=(0,s.Button)(n,r.ICONS.plus),c=(0,s.Button)(n,"update",n.i18n("Reset")),u=(0,s.Button)(n,"undo",n.i18n("Undo")),p=(0,s.Button)(n,"redo",n.i18n("Redo"));l.setState({tooltip:"Zoom out"}),h.setState({tooltip:"Zoom in"});let g=null;i.onAction(()=>{g=i,t.save()}),a.onAction(()=>{g=a,t.saveAs()}),l.onAction(()=>t.update({zoom:t.state.zoom/1.2})),h.onAction(()=>t.update({zoom:1.2*t.state.zoom})),c.onAction(()=>t.reset()),u.onAction(()=>t.update({history:{step:-1}})),p.onAction(()=>t.update({history:{step:1}}));let f=(...e)=>{let t=n.c.div("jodit-image-editor-pro__group");return t.style.display="flex",t.style.alignItems="center",t.style.gap="4px",e.forEach(e=>t.appendChild(e)),t},m=n.c.div("jodit-image-editor-pro__toolbar");m.style.display="flex",m.style.alignItems="center",m.style.gap="12px",m.style.width="100%",o.style.opacity="0.75",d.style.minWidth="3.5em",d.style.textAlign="center",m.appendChild(f(i.container,a.container)),m.appendChild(f(o,l.container,d,h.container));let b=f(c.container,u.container,p.container);b.style.marginLeft="auto",m.appendChild(b),e.setHeader(m);let x="jodit-image-editor-pro__button_busy",y=e=>{let t=r.selectors.selectOutputSize(e),n="exporting"===e.status,s=n||"loading"===e.status,l=e.busyVisible,h=n&&(null==l||l);n||(g=null),i.setState({disabled:!e.source||s}),a.setState({disabled:!e.source||s}),i.container.classList.toggle(x,h&&g!==a),a.container.classList.toggle(x,h&&g===a),c.setState({disabled:!r.selectors.selectIsDirty(e)}),u.setState({disabled:!r.selectors.selectCanUndo(e)}),p.setState({disabled:!r.selectors.selectCanRedo(e)}),o.textContent=t?`${t.width} \xd7 ${t.height}`:"";let f=r.selectors.selectViewportFit(e),m=f?Math.round(100*f.scale):Math.round(100*e.zoom);d.textContent=`${m}%`};y(t.state);let w=t.store.subscribe(y);return()=>{w(),[i,a,l,h,c,u,p].forEach(e=>e.destruct())}}saveAs(e,t,n,i,r){this.j.prompt("Enter new name","Save in new file",a=>{let o=(a||"").trim();if(!o)return this.j.alert("The name should not be empty"),!1;this.persist(e,t,o,n,i,r)})}async persist(e,t,n,i,r,a){null==e||e.update({status:"exporting"});try{let e=await this.blobSize(i),o={action:this.coreSupportsSaved()?"saved":"resize",box:e};void 0!==n?this.j.e.fire("afterImageEditorSave",o,n):this.j.e.fire("afterImageEditorSave",o);let s=await this.uploadEdited(t,i,n),l=()=>{a(),this.j.e.fire("update.filebrowser")};r(n,this.coreSupportsSaved()?{action:"saved",box:e,newPath:s||void 0}:{action:"resize",box:e},l,e=>{a(),this.error(e)})}catch(e){a(),this.error(e)}}async uploadEdited(e,t,n){var i,r;let{source:a,path:o,name:s}=await this.j.dataProvider.getPathByUrl(e),l=this.connectorUrl();if(!l)throw Error("No connector configured for imageSave");let d=String(n||s||"image.png"),h=new FormData;h.append("action","imageSave"),h.append("source",String(null!=a?a:"")),h.append("path",String(null!=o?o:"")),h.append("name",d),h.append("files[0]",t,d);let c=l.includes("?")?"&":"?",u=await fetch(`${l}${c}action=imageSave`,{method:"POST",body:h,credentials:"include"}),p=await u.json();if(!p.success)throw Error(p.message||"Failed to save the edited image");return null!=(i=null==(r=p.data)?void 0:r.newPath)?i:""}coreSupportsSaved(){let[e=0,t=0,n=0]=(this.j.getVersion?this.j.getVersion():"").split(".").map(e=>parseInt(e,10)||0);return e>4||4===e&&(t>12||12===t&&n>=34)}connectorUrl(){var e,t;let n=null==(e=this.j.o.ajax)?void 0:e.url,i=null==(t=this.j.o.uploader)?void 0:t.url;return"string"==typeof n&&n?n:"string"==typeof i&&i?i:""}async loadImage(e){let t=this.connectorUrl();if(t)try{return await this.loadViaConnector(t,e)}catch(e){}let n=e.includes("?")?"&":"?",i=await fetch(`${e}${n}_tst=${Date.now()}`,{credentials:"include"});if(!i.ok)throw Error(`Failed to load image (${i.status})`);return i.blob()}async loadViaConnector(e,t){var n;let{source:i,path:r,name:a}=await this.j.dataProvider.getPathByUrl(t),o=new FormData;o.append("action","imageLoad"),o.append("source",String(null!=i?i:"")),o.append("path",String(null!=r?r:"")),o.append("name",String(null!=a?a:""));let s=e.includes("?")?"&":"?",l=await fetch(`${e}${s}action=imageLoad`,{method:"POST",body:o,credentials:"include"}),d=await l.json();if(!d.success||!(null==(n=d.data)?void 0:n.content))throw Error(d.message||"Failed to load the image");return(await fetch(d.data.content)).blob()}async blobSize(e){let t=await createImageBitmap(e),n={w:t.width,h:t.height};return t.close(),n}error(e){this.j.e.fire("errorMessage",e.message)}constructor(...e){super(...e),(0,i._)(this,"isProImageEditor",!0)}}},45719:function(e,t,n){n(6441).Config.prototype.imageEditorPro={dialog:{width:"90%",height:"90%"}}},98270:function(e,t,n){n.r(t),n.d(t,{imageEditorPro:function(){return s}});var i=n(82749);n(45719);var r=n(76542),a=n(50911),o=n(2692);class s extends a.Plugin{afterInit(e){let t=r.ProImageEditor,n=o.JoditPro.modules;n.ImageEditorCore||n.ImageEditor===t||(n.ImageEditorCore=n.ImageEditor),n.ImageEditor=t}beforeDestruct(e){}}(0,i._)(s,"requires",["license"]),o.JoditPro.plugins.add("imageEditorPro",s)},85013:function(e,t,n){function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{ICONS:function(){return ek},ImageEditor:function(){return eq},selectors:function(){return I}});try{if("u">typeof document){var r=document.createElement("style");r.appendChild(document.createTextNode("/*\n * Jodit Image Editor — design system & layout.\n *\n * Everything is scoped under `.jie` so the stylesheet can be injected into any\n * page without leaking. Tokens are CSS custom properties; switching `data-theme`\n * re-themes the whole tree. PostCSS handles nesting + autoprefixing.\n */\n\n.jie {\n /* palette */\n --jie-accent: #5b5fc7;\n --jie-accent-soft: #eceefb;\n --jie-bg: #ffffff;\n --jie-surface: #ffffff;\n --jie-stage: #f3f4f8;\n --jie-border: #e6e8ef;\n --jie-text: #1f2430;\n --jie-text-dim: #8a90a2;\n --jie-danger: #e0533d;\n --jie-shadow: 0 1px 2px rgba(20, 24, 40, 0.06), 0 8px 24px rgba(20, 24, 40, 0.06);\n\n /* sizing scale — one system for every control */\n --jie-control-h: 38px; /* shared height: buttons, inputs, selects, color, slider row */\n --jie-control-px: 12px; /* horizontal padding inside controls */\n --jie-icon: 20px; /* inline icon size (rail icons override to 24) */\n --jie-radius: 12px; /* cards / panels */\n --jie-radius-sm: 8px; /* controls */\n --jie-gap: 16px; /* between groups */\n --jie-gap-sm: 8px; /* between controls in a row */\n --jie-font-sm: 13px;\n --jie-font-md: 14px;\n --jie-rail-w: 92px;\n --jie-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 420px;\n box-sizing: border-box;\n font-family: var(--jie-font);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n overflow: hidden;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.jie *,.jie *::before,.jie *::after {\n box-sizing: border-box;\n }\n\n.jie[data-theme='dark'] {\n --jie-accent: #8a8df0;\n --jie-accent-soft: #2a2d44;\n --jie-bg: #14161f;\n --jie-surface: #1b1e2a;\n --jie-stage: #0f1118;\n --jie-border: #2a2e3d;\n --jie-text: #e7e9f3;\n --jie-text-dim: #8b91a7;\n --jie-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);\n }\n\n/* ---- top bar ------------------------------------------------------------ */\n.jie-topbar {\n display: flex;\n align-items: center;\n gap: var(--jie-gap);\n padding: 12px 16px;\n border-bottom: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n.jie-topbar__save {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.jie-topbar__meta {\n display: flex;\n align-items: center;\n gap: 12px;\n margin: 0 auto;\n color: var(--jie-text-dim);\n font-size: 14px;\n}\n\n.jie-zoom {\n display: flex;\n align-items: center;\n gap: 6px;\n font-variant-numeric: tabular-nums;\n}\n\n.jie-topbar__actions {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n/* ---- buttons ------------------------------------------------------------ */\n.jie-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: var(--jie-control-h); /* single-char buttons (B / I) stay square */\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n font-weight: 600;\n line-height: 1;\n white-space: nowrap;\n color: var(--jie-text);\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease,\n border-color 0.12s ease;\n}\n.jie-btn:hover:not(:disabled) {\n background: var(--jie-accent-soft);\n }\n.jie-btn:disabled {\n opacity: 0.4;\n cursor: default;\n }\n/* inline icons are smaller than the standalone rail icons */\n.jie-btn .jie-icon {\n width: var(--jie-icon);\n height: var(--jie-icon);\n }\n\n.jie-btn--primary {\n color: #fff;\n background: var(--jie-accent);\n padding-inline: 18px;\n}\n\n.jie-btn--primary:hover:not(:disabled) {\n background: color-mix(in srgb, var(--jie-accent) 88%, #000);\n }\n\n.jie-btn--icon {\n width: var(--jie-control-h);\n padding: 0;\n color: var(--jie-text-dim);\n}\n\n.jie-btn--icon:hover:not(:disabled) {\n color: var(--jie-text);\n }\n\n.jie-btn--active {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n}\n\n/* text-style modifiers (the B / I annotation toggles) */\n.jie-btn--bold {\n font-weight: 800;\n}\n.jie-btn--italic {\n font-style: italic;\n font-family: Georgia, 'Times New Roman', serif;\n}\n\n.jie-icon {\n display: inline-flex;\n width: 24px;\n height: 24px;\n}\n\n.jie-icon svg {\n width: 100%;\n height: 100%;\n }\n\n/* ---- body / rail -------------------------------------------------------- */\n.jie-body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n\n.jie-rail {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: var(--jie-rail-w);\n padding: 14px 10px;\n border-right: 1px solid var(--jie-border);\n background: var(--jie-surface);\n overflow-y: auto;\n}\n\n.jie-tab {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n padding: 12px 6px;\n font-size: 12px;\n font-weight: 600;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease;\n}\n\n.jie-tab:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-tab[aria-selected='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n/* ---- stage / preview ---------------------------------------------------- */\n.jie-stage {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n background: var(--jie-bg);\n}\n\n.jie-canvas-wrap {\n position: relative;\n flex: 1;\n margin: 16px;\n border-radius: var(--jie-radius);\n background: var(--jie-stage);\n overflow: hidden;\n touch-action: none;\n}\n\n.jie-canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* ---- transient status (loading / saving / error) ------------------------- */\n\n.jie-spinner {\n display: inline-block;\n flex: 0 0 auto;\n width: var(--jie-icon);\n height: var(--jie-icon);\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: jie-spin 0.8s linear infinite;\n}\n\n@keyframes jie-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Covers the canvas while the image is loading, or shows the load error. */\n.jie-overlay {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--jie-gap-sm);\n font-size: var(--jie-font-md);\n color: var(--jie-text-dim);\n background: var(--jie-stage);\n}\n.jie-overlay .jie-spinner {\n width: 32px;\n height: 32px;\n border-width: 3px;\n color: var(--jie-accent);\n }\n\n.jie-overlay--error {\n color: var(--jie-danger);\n}\n\n.jie-overlay__detail {\n max-width: 80%;\n font-size: var(--jie-font-sm);\n text-align: center;\n color: var(--jie-text-dim);\n}\n\n/* crop overlay */\n.jie-crop {\n position: absolute;\n border: 1.5px dashed var(--jie-accent);\n box-shadow: 0 0 0 100vmax var(--jie-scrim, rgba(17, 24, 39, 0.45));\n transform-origin: center;\n cursor: move;\n}\n\n/*\n * Rotation knob, centred *above* the frame and connected by a short stem. The\n * preview keeps `VIEWPORT_PADDING` around the image, so the knob has room and is\n * never clipped — even for a full-image crop.\n */\n.jie-crop__rotate {\n position: absolute;\n left: 50%;\n top: -34px;\n width: 18px;\n height: 18px;\n margin-left: -9px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.3);\n cursor: grab;\n touch-action: none;\n\n /* stem runs from the knob's bottom (-16px) toward the frame, stopping ~5px\n short of the edge so it never touches/overlaps the dashed border */\n}\n.jie-crop__rotate::before {\n content: '';\n position: absolute;\n left: 50%;\n top: 18px;\n width: 2px;\n height: 11px;\n margin-left: -1px;\n background: var(--jie-accent);\n }\n.jie-crop__rotate:active {\n cursor: grabbing;\n }\n\n.jie-crop__handle {\n position: absolute;\n width: 14px;\n height: 14px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n}\n\n.jie-crop__handle[data-h='nw'] {\n top: -7px;\n left: -7px;\n cursor: nwse-resize;\n }\n\n.jie-crop__handle[data-h='ne'] {\n top: -7px;\n right: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='sw'] {\n bottom: -7px;\n left: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='se'] {\n bottom: -7px;\n right: -7px;\n cursor: nwse-resize;\n }\n\n/* ---- bottom panel ------------------------------------------------------- */\n.jie-panel {\n display: flex;\n flex-direction: column;\n gap: 14px;\n align-items: center;\n padding: 14px 16px 20px;\n border-top: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n/* a row of equal-height controls, centred on a shared baseline */\n.jie-toolrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap-sm);\n align-items: center;\n justify-content: center;\n}\n\n/* a row of labelled (label-above) fields; inputs and buttons share a height,\n so aligning their bottoms keeps everything tidy */\n.jie-fieldrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap);\n align-items: flex-end;\n justify-content: center;\n}\n\n.jie-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n}\n\n.jie-input,\n.jie-select {\n height: var(--jie-control-h);\n width: 120px;\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n:is(.jie-input,.jie-select):focus {\n outline: 2px solid var(--jie-accent-soft);\n border-color: var(--jie-accent);\n }\n\n/* native colour input, normalised to the control height as a rounded swatch */\n/* colour picker: a swatch button that opens a popover of preset swatches */\n.jie-colorpicker {\n position: relative;\n display: inline-flex;\n}\n\n/* the trigger swatch (shows the current colour via inline `background`) */\n.jie-color {\n width: var(--jie-control-h);\n height: var(--jie-control-h);\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-bg);\n cursor: pointer;\n}\n\n.jie-popover__backdrop {\n position: fixed;\n inset: 0;\n z-index: 50;\n}\n\n.jie-popover {\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n z-index: 51;\n padding: 10px;\n background: var(--jie-surface);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n box-shadow: var(--jie-shadow);\n}\n\n.jie-swatches {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 8px;\n}\n\n/* 3\xd73 position anchor grid */\n.jie-posgrid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 2px;\n padding: 3px;\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n.jie-posgrid__cell {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n}\n\n.jie-posgrid__cell .jie-icon {\n width: 16px;\n height: 16px;\n }\n\n.jie-posgrid__cell:hover {\n background: var(--jie-accent-soft);\n color: var(--jie-text);\n }\n\n.jie-posgrid__cell[aria-pressed='true'] {\n background: var(--jie-accent);\n color: #fff;\n }\n\n/* font selector */\n.jie-fontselect {\n position: relative;\n display: inline-flex;\n}\n\n.jie-fontselect__trigger {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: 130px;\n padding: 0 10px;\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontselect__trigger > span {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n.jie-fontselect__trigger .jie-icon {\n width: 16px;\n height: 16px;\n color: var(--jie-text-dim);\n flex: none;\n }\n\n.jie-fontlist {\n min-width: 180px;\n max-height: 260px;\n overflow-y: auto;\n padding: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.jie-fontlist__item {\n padding: 8px 10px;\n font-size: 15px;\n text-align: left;\n color: var(--jie-text);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontlist__item:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-fontlist__item[aria-pressed='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n.jie-swatch {\n width: 28px;\n height: 28px;\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-surface);\n cursor: pointer;\n transition:\n transform 0.1s ease,\n box-shadow 0.1s ease;\n}\n\n.jie-swatch:hover {\n transform: scale(1.08);\n }\n\n.jie-swatch[aria-pressed='true'] {\n box-shadow:\n inset 0 0 0 2px var(--jie-surface),\n 0 0 0 2px var(--jie-accent);\n }\n\n/* slider — the whole control occupies the shared height and centres its track */\n.jie-slider {\n display: flex;\n align-items: center;\n gap: 10px;\n height: var(--jie-control-h);\n width: clamp(180px, 28vw, 300px);\n}\n\n.jie-slider__label {\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n white-space: nowrap;\n}\n\n.jie-slider__value {\n min-width: 2.5ch;\n text-align: right;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n}\n\n/*\n * Fully custom range so it looks identical across evergreen browsers (the\n * native `accent-color` only themes the colour, not the track/thumb shapes).\n * The filled portion is driven by `--jie-range-fill` (set per render by the\n * slider component) on WebKit, and by the native `::-moz-range-progress` on\n * Firefox.\n */\n.jie-range {\n --jie-range-fill: 50%;\n appearance: none;\n flex: 1;\n min-width: 0;\n height: 16px; /* hit area */\n background: transparent;\n cursor: pointer;\n}\n.jie-range::-webkit-slider-runnable-track {\n height: 4px;\n border-radius: 999px;\n background: linear-gradient(\n to right,\n var(--jie-accent) var(--jie-range-fill),\n var(--jie-border) var(--jie-range-fill)\n );\n }\n.jie-range::-webkit-slider-thumb {\n appearance: none;\n margin-top: -6px; /* centre the 16px thumb on the 4px track */\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range::-moz-range-track {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-border);\n }\n.jie-range::-moz-range-progress {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-accent);\n }\n.jie-range::-moz-range-thumb {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range:focus-visible {\n outline: none;\n }\n.jie-range:focus-visible::-webkit-slider-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n.jie-range:focus-visible::-moz-range-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n\n/* filter thumbnails */\n.jie-thumbs {\n display: flex;\n gap: 12px;\n width: 100%;\n padding-bottom: 4px;\n overflow-x: auto;\n justify-content: flex-start;\n}\n\n.jie-thumb {\n display: flex;\n flex-direction: column;\n gap: 6px;\n align-items: center;\n padding: 4px;\n font-size: 12px;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.jie-thumb canvas,.jie-thumb .jie-thumb__swatch {\n width: 76px;\n height: 56px;\n border-radius: var(--jie-radius-sm);\n border: 2px solid transparent;\n object-fit: cover;\n background: var(--jie-stage);\n }\n\n.jie-thumb[aria-pressed='true'] {\n color: var(--jie-accent);\n }\n\n.jie-thumb[aria-pressed='true'] canvas,.jie-thumb[aria-pressed='true'] .jie-thumb__swatch {\n border-color: var(--jie-accent);\n }\n\n/* ---- responsive / mobile ------------------------------------------------ */\n@media (max-width: 720px) {\n .jie {\n --jie-rail-w: 100%;\n }\n\n .jie-topbar__meta {\n display: none;\n }\n\n .jie-body {\n flex-direction: column-reverse;\n }\n\n .jie-rail {\n flex-direction: row;\n width: 100%;\n border-right: 0;\n border-top: 1px solid var(--jie-border);\n overflow-x: auto;\n }\n\n .jie-tab {\n flex: 0 0 auto;\n min-width: 72px;\n }\n\n .jie-canvas-wrap {\n margin: 10px;\n }\n\n .jie-input {\n width: 100px;\n }\n}\n\n@media (hover: none) {\n .jie-crop__handle {\n width: 22px;\n height: 22px;\n }\n}")),document.head.appendChild(r)}}catch(e){}let a=Object.freeze([{label:"Arial",value:"Arial, Helvetica, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Verdana",value:"Verdana, Geneva, sans-serif"},{label:"Tahoma",value:"Tahoma, Geneva, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", Helvetica, sans-serif'},{label:"Times New Roman",value:'"Times New Roman", Times, serif'},{label:"Georgia",value:'Georgia, "Times New Roman", serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Impact",value:"Impact, Haettenschweiler, sans-serif"}]),o=Object.freeze({brightness:0,contrast:0,saturation:0,warmth:0,blur:0}),s=Object.freeze(["#ffffff","#1a1a1a","#9e9689","#4a90e2","#54b98a","#f2c94c","#eb5757","#a29bfe","#8b5cf6","#f178b6","#f2994a","#b8e454","#7ec8f0","#5b6470","#d8d2c8","#eeeeee"]);function l(){return{flip:{horizontal:!1,vertical:!1},rotate:0,angle:0,crop:null,resize:null,finetune:{...o},filter:"original",annotations:[],focus:null}}function d(){return{source:null,status:"idle",busyVisible:!1,error:null,activeTab:"adjust",activeTool:"crop",zoom:1,history:{entries:[l()],index:0},selectedAnnotationId:null,theme:"light",showToolbar:!0,locale:"en",minCropSize:8,minResizeSize:1,palette:[...s],fonts:a.map(e=>({...e})),activePopover:null,viewport:null}}function h(e){let t=e.entries[e.index];if(void 0===t)throw RangeError(`history index ${e.index} is out of bounds`);return t}function c(e,t){let n=e.entries.slice(0,e.index+1);n.push(t);let i=Math.max(0,n.length-100),r=i>0?n.slice(i):n;return{entries:r,index:r.length-1}}function u(e,t){let n=Math.min(Math.max(t,0),e.entries.length-1);return n===e.index?e:{...e,index:n}}function p(e,t){var n,i,r,a,o,s;let d=e;if(void 0!==t.activeTab&&(d=g(d,{activeTab:t.activeTab})),void 0!==t.activeTool&&(d=g(d,{activeTool:t.activeTool})),void 0!==t.zoom&&(d=g(d,{zoom:!Number.isFinite(a=t.zoom)||a<=0?1:Math.min(Math.max(a,.01),64)})),void 0!==t.theme&&(d=g(d,{theme:t.theme})),void 0!==t.showToolbar&&(d=g(d,{showToolbar:t.showToolbar})),void 0!==t.locale&&(d=g(d,{locale:t.locale})),void 0!==t.minCropSize&&(d=g(d,{minCropSize:Math.max(1,t.minCropSize)})),void 0!==t.minResizeSize&&(d=g(d,{minResizeSize:Math.max(1,t.minResizeSize)})),void 0!==t.palette&&(d=g(d,{palette:t.palette})),void 0!==t.fonts&&(d=g(d,{fonts:t.fonts})),void 0!==t.activePopover&&(d=g(d,{activePopover:t.activePopover})),void 0!==t.status&&(d=g(d,{status:t.status}),"exporting"!==t.status&&d.busyVisible&&(d=g(d,{busyVisible:!1}))),void 0!==t.busyVisible&&(d=g(d,{busyVisible:t.busyVisible})),void 0!==t.error&&(d=g(d,{error:t.error})),void 0!==t.source&&(d=g(d,{source:t.source})),void 0!==t.viewport&&(d=g(d,{viewport:t.viewport})),void 0!==t.selectedAnnotationId&&(d=g(d,{selectedAnnotationId:t.selectedAnnotationId})),t.resetHistory&&(d=g(d,{history:{entries:[l()],index:0}})),t.resetDesign&&(d=g(d,{history:c(d.history,l())})),void 0!==t.design){let e,i=(o=h(d.history),s=t.design,{...o,...s,flip:s.flip?{...o.flip,...s.flip}:o.flip,finetune:s.finetune?{...o.finetune,...s.finetune}:o.finetune,rotate:void 0!==s.rotate?(90*Math.round(s.rotate/90)%360+360)%360:o.rotate}),r=!1===t.commit?((e=(n=d.history).entries.slice())[n.index]=i,{entries:e,index:n.index}):c(d.history,i);d=g(d,{history:r})}if(void 0!==t.history){let e=t.history,n="step"in e?(i=d.history,r=e.step,u(i,i.index+r)):u(d.history,e.index);d=g(d,{history:n})}return d}function g(e,t){for(let n of Object.keys(t))if(e[n]!==t[n])return{...e,...t};return e}class f{request(e){this.pending=e,null===this.handle&&(this.handle=this.schedule(()=>this.flush()))}flush(){null!==this.handle&&(this.clear(this.handle),this.handle=null);let e=this.pending;this.pending=null,e&&e()}cancel(){null!==this.handle&&(this.clear(this.handle),this.handle=null),this.pending=null}constructor(e,t){i(this,"pending",null),i(this,"handle",null),this.schedule=e,this.clear=t}}class m{request(e){this.pending=e,this.flush()}flush(){let e=this.pending;this.pending=null,e&&e()}cancel(){this.pending=null}constructor(){i(this,"pending",null)}}class b{getState(){return this.state}update(e){let t=this.reducer(this.state,e);return t!==this.state&&(this.state=t,this.scheduler.request(()=>this.notify())),this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}flush(){this.scheduler.flush()}destroy(){this.scheduler.cancel(),this.listeners.clear()}notify(){if(!this.notifying){this.notifying=!0;try{for(let e of this.listeners)e(this.state)}finally{this.notifying=!1}}}constructor(e={}){var t,n,r;i(this,"state",void 0),i(this,"reducer",void 0),i(this,"scheduler",void 0),i(this,"listeners",new Set),i(this,"notifying",!1),this.state=null!=(t=e.initialState)?t:d(),this.reducer=null!=(n=e.reducer)?n:p,this.scheduler=null!=(r=e.scheduler)?r:new m}}function x(e,t,n){return Math.min(Math.max(e,t),n)}function y(e,t){let n=x(e.width,1,t.width),i=x(e.height,1,t.height);return{x:x(e.x,0,t.width-n),y:x(e.y,0,t.height-i),width:n,height:i}}function w(e){return h(e.history)}function j(e){return"adjust"===e.activeTab&&"crop"===e.activeTool}function M(e){let t=w(e);return j(e)?{...t,crop:null,angle:0}:t}function S(e){return e.history.index>0}function k(e){var t;return(t=e.history).index<t.entries.length-1}function z(e){return e.history.index>0||e.history.entries.length>1}function C(e){if(!e.source)return null;let t=w(e),{width:n,height:i}=e.source;return 90===t.rotate||270===t.rotate?{width:i,height:n}:{width:n,height:i}}function _(e){let t=w(e);return t.resize?t.resize:t.crop?{width:Math.round(t.crop.width),height:Math.round(t.crop.height)}:C(e)}function T(e){return j(e)?C(e):_(e)}function P(e){let t,n,i,r=T(e);if(!r||!e.viewport)return null;let a={width:Math.max(1,e.viewport.width-88),height:Math.max(1,e.viewport.height-88)},o=(t=Math.min(a.width/r.width,a.height/r.height)||0,n=r.width*t,i=r.height*t,{scale:t,width:n,height:i,offsetX:(a.width-n)/2,offsetY:(a.height-i)/2}).scale*e.zoom,s=r.width*o,l=r.height*o;return{scale:o,width:s,height:l,offsetX:(e.viewport.width-s)/2,offsetY:(e.viewport.height-l)/2,content:r}}function E(e){return w(e).angle}function A(e){let t=w(e);if(t.crop)return t.crop;let n=C(e);return n?{x:0,y:0,width:n.width,height:n.height}:null}let I=Object.freeze(Object.defineProperty({__proto__:null,VIEWPORT_PADDING:44,selectCanRedo:k,selectCanUndo:S,selectCropAngle:E,selectDesign:w,selectEffectiveCrop:A,selectIsCropping:j,selectIsDirty:z,selectOrientedSize:C,selectOutputSize:_,selectPreviewContentSize:T,selectPreviewDesign:M,selectViewportFit:P},Symbol.toStringTag,{value:"Module"})),R=Math.PI/180,B={nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]};function $(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function O(e,t,n,i){let r=$(e),a=t*R,o=Math.cos(a),s=Math.sin(a),l=n*e.width/2,d=i*e.height/2;return{x:r.x+l*o-d*s,y:r.y+l*s+d*o}}function D(e,t,n,i){return Math.atan2(i-t,n-e)/R}function L(e,t,n){F(e,"width"),F(t,"height");let i=e*t*4;if(n&&n.length!==i)throw RangeError(`data length ${n.length} does not match ${e}x${t} (${i})`);return{width:e,height:t,data:null!=n?n:new Uint8ClampedArray(i)}}function V(e,t,n){return(n*e.width+t)*4}function F(e,t){if(!Number.isInteger(e)||e<=0)throw RangeError(`${t} must be a positive integer, got ${e}`)}function N(e,t){let n=L(e.width,e.height),{width:i,height:r}=e;for(let a=0;a<r;a++)for(let o=0;o<i;o++)q(e,V(e,"horizontal"===t?i-1-o:o,"vertical"===t?r-1-a:a),n,V(n,o,a));return n}function U(e,t){let n=Math.max(1,Math.round(t.width)),i=Math.max(1,Math.round(t.height));if(n===e.width&&i===e.height)return L(n,i,new Uint8ClampedArray(e.data));let r=e;for(;r.width>=2*n;)r=function(e){let t=Math.ceil(e.width/2),n=L(t,e.height);for(let i=0;i<e.height;i++)for(let r=0;r<t;r++){let t=V(e,2*r,i),a=V(e,Math.min(2*r+1,e.width-1),i),o=V(n,r,i);for(let i=0;i<4;i++)n.data[o+i]=(e.data[t+i]+e.data[a+i])/2}return n}(r);for(;r.height>=2*i;)r=function(e){let t=Math.ceil(e.height/2),n=L(e.width,t);for(let i=0;i<t;i++)for(let t=0;t<e.width;t++){let r=V(e,t,2*i),a=V(e,t,Math.min(2*i+1,e.height-1)),o=V(n,t,i);for(let t=0;t<4;t++)n.data[o+t]=(e.data[r+t]+e.data[a+t])/2}return n}(r);return r.width===n&&r.height===i?L(n,i,new Uint8ClampedArray(r.data)):function(e,t,n){let i=L(t,n),r=e.width/t,a=e.height/n;for(let c=0;c<n;c++){let n=(c+.5)*a-.5,u=Math.floor(n),p=n-u,g=H(u,e.height),f=H(u+1,e.height);for(let n=0;n<t;n++){let t=(n+.5)*r-.5,a=Math.floor(t),u=t-a,m=H(a,e.width),b=H(a+1,e.width),x=V(e,m,g),y=V(e,b,g),w=V(e,m,f),j=V(e,b,f),M=V(i,n,c);for(let t=0;t<4;t++){var o,s,l,d,h;let n=(o=e.data[x+t],s=e.data[y+t],o+(s-o)*u),r=(l=e.data[w+t],d=e.data[j+t],l+(d-l)*u);i.data[M+t]=(h=n)+(r-h)*p}}}return i}(r,n,i)}function q(e,t,n,i){n.data[i]=e.data[t],n.data[i+1]=e.data[t+1],n.data[i+2]=e.data[t+2],n.data[i+3]=e.data[t+3]}function H(e,t){return e<0?0:e>=t?t-1:e}function X(e,t){let n=L(e.width,e.height,new Uint8ClampedArray(e.data));for(let e=0;e<n.data.length;e+=4)n.data[e]=t(n.data[e],0),n.data[e+1]=t(n.data[e+1],1),n.data[e+2]=t(n.data[e+2],2);return n}function Y(e,t){if(0===t)return et(e);let n=t/100*255;return X(e,e=>e+n)}function Z(e,t){if(0===t)return et(e);let n=t/100*255,i=259*(n+255)/(255*(259-n));return X(e,e=>i*(e-128)+128)}function W(e,t){if(0===t)return et(e);let n=1+t/100,i=L(e.width,e.height,new Uint8ClampedArray(e.data));for(let e=0;e<i.data.length;e+=4){let t=i.data[e],r=i.data[e+1],a=i.data[e+2],o=.299*t+.587*r+.114*a;i.data[e]=o+(t-o)*n,i.data[e+1]=o+(r-o)*n,i.data[e+2]=o+(a-o)*n}return i}function G(e,t){if(0===t)return et(e);let n=t/100*40;return X(e,(e,t)=>0===t?e+n:2===t?e-n:e)}function K(e,t,n=20){let i=Math.round(Math.max(0,Math.min(100,t))/100*n);return i<=0?et(e):Q(Q(e,i,"horizontal"),i,"vertical")}function J(e,t){let n=e;return K(n=G(n=W(n=Z(n=Y(n,t.brightness),t.contrast),t.saturation),t.warmth),t.blur)}function Q(e,t,n){let i=L(e.width,e.height),{width:r,height:a,data:o}=e,s="horizontal"===n,l=s?a:r,d=s?r:a,h=2*t+1;for(let e=0;l>e;e++)for(let n=0;n<4;n++){let l=0;for(let i=-t;t>=i;i++)l+=ee(o,r,a,s,e,i,n);for(let c=0;d>c;c++){let d=(s?e*r+c:c*r+e)*4+n;i.data[d]=l/h;let u=ee(o,r,a,s,e,c-t,n);l+=ee(o,r,a,s,e,c+t+1,n)-u}}return i}function ee(e,t,n,i,r,a,o){let s=(i?t:n)-1,l=a<0?0:a>s?s:a;return e[(i?r*t+l:l*t+r)*4+o]}function et(e){return L(e.width,e.height,new Uint8ClampedArray(e.data))}function en(e,t){let n=L(e.width,e.height,new Uint8ClampedArray(e.data));for(let e=0;e<n.data.length;e+=4){let[i,r,a]=t(n.data[e],n.data[e+1],n.data[e+2]);n.data[e]=i,n.data[e+1]=r,n.data[e+2]=a}return n}Object.freeze(Object.defineProperty({__proto__:null,applyFinetune:J,blur:K,brightness:Y,contrast:Z,saturation:W,warmth:G},Symbol.toStringTag,{value:"Module"}));let ei=e=>L(e.width,e.height,new Uint8ClampedArray(e.data)),er=new Map;function ea(e){return er.set(e.id,e),()=>{er.get(e.id)===e&&er.delete(e.id)}}function eo(e,t){let n=er.get(t);return n?n.apply(e):ei(e)}function es(e){return new ImageData(e.data,e.width,e.height)}[{id:"original",label:"Original",apply:ei},{id:"invert",label:"Invert",apply:e=>en(e,(e,t,n)=>[255-e,255-t,255-n])},{id:"grayscale",label:"Black & White",apply:e=>en(e,(e,t,n)=>{let i=.299*e+.587*t+.114*n;return[i,i,i]})},{id:"sepia",label:"Sepia",apply:e=>en(e,(e,t,n)=>[.393*e+.769*t+.189*n,.349*e+.686*t+.168*n,.272*e+.534*t+.131*n])},{id:"solarize",label:"Solarize",apply:e=>en(e,(e,t,n)=>[e<128?e:255-e,t<128?t:255-t,n<128?n:255-n])},{id:"clarendon",label:"Clarendon",apply:e=>G(W(Z(e,20),25),-10)},{id:"gingham",label:"Gingham",apply:e=>G(W(Z(e,-10),-15),12)}].forEach(ea);class el{register(e){let t=this.locales.get(e.id);return this.locales.set(e.id,{...null!=t?t:{},...e.messages}),()=>{t?this.locales.set(e.id,t):this.locales.delete(e.id)}}has(e){return this.locales.has(e)}get(e){return this.locales.get(e)}list(){return[...this.locales.keys()]}translator(e){var t;return function(e={},t={}){return(n,i)=>{var r,a;let o=null!=(r=null!=(a=e[n])?a:t[n])?r:n;return i?o.replace(/\{(\w+)\}/g,(e,t)=>t in i?String(i[t]):e):o}}(null!=(t=this.locales.get(e))?t:{})}constructor(){i(this,"locales",new Map)}}let ed=new Set(["value","checked","disabled","selected","innerHTML"]);function eh(e,t={},n=[]){return{kind:"element",tag:e,key:t.key,props:t,children:function(e){let t=Array.isArray(e)?e:[e],n=[];for(let e of t)null!=e&&!1!==e&&!0!==e&&n.push("object"==typeof e?e:{kind:"text",text:String(e)});return n}(n)}}function ec(e){return"element"===e.kind}let eu={};class ep{render(e){if(null===this.prev){let t=this.mount(e);this.host.insert(this.container,t,null)}else if(eg(this.prev,e))this.patch(this.prev,e);else{let t=this.mount(e),n=this.prev.node;this.host.insert(this.container,t,this.host.nextSibling(n)),this.host.remove(this.container,n)}this.prev=e}unmount(){this.prev&&(this.host.remove(this.container,this.prev.node),this.prev=null)}mount(e){if(!ec(e)){let t=this.host.createText(e.text);return e.node=t,t}let t=this.host.createElement(e.tag);for(let n of(e.node=t,this.applyProps(t,eu,e.props),e.children))this.host.insert(t,this.mount(n),null);return t}patch(e,t){let n=e.node;return(t.node=n,ec(t)&&ec(e))?(this.applyProps(n,e.props,t.props),this.patchChildren(n,e.children,t.children)):ec(t)||t.text===e.text||this.host.setText(n,t.text),n}applyProps(e,t,n){var i,r,a,o;for(let s of(this.applyClass(e,t.class,n.class),this.applyStyle(e,null!=(i=t.style)?i:{},null!=(r=n.style)?r:{}),this.applyEvents(e,null!=(a=t.on)?a:{},null!=(o=n.on)?o:{}),Object.keys(n))){if(ef(s))continue;let i=n[s];i!==t[s]&&this.applyAttr(e,s,i)}for(let i of Object.keys(t))ef(i)||i in n||(ed.has(i)?this.host.setProperty(e,i,""):this.host.removeAttribute(e,i))}applyAttr(e,t,n){var i;ed.has(t)?this.host.setProperty(e,t,n):!1===n||null==n?this.host.removeAttribute(e,t):this.host.setAttribute(e,t,!0===n?"":"string"==typeof n?n:"number"==typeof n||"boolean"==typeof n||"bigint"==typeof n?String(n):null!=(i=JSON.stringify(n))?i:"")}applyClass(e,t,n){t!==n&&(n?this.host.setAttribute(e,"class",n):this.host.removeAttribute(e,"class"))}applyStyle(e,t,n){for(let i of Object.keys(n))n[i]!==t[i]&&this.host.setStyle(e,i,String(n[i]));for(let i of Object.keys(t))i in n||this.host.removeStyle(e,i)}applyEvents(e,t,n){let i=this.events.get(e);for(let r of Object.keys(t))!(r in n)&&(null==i?void 0:i.has(r))&&(this.host.removeEventListener(e,r,i.get(r).wrapper),i.delete(r));for(let t of Object.keys(n)){let r=n[t],a=null==i?void 0:i.get(t);if(a){a.handler=r;continue}i||(i=new Map,this.events.set(e,i));let o={handler:r,wrapper:e=>o.handler(e)};i.set(t,o),this.host.addEventListener(e,t,o.wrapper)}}patchChildren(e,t,n){let i=0,r=t.length-1,a=0,o=n.length-1,s=null;for(;i<=r&&a<=o;){let l=t[i],d=t[r],h=n[a],c=n[o];if(eg(l,h)){this.patch(l,h),i++,a++;continue}if(eg(d,c)){this.patch(d,c),r--,o--;continue}if(eg(l,c)){this.patch(l,c),this.host.insert(e,l.node,this.host.nextSibling(d.node)),i++,o--;continue}if(eg(d,h)){this.patch(d,h),this.host.insert(e,d.node,l.node),r--,a++;continue}null!=s||(s=function(e,t,n){let i=new Map;for(let r=t;r<=n;r++){let t=e[r].key;void 0!==t&&i.set(t,r)}return i}(t,i,r));let u=void 0!==h.key?s.get(h.key):void 0;if(void 0===u)this.host.insert(e,this.mount(h),l.node);else{let n=t[u];this.patch(n,h),n.node=void 0,this.host.insert(e,h.node,l.node)}a++}if(i>r){var l,d;let t=null!=(l=null==(d=n[o+1])?void 0:d.node)?l:null;for(let i=a;o>=i;i++)this.host.insert(e,this.mount(n[i]),t)}else if(a>o)for(let n=i;r>=n;n++){let i=t[n].node;i&&this.host.remove(e,i)}}constructor(e,t){i(this,"events",new WeakMap),i(this,"prev",null),this.host=e,this.container=t}}function eg(e,t){return e.kind===t.kind&&("text"===e.kind||e.tag===t.tag&&e.key===t.key)}function ef(e){return"key"===e||"class"===e||"style"===e||"on"===e}class ev{createElement(e){return this.doc.createElement(e)}createText(e){return this.doc.createTextNode(e)}setText(e,t){e.textContent=t}insert(e,t,n){e.insertBefore(t,n)}remove(e,t){t.parentNode===e&&e.removeChild(t)}parent(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n){e.setAttribute(t,n)}removeAttribute(e,t){e.removeAttribute(t)}setProperty(e,t,n){e[t]=n}setStyle(e,t,n){e.style.setProperty(t,n)}removeStyle(e,t){e.style.removeProperty(t)}addEventListener(e,t,n){e.addEventListener(t,n)}removeEventListener(e,t,n){e.removeEventListener(t,n)}constructor(e=document){this.doc=e}}class em{register(e){var t;return this.tools.set(e.id,e),this.order.set(e.id,null!=(t=e.order)?t:em.UNORDERED_BASE+this.seq++),()=>{this.tools.get(e.id)===e&&(this.tools.delete(e.id),this.order.delete(e.id))}}get(e){return this.tools.get(e)}has(e){return this.tools.has(e)}list(){return[...this.tools.values()].sort((e,t)=>{var n,i;return(null!=(n=this.order.get(e.id))?n:0)-(null!=(i=this.order.get(t.id))?i:0)})}first(){return this.list()[0]}constructor(){i(this,"tools",new Map),i(this,"seq",0),i(this,"order",new Map)}}function eb(e){return eh("span",{class:"jie-icon",innerHTML:e})}function ex(){return eh("span",{class:"jie-spinner"})}function ey(e){var t,n,i;let r=["jie-btn"];"primary"===e.variant&&r.push("jie-btn--primary"),"icon"===e.variant&&r.push("jie-btn--icon"),e.active&&r.push("jie-btn--active"),e.busy&&r.push("jie-btn--busy"),e.className&&r.push(e.className);let a=[];return e.busy?a.push(ex()):e.icon&&a.push(eb(e.icon)),e.label&&a.push(eh("span",{},e.label)),eh("button",{key:e.key,class:r.join(" "),type:"button",disabled:null!=(t=e.disabled)&&t,title:null!=(n=null!=(i=e.title)?i:e.label)?n:"",on:{click:e.onClick}},a)}function ew(e){var t;let n=e.onStart,i={input:t=>e.onInput(Number(t.target.value))};n&&(i.pointerdown=()=>n());let r=e.max-e.min||1,a=Math.min(100,Math.max(0,(e.value-e.min)/r*100));return eh("div",{class:"jie-slider"},[eh("span",{class:"jie-slider__label"},e.label),eh("input",{class:"jie-range",type:"range",min:String(e.min),max:String(e.max),step:String(null!=(t=e.step)?t:1),value:String(e.value),style:{"--jie-range-fill":`${a}%`},on:i}),eh("span",{class:"jie-slider__value"},String(Math.round(e.value)))])}function ej(e){return eh("label",{class:"jie-field"},[eh("span",{},e.label),eh("span",{style:{display:"flex","align-items":"center",gap:"6px"}},[eh("input",{class:"jie-input",type:"number",value:String(e.value),on:{change:t=>{let n=Number(t.target.value);Number.isFinite(n)&&e.onChange(n)}}}),e.suffix?eh("span",{},e.suffix):null])])}function eM(e,t,n){return eh("div",{class:"jie-toolrow"},e.map(e=>ey({key:e.id,label:e.label,icon:e.icon,active:e.id===t,onClick:()=>n(e.id)})))}i(em,"UNORDERED_BASE",1e6);let eS=e=>`<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`,ek={adjust:eS('<path d="M4 8h2M9 8h11M4 16h11M18 16h2"/><circle cx="7.5" cy="8" r="1.6"/><circle cx="16.5" cy="16" r="1.6"/>'),finetune:eS('<path d="M4 7h12M4 12h16M4 17h8"/><circle cx="18" cy="7" r="1.6"/><circle cx="12" cy="17" r="1.6"/>'),filters:eS('<circle cx="9" cy="9" r="5"/><circle cx="15" cy="9" r="5"/><circle cx="12" cy="15" r="5"/>'),watermark:eS('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 15l5-4 4 3 3-2 6 4"/><circle cx="8.5" cy="9.5" r="1.4"/>'),annotate:eS('<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>'),resize:eS('<path d="M9 3H5a2 2 0 0 0-2 2v4M21 15v4a2 2 0 0 1-2 2h-4"/><path d="M8 16l8-8M16 8h-4M16 8v4"/>'),crop:eS('<path d="M6 2v14a2 2 0 0 0 2 2h14"/><path d="M2 6h14a2 2 0 0 1 2 2v14"/>'),rotate:eS('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),flipX:eS('<path d="M12 3v18"/><path d="M8 7 4 12l4 5Z"/><path d="M16 7l4 5-4 5Z"/>'),flipY:eS('<path d="M3 12h18"/><path d="M7 8 12 4l5 4Z"/><path d="M7 16l5 4 5-4Z"/>'),undo:eS('<path d="M9 7 4 12l5 5"/><path d="M4 12h11a5 5 0 0 1 0 10h-1"/>'),redo:eS('<path d="m15 7 5 5-5 5"/><path d="M20 12H9a5 5 0 0 0 0 10h1"/>'),reset:eS('<path d="M3 12a9 9 0 1 1 2.6 6.3"/><path d="M3 21v-5h5"/>'),trash:eS('<path d="M4 7h16M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13M10 11v6M14 11v6"/>'),plus:eS('<path d="M12 5v14M5 12h14"/>'),minus:eS('<path d="M5 12h14"/>'),zoomIn:eS('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M10.5 7.5v6M7.5 10.5h6"/>'),zoomOut:eS('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M7.5 10.5h6"/>'),posTopLeft:eS('<path d="M17 17 7 7M7 13V7h6"/>'),posTop:eS('<path d="M12 19V6M7 11l5-5 5 5"/>'),posTopRight:eS('<path d="M7 17 17 7M11 7h6v6"/>'),posLeft:eS('<path d="M19 12H6M11 7l-5 5 5 5"/>'),posCenter:eS('<circle cx="12" cy="12" r="6.5"/><circle cx="12" cy="12" r="2" fill="currentColor" stroke="none"/>'),posRight:eS('<path d="M5 12h13M13 7l5 5-5 5"/>'),posBottomLeft:eS('<path d="M17 7 7 17M7 11v6h6"/>'),posBottom:eS('<path d="M12 5v13M7 13l5 5 5-5"/>'),posBottomRight:eS('<path d="M7 7l10 10M17 11v6h-6"/>'),font:eS('<path d="M4 20 9.5 6h1L16 20M6 15h8M17 20l3-9h.5l3 9M18 17h4"/>'),focus:eS('<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3.5"/>'),lock:eS('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>'),unlock:eS('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.5-2"/>'),text:eS('<path d="M5 5h14M12 5v14M9 19h6"/>'),brightness:eS('<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19"/>'),contrast:eS('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18Z" fill="currentColor" stroke="none"/>'),blur:eS('<path d="M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11Z"/>'),book:eS('<path d="M4 5a2 2 0 0 1 2-2h5v18H6a2 2 0 0 1-2-2Z"/><path d="M20 5a2 2 0 0 0-2-2h-5v18h5a2 2 0 0 0 2-2Z"/>')},ez={id:"adjust",label:"Adjust",icon:ek.adjust,order:0,defaultTool:"crop",renderPanel({state:e,update:t,t:n}){let i=w(e),r=j(e);return eh("div",{class:"jie-toolrow"},[ey({label:n("Crop"),icon:ek.crop,active:r,onClick:()=>t({activeTab:"adjust",activeTool:r?null:"crop"})}),ey({label:n("Rotate"),icon:ek.rotate,onClick:()=>t({design:{rotate:i.rotate+90}})}),ey({label:n("Flip X"),icon:ek.flipX,onClick:()=>t({design:{flip:{horizontal:!i.flip.horizontal}}})}),ey({label:n("Flip Y"),icon:ek.flipY,onClick:()=>t({design:{flip:{vertical:!i.flip.vertical}}})})])}},eC=[{id:"brightness",label:"Brightness",icon:ek.brightness,min:-100,max:100},{id:"contrast",label:"Contrast",icon:ek.contrast,min:-100,max:100},{id:"saturation",label:"Saturation",icon:ek.filters,min:-100,max:100},{id:"blur",label:"Blur",icon:ek.blur,min:0,max:100},{id:"warmth",label:"Warmth",icon:ek.brightness,min:-100,max:100}],e_={id:"finetune",label:"Finetune",icon:ek.finetune,order:1,defaultTool:"brightness",renderPanel({state:e,update:t,t:n}){var i,r;let a=(i=e.activeTool,null!=(r=eC.find(e=>e.id===i))?r:eC[0]),o=w(e).finetune[a.id],s=(e,n)=>{t({design:{finetune:{[a.id]:e}},commit:n})};return eh("div",{class:"jie-panel-stack",style:{display:"contents"}},[ew({label:n(a.label),value:o,min:a.min,max:a.max,onStart:()=>s(o,!0),onInput:e=>s(e,!1)}),eM(eC.map(e=>({id:e.id,label:n(e.label),icon:e.icon})),a.id,e=>t({activeTab:"finetune",activeTool:e}))])}},eT={id:"filters",label:"Filters",icon:ek.filters,order:2,renderPanel({state:e,update:t,t:n}){let i=w(e).filter;return eh("div",{class:"jie-thumbs"},[...er.values()].map(e=>eh("button",{key:e.id,class:"jie-thumb",type:"button","aria-pressed":String(e.id===i),on:{click:()=>t({design:{filter:e.id}})}},[eh("canvas",{class:"jie-thumb__swatch","data-jie-filter-thumb":e.id}),eh("span",{},n(e.label))])))}},eP={id:"focus",label:"Focus",icon:ek.focus,order:3,defaultTool:"radial",renderPanel({state:e,update:t,t:n}){var i;let r=null!=(i=w(e).focus)?i:{shape:"radial",x:.5,y:.5,radius:.28,angle:0,amount:60},a=null!==w(e).focus,o=(e,n)=>t({design:{focus:{...r,...e}},commit:n});return eh("div",{class:"jie-panel-stack",style:{display:"contents"}},[eh("div",{class:"jie-toolrow"},[ew({label:n("Intensity"),value:r.amount,min:0,max:100,onStart:()=>o({amount:r.amount},!0),onInput:e=>o({amount:e},!1)}),ew({label:n("Radius"),value:Math.round(100*r.radius),min:5,max:90,onStart:()=>o({radius:r.radius},!0),onInput:e=>o({radius:e/100},!1)}),a?ey({variant:"icon",icon:ek.trash,title:n("Reset"),onClick:()=>t({design:{focus:null}})}):null]),eM([{id:"radial",label:n("Radial")},{id:"linear",label:n("Linear")}],r.shape,e=>o({shape:e},!0))])}},eE=[{align:"left",valign:"top",icon:ek.posTopLeft},{align:"center",valign:"top",icon:ek.posTop},{align:"right",valign:"top",icon:ek.posTopRight},{align:"left",valign:"middle",icon:ek.posLeft},{align:"center",valign:"middle",icon:ek.posCenter},{align:"right",valign:"middle",icon:ek.posRight},{align:"left",valign:"bottom",icon:ek.posBottomLeft},{align:"center",valign:"bottom",icon:ek.posBottom},{align:"right",valign:"bottom",icon:ek.posBottomRight}],eA=function(e="id"){let t=0;return()=>`${e}-${++t}`}("jie"),eI="text-color",eR="text-font",eB={id:"annotate",label:"Text",icon:ek.text,order:4,defaultTool:"text",renderPanel({state:e,update:t,t:n}){var i,r,o,s,l,d;let h,c,u,p=w(e),g=p.annotations[0];if(!g)return eh("div",{class:"jie-toolrow"},[ey({label:n("Add text"),icon:ek.text,variant:"primary",onClick:()=>{let e=function(e,t={}){return{id:e,type:"text",text:"Text",x:.5,y:.5,fontSize:.06,fontFamily:a[0].value,color:"#eb5757",bold:!1,italic:!1,align:"center",valign:"middle",...t}}(eA());t({design:{annotations:[e]},selectedAnnotationId:e.id})}})]);let f=e=>{var n,i;return t({design:{annotations:(n=p.annotations,i=g.id,n.map(t=>t.id===i?{...t,...e}:t))}})};return eh("div",{class:"jie-toolrow"},[eh("input",{class:"jie-input",type:"text",value:g.text,on:{input:e=>f({text:e.target.value})}}),(h=(i={value:g.fontFamily,fonts:e.fonts,title:n("Font"),open:e.activePopover===eR,onToggle:()=>t({activePopover:e.activePopover===eR?null:eR}),onPick:e=>{f({fontFamily:e}),t({activePopover:null})}}).fonts.find(e=>e.value===i.value),c=[eh("button",{class:"jie-fontselect__trigger",type:"button",title:null!=(r=i.title)?r:"Font","aria-haspopup":"listbox","aria-expanded":String(i.open),on:{click:()=>i.onToggle()}},[eb(ek.font),eh("span",{style:{"font-family":i.value}},null!=(o=null==h?void 0:h.label)?o:"Font"),eb(ek.book)])],i.open&&c.push(eh("div",{class:"jie-popover__backdrop",on:{click:()=>i.onToggle()}}),eh("div",{class:"jie-popover jie-fontlist",role:"listbox"},i.fonts.map(e=>eh("button",{key:e.value,class:"jie-fontlist__item",type:"button","aria-pressed":String(e.value===i.value),style:{"font-family":e.value},on:{click:()=>i.onPick(e.value)}},e.label)))),eh("div",{class:"jie-fontselect"},c)),(u=[eh("button",{class:"jie-color",type:"button",title:null!=(l=(s={value:g.color,palette:e.palette,title:n("Colour"),open:e.activePopover===eI,onToggle:()=>t({activePopover:e.activePopover===eI?null:eI}),onPick:e=>{f({color:e}),t({activePopover:null})}}).title)?l:"Colour",style:{background:s.value},"aria-haspopup":"true","aria-expanded":String(s.open),on:{click:()=>s.onToggle()}})],s.open&&u.push(eh("div",{class:"jie-popover__backdrop",on:{click:()=>s.onToggle()}}),eh("div",{class:"jie-popover jie-swatches",role:"listbox"},s.palette.map(e=>eh("button",{key:e,class:"jie-swatch",type:"button",title:e,style:{background:e},"aria-pressed":String(e.toLowerCase()===s.value.toLowerCase()),on:{click:()=>s.onPick(e)}})))),eh("div",{class:"jie-colorpicker"},u)),ey({label:"B",className:"jie-btn--bold",active:g.bold,onClick:()=>f({bold:!g.bold})}),ey({label:"I",className:"jie-btn--italic",active:g.italic,onClick:()=>f({italic:!g.italic})}),ew({label:n("Size"),value:Math.round(100*g.fontSize),min:1,max:40,onInput:e=>f({fontSize:e/100})}),(d={align:g.align,valign:g.valign,onPick:(e,t)=>f({align:e,valign:t,x:"left"===e?.04:"right"===e?.96:.5,y:"top"===t?.04:"bottom"===t?.96:.5})},eh("div",{class:"jie-posgrid",role:"group"},eE.map(e=>eh("button",{key:`${e.valign}-${e.align}`,class:"jie-posgrid__cell",type:"button","data-pos":`${e.valign}-${e.align}`,"aria-pressed":String(e.align===d.align&&e.valign===d.valign),on:{click:()=>d.onPick(e.align,e.valign)}},[eb(e.icon)])))),ey({variant:"icon",icon:ek.trash,title:n("Delete"),onClick:()=>{var e,n;return t({design:{annotations:(e=p.annotations,n=g.id,e.filter(e=>e.id!==n))},selectedAnnotationId:null})}})])}},e$={id:"resize",label:"Resize",icon:ek.resize,order:5,renderPanel({state:e,update:t,t:n}){let i=_(e);if(!i)return null;let r="unlocked"!==e.activeTool,a=n=>t({design:{resize:function(e,t,n,i=1){let r=e.width/e.height;if(!n){var a,o;return{width:Math.max(i,Math.round(null!=(a=t.width)?a:e.width)),height:Math.max(i,Math.round(null!=(o=t.height)?o:e.height))}}if(void 0!==t.width){let e=Math.max(i,Math.round(t.width));return{width:e,height:Math.max(i,Math.round(e/r))}}if(void 0!==t.height){let e=Math.max(i,Math.round(t.height));return{width:Math.max(i,Math.round(e*r)),height:e}}return{...e}}(i,n,r,e.minResizeSize)}});return eh("div",{class:"jie-fieldrow"},[ej({label:n("Width"),value:i.width,suffix:n("px"),onChange:e=>a({width:e})}),ey({variant:"icon",icon:r?ek.lock:ek.unlock,title:r?n("Aspect ratio locked"):n("Aspect ratio unlocked"),onClick:()=>t({activeTab:"resize",activeTool:r?"unlocked":"locked"})}),ej({label:n("Height"),value:i.height,suffix:n("px"),onChange:e=>a({height:e})}),ey({variant:"icon",icon:ek.reset,title:n("Reset size"),onClick:()=>t({design:{resize:null}})})])}};function eO(e){return parseInt(e+e,16)}function eD(e,t){return parseInt(e.slice(t,t+2),16)}let eL=/image\/(jpe?g|bmp)/i;function eV(e,t){if("u"<typeof document)throw Error("No DOM available: provide a CanvasFactory to the codec");let n=document.createElement("canvas");return n.width=e,n.height=t,{get width(){return n.width},set width(v){n.width=v},get height(){return n.height},set height(v){n.height=v},getContext:e=>n.getContext(e),toBlobAsync:(e,t)=>new Promise((i,r)=>{n.toBlob(e=>e?i(e):r(Error("canvas.toBlob returned null")),e,t)})}}class eF{async decode(e){var t,n,i;let r,a=await this.toBitmap(e),o=(t=a.width,n=a.height,i={maxSize:this.maxSize,maxPixels:this.maxPixels},r=1,i.maxSize&&i.maxSize>0&&(r=Math.min(r,i.maxSize/Math.max(t,n))),i.maxPixels&&i.maxPixels>0&&(r=Math.min(r,Math.sqrt(i.maxPixels/(t*n)))),Math.min(1,r)),s=Math.max(1,Math.round(a.width*o)),l=Math.max(1,Math.round(a.height*o)),d=this.createCanvas(s,l),h=this.context(d);h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.drawImage(a,0,0,s,l),"close"in a&&"function"==typeof a.close&&a.close();let c=h.getImageData(0,0,s,l);return L(c.width,c.height,c.data)}async encode(e,t={}){let n,{type:i="image/png",quality:r=.92,background:a}=t,o=void 0!==a||eL.test(i)?function(e,[t,n,i]){let r=L(e.width,e.height);for(let a=0;a<e.data.length;a+=4){let o=e.data[a+3]/255,s=1-o;r.data[a]=e.data[a]*o+t*s,r.data[a+1]=e.data[a+1]*o+n*s,r.data[a+2]=e.data[a+2]*o+i*s,r.data[a+3]=255}return r}(e,(n=(null!=a?a:"#ffffff").trim().replace(/^#/,""),/^[0-9a-f]{3}$/i.test(n)?[eO(n[0]),eO(n[1]),eO(n[2])]:/^[0-9a-f]{6}$/i.test(n)?[eD(n,0),eD(n,2),eD(n,4)]:[255,255,255])):e,s=this.createCanvas(o.width,o.height);return this.context(s).putImageData(es(o),0,0),s.toBlobAsync(i,r)}context(e){let t=e.getContext("2d");if(!t)throw Error("Unable to acquire a 2D canvas context");return t}async toBitmap(e){return"function"==typeof createImageBitmap?createImageBitmap(e,{imageOrientation:"from-image"}):new Promise((t,n)=>{let i=URL.createObjectURL(e),r=new Image;r.style.imageOrientation="from-image",r.onload=()=>{URL.revokeObjectURL(i),t(r)},r.onerror=()=>{URL.revokeObjectURL(i),n(Error("Failed to decode image blob"))},r.src=i})}constructor(e=eV,t={}){var n;i(this,"maxPixels",void 0),i(this,"maxSize",void 0),this.createCanvas=e,this.maxPixels=null!=(n=t.maxPixels)?n:0x1000000,this.maxSize=t.maxSize}}class eN{decode(e){return this.codec.decode(e)}render(e,t){let n=function(e,t){let n=e;if(t.flip.horizontal&&(n=N(n,"horizontal")),t.flip.vertical&&(n=N(n,"vertical")),0!==t.rotate&&(n=function(e,t){let n=(Math.round(t/90)%4+4)%4;if(0===n)return L(e.width,e.height,new Uint8ClampedArray(e.data));let{width:i,height:r}=e,a=1===n||3===n,o=L(a?r:i,a?i:r);for(let t=0;t<r;t++)for(let a=0;a<i;a++){let s,l;1===n?(s=r-1-t,l=a):2===n?(s=i-1-a,l=r-1-t):(s=t,l=i-1-a),q(e,V(e,a,t),o,V(o,s,l))}return o}(n,t.rotate)),0!==t.angle){var i;let e=null!=(i=t.crop)?i:{x:0,y:0,width:n.width,height:n.height};n=function(e,t,n){let i=Math.max(1,Math.round(t.width)),r=Math.max(1,Math.round(t.height)),a=L(i,r),o=t.x+t.width/2,s=t.y+t.height/2,l=n*Math.PI/180,d=Math.cos(l),h=Math.sin(l);for(let t=0;t<r;t++){let n=t+.5-r/2;for(let r=0;i>r;r++){let l=r+.5-i/2;!function(e,t,n,i,r){if(t<=-1||n<=-1||t>=e.width||n>=e.height){i.data[r]=0,i.data[r+1]=0,i.data[r+2]=0,i.data[r+3]=0;return}let a=Math.floor(t),o=Math.floor(n),s=t-a,l=n-o,d=H(a,e.width),h=H(a+1,e.width),c=H(o,e.height),u=H(o+1,e.height),p=V(e,d,c),g=V(e,h,c),f=V(e,d,u),m=V(e,h,u);for(let t=0;t<4;t++){var b,x;let n=(b=e.data[p+t],b+(e.data[g+t]-b)*s),a=(x=e.data[f+t],x+(e.data[m+t]-x)*s);i.data[r+t]=n+(a-n)*l}}(e,o+l*d-n*h-.5,s+l*h+n*d-.5,a,V(a,r,t))}}return a}(n,e,t.angle)}else t.crop&&(n=function(e,t){let n,i,r=y({x:n=Math.round(t.x),y:i=Math.round(t.y),width:Math.round(t.x+t.width)-n,height:Math.round(t.y+t.height)-i},e),a=L(r.width,r.height);for(let t=0;t<r.height;t++){let n=V(e,r.x,r.y+t),i=V(a,0,t);a.data.set(e.data.subarray(n,n+4*r.width),i)}return a}(n,t.crop));return t.resize&&(n=U(n,t.resize)),n=eo(n=J(n,t.finetune),t.filter),t.focus&&(n=function(e,t){if(t.amount<=0)return L(e.width,e.height,new Uint8ClampedArray(e.data));let n=K(e,t.amount,32),{width:i,height:r}=e,a=L(i,r),o=Math.min(i,r),s=t.x*i,l=t.y*r,d=t.radius*o,h=Math.max(.06*o,.9*d),c=t.angle*Math.PI/180,u=-Math.sin(c),p=Math.cos(c);for(let o=0;o<r;o++)for(let r=0;r<i;r++){let i=r-s,c=o-l,g=function(e,t,n){if(t<=e)return+(n>=t);let i=Math.min(1,Math.max(0,(n-e)/(t-e)));return i*i*(3-2*i)}(d,d+h,"radial"===t.shape?Math.hypot(i,c):Math.abs(i*u+c*p)),f=V(a,r,o);for(let t=0;t<4;t++)a.data[f+t]=e.data[f+t]+(n.data[f+t]-e.data[f+t])*g}return a}(n,t.focus)),n}(e,t);return function(e,t,n){if(0===n.length)return t;let i=e(t.width,t.height).getContext("2d");if(!i)throw Error("Unable to acquire a 2D canvas context");for(let e of(i.putImageData(es(t),0,0),n)){if("text"!==e.type)continue;let n=function(e,t){let n=Math.max(1,Math.round(e.fontSize*t.height)),i=e.bold?"bold":"normal",r=e.italic?"italic":"normal";return{text:e.text,x:Math.round(e.x*t.width),y:Math.round(e.y*t.height),fontPx:n,font:`${r} ${i} ${n}px ${e.fontFamily}`,color:e.color,align:e.align,baseline:e.valign}}(e,t);i.font=n.font,i.fillStyle=n.color,i.textAlign=n.align,i.textBaseline=n.baseline,function(e,t){let n=t.text.split("\n"),i=1.2*t.fontPx,r=(n.length-1)*i,a="middle"===t.baseline?t.y-r/2:"bottom"===t.baseline?t.y-r:t.y;n.forEach((n,r)=>e.fillText(n,t.x,a+r*i))}(i,n)}let r=i.getImageData(0,0,t.width,t.height);return L(r.width,r.height,r.data)}(this.createCanvas,n,t.annotations)}async toBlob(e,t,n){return this.codec.encode(this.render(e,t),n)}constructor(e){i(this,"codec",void 0),i(this,"createCanvas",void 0),this.codec=e.codec,this.createCanvas=e.createCanvas}}function eU(e,t,n){e.update({zoom:t.zoom*n})}class eq{get state(){return this.store.getState()}update(e){return this.store.update(e),this}async save(){return this.handleSave()}async saveAs(){return this.handleSaveAs()}reset(){return this.handleReset(),this}use(e){let t=e.setup(this.api());return"function"==typeof t&&this.disposers.push(t),this}async fromBlob(e){this.store.update({status:"loading",error:null});try{let t=await this.processor.decode(e);if(this.destroyed)return this;this.source=t,this.previewSource=eH(t,this.previewMaxSize),this.thumbSource=eH(t,160),this.thumbVersion++,this.store.update({source:{width:t.width,height:t.height,name:e instanceof File?e.name:null,mimeType:e.type||"image/png"},resetHistory:!0,status:"ready"})}catch(e){this.store.update({status:"error",error:e instanceof Error?e.message:String(e)})}return this}async toBlob(e){if(!this.source)throw Error("No image loaded — call fromBlob() first");let t=w(this.store.getState());this.store.update({status:"exporting"});try{return t.annotations.length>0&&"u">typeof document&&document.fonts&&await document.fonts.ready,await this.processor.toBlob(this.source,t,e)}finally{this.store.update({status:"ready"})}}destroy(){var e,t;if(!this.destroyed){for(let n of(this.destroyed=!0,this.clearBusyTimer(),null==(e=this.dragCleanup)||e.call(this),null==(t=this.resizeObserver)||t.disconnect(),this.disposers.splice(0)))n();this.renderer.unmount(),this.store.destroy()}}api(){return{registerTool:e=>this.registry.register(e),registerFilter:e=>ea(e),registerLocale:e=>this.locales.register(e),getState:()=>this.store.getState(),update:e=>this.store.update(e)}}translator(){return this.locales.translator(this.store.getState().locale)}appContext(){return{update:e=>this.store.update(e),tools:this.registry.list(),t:this.translator(),onSave:()=>void this.handleSave(),onSaveAs:()=>void this.handleSaveAs(),onReset:()=>this.handleReset(),beginCropDrag:(e,t)=>this.beginCropDrag(e,t),beginCropRotate:e=>this.beginCropRotate(e)}}handleReset(){z(this.store.getState())&&this.confirm(this.translator()("Reset all changes? You can still undo afterwards."))&&this.store.update({resetDesign:!0})}render(){if(!this.destroyed){var e,t,n,i;let r,a,o,s,l,d,h,c;this.renderer.render((e=this.store.getState(),t=this.appContext(),eh("div",{class:"jie","data-theme":e.theme},[e.showToolbar?(r=_(e),o=(a=P(e))?Math.round(100*a.scale):Math.round(100*e.zoom),s=t.t,l="loading"===e.status||"exporting"===e.status,d="exporting"===e.status&&e.busyVisible,eh("header",{class:"jie-topbar"},[eh("div",{class:"jie-topbar__save"},[ey({label:s("Save"),variant:"primary",onClick:()=>t.onSave(),disabled:!e.source||l,busy:d}),ey({label:s("Save as"),onClick:()=>t.onSaveAs(),disabled:!e.source||l,busy:d})]),eh("div",{class:"jie-topbar__meta"},[r?eh("span",{},`${r.width} x ${r.height} px`):null,eb(ek.book),eh("div",{class:"jie-zoom"},[ey({variant:"icon",icon:ek.zoomOut,title:s("Zoom out"),onClick:()=>eU(t,e,1/1.2)}),eh("span",{},`${o}%`),ey({variant:"icon",icon:ek.zoomIn,title:s("Zoom in"),onClick:()=>eU(t,e,1.2)})])]),eh("div",{class:"jie-topbar__actions"},[ey({variant:"icon",icon:ek.reset,title:s("Reset"),disabled:!z(e),onClick:()=>t.onReset()}),ey({variant:"icon",icon:ek.undo,title:s("Undo"),disabled:!S(e),onClick:()=>t.update({history:{step:-1}})}),ey({variant:"icon",icon:ek.redo,title:s("Redo"),disabled:!k(e),onClick:()=>t.update({history:{step:1}})})])])):null,eh("div",{class:"jie-body"},[eh("nav",{class:"jie-rail"},t.tools.map(n=>eh("button",{key:n.id,class:"jie-tab",type:"button","aria-selected":String(e.activeTab===n.id),on:{click:()=>{var e;return t.update({activeTab:n.id,activeTool:null!=(e=n.defaultTool)?e:null})}}},[eb(n.icon),eh("span",{},t.t(n.label))]))),(c=null!=(i=null==(h=null!=(n=t.tools.find(t=>t.id===e.activeTab))?n:t.tools[0])?void 0:h.renderPanel({state:e,update:t.update,t:t.t}))?i:null,eh("div",{class:"jie-stage"},[eh("div",{class:"jie-canvas-wrap","data-jie-canvas-wrap":""},[eh("canvas",{class:"jie-canvas","data-jie-canvas":""}),function(e,t){if(!j(e))return null;let n=P(e),i=A(e);if(!n||!i)return null;let r=E(e);return eh("div",{class:"jie-crop",style:{left:`${n.offsetX+i.x*n.scale}px`,top:`${n.offsetY+i.y*n.scale}px`,width:`${i.width*n.scale}px`,height:`${i.height*n.scale}px`,transform:`rotate(${r}deg)`},on:{pointerdown:e=>t.beginCropDrag("move",e)}},[eh("div",{key:"rotate",class:"jie-crop__rotate",title:"Rotate",on:{pointerdown:e=>{e.stopPropagation(),t.beginCropRotate(e)}}}),...["nw","ne","sw","se"].map(e=>eh("div",{key:e,class:"jie-crop__handle","data-h":e,on:{pointerdown:n=>{n.stopPropagation(),t.beginCropDrag(e,n)}}}))])}(e,t),"loading"===e.status?eh("div",{class:"jie-overlay","data-jie-loading":""},[ex()]):"error"===e.status&&e.error?eh("div",{class:"jie-overlay jie-overlay--error","data-jie-error":""},[eh("span",{},t.t("Failed to load the image")),eh("span",{class:"jie-overlay__detail"},e.error)]):null]),c?eh("div",{class:"jie-panel"},[c]):null]))])]))),this.ensureViewportObserver(),this.paint(),this.paintFilterThumbs()}}async handleSave(){var e;if(!this.canExport())return;let t=await this.toBlob();null==(e=this.onSaveCb)||e.call(this,t,this),this.container.dispatchEvent(new CustomEvent("jie:save",{detail:{blob:t},bubbles:!0}))}async handleSaveAs(){var e;if(!this.canExport())return;let t=await this.toBlob();null==(e=this.onSaveAsCb)||e.call(this,t,this),this.container.dispatchEvent(new CustomEvent("jie:saveas",{detail:{blob:t},bubbles:!0}))}canExport(){let{status:e}=this.store.getState();return null!==this.source&&"exporting"!==e&&"loading"!==e}syncBusyTimer(e){"exporting"!==e.status?this.clearBusyTimer():e.busyVisible||null!==this.busyTimer||(this.busyTimer=setTimeout(()=>{this.busyTimer=null,this.destroyed||"exporting"!==this.store.getState().status||this.store.update({busyVisible:!0})},this.spinnerDelay))}clearBusyTimer(){null!==this.busyTimer&&(clearTimeout(this.busyTimer),this.busyTimer=null)}ensureViewportObserver(){var e;let t=this.container.querySelector("[data-jie-canvas-wrap]");if(t&&t!==this.observedWrap){if(null==(e=this.resizeObserver)||e.disconnect(),this.observedWrap=t,"u"<typeof ResizeObserver)return void this.measureViewport(t);this.resizeObserver=new ResizeObserver(()=>this.measureViewport(t)),this.resizeObserver.observe(t),this.measureViewport(t)}}measureViewport(e){let{clientWidth:t,clientHeight:n}=e,i=this.store.getState().viewport;t<=0||n<=0||i&&i.width===t&&i.height===n||this.store.update({viewport:{width:t,height:n}})}paint(){let e=this.store.getState(),t=this.container.querySelector("[data-jie-canvas]");if(!t||!this.previewSource||!e.viewport)return;let n=P(e);if(!n)return;let i=M(e),r=`${this.thumbVersion}:${JSON.stringify(i)}`;r===this.cachedRasterKey&&this.cachedRaster||(this.cachedRaster=this.processor.render(this.previewSource,i),this.cachedRasterKey=r);let a=`${r}@${e.viewport.width}x${e.viewport.height}:${n.scale}:${n.offsetX},${n.offsetY}`;a!==this.lastPaintKey&&(this.lastPaintKey=a,function(e,t,n,i){let r="u">typeof window&&window.devicePixelRatio||1;e.width=Math.max(1,Math.round(n.width*r)),e.height=Math.max(1,Math.round(n.height*r));let a=e.getContext("2d");if(!a)return;a.setTransform(r,0,0,r,0,0),a.clearRect(0,0,n.width,n.height);let o=document.createElement("canvas");o.width=t.width,o.height=t.height;let s=o.getContext("2d");s&&(s.putImageData(es(t),0,0),a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(o,i.offsetX,i.offsetY,i.width,i.height))}(t,this.cachedRaster,e.viewport,n))}paintFilterThumbs(){let e=this.thumbSource;if(e)for(let t of this.container.querySelectorAll("canvas[data-jie-filter-thumb]")){let n=t.dataset.jieFilterThumb;if(!n)continue;let i=`${this.thumbVersion}:${n}`;if(t.dataset.key===i)continue;let r=eo(e,n);t.width=r.width,t.height=r.height;let a=t.getContext("2d");a&&(a.putImageData(es(r),0,0),t.dataset.key=i)}}beginCropDrag(e,t){let n=this.store.getState(),i=P(n),r=A(n),a=C(n);if(!i||!r||!a)return;let o=E(n),s=n.minCropSize,l=t.clientX,d=t.clientY;this.runPointerGesture(t,t=>{let n=(t.clientX-l)/i.scale,h=(t.clientY-d)/i.scale;return{crop:0!==o?function(e,t,n,i,r,a=8){if("move"===n)return{...e,x:e.x+i,y:e.y+r};let[o,s]=B[n],l=O(e,t,o,s),d=O(e,t,-o,-s),h={x:l.x+i,y:l.y+r},c=(h.x+d.x)/2,u=(h.y+d.y)/2,p=t*R,g=Math.cos(p),f=Math.sin(p),m=h.x-d.x,b=h.y-d.y,x=Math.max(a,Math.abs(m*g+b*f)),y=Math.max(a,Math.abs(-(m*f)+b*g));return{x:c-x/2,y:u-y/2,width:x,height:y}}(r,o,e,n,h,s):function(e,t,n,i,r,a=null,o=8){var s;let l,d;if("move"===t)return y({...e,x:e.x+n,y:e.y+i},r);let{x:h,y:c,width:u,height:p}=e;if("nw"===t||"sw"===t){let e=x(h+n,0,h+u-o);u+=h-e,h=e}else u=x(u+n,o,r.width-h);if("nw"===t||"ne"===t){let e=x(c+i,0,c+p-o);p+=c-e,c=e}else p=x(p+i,o,r.height-c);let g={x:h,y:c,width:u,height:p};return null!==a&&a>0&&(l=(s=g).width/a,d="sw"===t||"se"===t?s.y:s.y+s.height-l,g={...s,height:l,y:d}),y(g,r)}(r,e,n,h,a,null,s)}})}beginCropRotate(e){var t;let n=this.store.getState(),i=P(n),r=A(n),a=null!=(t=this.observedWrap)?t:this.container.querySelector("[data-jie-canvas-wrap]");if(!i||!r||!a)return;let o=a.getBoundingClientRect(),s=$(r),l=o.left+i.offsetX+s.x*i.scale,d=o.top+i.offsetY+s.y*i.scale,h=E(n),c=D(l,d,e.clientX,e.clientY);this.runPointerGesture(e,e=>{let t=h+(D(l,d,e.clientX,e.clientY)-c);return 2>Math.abs(t)&&(t=0),{angle:Math.round(10*t)/10}})}runPointerGesture(e,t){e.preventDefault();let n=!1,i=e=>{this.store.update({design:t(e),commit:!n}),n=!0},r=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",r),this.dragCleanup=null};window.addEventListener("pointermove",i),window.addEventListener("pointerup",r),this.dragCleanup=r}constructor(e){var t,n,r,a,o,s,l,h;for(const s of(i(this,"store",void 0),i(this,"container",void 0),i(this,"renderer",void 0),i(this,"registry",new em),i(this,"locales",new el),i(this,"processor",void 0),i(this,"previewMaxSize",void 0),i(this,"spinnerDelay",void 0),i(this,"busyTimer",null),i(this,"onSaveCb",void 0),i(this,"onSaveAsCb",void 0),i(this,"confirm",void 0),i(this,"source",null),i(this,"previewSource",null),i(this,"thumbSource",null),i(this,"thumbVersion",0),i(this,"cachedRaster",null),i(this,"cachedRasterKey",""),i(this,"lastPaintKey",""),i(this,"disposers",[]),i(this,"resizeObserver",null),i(this,"observedWrap",null),i(this,"dragCleanup",null),i(this,"destroyed",!1),this.container=function(e){if("string"!=typeof e)return e;let t=document.querySelector(e);if(!t)throw Error(`Container not found: ${e}`);return t}(e.container),this.processor=null!=(t=e.processor)?t:function(e=eV,t){return new eN({codec:new eF(e,t),createCanvas:e})}(void 0,{maxPixels:e.maxSourcePixels,maxSize:e.maxSourceSize}),this.previewMaxSize=null!=(n=e.previewMaxSize)?n:1600,this.spinnerDelay=Math.max(0,null!=(r=e.spinnerDelay)?r:250),this.onSaveCb=e.onSave,this.onSaveAsCb=e.onSaveAs,this.confirm=null!=(a=e.confirm)?a:e=>"u"<typeof window||window.confirm(e),null!=(o=e.locales)?o:[]))this.locales.register(s);for(const t of(this.store=new b({scheduler:null!=(s=e.scheduler)?s:function(){if("function"!=typeof requestAnimationFrame)return new f(e=>setTimeout(e,16),e=>clearTimeout(e));let e=e=>{cancelAnimationFrame(e.raf),null!==e.timer&&(clearTimeout(e.timer),e.timer=null)};return new f(t=>{let n={raf:0,timer:null},i=()=>{e(n),t()};return n.raf=requestAnimationFrame(i),n.timer=setTimeout(i,100),n},e)}(),initialState:{...d(),...e.state,...e.locale?{locale:e.locale}:{},...void 0!==e.minCropSize?{minCropSize:Math.max(1,e.minCropSize)}:{},...void 0!==e.minResizeSize?{minResizeSize:Math.max(1,e.minResizeSize)}:{},...e.palette?{palette:e.palette}:{},...e.fonts?{fonts:e.fonts}:{}}}),null!=(l=e.tools)?l:[ez,e_,eT,eP,eB,e$]))this.registry.register(t);for(const t of null!=(h=e.plugins)?h:[])this.use(t);this.renderer=new ep(new ev(document),this.container),this.disposers.push(this.store.subscribe(()=>this.render())),this.disposers.push(this.store.subscribe(e=>this.syncBusyTimer(e))),this.render(),e.image&&this.fromBlob(e.image)}}function eH(e,t){let n=Math.max(e.width,e.height);if(t>=n)return e;let i=t/n;return U(e,{width:Math.round(e.width*i),height:Math.round(e.height*i)})}}},function(e){return e(e.s=98270)}])});
@@ -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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
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.13.4
4
+ * Version: v4.13.7
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
package/es2021/jodit.css CHANGED
@@ -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.13.4
4
+ * Version: v4.13.7
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */