jodit-pro 4.12.39 → 4.13.1
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.
- package/config.js +1 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +30 -30
- package/es2015/jodit.js +25 -7
- package/es2015/jodit.min.js +5 -5
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.css +1 -1
- package/es2015/plugins/autocomplete/autocomplete.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2015/plugins/backup/backup.css +1 -1
- package/es2015/plugins/backup/backup.js +1 -1
- package/es2015/plugins/backup/backup.min.js +1 -1
- package/es2015/plugins/button-generator/button-generator.css +1 -1
- package/es2015/plugins/button-generator/button-generator.js +1 -1
- package/es2015/plugins/button-generator/button-generator.min.js +1 -1
- package/es2015/plugins/change-case/change-case.js +1 -1
- package/es2015/plugins/change-case/change-case.min.js +1 -1
- package/es2015/plugins/color-picker/color-picker.css +1 -1
- package/es2015/plugins/color-picker/color-picker.js +1 -1
- package/es2015/plugins/color-picker/color-picker.min.js +1 -1
- package/es2015/plugins/emoji/emoji.css +1 -1
- package/es2015/plugins/emoji/emoji.js +1 -1
- package/es2015/plugins/emoji/emoji.min.js +1 -1
- package/es2015/plugins/export-docs/export-docs.js +1 -1
- package/es2015/plugins/export-docs/export-docs.min.js +1 -1
- package/es2015/plugins/finder/finder.css +47 -4
- package/es2015/plugins/finder/finder.js +66 -5
- package/es2015/plugins/finder/finder.min.css +1 -1
- package/es2015/plugins/finder/finder.min.js +4 -4
- package/es2015/plugins/google-maps/google-maps.css +1 -1
- package/es2015/plugins/google-maps/google-maps.js +1 -1
- package/es2015/plugins/google-maps/google-maps.min.js +1 -1
- package/es2015/plugins/google-search/google-search.js +1 -1
- package/es2015/plugins/google-search/google-search.min.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.css +52 -0
- package/es2015/plugins/image-editor-pro/image-editor-pro.js +3969 -0
- package/es2015/plugins/image-editor-pro/image-editor-pro.min.css +1 -0
- package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +8 -0
- package/es2015/plugins/keyboard/keyboard.css +1 -1
- package/es2015/plugins/keyboard/keyboard.js +1 -1
- package/es2015/plugins/keyboard/keyboard.min.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2015/plugins/page-break/page-break.js +1 -1
- package/es2015/plugins/page-break/page-break.min.js +1 -1
- package/es2015/plugins/paste-code/paste-code.css +1 -1
- package/es2015/plugins/paste-code/paste-code.js +1 -1
- package/es2015/plugins/paste-code/paste-code.min.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2015/plugins/style/style.css +1 -1
- package/es2015/plugins/style/style.js +1 -1
- package/es2015/plugins/style/style.min.js +1 -1
- package/es2015/plugins/templates/templates.css +1 -1
- package/es2015/plugins/templates/templates.js +1 -1
- package/es2015/plugins/templates/templates.min.js +1 -1
- package/es2015/plugins/todo-list/todo-list.css +1 -1
- package/es2015/plugins/todo-list/todo-list.js +1 -1
- package/es2015/plugins/todo-list/todo-list.min.js +1 -1
- package/es2015/plugins/translate/translate.css +1 -1
- package/es2015/plugins/translate/translate.js +1 -1
- package/es2015/plugins/translate/translate.min.js +1 -1
- package/es2015/plugins/tune-block/tune-block.css +1 -1
- package/es2015/plugins/tune-block/tune-block.js +1 -1
- package/es2015/plugins/tune-block/tune-block.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +31 -31
- package/es2018/jodit.min.js +5 -5
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.min.css +1 -1
- package/es2018/plugins/finder/finder.min.js +4 -4
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/image-editor-pro/image-editor-pro.min.css +1 -0
- package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +8 -0
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/style/style.min.js +1 -1
- package/es2018/plugins/templates/templates.min.js +1 -1
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +823 -39
- package/es2021/jodit.js +25 -7
- package/es2021/jodit.min.js +6 -6
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.css +1 -1
- package/es2021/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021/plugins/backup/backup.css +1 -1
- package/es2021/plugins/backup/backup.js +1 -1
- package/es2021/plugins/backup/backup.min.js +1 -1
- package/es2021/plugins/button-generator/button-generator.css +1 -1
- package/es2021/plugins/button-generator/button-generator.js +1 -1
- package/es2021/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021/plugins/change-case/change-case.js +1 -1
- package/es2021/plugins/change-case/change-case.min.js +1 -1
- package/es2021/plugins/color-picker/color-picker.css +1 -1
- package/es2021/plugins/color-picker/color-picker.js +1 -1
- package/es2021/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021/plugins/emoji/emoji.css +1 -1
- package/es2021/plugins/emoji/emoji.js +1 -1
- package/es2021/plugins/emoji/emoji.min.js +1 -1
- package/es2021/plugins/export-docs/export-docs.js +1 -1
- package/es2021/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021/plugins/finder/finder.css +47 -4
- package/es2021/plugins/finder/finder.js +66 -5
- package/es2021/plugins/finder/finder.min.css +1 -1
- package/es2021/plugins/finder/finder.min.js +12 -12
- package/es2021/plugins/google-maps/google-maps.css +1 -1
- package/es2021/plugins/google-maps/google-maps.js +1 -1
- package/es2021/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021/plugins/google-search/google-search.js +1 -1
- package/es2021/plugins/google-search/google-search.min.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.css +52 -0
- package/es2021/plugins/image-editor-pro/image-editor-pro.js +3870 -0
- package/es2021/plugins/image-editor-pro/image-editor-pro.min.css +1 -0
- package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +792 -0
- package/es2021/plugins/keyboard/keyboard.css +1 -1
- package/es2021/plugins/keyboard/keyboard.js +1 -1
- package/es2021/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021/plugins/page-break/page-break.js +1 -1
- package/es2021/plugins/page-break/page-break.min.js +1 -1
- package/es2021/plugins/paste-code/paste-code.css +1 -1
- package/es2021/plugins/paste-code/paste-code.js +1 -1
- package/es2021/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021/plugins/style/style.css +1 -1
- package/es2021/plugins/style/style.js +1 -1
- package/es2021/plugins/style/style.min.js +1 -1
- package/es2021/plugins/templates/templates.css +1 -1
- package/es2021/plugins/templates/templates.js +1 -1
- package/es2021/plugins/templates/templates.min.js +1 -1
- package/es2021/plugins/todo-list/todo-list.css +1 -1
- package/es2021/plugins/todo-list/todo-list.js +1 -1
- package/es2021/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021/plugins/translate/translate.css +1 -1
- package/es2021/plugins/translate/translate.js +1 -1
- package/es2021/plugins/translate/translate.min.js +1 -1
- package/es2021/plugins/tune-block/tune-block.css +1 -1
- package/es2021/plugins/tune-block/tune-block.js +1 -1
- package/es2021/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +865 -81
- package/es2021.en/jodit.js +25 -7
- package/es2021.en/jodit.min.js +6 -6
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021.en/plugins/backup/backup.css +1 -1
- package/es2021.en/plugins/backup/backup.js +1 -1
- package/es2021.en/plugins/backup/backup.min.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.css +1 -1
- package/es2021.en/plugins/button-generator/button-generator.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021.en/plugins/change-case/change-case.js +1 -1
- package/es2021.en/plugins/change-case/change-case.min.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.css +1 -1
- package/es2021.en/plugins/color-picker/color-picker.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021.en/plugins/emoji/emoji.css +1 -1
- package/es2021.en/plugins/emoji/emoji.js +1 -1
- package/es2021.en/plugins/emoji/emoji.min.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021.en/plugins/finder/finder.css +47 -4
- package/es2021.en/plugins/finder/finder.js +66 -5
- package/es2021.en/plugins/finder/finder.min.css +1 -1
- package/es2021.en/plugins/finder/finder.min.js +4 -4
- package/es2021.en/plugins/google-maps/google-maps.css +1 -1
- package/es2021.en/plugins/google-maps/google-maps.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021.en/plugins/google-search/google-search.js +1 -1
- package/es2021.en/plugins/google-search/google-search.min.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +52 -0
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +3870 -0
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.css +1 -0
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +792 -0
- package/es2021.en/plugins/keyboard/keyboard.css +1 -1
- package/es2021.en/plugins/keyboard/keyboard.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021.en/plugins/page-break/page-break.js +1 -1
- package/es2021.en/plugins/page-break/page-break.min.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.css +1 -1
- package/es2021.en/plugins/paste-code/paste-code.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021.en/plugins/style/style.css +1 -1
- package/es2021.en/plugins/style/style.js +1 -1
- package/es2021.en/plugins/style/style.min.js +1 -1
- package/es2021.en/plugins/templates/templates.css +1 -1
- package/es2021.en/plugins/templates/templates.js +1 -1
- package/es2021.en/plugins/templates/templates.min.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.css +1 -1
- package/es2021.en/plugins/todo-list/todo-list.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021.en/plugins/translate/translate.css +1 -1
- package/es2021.en/plugins/translate/translate.js +1 -1
- package/es2021.en/plugins/translate/translate.min.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.css +1 -1
- package/es2021.en/plugins/tune-block/tune-block.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +22 -6
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.css +1 -1
- package/es5/plugins/autocomplete/autocomplete.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es5/plugins/backup/backup.css +1 -1
- package/es5/plugins/backup/backup.js +1 -1
- package/es5/plugins/backup/backup.min.js +1 -1
- package/es5/plugins/button-generator/button-generator.css +1 -1
- package/es5/plugins/button-generator/button-generator.js +1 -1
- package/es5/plugins/button-generator/button-generator.min.js +1 -1
- package/es5/plugins/change-case/change-case.js +1 -1
- package/es5/plugins/change-case/change-case.min.js +1 -1
- package/es5/plugins/color-picker/color-picker.css +1 -1
- package/es5/plugins/color-picker/color-picker.js +1 -1
- package/es5/plugins/color-picker/color-picker.min.js +1 -1
- package/es5/plugins/emoji/emoji.css +1 -1
- package/es5/plugins/emoji/emoji.js +1 -1
- package/es5/plugins/emoji/emoji.min.js +1 -1
- package/es5/plugins/export-docs/export-docs.js +1 -1
- package/es5/plugins/export-docs/export-docs.min.js +1 -1
- package/es5/plugins/finder/finder.css +47 -4
- package/es5/plugins/finder/finder.js +114 -30
- package/es5/plugins/finder/finder.min.css +1 -1
- package/es5/plugins/finder/finder.min.js +2 -2
- package/es5/plugins/google-maps/google-maps.css +1 -1
- package/es5/plugins/google-maps/google-maps.js +1 -1
- package/es5/plugins/google-maps/google-maps.min.js +1 -1
- package/es5/plugins/google-search/google-search.js +1 -1
- package/es5/plugins/google-search/google-search.min.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.css +52 -0
- package/es5/plugins/image-editor-pro/image-editor-pro.js +5469 -0
- package/es5/plugins/image-editor-pro/image-editor-pro.min.css +1 -0
- package/es5/plugins/image-editor-pro/image-editor-pro.min.js +8 -0
- package/es5/plugins/keyboard/keyboard.css +1 -1
- package/es5/plugins/keyboard/keyboard.js +1 -1
- package/es5/plugins/keyboard/keyboard.min.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es5/plugins/page-break/page-break.js +1 -1
- package/es5/plugins/page-break/page-break.min.js +1 -1
- package/es5/plugins/paste-code/paste-code.css +1 -1
- package/es5/plugins/paste-code/paste-code.js +1 -1
- package/es5/plugins/paste-code/paste-code.min.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es5/plugins/style/style.css +1 -1
- package/es5/plugins/style/style.js +1 -1
- package/es5/plugins/style/style.min.js +1 -1
- package/es5/plugins/templates/templates.css +1 -1
- package/es5/plugins/templates/templates.js +1 -1
- package/es5/plugins/templates/templates.min.js +1 -1
- package/es5/plugins/todo-list/todo-list.css +1 -1
- package/es5/plugins/todo-list/todo-list.js +1 -1
- package/es5/plugins/todo-list/todo-list.min.js +1 -1
- package/es5/plugins/translate/translate.css +1 -1
- package/es5/plugins/translate/translate.js +1 -1
- package/es5/plugins/translate/translate.min.js +1 -1
- package/es5/plugins/tune-block/tune-block.css +1 -1
- package/es5/plugins/tune-block/tune-block.js +1 -1
- package/es5/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +9 -0
- package/esm/plugins/all.js +1 -1
- package/esm/plugins/finder/browser.d.ts +10 -1
- package/esm/plugins/finder/browser.js +1 -1
- package/esm/plugins/finder/ui/lightboox/lightbox.js +2 -2
- package/esm/plugins/finder/ui/virtual-scroll/virtual-scroll.d.ts +11 -1
- package/esm/plugins/finder/ui/virtual-scroll/virtual-scroll.js +2 -2
- package/esm/plugins/image-editor-pro/adapter.d.ts +98 -0
- package/esm/plugins/image-editor-pro/adapter.js +1 -0
- package/esm/plugins/image-editor-pro/config.d.ts +17 -0
- package/esm/plugins/image-editor-pro/config.js +1 -0
- package/esm/plugins/image-editor-pro/image-editor-pro.d.ts +26 -0
- package/esm/plugins/image-editor-pro/image-editor-pro.js +1 -0
- package/package.json +2 -1
- package/types/config.d.ts +9 -0
- package/types/plugins/finder/browser.d.ts +10 -1
- package/types/plugins/finder/ui/virtual-scroll/virtual-scroll.d.ts +11 -1
- package/types/plugins/image-editor-pro/adapter.d.ts +98 -0
- package/types/plugins/image-editor-pro/config.d.ts +17 -0
- package/types/plugins/image-editor-pro/image-editor-pro.d.ts +26 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.jodit-image-editor-pro .jie,.jodit-image-editor-pro .jie-canvas-wrap{border-radius:0}.jodit-image-editor-pro__button_busy .jodit-ui-button__icon svg{display:none}.jodit-image-editor-pro__button_busy .jodit-ui-button__icon:after{animation:a .8s linear infinite;border:2px solid;border-radius:50%;border-right:2px solid transparent;content:"";display:block;height:14px;width:14px}@keyframes a{to{transform:rotate(1turn)}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* jodit-pro - PRO Version of Jodit Editor
|
|
3
|
+
* Author: Chupurnov Valerii <chupurnov@gmail.com>
|
|
4
|
+
* Version: v4.13.1
|
|
5
|
+
* Url: https://xdsoft.net/jodit/pro/
|
|
6
|
+
* License(s): SEE LICENSE IN LICENSE.md
|
|
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 h}});var i=n(77688),r=n(82749),a=n(85013),o=n(6441),s=n(91907),l=n(10830),d=n(78584);class h extends s.ViewComponent{className(){return"ImageEditorPro"}open(e,t){return(0,i._)(function*(){let n=this.j,i=o.Config.defaultOptions.imageEditorPro,r=n.c.div("jodit-image-editor-pro");r.style.width="100%",r.style.height="100%";let s=new d.Dialog({language:n.o.language});s.setSize(i.dialog.width,i.dialog.height),s.setContent(r),s.open();let l=null,h=null,c=()=>{null==h||h(),h=null,null==l||l.destroy(),l=null,s.close()};s.e.on("beforeClose",()=>{null==h||h(),h=null,null==l||l.destroy(),l=null}),l=new a.ImageEditor({container:r,state:{showToolbar:!1,status:"loading"},onSave:n=>{this.persist(l,e,void 0,n,t,c)},onSaveAs:n=>{this.saveAs(l,e,n,t,c)}}),h=this.mountToolbar(s,l);try{let t=yield this.loadImage(e);yield l.fromBlob(t)}catch(e){null==l||l.update({status:"error",error:e instanceof Error?e.message:String(e)}),this.error(e)}}).call(this)}mountToolbar(e,t){let n=this.j,i=(0,l.Button)(n,{icon:{name:"save"},text:n.i18n("Save")},"primary"),r=(0,l.Button)(n,{icon:{name:"save"},name:"save-as",text:n.i18n("Save as")}),o=n.c.span("jodit-image-editor-pro__size"),s=(0,l.Button)(n,a.ICONS.minus),d=n.c.span("jodit-image-editor-pro__zoom"),h=(0,l.Button)(n,a.ICONS.plus),c=(0,l.Button)(n,"update",n.i18n("Reset")),u=(0,l.Button)(n,"undo",n.i18n("Undo")),p=(0,l.Button)(n,"redo",n.i18n("Redo"));s.setState({tooltip:"Zoom out"}),h.setState({tooltip:"Zoom in"});let g=null;i.onAction(()=>{g=i,t.save()}),r.onAction(()=>{g=r,t.saveAs()}),s.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,r.container)),m.appendChild(f(o,s.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=a.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}),r.setState({disabled:!e.source||s}),i.container.classList.toggle(x,h&&g!==r),r.container.classList.toggle(x,h&&g===r),c.setState({disabled:!a.selectors.selectIsDirty(e)}),u.setState({disabled:!a.selectors.selectCanUndo(e)}),p.setState({disabled:!a.selectors.selectCanRedo(e)}),o.textContent=t?`${t.width} \xd7 ${t.height}`:"";let f=a.selectors.selectViewportFit(e),m=f?Math.round(100*f.scale):Math.round(100*e.zoom);d.textContent=`${m}%`};y(t.state);let j=t.store.subscribe(y);return()=>{j(),[i,r,s,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)})}persist(e,t,n,r,a,o){return(0,i._)(function*(){null==e||e.update({status:"exporting"});try{let{w:e,h:i}=yield this.blobSize(r),s=yield this.uploadEdited(t,r,n),l=()=>{o(),this.j.e.fire("update.filebrowser")};a(n,this.coreSupportsSaved()?{action:"saved",box:{w:e,h:i},newPath:s||void 0}:{action:"resize",box:{w:e,h:i}},l,e=>{o(),this.error(e)})}catch(e){o(),this.error(e)}}).call(this)}uploadEdited(e,t,n){return(0,i._)(function*(){var i,r;let{source:a,path:o,name:s}=yield 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=yield fetch(`${l}${c}action=imageSave`,{method:"POST",body:h,credentials:"include"}),p=yield 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:""}).call(this)}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:""}loadImage(e){return(0,i._)(function*(){let t=this.connectorUrl();if(t)try{return yield this.loadViaConnector(t,e)}catch(e){}let n=e.includes("?")?"&":"?",i=yield fetch(`${e}${n}_tst=${Date.now()}`,{credentials:"include"});if(!i.ok)throw Error(`Failed to load image (${i.status})`);return i.blob()}).call(this)}loadViaConnector(e,t){return(0,i._)(function*(){var n;let{source:i,path:r,name:a}=yield 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=yield fetch(`${e}${s}action=imageLoad`,{method:"POST",body:o,credentials:"include"}),d=yield l.json();if(!d.success||!(null==(n=d.data)?void 0:n.content))throw Error(d.message||"Failed to load the image");return(yield fetch(d.data.content)).blob()}).call(this)}blobSize(e){return(0,i._)(function*(){let t=yield 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,r._)(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,i,r,a,o){try{var s=e[a](o),l=s.value}catch(e){n(e);return}s.done?t(l):Promise.resolve(l).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){a(e,t,n[t])})}return e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}n.d(t,{ICONS:function(){return eT},ImageEditor:function(){return eZ},selectors:function(){return $}});try{if("u">typeof document){var l=document.createElement("style");l.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(l)}}catch(e){}let d=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"}]),h=Object.freeze({brightness:0,contrast:0,saturation:0,warmth:0,blur:0}),c=Object.freeze(["#ffffff","#1a1a1a","#9e9689","#4a90e2","#54b98a","#f2c94c","#eb5757","#a29bfe","#8b5cf6","#f178b6","#f2994a","#b8e454","#7ec8f0","#5b6470","#d8d2c8","#eeeeee"]);function u(){return{flip:{horizontal:!1,vertical:!1},rotate:0,angle:0,crop:null,resize:null,finetune:o({},h),filter:"original",annotations:[],focus:null}}function p(){return{source:null,status:"idle",busyVisible:!1,error:null,activeTab:"adjust",activeTool:"crop",zoom:1,history:{entries:[u()],index:0},selectedAnnotationId:null,theme:"light",showToolbar:!0,locale:"en",minCropSize:8,minResizeSize:1,palette:[...c],fonts:d.map(e=>o({},e)),activePopover:null,viewport:null}}function g(e){let t=e.entries[e.index];if(void 0===t)throw RangeError(`history index ${e.index} is out of bounds`);return t}function f(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 m(e,t){let n=Math.min(Math.max(t,0),e.entries.length-1);return n===e.index?e:s(o({},e),{index:n})}function b(e,t){var n,i,r,a,l,d;let h=e;if(void 0!==t.activeTab&&(h=x(h,{activeTab:t.activeTab})),void 0!==t.activeTool&&(h=x(h,{activeTool:t.activeTool})),void 0!==t.zoom&&(h=x(h,{zoom:!Number.isFinite(a=t.zoom)||a<=0?1:Math.min(Math.max(a,.01),64)})),void 0!==t.theme&&(h=x(h,{theme:t.theme})),void 0!==t.showToolbar&&(h=x(h,{showToolbar:t.showToolbar})),void 0!==t.locale&&(h=x(h,{locale:t.locale})),void 0!==t.minCropSize&&(h=x(h,{minCropSize:Math.max(1,t.minCropSize)})),void 0!==t.minResizeSize&&(h=x(h,{minResizeSize:Math.max(1,t.minResizeSize)})),void 0!==t.palette&&(h=x(h,{palette:t.palette})),void 0!==t.fonts&&(h=x(h,{fonts:t.fonts})),void 0!==t.activePopover&&(h=x(h,{activePopover:t.activePopover})),void 0!==t.status&&(h=x(h,{status:t.status}),"exporting"!==t.status&&h.busyVisible&&(h=x(h,{busyVisible:!1}))),void 0!==t.busyVisible&&(h=x(h,{busyVisible:t.busyVisible})),void 0!==t.error&&(h=x(h,{error:t.error})),void 0!==t.source&&(h=x(h,{source:t.source})),void 0!==t.viewport&&(h=x(h,{viewport:t.viewport})),void 0!==t.selectedAnnotationId&&(h=x(h,{selectedAnnotationId:t.selectedAnnotationId})),t.resetHistory&&(h=x(h,{history:{entries:[u()],index:0}})),t.resetDesign&&(h=x(h,{history:f(h.history,u())})),void 0!==t.design){let e,i=s(o({},l=g(h.history),d=t.design),{flip:d.flip?o({},l.flip,d.flip):l.flip,finetune:d.finetune?o({},l.finetune,d.finetune):l.finetune,rotate:void 0!==d.rotate?(90*Math.round(d.rotate/90)%360+360)%360:l.rotate}),r=!1===t.commit?((e=(n=h.history).entries.slice())[n.index]=i,{entries:e,index:n.index}):f(h.history,i);h=x(h,{history:r})}if(void 0!==t.history){let e=t.history,n="step"in e?(i=h.history,r=e.step,m(i,i.index+r)):m(h.history,e.index);h=x(h,{history:n})}return h}function x(e,t){for(let n of Object.keys(t))if(e[n]!==t[n])return o({},e,t);return e}class y{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){a(this,"pending",null),a(this,"handle",null),this.schedule=e,this.clear=t}}class j{request(e){this.pending=e,this.flush()}flush(){let e=this.pending;this.pending=null,e&&e()}cancel(){this.pending=null}constructor(){a(this,"pending",null)}}class w{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,i;a(this,"state",void 0),a(this,"reducer",void 0),a(this,"scheduler",void 0),a(this,"listeners",new Set),a(this,"notifying",!1),this.state=null!=(t=e.initialState)?t:p(),this.reducer=null!=(n=e.reducer)?n:b,this.scheduler=null!=(i=e.scheduler)?i:new j}}function M(e,t,n){return Math.min(Math.max(e,t),n)}function S(e,t){let n=M(e.width,1,t.width),i=M(e.height,1,t.height);return{x:M(e.x,0,t.width-n),y:M(e.y,0,t.height-i),width:n,height:i}}function k(e){return g(e.history)}function z(e){return"adjust"===e.activeTab&&"crop"===e.activeTool}function C(e){let t=k(e);return z(e)?s(o({},t),{crop:null,angle:0}):t}function _(e){return e.history.index>0}function T(e){var t;return(t=e.history).index<t.entries.length-1}function P(e){return e.history.index>0||e.history.entries.length>1}function E(e){if(!e.source)return null;let t=k(e),{width:n,height:i}=e.source;return 90===t.rotate||270===t.rotate?{width:i,height:n}:{width:n,height:i}}function A(e){let t=k(e);return t.resize?t.resize:t.crop?{width:Math.round(t.crop.width),height:Math.round(t.crop.height)}:E(e)}function R(e){return z(e)?E(e):A(e)}function O(e){let t,n,i,r=R(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 I(e){return k(e).angle}function B(e){let t=k(e);if(t.crop)return t.crop;let n=E(e);return n?{x:0,y:0,width:n.width,height:n.height}:null}let $=Object.freeze(Object.defineProperty({__proto__:null,VIEWPORT_PADDING:44,selectCanRedo:T,selectCanUndo:_,selectCropAngle:I,selectDesign:k,selectEffectiveCrop:B,selectIsCropping:z,selectIsDirty:P,selectOrientedSize:E,selectOutputSize:A,selectPreviewContentSize:R,selectPreviewDesign:C,selectViewportFit:O},Symbol.toStringTag,{value:"Module"})),D=Math.PI/180,L={nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]};function V(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function F(e,t,n,i){let r=V(e),a=t*D,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 N(e,t,n,i){return Math.atan2(i-t,n-e)/D}function U(e,t,n){H(e,"width"),H(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 q(e,t,n){return(n*e.width+t)*4}function H(e,t){if(!Number.isInteger(e)||e<=0)throw RangeError(`${t} must be a positive integer, got ${e}`)}function X(e,t){let n=U(e.width,e.height),{width:i,height:r}=e;for(let a=0;a<r;a++)for(let o=0;o<i;o++)Z(e,q(e,"horizontal"===t?i-1-o:o,"vertical"===t?r-1-a:a),n,q(n,o,a));return n}function Y(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 U(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=U(t,e.height);for(let i=0;i<e.height;i++)for(let r=0;r<t;r++){let t=q(e,2*r,i),a=q(e,Math.min(2*r+1,e.width-1),i),o=q(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=U(e.width,t);for(let i=0;i<t;i++)for(let t=0;t<e.width;t++){let r=q(e,t,2*i),a=q(e,t,Math.min(2*i+1,e.height-1)),o=q(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?U(n,i,new Uint8ClampedArray(r.data)):function(e,t,n){let i=U(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=W(u,e.height),f=W(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=W(a,e.width),b=W(a+1,e.width),x=q(e,m,g),y=q(e,b,g),j=q(e,m,f),w=q(e,b,f),M=q(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[j+t],d=e.data[w+t],l+(d-l)*u);i.data[M+t]=(h=n)+(r-h)*p}}}return i}(r,n,i)}function Z(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 W(e,t){return e<0?0:e>=t?t-1:e}function G(e,t){let n=U(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 K(e,t){if(0===t)return ea(e);let n=t/100*255;return G(e,e=>e+n)}function J(e,t){if(0===t)return ea(e);let n=t/100*255,i=259*(n+255)/(255*(259-n));return G(e,e=>i*(e-128)+128)}function Q(e,t){if(0===t)return ea(e);let n=1+t/100,i=U(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 ee(e,t){if(0===t)return ea(e);let n=t/100*40;return G(e,(e,t)=>0===t?e+n:2===t?e-n:e)}function et(e,t,n=20){let i=Math.round(Math.max(0,Math.min(100,t))/100*n);return i<=0?ea(e):ei(ei(e,i,"horizontal"),i,"vertical")}function en(e,t){let n=e;return et(n=ee(n=Q(n=J(n=K(n,t.brightness),t.contrast),t.saturation),t.warmth),t.blur)}function ei(e,t,n){let i=U(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+=er(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=er(o,r,a,s,e,c-t,n);l+=er(o,r,a,s,e,c+t+1,n)-u}}return i}function er(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 ea(e){return U(e.width,e.height,new Uint8ClampedArray(e.data))}function eo(e,t){let n=U(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:en,blur:et,brightness:K,contrast:J,saturation:Q,warmth:ee},Symbol.toStringTag,{value:"Module"}));let es=e=>U(e.width,e.height,new Uint8ClampedArray(e.data)),el=new Map;function ed(e){return el.set(e.id,e),()=>{el.get(e.id)===e&&el.delete(e.id)}}function eh(e,t){let n=el.get(t);return n?n.apply(e):es(e)}function ec(e){return new ImageData(e.data,e.width,e.height)}[{id:"original",label:"Original",apply:es},{id:"invert",label:"Invert",apply:e=>eo(e,(e,t,n)=>[255-e,255-t,255-n])},{id:"grayscale",label:"Black & White",apply:e=>eo(e,(e,t,n)=>{let i=.299*e+.587*t+.114*n;return[i,i,i]})},{id:"sepia",label:"Sepia",apply:e=>eo(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=>eo(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=>ee(Q(J(e,20),25),-10)},{id:"gingham",label:"Gingham",apply:e=>ee(Q(J(e,-10),-15),12)}].forEach(ed);class eu{register(e){let t=this.locales.get(e.id);return this.locales.set(e.id,o({},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(){a(this,"locales",new Map)}}let ep=new Set(["value","checked","disabled","selected","innerHTML"]);function eg(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 ef(e){return"element"===e.kind}let ev={};class em{render(e){if(null===this.prev){let t=this.mount(e);this.host.insert(this.container,t,null)}else if(eb(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(!ef(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,ev,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,ef(t)&&ef(e))?(this.applyProps(n,e.props,t.props),this.patchChildren(n,e.children,t.children)):ef(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(ex(s))continue;let i=n[s];i!==t[s]&&this.applyAttr(e,s,i)}for(let i of Object.keys(t))ex(i)||i in n||(ep.has(i)?this.host.setProperty(e,i,""):this.host.removeAttribute(e,i))}applyAttr(e,t,n){var i;ep.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(eb(l,h)){this.patch(l,h),i++,a++;continue}if(eb(d,c)){this.patch(d,c),r--,o--;continue}if(eb(l,c)){this.patch(l,c),this.host.insert(e,l.node,this.host.nextSibling(d.node)),i++,o--;continue}if(eb(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){a(this,"events",new WeakMap),a(this,"prev",null),this.host=e,this.container=t}}function eb(e,t){return e.kind===t.kind&&("text"===e.kind||e.tag===t.tag&&e.key===t.key)}function ex(e){return"key"===e||"class"===e||"style"===e||"on"===e}class ey{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 ej{register(e){var t;return this.tools.set(e.id,e),this.order.set(e.id,null!=(t=e.order)?t:ej.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(){a(this,"tools",new Map),a(this,"seq",0),a(this,"order",new Map)}}function ew(e){return eg("span",{class:"jie-icon",innerHTML:e})}function eM(){return eg("span",{class:"jie-spinner"})}function eS(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(eM()):e.icon&&a.push(ew(e.icon)),e.label&&a.push(eg("span",{},e.label)),eg("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 ek(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 eg("div",{class:"jie-slider"},[eg("span",{class:"jie-slider__label"},e.label),eg("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}),eg("span",{class:"jie-slider__value"},String(Math.round(e.value)))])}function ez(e){return eg("label",{class:"jie-field"},[eg("span",{},e.label),eg("span",{style:{display:"flex","align-items":"center",gap:"6px"}},[eg("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?eg("span",{},e.suffix):null])])}function eC(e,t,n){return eg("div",{class:"jie-toolrow"},e.map(e=>eS({key:e.id,label:e.label,icon:e.icon,active:e.id===t,onClick:()=>n(e.id)})))}a(ej,"UNORDERED_BASE",1e6);let e_=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>`,eT={adjust:e_('<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:e_('<path d="M4 7h12M4 12h16M4 17h8"/><circle cx="18" cy="7" r="1.6"/><circle cx="12" cy="17" r="1.6"/>'),filters:e_('<circle cx="9" cy="9" r="5"/><circle cx="15" cy="9" r="5"/><circle cx="12" cy="15" r="5"/>'),watermark:e_('<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:e_('<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>'),resize:e_('<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:e_('<path d="M6 2v14a2 2 0 0 0 2 2h14"/><path d="M2 6h14a2 2 0 0 1 2 2v14"/>'),rotate:e_('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),flipX:e_('<path d="M12 3v18"/><path d="M8 7 4 12l4 5Z"/><path d="M16 7l4 5-4 5Z"/>'),flipY:e_('<path d="M3 12h18"/><path d="M7 8 12 4l5 4Z"/><path d="M7 16l5 4 5-4Z"/>'),undo:e_('<path d="M9 7 4 12l5 5"/><path d="M4 12h11a5 5 0 0 1 0 10h-1"/>'),redo:e_('<path d="m15 7 5 5-5 5"/><path d="M20 12H9a5 5 0 0 0 0 10h1"/>'),reset:e_('<path d="M3 12a9 9 0 1 1 2.6 6.3"/><path d="M3 21v-5h5"/>'),trash:e_('<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:e_('<path d="M12 5v14M5 12h14"/>'),minus:e_('<path d="M5 12h14"/>'),zoomIn:e_('<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:e_('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M7.5 10.5h6"/>'),posTopLeft:e_('<path d="M17 17 7 7M7 13V7h6"/>'),posTop:e_('<path d="M12 19V6M7 11l5-5 5 5"/>'),posTopRight:e_('<path d="M7 17 17 7M11 7h6v6"/>'),posLeft:e_('<path d="M19 12H6M11 7l-5 5 5 5"/>'),posCenter:e_('<circle cx="12" cy="12" r="6.5"/><circle cx="12" cy="12" r="2" fill="currentColor" stroke="none"/>'),posRight:e_('<path d="M5 12h13M13 7l5 5-5 5"/>'),posBottomLeft:e_('<path d="M17 7 7 17M7 11v6h6"/>'),posBottom:e_('<path d="M12 5v13M7 13l5 5 5-5"/>'),posBottomRight:e_('<path d="M7 7l10 10M17 11v6h-6"/>'),font:e_('<path d="M4 20 9.5 6h1L16 20M6 15h8M17 20l3-9h.5l3 9M18 17h4"/>'),focus:e_('<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3.5"/>'),lock:e_('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>'),unlock:e_('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.5-2"/>'),text:e_('<path d="M5 5h14M12 5v14M9 19h6"/>'),brightness:e_('<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:e_('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18Z" fill="currentColor" stroke="none"/>'),blur:e_('<path d="M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11Z"/>'),book:e_('<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"/>')},eP={id:"adjust",label:"Adjust",icon:eT.adjust,order:0,defaultTool:"crop",renderPanel({state:e,update:t,t:n}){let i=k(e),r=z(e);return eg("div",{class:"jie-toolrow"},[eS({label:n("Crop"),icon:eT.crop,active:r,onClick:()=>t({activeTab:"adjust",activeTool:r?null:"crop"})}),eS({label:n("Rotate"),icon:eT.rotate,onClick:()=>t({design:{rotate:i.rotate+90}})}),eS({label:n("Flip X"),icon:eT.flipX,onClick:()=>t({design:{flip:{horizontal:!i.flip.horizontal}}})}),eS({label:n("Flip Y"),icon:eT.flipY,onClick:()=>t({design:{flip:{vertical:!i.flip.vertical}}})})])}},eE=[{id:"brightness",label:"Brightness",icon:eT.brightness,min:-100,max:100},{id:"contrast",label:"Contrast",icon:eT.contrast,min:-100,max:100},{id:"saturation",label:"Saturation",icon:eT.filters,min:-100,max:100},{id:"blur",label:"Blur",icon:eT.blur,min:0,max:100},{id:"warmth",label:"Warmth",icon:eT.brightness,min:-100,max:100}],eA={id:"finetune",label:"Finetune",icon:eT.finetune,order:1,defaultTool:"brightness",renderPanel({state:e,update:t,t:n}){var i,r;let a=(i=e.activeTool,null!=(r=eE.find(e=>e.id===i))?r:eE[0]),o=k(e).finetune[a.id],s=(e,n)=>{t({design:{finetune:{[a.id]:e}},commit:n})};return eg("div",{class:"jie-panel-stack",style:{display:"contents"}},[ek({label:n(a.label),value:o,min:a.min,max:a.max,onStart:()=>s(o,!0),onInput:e=>s(e,!1)}),eC(eE.map(e=>({id:e.id,label:n(e.label),icon:e.icon})),a.id,e=>t({activeTab:"finetune",activeTool:e}))])}},eR={id:"filters",label:"Filters",icon:eT.filters,order:2,renderPanel({state:e,update:t,t:n}){let i=k(e).filter;return eg("div",{class:"jie-thumbs"},[...el.values()].map(e=>eg("button",{key:e.id,class:"jie-thumb",type:"button","aria-pressed":String(e.id===i),on:{click:()=>t({design:{filter:e.id}})}},[eg("canvas",{class:"jie-thumb__swatch","data-jie-filter-thumb":e.id}),eg("span",{},n(e.label))])))}},eO={id:"focus",label:"Focus",icon:eT.focus,order:3,defaultTool:"radial",renderPanel({state:e,update:t,t:n}){var i;let r=null!=(i=k(e).focus)?i:{shape:"radial",x:.5,y:.5,radius:.28,angle:0,amount:60},a=null!==k(e).focus,s=(e,n)=>t({design:{focus:o({},r,e)},commit:n});return eg("div",{class:"jie-panel-stack",style:{display:"contents"}},[eg("div",{class:"jie-toolrow"},[ek({label:n("Intensity"),value:r.amount,min:0,max:100,onStart:()=>s({amount:r.amount},!0),onInput:e=>s({amount:e},!1)}),ek({label:n("Radius"),value:Math.round(100*r.radius),min:5,max:90,onStart:()=>s({radius:r.radius},!0),onInput:e=>s({radius:e/100},!1)}),a?eS({variant:"icon",icon:eT.trash,title:n("Reset"),onClick:()=>t({design:{focus:null}})}):null]),eC([{id:"radial",label:n("Radial")},{id:"linear",label:n("Linear")}],r.shape,e=>s({shape:e},!0))])}},eI=[{align:"left",valign:"top",icon:eT.posTopLeft},{align:"center",valign:"top",icon:eT.posTop},{align:"right",valign:"top",icon:eT.posTopRight},{align:"left",valign:"middle",icon:eT.posLeft},{align:"center",valign:"middle",icon:eT.posCenter},{align:"right",valign:"middle",icon:eT.posRight},{align:"left",valign:"bottom",icon:eT.posBottomLeft},{align:"center",valign:"bottom",icon:eT.posBottom},{align:"right",valign:"bottom",icon:eT.posBottomRight}],eB=function(e="id"){let t=0;return()=>`${e}-${++t}`}("jie"),e$="text-color",eD="text-font",eL={id:"annotate",label:"Text",icon:eT.text,order:4,defaultTool:"text",renderPanel({state:e,update:t,t:n}){var i,r,a,s,l,h;let c,u,p,g=k(e),f=g.annotations[0];if(!f)return eg("div",{class:"jie-toolrow"},[eS({label:n("Add text"),icon:eT.text,variant:"primary",onClick:()=>{let e=function(e,t={}){return o({id:e,type:"text",text:"Text",x:.5,y:.5,fontSize:.06,fontFamily:d[0].value,color:"#eb5757",bold:!1,italic:!1,align:"center",valign:"middle"},t)}(eB());t({design:{annotations:[e]},selectedAnnotationId:e.id})}})]);let m=e=>{var n,i;return t({design:{annotations:(n=g.annotations,i=f.id,n.map(t=>t.id===i?o({},t,e):t))}})};return eg("div",{class:"jie-toolrow"},[eg("input",{class:"jie-input",type:"text",value:f.text,on:{input:e=>m({text:e.target.value})}}),(c=(i={value:f.fontFamily,fonts:e.fonts,title:n("Font"),open:e.activePopover===eD,onToggle:()=>t({activePopover:e.activePopover===eD?null:eD}),onPick:e=>{m({fontFamily:e}),t({activePopover:null})}}).fonts.find(e=>e.value===i.value),u=[eg("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()}},[ew(eT.font),eg("span",{style:{"font-family":i.value}},null!=(a=null==c?void 0:c.label)?a:"Font"),ew(eT.book)])],i.open&&u.push(eg("div",{class:"jie-popover__backdrop",on:{click:()=>i.onToggle()}}),eg("div",{class:"jie-popover jie-fontlist",role:"listbox"},i.fonts.map(e=>eg("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)))),eg("div",{class:"jie-fontselect"},u)),(p=[eg("button",{class:"jie-color",type:"button",title:null!=(l=(s={value:f.color,palette:e.palette,title:n("Colour"),open:e.activePopover===e$,onToggle:()=>t({activePopover:e.activePopover===e$?null:e$}),onPick:e=>{m({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&&p.push(eg("div",{class:"jie-popover__backdrop",on:{click:()=>s.onToggle()}}),eg("div",{class:"jie-popover jie-swatches",role:"listbox"},s.palette.map(e=>eg("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)}})))),eg("div",{class:"jie-colorpicker"},p)),eS({label:"B",className:"jie-btn--bold",active:f.bold,onClick:()=>m({bold:!f.bold})}),eS({label:"I",className:"jie-btn--italic",active:f.italic,onClick:()=>m({italic:!f.italic})}),ek({label:n("Size"),value:Math.round(100*f.fontSize),min:1,max:40,onInput:e=>m({fontSize:e/100})}),(h={align:f.align,valign:f.valign,onPick:(e,t)=>m(o({align:e,valign:t},{x:"left"===e?.04:"right"===e?.96:.5,y:"top"===t?.04:"bottom"===t?.96:.5}))},eg("div",{class:"jie-posgrid",role:"group"},eI.map(e=>eg("button",{key:`${e.valign}-${e.align}`,class:"jie-posgrid__cell",type:"button","data-pos":`${e.valign}-${e.align}`,"aria-pressed":String(e.align===h.align&&e.valign===h.valign),on:{click:()=>h.onPick(e.align,e.valign)}},[ew(e.icon)])))),eS({variant:"icon",icon:eT.trash,title:n("Delete"),onClick:()=>{var e,n;return t({design:{annotations:(e=g.annotations,n=f.id,e.filter(e=>e.id!==n))},selectedAnnotationId:null})}})])}},eV={id:"resize",label:"Resize",icon:eT.resize,order:5,renderPanel({state:e,update:t,t:n}){let i=A(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,s;return{width:Math.max(i,Math.round(null!=(a=t.width)?a:e.width)),height:Math.max(i,Math.round(null!=(s=t.height)?s: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 o({},e)}(i,n,r,e.minResizeSize)}});return eg("div",{class:"jie-fieldrow"},[ez({label:n("Width"),value:i.width,suffix:n("px"),onChange:e=>a({width:e})}),eS({variant:"icon",icon:r?eT.lock:eT.unlock,title:r?n("Aspect ratio locked"):n("Aspect ratio unlocked"),onClick:()=>t({activeTab:"resize",activeTool:r?"unlocked":"locked"})}),ez({label:n("Height"),value:i.height,suffix:n("px"),onChange:e=>a({height:e})}),eS({variant:"icon",icon:eT.reset,title:n("Reset size"),onClick:()=>t({design:{resize:null}})})])}};function eF(e){return parseInt(e+e,16)}function eN(e,t){return parseInt(e.slice(t,t+2),16)}let eU=/image\/(jpe?g|bmp)/i;function eq(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 eH{decode(e){return r(function*(){var t,n,i;let r,a=yield 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 U(c.width,c.height,c.data)}).call(this)}encode(e){return r(function*(e,t={}){let n,{type:i="image/png",quality:r=.92,background:a}=t,o=void 0!==a||eU.test(i)?function(e,[t,n,i]){let r=U(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)?[eF(n[0]),eF(n[1]),eF(n[2])]:/^[0-9a-f]{6}$/i.test(n)?[eN(n,0),eN(n,2),eN(n,4)]:[255,255,255])):e,s=this.createCanvas(o.width,o.height);return this.context(s).putImageData(ec(o),0,0),s.toBlobAsync(i,r)}).apply(this,arguments)}context(e){let t=e.getContext("2d");if(!t)throw Error("Unable to acquire a 2D canvas context");return t}toBitmap(e){return r(function*(){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=eq,t={}){var n;a(this,"maxPixels",void 0),a(this,"maxSize",void 0),this.createCanvas=e,this.maxPixels=null!=(n=t.maxPixels)?n:0x1000000,this.maxSize=t.maxSize}}class eX{decode(e){return this.codec.decode(e)}render(e,t){let n=function(e,t){let n=e;if(t.flip.horizontal&&(n=X(n,"horizontal")),t.flip.vertical&&(n=X(n,"vertical")),0!==t.rotate&&(n=function(e,t){let n=(Math.round(t/90)%4+4)%4;if(0===n)return U(e.width,e.height,new Uint8ClampedArray(e.data));let{width:i,height:r}=e,a=1===n||3===n,o=U(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),Z(e,q(e,a,t),o,q(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=U(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=W(a,e.width),h=W(a+1,e.width),c=W(o,e.height),u=W(o+1,e.height),p=q(e,d,c),g=q(e,h,c),f=q(e,d,u),m=q(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,q(a,r,t))}}return a}(n,e,t.angle)}else t.crop&&(n=function(e,t){let n,i,r=S({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=U(r.width,r.height);for(let t=0;t<r.height;t++){let n=q(e,r.x,r.y+t),i=q(a,0,t);a.data.set(e.data.subarray(n,n+4*r.width),i)}return a}(n,t.crop));return t.resize&&(n=Y(n,t.resize)),n=eh(n=en(n,t.finetune),t.filter),t.focus&&(n=function(e,t){if(t.amount<=0)return U(e.width,e.height,new Uint8ClampedArray(e.data));let n=et(e,t.amount,32),{width:i,height:r}=e,a=U(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=q(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(ec(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 U(r.width,r.height,r.data)}(this.createCanvas,n,t.annotations)}toBlob(e,t,n){return r(function*(){return this.codec.encode(this.render(e,t),n)}).call(this)}constructor(e){a(this,"codec",void 0),a(this,"createCanvas",void 0),this.codec=e.codec,this.createCanvas=e.createCanvas}}function eY(e,t,n){e.update({zoom:t.zoom*n})}class eZ{get state(){return this.store.getState()}update(e){return this.store.update(e),this}save(){return r(function*(){return this.handleSave()}).call(this)}saveAs(){return r(function*(){return this.handleSaveAs()}).call(this)}reset(){return this.handleReset(),this}use(e){let t=e.setup(this.api());return"function"==typeof t&&this.disposers.push(t),this}fromBlob(e){return r(function*(){this.store.update({status:"loading",error:null});try{let t=yield this.processor.decode(e);if(this.destroyed)return this;this.source=t,this.previewSource=eW(t,this.previewMaxSize),this.thumbSource=eW(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}).call(this)}toBlob(e){return r(function*(){if(!this.source)throw Error("No image loaded — call fromBlob() first");let t=k(this.store.getState());this.store.update({status:"exporting"});try{return t.annotations.length>0&&"u">typeof document&&document.fonts&&(yield document.fonts.ready),yield this.processor.toBlob(this.source,t,e)}finally{this.store.update({status:"ready"})}}).call(this)}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=>ed(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(){P(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(),eg("div",{class:"jie","data-theme":e.theme},[e.showToolbar?(r=A(e),o=(a=O(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,eg("header",{class:"jie-topbar"},[eg("div",{class:"jie-topbar__save"},[eS({label:s("Save"),variant:"primary",onClick:()=>t.onSave(),disabled:!e.source||l,busy:d}),eS({label:s("Save as"),onClick:()=>t.onSaveAs(),disabled:!e.source||l,busy:d})]),eg("div",{class:"jie-topbar__meta"},[r?eg("span",{},`${r.width} x ${r.height} px`):null,ew(eT.book),eg("div",{class:"jie-zoom"},[eS({variant:"icon",icon:eT.zoomOut,title:s("Zoom out"),onClick:()=>eY(t,e,1/1.2)}),eg("span",{},`${o}%`),eS({variant:"icon",icon:eT.zoomIn,title:s("Zoom in"),onClick:()=>eY(t,e,1.2)})])]),eg("div",{class:"jie-topbar__actions"},[eS({variant:"icon",icon:eT.reset,title:s("Reset"),disabled:!P(e),onClick:()=>t.onReset()}),eS({variant:"icon",icon:eT.undo,title:s("Undo"),disabled:!_(e),onClick:()=>t.update({history:{step:-1}})}),eS({variant:"icon",icon:eT.redo,title:s("Redo"),disabled:!T(e),onClick:()=>t.update({history:{step:1}})})])])):null,eg("div",{class:"jie-body"},[eg("nav",{class:"jie-rail"},t.tools.map(n=>eg("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})}}},[ew(n.icon),eg("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,eg("div",{class:"jie-stage"},[eg("div",{class:"jie-canvas-wrap","data-jie-canvas-wrap":""},[eg("canvas",{class:"jie-canvas","data-jie-canvas":""}),function(e,t){if(!z(e))return null;let n=O(e),i=B(e);if(!n||!i)return null;let r=I(e);return eg("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)}},[eg("div",{key:"rotate",class:"jie-crop__rotate",title:"Rotate",on:{pointerdown:e=>{e.stopPropagation(),t.beginCropRotate(e)}}}),...["nw","ne","sw","se"].map(e=>eg("div",{key:e,class:"jie-crop__handle","data-h":e,on:{pointerdown:n=>{n.stopPropagation(),t.beginCropDrag(e,n)}}}))])}(e,t),"loading"===e.status?eg("div",{class:"jie-overlay","data-jie-loading":""},[eM()]):"error"===e.status&&e.error?eg("div",{class:"jie-overlay jie-overlay--error","data-jie-error":""},[eg("span",{},t.t("Failed to load the image")),eg("span",{class:"jie-overlay__detail"},e.error)]):null]),c?eg("div",{class:"jie-panel"},[c]):null]))])]))),this.ensureViewportObserver(),this.paint(),this.paintFilterThumbs()}}handleSave(){return r(function*(){var e;if(!this.canExport())return;let t=yield this.toBlob();null==(e=this.onSaveCb)||e.call(this,t,this),this.container.dispatchEvent(new CustomEvent("jie:save",{detail:{blob:t},bubbles:!0}))}).call(this)}handleSaveAs(){return r(function*(){var e;if(!this.canExport())return;let t=yield this.toBlob();null==(e=this.onSaveAsCb)||e.call(this,t,this),this.container.dispatchEvent(new CustomEvent("jie:saveas",{detail:{blob:t},bubbles:!0}))}).call(this)}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=O(e);if(!n)return;let i=C(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(ec(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=eh(e,n);t.width=r.width,t.height=r.height;let a=t.getContext("2d");a&&(a.putImageData(ec(r),0,0),t.dataset.key=i)}}beginCropDrag(e,t){let n=this.store.getState(),i=O(n),r=B(n),a=E(n);if(!i||!r||!a)return;let l=I(n),d=n.minCropSize,h=t.clientX,c=t.clientY;this.runPointerGesture(t,t=>{let n=(t.clientX-h)/i.scale,u=(t.clientY-c)/i.scale;return{crop:0!==l?function(e,t,n,i,r,a=8){if("move"===n)return s(o({},e),{x:e.x+i,y:e.y+r});let[l,d]=L[n],h=F(e,t,l,d),c=F(e,t,-l,-d),u={x:h.x+i,y:h.y+r},p=(u.x+c.x)/2,g=(u.y+c.y)/2,f=t*D,m=Math.cos(f),b=Math.sin(f),x=u.x-c.x,y=u.y-c.y,j=Math.max(a,Math.abs(x*m+y*b)),w=Math.max(a,Math.abs(-(x*b)+y*m));return{x:p-j/2,y:g-w/2,width:j,height:w}}(r,l,e,n,u,d):function(e,t,n,i,r,a=null,l=8){var d;let h,c;if("move"===t)return S(s(o({},e),{x:e.x+n,y:e.y+i}),r);let{x:u,y:p,width:g,height:f}=e;if("nw"===t||"sw"===t){let e=M(u+n,0,u+g-l);g+=u-e,u=e}else g=M(g+n,l,r.width-u);if("nw"===t||"ne"===t){let e=M(p+i,0,p+f-l);f+=p-e,p=e}else f=M(f+i,l,r.height-p);let m={x:u,y:p,width:g,height:f};return null!==a&&a>0&&(h=(d=m).width/a,c="sw"===t||"se"===t?d.y:d.y+d.height-h,m=s(o({},d),{height:h,y:c})),S(m,r)}(r,e,n,u,a,null,d)}})}beginCropRotate(e){var t;let n=this.store.getState(),i=O(n),r=B(n),a=null!=(t=this.observedWrap)?t:this.container.querySelector("[data-jie-canvas-wrap]");if(!i||!r||!a)return;let o=a.getBoundingClientRect(),s=V(r),l=o.left+i.offsetX+s.x*i.scale,d=o.top+i.offsetY+s.y*i.scale,h=I(n),c=N(l,d,e.clientX,e.clientY);this.runPointerGesture(e,e=>{let t=h+(N(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,i,r,s,l,d,h;for(const o of(a(this,"store",void 0),a(this,"container",void 0),a(this,"renderer",void 0),a(this,"registry",new ej),a(this,"locales",new eu),a(this,"processor",void 0),a(this,"previewMaxSize",void 0),a(this,"spinnerDelay",void 0),a(this,"busyTimer",null),a(this,"onSaveCb",void 0),a(this,"onSaveAsCb",void 0),a(this,"confirm",void 0),a(this,"source",null),a(this,"previewSource",null),a(this,"thumbSource",null),a(this,"thumbVersion",0),a(this,"cachedRaster",null),a(this,"cachedRasterKey",""),a(this,"lastPaintKey",""),a(this,"disposers",[]),a(this,"resizeObserver",null),a(this,"observedWrap",null),a(this,"dragCleanup",null),a(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=eq,t){return new eX({codec:new eH(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!=(i=e.spinnerDelay)?i:250),this.onSaveCb=e.onSave,this.onSaveAsCb=e.onSaveAs,this.confirm=null!=(r=e.confirm)?r:e=>"u"<typeof window||window.confirm(e),null!=(s=e.locales)?s:[]))this.locales.register(o);for(const t of(this.store=new w({scheduler:null!=(l=e.scheduler)?l:function(){if("function"!=typeof requestAnimationFrame)return new y(e=>setTimeout(e,16),e=>clearTimeout(e));let e=e=>{cancelAnimationFrame(e.raf),null!==e.timer&&(clearTimeout(e.timer),e.timer=null)};return new y(t=>{let n={raf:0,timer:null},i=()=>{e(n),t()};return n.raf=requestAnimationFrame(i),n.timer=setTimeout(i,100),n},e)}(),initialState:o({},p(),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!=(d=e.tools)?d:[eP,eA,eR,eO,eL,eV]))this.registry.register(t);for(const t of null!=(h=e.plugins)?h:[])this.use(t);this.renderer=new em(new ey(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 eW(e,t){let n=Math.max(e.width,e.height);if(t>=n)return e;let i=t/n;return Y(e,{width:Math.round(e.width*i),height:Math.round(e.height*i)})}}},function(e){return e(e.s=98270)}])});
|