@wangeditor-next/editor 6.4.1 → 6.4.3
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/README.md +21 -0
- package/dist/core.d.ts +996 -0
- package/dist/core.js +41 -12
- package/dist/core.mjs +41 -12
- package/dist/css/style.css +7 -7
- package/dist/index.d.ts +971 -0
- package/dist/index.js +76 -19
- package/dist/index.mjs +76 -19
- package/dist/upload.d.ts +450 -0
- package/dist/upload.js +16 -12
- package/dist/upload.mjs +16 -12
- package/package.json +20 -21
- package/dist/basic-modules/src/constants/icon-svg.d.ts +0 -49
- package/dist/basic-modules/src/index.d.ts +0 -9
- package/dist/basic-modules/src/locale/en.d.ts +0 -107
- package/dist/basic-modules/src/locale/index.d.ts +0 -5
- package/dist/basic-modules/src/locale/zh-CN.d.ts +0 -107
- package/dist/basic-modules/src/modules/blockquote/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/blockquote/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/blockquote/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/blockquote/menu/BlockquoteMenu.d.ts +0 -20
- package/dist/basic-modules/src/modules/blockquote/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/blockquote/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/blockquote/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/blockquote/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/code-block/custom-types.d.ts +0 -17
- package/dist/basic-modules/src/modules/code-block/elem-to-html.d.ts +0 -16
- package/dist/basic-modules/src/modules/code-block/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/code-block/menu/CodeBlockMenu.d.ts +0 -23
- package/dist/basic-modules/src/modules/code-block/menu/index.d.ts +0 -12
- package/dist/basic-modules/src/modules/code-block/parse-elem-html.d.ts +0 -19
- package/dist/basic-modules/src/modules/code-block/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/code-block/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/code-block/render-elem.d.ts +0 -18
- package/dist/basic-modules/src/modules/color/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/color/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/color/menu/BaseMenu.d.ts +0 -20
- package/dist/basic-modules/src/modules/color/menu/BgColorMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/color/menu/ColorMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/color/menu/config.d.ts +0 -6
- package/dist/basic-modules/src/modules/color/menu/index.d.ts +0 -20
- package/dist/basic-modules/src/modules/color/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/color/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/color/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/color/style-to-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/common/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/common/menu/EnterMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/common/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/divider/custom-types.d.ts +0 -12
- package/dist/basic-modules/src/modules/divider/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/divider/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/divider/menu/InsertDividerMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/divider/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/divider/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/divider/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/divider/render-elem.d.ts +0 -13
- package/dist/basic-modules/src/modules/emotion/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/emotion/menu/EmotionMenu.d.ts +0 -19
- package/dist/basic-modules/src/modules/emotion/menu/config.d.ts +0 -5
- package/dist/basic-modules/src/modules/emotion/menu/index.d.ts +0 -12
- package/dist/basic-modules/src/modules/font-size-family/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/font-size-family/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/font-size-family/menu/BaseMenu.d.ts +0 -18
- package/dist/basic-modules/src/modules/font-size-family/menu/FontFamilyMenu.d.ts +0 -14
- package/dist/basic-modules/src/modules/font-size-family/menu/FontSizeMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/font-size-family/menu/config.d.ts +0 -12
- package/dist/basic-modules/src/modules/font-size-family/menu/index.d.ts +0 -26
- package/dist/basic-modules/src/modules/font-size-family/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/font-size-family/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/font-size-family/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/font-size-family/style-to-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/format-painter/helper.d.ts +0 -3
- package/dist/basic-modules/src/modules/format-painter/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/format-painter/menu/FormatPainter.d.ts +0 -37
- package/dist/basic-modules/src/modules/format-painter/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/format-painter/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/full-screen/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/full-screen/menu/FullScreen.d.ts +0 -18
- package/dist/basic-modules/src/modules/full-screen/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/header/custom-types.d.ts +0 -29
- package/dist/basic-modules/src/modules/header/elem-to-html.d.ts +0 -29
- package/dist/basic-modules/src/modules/header/helper.d.ts +0 -14
- package/dist/basic-modules/src/modules/header/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/header/menu/Header1ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header2ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header3ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header4ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header5ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header6ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/HeaderButtonMenuBase.d.ts +0 -19
- package/dist/basic-modules/src/modules/header/menu/HeaderSelectMenu.d.ts +0 -26
- package/dist/basic-modules/src/modules/header/menu/index.d.ts +0 -39
- package/dist/basic-modules/src/modules/header/parse-elem-html.d.ts +0 -32
- package/dist/basic-modules/src/modules/header/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/header/render-elem.d.ts +0 -32
- package/dist/basic-modules/src/modules/image/custom-types.d.ts +0 -22
- package/dist/basic-modules/src/modules/image/elem-to-html.d.ts +0 -12
- package/dist/basic-modules/src/modules/image/helper.d.ts +0 -13
- package/dist/basic-modules/src/modules/image/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/image/menu/DeleteImage.d.ts +0 -15
- package/dist/basic-modules/src/modules/image/menu/EditImage.d.ts +0 -28
- package/dist/basic-modules/src/modules/image/menu/EditImageSizeMenu.d.ts +0 -25
- package/dist/basic-modules/src/modules/image/menu/InsertImage.d.ts +0 -27
- package/dist/basic-modules/src/modules/image/menu/PreviewImage.d.ts +0 -14
- package/dist/basic-modules/src/modules/image/menu/ViewImageLink.d.ts +0 -15
- package/dist/basic-modules/src/modules/image/menu/Width100.d.ts +0 -10
- package/dist/basic-modules/src/modules/image/menu/Width30.d.ts +0 -10
- package/dist/basic-modules/src/modules/image/menu/Width50.d.ts +0 -10
- package/dist/basic-modules/src/modules/image/menu/WidthBase.d.ts +0 -16
- package/dist/basic-modules/src/modules/image/menu/config.d.ts +0 -30
- package/dist/basic-modules/src/modules/image/menu/index.d.ts +0 -61
- package/dist/basic-modules/src/modules/image/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/image/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/image/render-elem.d.ts +0 -13
- package/dist/basic-modules/src/modules/indent/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/indent/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/indent/is-indent-target.d.ts +0 -4
- package/dist/basic-modules/src/modules/indent/menu/BaseMenu.d.ts +0 -25
- package/dist/basic-modules/src/modules/indent/menu/DecreaseIndentMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/indent/menu/IncreaseIndentMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/indent/menu/index.d.ts +0 -14
- package/dist/basic-modules/src/modules/indent/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/indent/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/indent/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/indent/style-to-html.d.ts +0 -7
- package/dist/basic-modules/src/modules/justify/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/justify/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/justify/menu/BaseMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/justify/menu/JustifyCenterMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/JustifyJustifyMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/JustifyLeftMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/JustifyRightMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/index.d.ts +0 -24
- package/dist/basic-modules/src/modules/justify/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/justify/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/justify/style-to-html.d.ts +0 -7
- package/dist/basic-modules/src/modules/line-height/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/line-height/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/line-height/menu/LineHeightMenu.d.ts +0 -26
- package/dist/basic-modules/src/modules/line-height/menu/config.d.ts +0 -5
- package/dist/basic-modules/src/modules/line-height/menu/index.d.ts +0 -12
- package/dist/basic-modules/src/modules/line-height/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/line-height/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/line-height/style-to-html.d.ts +0 -7
- package/dist/basic-modules/src/modules/link/custom-types.d.ts +0 -11
- package/dist/basic-modules/src/modules/link/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/link/helper.d.ts +0 -20
- package/dist/basic-modules/src/modules/link/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/link/menu/EditLink.d.ts +0 -30
- package/dist/basic-modules/src/modules/link/menu/InsertLink.d.ts +0 -25
- package/dist/basic-modules/src/modules/link/menu/UnLink.d.ts +0 -15
- package/dist/basic-modules/src/modules/link/menu/ViewLink.d.ts +0 -16
- package/dist/basic-modules/src/modules/link/menu/config.d.ts +0 -18
- package/dist/basic-modules/src/modules/link/menu/index.d.ts +0 -33
- package/dist/basic-modules/src/modules/link/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/link/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/link/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/link/url.d.ts +0 -10
- package/dist/basic-modules/src/modules/paragraph/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/paragraph/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/paragraph/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/paragraph/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/paragraph/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/paragraph/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/text-style/custom-types.d.ts +0 -16
- package/dist/basic-modules/src/modules/text-style/helper.d.ts +0 -8
- package/dist/basic-modules/src/modules/text-style/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/text-style/menu/BaseMenu.d.ts +0 -27
- package/dist/basic-modules/src/modules/text-style/menu/BoldMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/ClearStyleMenu.d.ts +0 -20
- package/dist/basic-modules/src/modules/text-style/menu/CodeMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/EmphasisDotMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/text-style/menu/ItalicMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/SubMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/text-style/menu/SupMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/text-style/menu/ThroughMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/UnderlineMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/WavyUnderlineMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/text-style/menu/index.d.ts +0 -54
- package/dist/basic-modules/src/modules/text-style/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/text-style/render-style.d.ts +0 -14
- package/dist/basic-modules/src/modules/text-style/style-constants.d.ts +0 -35
- package/dist/basic-modules/src/modules/text-style/style-to-html.d.ts +0 -13
- package/dist/basic-modules/src/modules/todo/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/todo/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/todo/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/todo/menu/Todo.d.ts +0 -15
- package/dist/basic-modules/src/modules/todo/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/todo/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/todo/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/todo/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/todo/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/undo-redo/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/undo-redo/menu/RedoMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/undo-redo/menu/UndoMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/undo-redo/menu/index.d.ts +0 -14
- package/dist/basic-modules/src/utils/dom.d.ts +0 -36
- package/dist/basic-modules/src/utils/style-class.d.ts +0 -14
- package/dist/basic-modules/src/utils/util.d.ts +0 -11
- package/dist/basic-modules/src/utils/vdom.d.ts +0 -25
- package/dist/code-highlight/src/constants/svg.d.ts +0 -10
- package/dist/code-highlight/src/custom-types.d.ts +0 -17
- package/dist/code-highlight/src/decorate/index.d.ts +0 -7
- package/dist/code-highlight/src/index.d.ts +0 -9
- package/dist/code-highlight/src/locale/en.d.ts +0 -10
- package/dist/code-highlight/src/locale/index.d.ts +0 -5
- package/dist/code-highlight/src/locale/zh-CN.d.ts +0 -10
- package/dist/code-highlight/src/module/elem-to-html.d.ts +0 -11
- package/dist/code-highlight/src/module/index.d.ts +0 -7
- package/dist/code-highlight/src/module/menu/SelectLangMenu.d.ts +0 -24
- package/dist/code-highlight/src/module/menu/config.d.ts +0 -8
- package/dist/code-highlight/src/module/menu/index.d.ts +0 -15
- package/dist/code-highlight/src/module/parse-style-html.d.ts +0 -8
- package/dist/code-highlight/src/module/render-style.d.ts +0 -13
- package/dist/code-highlight/src/utils/dom.d.ts +0 -15
- package/dist/code-highlight/src/utils/vdom.d.ts +0 -11
- package/dist/code-highlight/src/vendor/prism.d.ts +0 -37
- package/dist/core/src/config/index.d.ts +0 -13
- package/dist/core/src/config/interface.d.ts +0 -317
- package/dist/core/src/config/register.d.ts +0 -12
- package/dist/core/src/config/style-mode.d.ts +0 -8
- package/dist/core/src/constants/index.d.ts +0 -1
- package/dist/core/src/constants/svg.d.ts +0 -12
- package/dist/core/src/create/bind-node-relation.d.ts +0 -15
- package/dist/core/src/create/create-editor.d.ts +0 -10
- package/dist/core/src/create/create-toolbar.d.ts +0 -14
- package/dist/core/src/create/helper.d.ts +0 -37
- package/dist/core/src/create/index.d.ts +0 -8
- package/dist/core/src/editor/dom-editor.d.ts +0 -154
- package/dist/core/src/editor/interface.d.ts +0 -90
- package/dist/core/src/editor/plugins/with-config.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-content.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-dom.d.ts +0 -10
- package/dist/core/src/editor/plugins/with-emitter.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-event-data.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-history.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-max-length.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-selection.d.ts +0 -7
- package/dist/core/src/i18n/index.d.ts +0 -32
- package/dist/core/src/index.d.ts +0 -45
- package/dist/core/src/menus/bar/HoverBar.d.ts +0 -48
- package/dist/core/src/menus/bar/Toolbar.d.ts +0 -38
- package/dist/core/src/menus/bar-item/BaseButton.d.ts +0 -26
- package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +0 -14
- package/dist/core/src/menus/bar-item/GroupButton.d.ts +0 -17
- package/dist/core/src/menus/bar-item/ModalButton.d.ts +0 -25
- package/dist/core/src/menus/bar-item/Select.d.ts +0 -22
- package/dist/core/src/menus/bar-item/SimpleButton.d.ts +0 -11
- package/dist/core/src/menus/bar-item/index.d.ts +0 -24
- package/dist/core/src/menus/bar-item/tooltip.d.ts +0 -6
- package/dist/core/src/menus/helpers/helpers.d.ts +0 -18
- package/dist/core/src/menus/helpers/position.d.ts +0 -36
- package/dist/core/src/menus/index.d.ts +0 -9
- package/dist/core/src/menus/interface.d.ts +0 -65
- package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +0 -26
- package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +0 -12
- package/dist/core/src/menus/panel-and-modal/Modal.d.ts +0 -44
- package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +0 -20
- package/dist/core/src/menus/register.d.ts +0 -15
- package/dist/core/src/parse-html/helper.d.ts +0 -10
- package/dist/core/src/parse-html/index.d.ts +0 -35
- package/dist/core/src/parse-html/parse-common-elem-html.d.ts +0 -15
- package/dist/core/src/parse-html/parse-elem-html.d.ts +0 -15
- package/dist/core/src/parse-html/parse-text-elem-html.d.ts +0 -16
- package/dist/core/src/render/element/getRenderElem.d.ts +0 -11
- package/dist/core/src/render/element/renderElement.d.ts +0 -9
- package/dist/core/src/render/element/renderStyle.d.ts +0 -15
- package/dist/core/src/render/helper.d.ts +0 -6
- package/dist/core/src/render/index.d.ts +0 -27
- package/dist/core/src/render/node2Vnode.d.ts +0 -15
- package/dist/core/src/render/text/genVnode.d.ts +0 -9
- package/dist/core/src/render/text/renderStyle.d.ts +0 -15
- package/dist/core/src/render/text/renderText.d.ts +0 -9
- package/dist/core/src/text-area/TextArea.d.ts +0 -52
- package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/blur.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/click.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/composition.d.ts +0 -27
- package/dist/core/src/text-area/event-handlers/copy.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/cut.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/drag.d.ts +0 -9
- package/dist/core/src/text-area/event-handlers/drop.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/focus.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/index.d.ts +0 -35
- package/dist/core/src/text-area/event-handlers/keydown.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/keypress.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/paste.d.ts +0 -8
- package/dist/core/src/text-area/helpers.d.ts +0 -30
- package/dist/core/src/text-area/place-holder.d.ts +0 -18
- package/dist/core/src/text-area/syncSelection.d.ts +0 -19
- package/dist/core/src/text-area/update-view.d.ts +0 -13
- package/dist/core/src/to-html/elem2html.d.ts +0 -9
- package/dist/core/src/to-html/index.d.ts +0 -44
- package/dist/core/src/to-html/node2html.d.ts +0 -12
- package/dist/core/src/to-html/text2html.d.ts +0 -9
- package/dist/core/src/upload/createUploader.d.ts +0 -14
- package/dist/core/src/upload/createUppyUploader.d.ts +0 -7
- package/dist/core/src/upload/index.d.ts +0 -9
- package/dist/core/src/upload/interface.d.ts +0 -72
- package/dist/core/src/upload.d.ts +0 -5
- package/dist/core/src/utils/dom.d.ts +0 -103
- package/dist/core/src/utils/hotkeys.d.ts +0 -35
- package/dist/core/src/utils/key.d.ts +0 -11
- package/dist/core/src/utils/line.d.ts +0 -14
- package/dist/core/src/utils/sanitize-html.d.ts +0 -5
- package/dist/core/src/utils/ua.d.ts +0 -14
- package/dist/core/src/utils/util.d.ts +0 -28
- package/dist/core/src/utils/vdom.d.ts +0 -34
- package/dist/core/src/utils/weak-maps.d.ts +0 -60
- package/dist/editor/src/Boot.d.ts +0 -31
- package/dist/editor/src/constants/svg.d.ts +0 -14
- package/dist/editor/src/core.d.ts +0 -54
- package/dist/editor/src/create.d.ts +0 -29
- package/dist/editor/src/index.d.ts +0 -27
- package/dist/editor/src/init-default-config/config/hoverbar.d.ts +0 -47
- package/dist/editor/src/init-default-config/config/index.d.ts +0 -67
- package/dist/editor/src/init-default-config/config/toolbar.d.ts +0 -16
- package/dist/editor/src/init-default-config/index.d.ts +0 -5
- package/dist/editor/src/locale/en.d.ts +0 -14
- package/dist/editor/src/locale/index.d.ts +0 -5
- package/dist/editor/src/locale/zh-CN.d.ts +0 -14
- package/dist/editor/src/register-builtin-modules/index.d.ts +0 -5
- package/dist/editor/src/register-builtin-modules/register.d.ts +0 -7
- package/dist/editor/src/upload.d.ts +0 -6
- package/dist/editor/src/utils/browser-polyfill.d.ts +0 -6
- package/dist/editor/src/utils/dom.d.ts +0 -6
- package/dist/editor/src/utils/node-polyfill.d.ts +0 -4
- package/dist/list-module/src/constants/svg.d.ts +0 -11
- package/dist/list-module/src/index.d.ts +0 -8
- package/dist/list-module/src/locale/en.d.ts +0 -15
- package/dist/list-module/src/locale/index.d.ts +0 -5
- package/dist/list-module/src/locale/zh-CN.d.ts +0 -15
- package/dist/list-module/src/module/custom-types.d.ts +0 -27
- package/dist/list-module/src/module/elem-to-html.d.ts +0 -16
- package/dist/list-module/src/module/helpers.d.ts +0 -26
- package/dist/list-module/src/module/html-transform.d.ts +0 -10
- package/dist/list-module/src/module/index.d.ts +0 -7
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +0 -20
- package/dist/list-module/src/module/menu/BulletedListMenu.d.ts +0 -11
- package/dist/list-module/src/module/menu/LowerAlphaListMenu.d.ts +0 -13
- package/dist/list-module/src/module/menu/NumberedListMenu.d.ts +0 -11
- package/dist/list-module/src/module/menu/index.d.ts +0 -19
- package/dist/list-module/src/module/outline-actions.d.ts +0 -9
- package/dist/list-module/src/module/parse-elem-html.d.ts +0 -18
- package/dist/list-module/src/module/plugin.d.ts +0 -7
- package/dist/list-module/src/module/render-elem.d.ts +0 -13
- package/dist/list-module/src/module/style-class.d.ts +0 -6
- package/dist/list-module/src/utils/dom.d.ts +0 -19
- package/dist/list-module/src/utils/maps.d.ts +0 -7
- package/dist/list-module/src/utils/util.d.ts +0 -6
- package/dist/table-module/src/constants/svg.d.ts +0 -26
- package/dist/table-module/src/index.d.ts +0 -8
- package/dist/table-module/src/locale/en.d.ts +0 -56
- package/dist/table-module/src/locale/index.d.ts +0 -5
- package/dist/table-module/src/locale/zh-CN.d.ts +0 -56
- package/dist/table-module/src/module/cell-selection.d.ts +0 -11
- package/dist/table-module/src/module/column-resize.d.ts +0 -20
- package/dist/table-module/src/module/custom-types.d.ts +0 -48
- package/dist/table-module/src/module/elem-to-html.d.ts +0 -22
- package/dist/table-module/src/module/helpers.d.ts +0 -37
- package/dist/table-module/src/module/index.d.ts +0 -7
- package/dist/table-module/src/module/menu/CellProperty.d.ts +0 -14
- package/dist/table-module/src/module/menu/DeleteCol.d.ts +0 -15
- package/dist/table-module/src/module/menu/DeleteRow.d.ts +0 -15
- package/dist/table-module/src/module/menu/DeleteTable.d.ts +0 -15
- package/dist/table-module/src/module/menu/FullWidth.d.ts +0 -15
- package/dist/table-module/src/module/menu/InsertCol.d.ts +0 -15
- package/dist/table-module/src/module/menu/InsertRow.d.ts +0 -15
- package/dist/table-module/src/module/menu/InsertTable.d.ts +0 -24
- package/dist/table-module/src/module/menu/MergeCell.d.ts +0 -24
- package/dist/table-module/src/module/menu/SplitCell.d.ts +0 -24
- package/dist/table-module/src/module/menu/TableHeader.d.ts +0 -15
- package/dist/table-module/src/module/menu/TableProperty.d.ts +0 -49
- package/dist/table-module/src/module/menu/index.d.ts +0 -77
- package/dist/table-module/src/module/parse-elem-html.d.ts +0 -24
- package/dist/table-module/src/module/parse-style-html.d.ts +0 -8
- package/dist/table-module/src/module/plugin.d.ts +0 -7
- package/dist/table-module/src/module/pre-parse-html.d.ts +0 -15
- package/dist/table-module/src/module/render-elem/index.d.ts +0 -19
- package/dist/table-module/src/module/render-elem/render-cell.d.ts +0 -9
- package/dist/table-module/src/module/render-elem/render-row.d.ts +0 -9
- package/dist/table-module/src/module/render-elem/render-table.d.ts +0 -9
- package/dist/table-module/src/module/render-elem/selection-overlay.d.ts +0 -21
- package/dist/table-module/src/module/render-style.d.ts +0 -9
- package/dist/table-module/src/module/row-resize.d.ts +0 -15
- package/dist/table-module/src/module/style-to-html.d.ts +0 -6
- package/dist/table-module/src/module/table-cursor.d.ts +0 -20
- package/dist/table-module/src/module/weak-maps.d.ts +0 -6
- package/dist/table-module/src/module/with-selection.d.ts +0 -2
- package/dist/table-module/src/utils/dom.d.ts +0 -31
- package/dist/table-module/src/utils/has-common.d.ts +0 -7
- package/dist/table-module/src/utils/index.d.ts +0 -5
- package/dist/table-module/src/utils/is-of-type.d.ts +0 -6
- package/dist/table-module/src/utils/matrices.d.ts +0 -9
- package/dist/table-module/src/utils/options.d.ts +0 -16
- package/dist/table-module/src/utils/point.d.ts +0 -7
- package/dist/table-module/src/utils/types.d.ts +0 -19
- package/dist/table-module/src/utils/vdom.d.ts +0 -11
- package/dist/upload-image-module/src/constants/svg.d.ts +0 -10
- package/dist/upload-image-module/src/index.d.ts +0 -8
- package/dist/upload-image-module/src/locale/en.d.ts +0 -11
- package/dist/upload-image-module/src/locale/index.d.ts +0 -5
- package/dist/upload-image-module/src/locale/zh-CN.d.ts +0 -11
- package/dist/upload-image-module/src/module/index.d.ts +0 -7
- package/dist/upload-image-module/src/module/menu/UploadImageMenu.d.ts +0 -16
- package/dist/upload-image-module/src/module/menu/config.d.ts +0 -6
- package/dist/upload-image-module/src/module/menu/index.d.ts +0 -10
- package/dist/upload-image-module/src/module/plugin.d.ts +0 -7
- package/dist/upload-image-module/src/module/upload-images.d.ts +0 -11
- package/dist/upload-image-module/src/utils/dom.d.ts +0 -7
- package/dist/video-module/src/constants/svg.d.ts +0 -15
- package/dist/video-module/src/index.d.ts +0 -8
- package/dist/video-module/src/locale/en.d.ts +0 -24
- package/dist/video-module/src/locale/index.d.ts +0 -5
- package/dist/video-module/src/locale/zh-CN.d.ts +0 -24
- package/dist/video-module/src/module/alignment.d.ts +0 -10
- package/dist/video-module/src/module/custom-types.d.ts +0 -24
- package/dist/video-module/src/module/elem-to-html.d.ts +0 -12
- package/dist/video-module/src/module/helper/insert-video.d.ts +0 -12
- package/dist/video-module/src/module/helper/upload-videos.d.ts +0 -6
- package/dist/video-module/src/module/index.d.ts +0 -7
- package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +0 -25
- package/dist/video-module/src/module/menu/EditVideoSrcMenu.d.ts +0 -26
- package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +0 -25
- package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +0 -16
- package/dist/video-module/src/module/menu/VideoAlignMenu.d.ts +0 -18
- package/dist/video-module/src/module/menu/config.d.ts +0 -25
- package/dist/video-module/src/module/menu/index.d.ts +0 -43
- package/dist/video-module/src/module/parse-elem-html.d.ts +0 -14
- package/dist/video-module/src/module/plugin.d.ts +0 -7
- package/dist/video-module/src/module/pre-parse-html.d.ts +0 -15
- package/dist/video-module/src/module/render-elem.d.ts +0 -13
- package/dist/video-module/src/utils/dom.d.ts +0 -29
- package/dist/video-module/src/utils/util.d.ts +0 -12
package/dist/core.mjs
CHANGED
|
@@ -1,13 +1,42 @@
|
|
|
1
|
-
var e=
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&&t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e),f;function p(){typeof globalThis>`u`&&(window.globalThis=window)}function m(){typeof AggregateError>`u`&&(window.AggregateError=function(e,t){let n=Error(t);return n.errors=e,n})}if(typeof global>`u`){if(`ActiveXObject`in window){let e=`抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器`;e+=`
|
|
2
|
+
Sorry, wangEditor V5+ versions do not support IE browser.`,console.error(e)}p(),m()}else global&&(f=global.navigator)!=null&&f.userAgent.match(`QQBrowser`)&&(p(),m());if(typeof global==`object`){let e=global.crypto&&typeof global.crypto.getRandomValues==`function`?e=>global.crypto.getRandomValues.call(global.crypto,e):e=>e,t=Object.getOwnPropertyDescriptor(global,`window`);(!global.window||t.set)&&(global.window=global,global.requestAnimationFrame=()=>{},global.navigator={userAgent:``},global.location={hostname:`0.0.0.0`,port:0,protocol:`http:`},global.btoa=()=>{},global.crypto={getRandomValues(t){return e(t)}}),global.document!=null&&global.document.getElementsByTagName==null&&(global.document.getElementsByTagName=()=>[])}var h=s(((e,t)=>{function n(e){return e<10?`0${e}`:e.toString()}function r(){let e=new Date;return`${n(e.getHours())}:${n(e.getMinutes())}:${n(e.getSeconds())}`}t.exports=r})),g=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.justErrorsLogger=e.debugLogger=void 0;let t=h();e.justErrorsLogger={debug:()=>{},warn:()=>{},error:function(){var e=[...arguments];return console.error(`[Uppy] [${t()}]`,...e)}},e.debugLogger={debug:function(){var e=[...arguments];return console.debug(`[Uppy] [${t()}]`,...e)},warn:function(){var e=[...arguments];return console.warn(`[Uppy] [${t()}]`,...e)},error:function(){var e=[...arguments];return console.error(`[Uppy] [${t()}]`,...e)}}}));function _(e){"@babel/helpers - typeof";return _=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_(e)}var v=o((()=>{}));function y(e,t){if(_(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var b=o((()=>{v()}));function x(e){var t=y(e,`string`);return _(t)==`symbol`?t:t+``}var S=o((()=>{v(),b()}));function C(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=o((()=>{S()}));function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var D=o((()=>{w()}));function O(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){O(a,r,i,o,s,`next`,e)}function s(e){O(a,r,i,o,s,`throw`,e)}o(void 0)})}}var A=o((()=>{})),j=s(((e,t)=>{t.exports={nanoid:(e=21)=>{let t=``,n=e|0;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r}}})),M=s(((e,t)=>{t.exports=function(e){if(typeof e!=`number`||isNaN(e))throw TypeError(`Expected a number, got `+typeof e);var t=e<0,n=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`];if(t&&(e=-e),e<1)return(t?`-`:``)+e+` B`;var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var i=n[r];return e>=10||e%1==0?(t?`-`:``)+e.toFixed(0)+` `+i:(t?`-`:``)+e.toFixed(1)+` `+i}})),N=s(((e,t)=>{function n(e,t){this.text=e=e||``,this.hasWild=~e.indexOf(`*`),this.separator=t,this.parts=e.split(t)}n.prototype.match=function(e){var t=!0,n=this.parts,r,i=n.length,a;if(typeof e==`string`||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||``).split(this.separator),r=0;t&&r<i;r++)if(n[r]===`*`)continue;else t=r<a.length?n[r]===a[r]:!1;t=t&&a}else if(typeof e.splice==`function`)for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e==`object`)for(var o in t={},e)this.match(o)&&(t[o]=e[o]);return t},t.exports=function(e,t,r){var i=new n(e,r||/[\/\.]/);return t===void 0?i:i.match(t)}})),P=s(((e,t)=>{var n=N(),r=/[\/\+\.]/;t.exports=function(e,t){function i(t){var i=n(t,e,r);return i&&i.length>=2}return t?i(t.split(`;`)[0]):i}})),ee=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultOptions=e.RestrictionError=e.Restricter=void 0;let t=M(),n=P();e.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};var r=class extends Error{constructor(){super(...arguments),this.isRestriction=!0}};e.RestrictionError=r,typeof AggregateError>`u`&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}}),e.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{let t=e();if(t.restrictions.allowedFileTypes!=null&&!Array.isArray(t.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(e,i){let{maxFileSize:a,minFileSize:o,maxTotalFileSize:s,maxNumberOfFiles:c,allowedFileTypes:l}=this.getOpts().restrictions;if(c&&i.filter(e=>!e.isGhost).length+1>c)throw new r(`${this.i18n(`youCanOnlyUploadX`,{smart_count:c})}`);if(l&&!l.some(t=>t.includes(`/`)?e.type?n(e.type.replace(/;.*?$/,``),t):!1:t[0]===`.`&&e.extension?e.extension.toLowerCase()===t.slice(1).toLowerCase():!1)){let e=l.join(`, `);throw new r(this.i18n(`youCanOnlyUploadFileTypes`,{types:e}))}if(s&&e.size!=null&&i.reduce((e,t)=>e+t.size,e.size)>s)throw new r(this.i18n(`exceedsSize`,{size:t(s),file:e.name}));if(a&&e.size!=null&&e.size>a)throw new r(this.i18n(`exceedsSize`,{size:t(a),file:e.name}));if(o&&e.size!=null&&e.size<o)throw new r(this.i18n(`inferiorSize`,{size:t(o)}))}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(Object.keys(e).length<t)throw new r(this.i18n(`youHaveToAtLeastSelectX`,{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new r(this.i18n(`missingRequiredMetaFieldOnFile`,{fileName:e.name})),{requiredMetaFields:n}=this.getOpts().restrictions,i=Object.prototype.hasOwnProperty,a=[];for(let t of n)(!i.call(e.meta,t)||e.meta[t]===``)&&a.push(t);return{missingFields:a,error:t}}}})),F=s(((e,t)=>{function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=n})),te=s(((e,t)=>{D();function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}let a=F();function o(e,t,n){let r=[];return e.forEach(e=>typeof e==`string`?t[Symbol.split](e).forEach((e,t,i)=>{e!==``&&r.push(e),t<i.length-1&&r.push(n)}):r.push(e)),r}
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/function i(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let i=t[e];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),r=o(r,new RegExp(`%\\{${e}\\}`,"g"),i)}return r}var s=n("apply");function a(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}return P=class{constructor(t){Object.defineProperty(this,s,{value:a}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,s)[s],this):e(this,s)[s](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!r(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return i(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return i(n,t)}},P}function ue(){return T||(T=1,j=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,s,a){var u=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),s=0,a=i.length;for(;s<a;s++){var u=i[s];if("*"===u&&(n=n.concat(t[u])),2===o.length&&o[0]===u){n=n.concat(t[u]);break}}return n}(e);u.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,u,[n,r,o,i,s,a])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,function r(){n.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e}),j}function le(){if(L)return R;L=1;var e="Expected a function",t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,s="object"==typeof d&&d&&d.Object===Object&&d,a="object"==typeof self&&self&&self.Object===Object&&self,u=s||a||Function("return this")(),l=Object.prototype.toString,c=Math.max,f=Math.min,h=function(){return u.Date.now()};function p(t,n,r){var o,i,s,a,u,l,d=0,p=!1,m=!1,y=!0;if("function"!=typeof t)throw new TypeError(e);function D(e){var n=o,r=i;return o=i=void 0,d=e,a=t.apply(r,n)}function C(e){var t=e-l;return void 0===l||t>=n||t<0||m&&e-d>=s}function b(){var e=h();if(C(e))return w(e);u=setTimeout(b,function(e){var t=n-(e-l);return m?f(t,s-(e-d)):t}(e))}function w(e){return u=void 0,y&&o?D(e):(o=i=void 0,a)}function E(){var e=h(),t=C(e);if(o=arguments,i=this,l=e,t){if(void 0===u)return function(e){return d=e,u=setTimeout(b,n),p?D(e):a}(l);if(m)return u=setTimeout(b,n),D(l)}return void 0===u&&(u=setTimeout(b,n)),a}return n=v(n)||0,g(r)&&(p=!!r.leading,s=(m="maxWait"in r)?c(v(r.maxWait)||0,n):s,y="trailing"in r?!!r.trailing:y),E.cancel=function(){void 0!==u&&clearTimeout(u),d=0,o=l=i=u=void 0},E.flush=function(){return void 0===u?a:w(h())},E}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(g(e)){var s="function"==typeof e.valueOf?e.valueOf():e;e=g(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var a=r.test(e);return a||o.test(e)?i(e.slice(2),a?2:8):n.test(e)?NaN:+e}return R=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(e);return g(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),p(t,n,{leading:o,maxWait:n,trailing:i})}}function ce(){if($)return M;$=1;var e=0;function t(t){return"__private_"+e+++"_"+t}var n=t("publish");class r{constructor(){Object.defineProperty(this,n,{value:o}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,n)[n](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach(e=>{e(...t)})}return r.VERSION="2.1.1",M=function(){return new r}}function de(){if(U)return I;return U=1,I=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}}function fe(){return H?z:(H=1,z={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"})}function he(){if(te)return ee;te=1;var e=w(),t=b(),n=ie();let r,o;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var s=0;function a(e){return"__private_"+s+++"_"+e}const u=ae(),l=ue(),c=le(),d=ce(),f=function(){if(W)return V;W=1;const e=de(),t=fe();return V=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),h=de(),p=function(){if(K)return q;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}return K=1,q=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(G||(G=1,J=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),J),v=Y?X:(Y=1,X=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=Q?Z:(Q=1,Z={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=a("plugins"),D=a("restricter"),C=a("storeUnsubscribe"),E=a("emitter"),B=a("preProcessors"),A=a("uploaders"),F=a("postProcessors"),x=a("informAndEmit"),O=a("checkRequiredMetaFieldsOnFile"),S=a("checkRequiredMetaFields"),_=a("assertNewUploadAllowed"),k=a("checkAndCreateFileStateObject"),P=a("startIfAutoProceed"),N=a("addListeners"),j=a("updateOnlineStatus"),T=a("createUpload"),R=a("getUpload"),L=a("removeUpload"),M=a("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class ${constructor(e){Object.defineProperty(this,M,{value:ge}),Object.defineProperty(this,L,{value:pe}),Object.defineProperty(this,R,{value:he}),Object.defineProperty(this,T,{value:se}),Object.defineProperty(this,N,{value:oe}),Object.defineProperty(this,P,{value:re}),Object.defineProperty(this,k,{value:ne}),Object.defineProperty(this,_,{value:H}),Object.defineProperty(this,S,{value:z}),Object.defineProperty(this,O,{value:U}),Object.defineProperty(this,x,{value:I}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,D,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:l()}),Object.defineProperty(this,B,{writable:!0,value:new Set}),Object.defineProperty(this,A,{writable:!0,value:new Set}),Object.defineProperty(this,F,{writable:!0,value:new Set}),Object.defineProperty(this,j,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,D)[D]=new n.Restricter(()=>this.opts,this.i18n),i(this,C)[C]=this.store.subscribe((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,N)[N]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(this,E)[E].emit(e,...n)}on(e,t){return i(this,E)[E].on(e,t),this}once(e,t){return i(this,E)[E].once(e,t),this}off(e,t){return i(this,E)[E].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach(r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o}),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,B)[B].add(e)}removePreProcessor(e){return i(this,B)[B].delete(e)}addPostProcessor(e){i(this,F)[F].add(e)}removePostProcessor(e){return i(this,F)[F].delete(e)}addUploader(e){i(this,A)[A].add(e)}removeUploader(e){return i(this,A)[A].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),i=r.filter(e=>!e.progress.uploadStarted),s=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),a=r.filter(e=>e.progress.uploadStarted),u=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),c=r.filter(e=>e.error),d=o.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:i,startedFiles:s,uploadStartedFiles:a,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:a.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,D)[D].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,_)[_](e);const{files:t}=this.getState();let n=i(this,k)[k](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,P)[P](),n.id}addFiles(e){i(this,_)[_]();const t={...this.getState().files},n=[],r=[];for(let o=0;o<e.length;o++)try{let r=i(this,k)[k](t,e[o]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[o].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&i(this,P)[P](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},s=Object.create(null);function a(e){return void 0===s[e]}e.forEach(e=>{n[e]&&(s[e]=n[e],delete o[e])}),Object.keys(i).forEach(e=>{const t=r[e].fileIDs.filter(a);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}});const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(s);l.forEach(e=>{this.emit("file-removed",s[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!0};e[t]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,T)[T](t,{forceAllowNewUpload:!0});return i(this,M)[M](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,T)[T]([e],{forceAllowNewUpload:!0});return i(this,M)[M](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(e=>null!=e.progress.bytesTotal),n=e.filter(e=>null==e.progress.bytesTotal);if(0===t.length){const t=100*e.length,r=n.reduce((e,t)=>e+t.progress.percentage,0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach(e=>{i+=e.progress.bytesUploaded}),n.forEach(e=>{i+=o*(e.progress.percentage||0)/100});let s=0===r?0:Math.round(i/r*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find(t=>t.id===e);if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex(t=>t.id===e.id);-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,C)[C](),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,j)[j]),window.removeEventListener("offline",i(this,j)[j]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,M)[M](e):(i(this,L)[L](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,T)[T](...arguments)}addResultData(e,t){if(!i(this,R)[R](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>i(this,D)[D].validateMinNumberOfFiles(t)).catch(e=>{throw i(this,x)[x](e),e}).then(()=>{if(!i(this,S)[S](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)});const o=i(this,T)[T](r);return i(this,M)[M](o)}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}function I(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function U(e){const{missingFields:t,error:n}=i(this,D)[D].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function z(e){let t=!0;for(const n of Object.values(e))i(this,O)[O](n)||(t=!1);return t}function H(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,x)[x](t,e),t}}function ne(e,t){const r=f(t),o=v(r,t),s=h(o).extension,a=Boolean(t.isRemote),u=p({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,x)[x](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:s||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:a,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map(t=>e[t]);i(this,D)[D].validate(d,t)}catch(e){throw i(this,x)[x](e,d),e}return d}function re(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function oe(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",(t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,x)[x](e)}else i(this,x)[x](n)}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,F)[F].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",e=>{e&&i(this,O)[O](e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,j)[j]),window.addEventListener("offline",i(this,j)[j]),setTimeout(i(this,j)[j],3e3))}function se(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const s=(0,e.nanoid)();return this.emit("upload",{id:s,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[s]:{fileIDs:t,step:0,result:{}}}}),s}function he(e){const{currentUploads:t}=this.getState();return t[e]}function pe(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function ge(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,B)[B],...i(this,A)[A],...i(this,F)[F]];try{for(let i=r;i<o.length&&n;i++){const r=o[i],s={...n,step:i};this.setState({currentUploads:{...t,[e]:s}}),await r(s.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw i(this,L)[L](e),t}if(n){n.fileIDs.forEach(e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});const r=n.fileIDs.map(e=>this.getFile(e)),o=r.filter(e=>!e.error),i=r.filter(e=>e.error);await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let s;return n&&(s=n.result,this.emit("complete",s),i(this,L)[L](e)),null==s&&this.log(`Not setting result for an upload that has been removed: ${e}`),s}return $.VERSION="2.3.4",ee=$}var pe,ge,ve,me,ye,De,Ce,be,we,Ee,Be,Ae,Fe,xe={},Oe=[],Se=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_e=Array.isArray;function ke(e,t){for(var n in t)e[n]=t[n];return e}function Pe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ne(e,t,n){var r,o,i,s={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?pe.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return je(e,s,r,o,null)}function je(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++ve:o,__i:-1,__u:0};return null==o&&null!=ge.vnode&&ge.vnode(i),i}function Te(e){return e.children}function Re(e,t){this.props=e,this.context=t}function Le(e,t){if(null==t)return e.__?Le(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Le(e):null}function Me(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Me(e)}}function $e(e){(!e.__d&&(e.__d=!0)&&ye.push(e)&&!Ie.__r++||De!=ge.debounceRendering)&&((De=ge.debounceRendering)||Ce)(Ie)}function Ie(){for(var e,t,n,r,o,i,s,a=1;ye.length;)ye.length>a&&ye.sort(be),e=ye.shift(),a=ye.length,e.__d&&(n=void 0,r=void 0,o=(r=(t=e).__v).__e,i=[],s=[],t.__P&&((n=ke({},r)).__v=r.__v+1,ge.vnode&&ge.vnode(n),Je(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?Le(r):o,!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,Xe(i,n,s),r.__e=r.__=null,n.__e!=o&&Me(n)));Ie.__r=0}function Ue(e,t,n,r,o,i,s,a,u,l,c){var d,f,h,p,g,v,m,y=r&&r.__k||Oe,D=t.length;for(u=ze(n,t,y,u,D),d=0;d<D;d++)null!=(h=n.__k[d])&&(f=-1==h.__i?xe:y[h.__i]||xe,h.__i=d,v=Je(e,h,f,o,i,s,a,u,l,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Qe(f.ref,null,h),c.push(h.ref,h.__c||p,h)),null==g&&null!=p&&(g=p),(m=!!(4&h.__u))||f.__k===h.__k?u=He(h,u,e,m):"function"==typeof h.type&&void 0!==v?u=v:p&&(u=p.nextSibling),h.__u&=-7);return n.__e=g,u}function ze(e,t,n,r,o){var i,s,a,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?(u=i+f,(s=e.__k[i]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?je(null,s,null,null,null):_e(s)?je(Te,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?je(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!=(l=s.__i=Ve(s,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(o>c?f--:o<c&&f++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,s.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(a=n[i])&&!(2&a.__u)&&(a.__e==r&&(r=Le(a)),et(a,a));return r}function He(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=He(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Le(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Ve(e,t,n,r){var o,i,s,a=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==e.key||c&&a==l.key&&u==l.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(l=t[s=o>=0?o--:i++])&&!(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function We(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Se.test(t)?n:n+"px"}function qe(e,t,n,r,o){var i,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||We(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||We(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(we,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Ee,e.addEventListener(t,i?Ae:Be,i)):e.removeEventListener(t,i?Ae:Be,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Ke(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=Ee++;else if(t.t<n.u)return;return n(ge.event?ge.event(t):t)}}}function Je(e,t,n,r,o,i,s,a,u,l){var c,d,f,h,p,g,v,m,y,D,C,b,w,E,B,A,F,x=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[a=t.__e=n.__e]),(c=ge.__b)&&c(t);e:if("function"==typeof x)try{if(m=t.props,y="prototype"in x&&x.prototype.render,D=(c=x.contextType)&&r[c.__c],C=c?D?D.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(y?t.__c=d=new x(m,C):(t.__c=d=new Re(m,C),d.constructor=x,d.render=tt),D&&D.sub(d),d.props=m,d.state||(d.state={}),d.context=C,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),y&&null==d.__s&&(d.__s=d.state),y&&null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ke({},d.__s)),ke(d.__s,x.getDerivedStateFromProps(m,d.__s))),h=d.props,p=d.state,d.__v=t,f)y&&null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),y&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,C)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,C),y&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,p,g)})}if(d.context=C,d.props=m,d.__P=e,d.__e=!1,w=ge.__r,E=0,y){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),B=0;B<d._sb.length;B++)d.__h.push(d._sb[B]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++E<25);d.state=d.__s,null!=d.getChildContext&&(r=ke(ke({},r),d.getChildContext())),y&&!f&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(h,p)),A=c,null!=c&&c.type===Te&&null==c.key&&(A=Ye(c.props.children)),a=Ue(e,_e(A)?A:[A],t,n,r,o,i,s,a,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=i)if(e.then){for(t.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else{for(F=i.length;F--;)Pe(i[F]);Ge(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ge(t);ge.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Ze(n.__e,t,n,r,o,i,s,u,l);return(c=ge.diffed)&&c(t),128&t.__u?void 0:a}function Ge(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Ge)}function Xe(e,t,n){for(var r=0;r<n.length;r++)Qe(n[r],n[++r],n[++r]);ge.__c&&ge.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){ge.__e(e,t.__v)}})}function Ye(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:_e(e)?e.map(Ye):ke({},e)}function Ze(e,t,n,r,o,i,s,a,u){var l,c,d,f,h,p,g,v=n.props,m=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((h=i[l])&&"setAttribute"in h==!!y&&(y?h.localName==y:3==h.nodeType)){e=h,i[l]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(o,y,m.is&&m),a&&(ge.__m&&ge.__m(t,i),a=!1),i=null}if(null==y)v===m||a&&e.data==m||(e.data=m);else{if(i=i&&pe.call(e.childNodes),v=n.props||xe,!a&&null!=i)for(v={},l=0;l<e.attributes.length;l++)v[(h=e.attributes[l]).name]=h.value;for(l in v)if(h=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=h;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;qe(e,l,null,h,o)}for(l in m)h=m[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?p=h:"checked"==l?g=h:a&&"function"!=typeof h||v[l]===h||qe(e,l,h,v[l],o);if(c)a||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Ue("template"==t.type?e.content:e,_e(f)?f:[f],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&Le(n,0),a,u),null!=i)for(l=i.length;l--;)Pe(i[l]);a||(l="value","progress"==y&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[l]||"progress"==y&&!p||"option"==y&&p!=v[l])&&qe(e,l,p,v[l],o),l="checked",null!=g&&g!=e[l]&&qe(e,l,g,v[l],o))}return e}function Qe(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ge.__e(e,n)}}function et(e,t,n){var r,o;if(ge.unmount&&ge.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Qe(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){ge.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&et(r[o],t,n||"function"!=typeof e.type);n||Pe(e.__e),e.__c=e.__=e.__e=void 0}function tt(e,t,n){return this.constructor(e,n)}function nt(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),ge.__&&ge.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],s=[],Je(t,e=(!r&&n||t).__k=Ne(Te,null,[e]),o||xe,xe,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?pe.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Xe(i,e,s)}pe=Oe.slice,ge={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},ve=0,me=function(e){return null!=e&&void 0===e.constructor},Re.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ke({},this.state),"function"==typeof e&&(e=e(ke({},n),this.props)),e&&ke(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$e(this))},Re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$e(this))},Re.prototype.render=Te,ye=[],Ce="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,be=function(e,t){return e.__v.__b-t.__v.__b},Ie.__r=0,we=/(PointerCapture)$|Capture$/i,Ee=0,Be=Ke(!1),Ae=Ke(!0),Fe=0;var rt,ot,it,st,at,ut,lt,ct,dt,ft,ht,pt=Object.freeze({__proto__:null,Component:Re,Fragment:Te,cloneElement:function(e,t,n){var r,o,i,s,a=ke({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=void 0===t[i]&&null!=s?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?pe.call(arguments,2):n),je(e.type,a,r||e.key,o||e.ref,null)},createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,$e(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Fe++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createElement:Ne,createRef:function(){return{current:null}},h:Ne,hydrate:function e(t,n){nt(t,n,e)},get isValidElement(){return me},get options(){return ge},render:nt,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(_e(t)?t.some(function(t){e(t,n)}):n.push(t)),n}}),gt=h(pt);function vt(){if(st)return it;st=1;const e=ot?rt:(ot=1,rt=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return it=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}function mt(){if(ct)return lt;ct=1;const e=ae();return lt=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function yt(){if(ft)return dt;ft=1;var e=gt;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function r(e){return"__private_"+n+++"_"+e}const o=vt(),i=ut?at:(ut=1,at=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),s=mt();var a=r("updateUI");class u extends s{constructor(){super(...arguments),Object.defineProperty(this,a,{writable:!0,value:void 0})}mount(n,r){const s=r.id,l=o(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,a)[a]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=o,t||(t=Promise.resolve().then(()=>(t=null,e(...n)))),t}}(t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())}),this.uppy.log(`Installing ${s} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||i(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof u)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins(t=>{t instanceof e&&(c=t)})}if(c)return this.uppy.log(`Installing ${s} to ${c.id}`),this.parent=c,this.el=c.addTarget(r),this.onMount(),this.el;this.uppy.log(`Not installing ${s}`);let d=`Invalid target option given to ${s}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(d)}update(e){var n,r;null!=this.el&&(null==(n=(r=t(this,a))[a])||n.call(r,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}return dt=u}ht||(ht=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=b();e.exports=he();const r=yt();t.UIPlugin=r;const o=mt();t.BasePlugin=o;const i=he();t.Uppy=i;const s=yt(),a=mt();i.Uppy=i,i.UIPlugin=s,i.BasePlugin=a,i.debugLogger=n.debugLogger}(D,D.exports));var Dt,Ct,bt,wt,Et,Bt,At,Ft,xt,Ot,St={};function _t(){if(Ct)return Dt;Ct=1;class e extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}return Dt=e}function kt(){if(Ot)return xt;let e;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Ot=1;var n=0;function r(e){return"__private_"+n+++"_"+e}const o=function(){if(wt)return bt;wt=1;const e=_t();return bt=function(){return fetch(...arguments).catch(t=>{throw"AbortError"===t.name?t:new e(t)})},bt}(),i=function(){if(Bt)return Et;Bt=1;const e=se();class t extends Error{constructor(t,n){void 0===n&&(n={}),super(t),this.cause=n.cause,this.cause&&e(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}return Et=t}(),s=function(){if(Ft)return At;Ft=1;class e extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}return At=e}();async function a(e){if(401===e.status)throw new s;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var u=r("companionHeaders"),l=r("getPostResponseFunc"),c=r("getUrl"),d=r("errorHandler");e=Symbol.for("uppy test: getCompanionHeaders");class f{constructor(e,n){Object.defineProperty(this,d,{value:p}),Object.defineProperty(this,c,{value:h}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,t(this,u)[u]=null==n?void 0:n.companionHeaders}setCompanionHeaders(e){t(this,u)[u]=e}[e](){return t(this,u)[u]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...f.defaultHeaders,...t(this,u)[u]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(t(this,c)[c](e),{method:"OPTIONS"}).then(e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map(e=>e.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then(e=>{let[t,n]=e;return Object.keys(n).forEach(e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])}),n})}get(e,n){return this.preflightAndHeaders(e).then(n=>o(t(this,c)[c](e),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"})).then(t(this,l)[l](n)).then(a).catch(t(this,d)[d]("get",e))}post(e,n,r){const i="post";return this.preflightAndHeaders(e).then(r=>o(t(this,c)[c](e),{method:i,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(n)})).then(t(this,l)[l](r)).then(a).catch(t(this,d)[d](i,e))}delete(e,n,r){const i="delete";return this.preflightAndHeaders(e).then(t=>o(`${this.hostname}/${e}`,{method:i,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null})).then(t(this,l)[l](r)).then(a).catch(t(this,d)[d](i,e))}}function h(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function p(e,n){return r=>{var o;return null!=(o=r)&&o.isAuthError||(r=new i(`Could not ${e} ${t(this,c)[c](n)}`,{cause:r})),Promise.reject(r)}}return f.VERSION="2.2.2",f.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${f.VERSION}`},xt=f}var Pt,Nt,jt,Tt,Rt,Lt,Mt,$t,It={};function Ut(){if(Pt)return It;return Pt=1,Object.defineProperty(It,"__esModule",{value:!0}),It.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},It.removeItem=function(e){return new Promise(t=>{localStorage.removeItem(e),t()})},It.setItem=function(e,t){return new Promise(n=>{localStorage.setItem(e,t),n()})},It}function zt(){if($t)return St;$t=1,Object.defineProperty(St,"__esModule",{value:!0}),St.Socket=St.SearchProvider=St.RequestClient=St.Provider=void 0;const e=kt();St.RequestClient=e;const t=function(){if(jt)return Nt;jt=1;var e=Ut();const t=kt();return Nt=class extends t{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}})}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(t,n,r){if(t.type="acquirer",t.files=[],r&&(t.opts={...r,...n}),n.serverUrl||n.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(n.companionAllowedHosts){const e=n.companionAllowedHosts;if(!("string"==typeof e||Array.isArray(e)||e instanceof RegExp))throw new TypeError(`${t.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);t.opts.companionAllowedHosts=e}else/^(?!https?:\/\/).*$/i.test(n.companionUrl)?t.opts.companionAllowedHosts=`https://${n.companionUrl.replace(/^\/\//,"")}`:t.opts.companionAllowedHosts=new URL(n.companionUrl).origin;t.storage=t.opts.storage||e}},Nt}();St.Provider=t;const n=function(){if(Rt)return Tt;Rt=1;const e=kt();return Tt=class extends e{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}},Tt}();St.SearchProvider=n;const r=function(){if(Mt)return Lt;let e,t;function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Mt=1;var r=0;function o(e){return"__private_"+r+++"_"+e}const i=ue();var s=o("queued"),a=o("emitter"),u=o("isOpen"),l=o("socket"),c=o("handleMessage");return e=Symbol.for("uppy test: getSocket"),t=Symbol.for("uppy test: getQueued"),Lt=class{constructor(e){Object.defineProperty(this,s,{writable:!0,value:[]}),Object.defineProperty(this,a,{writable:!0,value:i()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return n(this,u)[u]}[e](){return n(this,l)[l]}[t](){return n(this,s)[s]}open(){n(this,l)[l]=new WebSocket(this.opts.target),n(this,l)[l].onopen=()=>{for(n(this,u)[u]=!0;n(this,s)[s].length>0&&n(this,u)[u];){const e=n(this,s)[s].shift();this.send(e.action,e.payload)}},n(this,l)[l].onclose=()=>{n(this,u)[u]=!1},n(this,l)[l].onmessage=n(this,c)[c]}close(){var e;null==(e=n(this,l)[l])||e.close()}send(e,t){n(this,u)[u]?n(this,l)[l].send(JSON.stringify({action:e,payload:t})):n(this,s)[s].push({action:e,payload:t})}on(e,t){n(this,a)[a].on(e,t)}emit(e,t){n(this,a)[a].emit(e,t)}once(e,t){n(this,a)[a].once(e,t)}},Lt}();return St.Socket=r,St}var Ht,Vt,Wt,qt,Kt,Jt,Gt,Xt,Yt,Zt,Qt,en,tn,nn,rn,on,sn,an,un,ln={};function cn(){if(Ht)return ln;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Ht=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.internalRateLimitedQueue=ln.RateLimitedQueue=void 0;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("activeRequests"),o=n("queuedHandlers"),i=n("paused"),s=n("pauseTimer"),a=n("downLimit"),u=n("upperLimit"),l=n("rateLimitingTimer"),c=n("call"),d=n("queueNext"),f=n("next"),h=n("queue"),p=n("dequeue"),g=n("resume"),v=n("increaseLimit");function m(t){e(this,r)[r]+=1;let n,o=!1;try{n=t()}catch(t){throw e(this,r)[r]-=1,t}return{abort:()=>{o||(o=!0,e(this,r)[r]-=1,n(),e(this,d)[d]())},done:()=>{o||(o=!0,e(this,r)[r]-=1,e(this,d)[d]())}}}function y(){queueMicrotask(()=>e(this,f)[f]())}function D(){if(e(this,i)[i]||e(this,r)[r]>=this.limit)return;if(0===e(this,o)[o].length)return;const t=e(this,o)[o].shift(),n=e(this,c)[c](t.fn);t.abort=n.abort,t.done=n.done}function C(t,n){void 0===n&&(n={});const r={fn:t,priority:n.priority||0,abort:()=>{e(this,p)[p](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=e(this,o)[o].findIndex(e=>r.priority>e.priority);return-1===i?e(this,o)[o].push(r):e(this,o)[o].splice(i,0,r),r}function b(t){const n=e(this,o)[o].indexOf(t);-1!==n&&e(this,o)[o].splice(n,1)}ln.RateLimitedQueue=class{constructor(t){Object.defineProperty(this,p,{value:b}),Object.defineProperty(this,h,{value:C}),Object.defineProperty(this,f,{value:D}),Object.defineProperty(this,d,{value:y}),Object.defineProperty(this,c,{value:m}),Object.defineProperty(this,r,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,i,{writable:!0,value:!1}),Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(e(this,i)[i])e(this,l)[l]=setTimeout(e(this,v)[v],0);else{e(this,a)[a]=this.limit,this.limit=Math.ceil((e(this,u)[u]+e(this,a)[a])/2);for(let t=e(this,a)[a];t<=this.limit;t++)e(this,d)[d]();e(this,u)[u]-e(this,a)[a]>3?e(this,l)[l]=setTimeout(e(this,v)[v],2e3):e(this,a)[a]=Math.floor(e(this,a)[a]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,n){return!e(this,i)[i]&&e(this,r)[r]<this.limit?e(this,c)[c](t):e(this,h)[h](t,n)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];let s;const a=new Promise((r,i)=>{s=n.run(()=>{let t,n;try{n=Promise.resolve(e(...o))}catch(e){n=Promise.reject(e)}return n.then(e=>{t?i(t):(s.done(),r(e))},e=>{t?i(t):(s.done(),i(e))}),()=>{t=new Error("Cancelled")}},t)});return a.abort=()=>{s.abort()},a}}resume(){e(this,i)[i]=!1,clearTimeout(e(this,s)[s]);for(let t=0;t<this.limit;t++)e(this,d)[d]()}pause(t){void 0===t&&(t=null),e(this,i)[i]=!0,clearTimeout(e(this,s)[s]),null!=t&&(e(this,s)[s]=setTimeout(e(this,g)[g],t))}rateLimit(t){clearTimeout(e(this,l)[l]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(e(this,u)[u]=this.limit-1,this.limit=e(this,a)[a],e(this,l)[l]=setTimeout(e(this,v)[v],t))}get isPaused(){return e(this,i)[i]}};const w=Symbol("__queue");return ln.internalRateLimitedQueue=w,ln}function dn(){return rn?nn:(rn=1,nn={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}})}!function(){if(sn)return on;sn=1;var e=w(),t=zt(),n=cn();const r=mt(),o=function(){if(Wt)return Vt;Wt=1;const e=le();return Vt=e(function(e,t,n){const{progress:r,bytesUploaded:o,bytesTotal:i}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))},300,{leading:!0,trailing:!0})}(),i=Kt?qt:(Kt=1,qt=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}),s=Gt?Jt:(Gt=1,Jt=function(e){const t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map(e=>e.then(r,o))).then(()=>({successful:t,failed:n}))}),a=function(){if(Yt)return Xt;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Yt=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("emitter"),o=n("events");return Xt=class{constructor(t){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),e(this,r)[r]=t}on(t,n){return e(this,o)[o].push([t,n]),e(this,r)[r].on(t,n)}remove(){for(const[t,n]of e(this,o)[o].splice(0))e(this,r)[r].off(t,n)}}}(),u=function(){if(Qt)return Zt;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Qt=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("aliveTimer"),o=n("isDone"),i=n("onTimedOut"),s=n("timeout");return Zt=class{constructor(t,n){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:void 0}),e(this,s)[s]=t,e(this,i)[i]=n}progress(){e(this,o)[o]||e(this,s)[s]>0&&(clearTimeout(e(this,r)[r]),e(this,r)[r]=setTimeout(e(this,i)[i],e(this,s)[s]))}done(){e(this,o)[o]||(clearTimeout(e(this,r)[r]),e(this,r)[r]=null,e(this,o)[o]=!0)}}}(),l=_t(),c=tn?en:(tn=1,en=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}),d=dn();function f(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),c(e)?(n=new l(n,e),n):(n.request=e,n)}function h(e){return e.data.slice(0,e.data.size,e.meta.type)}class p extends r{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=d;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return c(t)&&(n=new l(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...r,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),n.internalRateLimitedQueue in this.opts?this.requests=this.opts[n.internalRateLimitedQueue]:this.requests=new n.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=h(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach(e=>{const t=this.getOptions(e),r=h(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)}),n}upload(t,n,r){const o=this.getOptions(t);return this.uppy.log(`uploading ${n} of ${r}`),new Promise((n,r)=>{this.uppy.emit("upload-started",t);const i=o.formData?this.createFormDataUpload(t,o):t.data,s=new XMLHttpRequest;let l;this.uploaderEvents[t.id]=new a(this.uppy);const c=new u(o.timeout,()=>{s.abort(),l.done();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-error",t,e),r(e)}),d=(0,e.nanoid)();s.upload.addEventListener("loadstart",()=>{this.uppy.log(`[XHRUpload] ${d} started`)}),s.upload.addEventListener("progress",e=>{this.uppy.log(`[XHRUpload] ${d} progress: ${e.loaded} / ${e.total}`),c.progress(),e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total})}),s.addEventListener("load",()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null),o.validateStatus(s.status,s.responseText,s)){const e=o.getResponseData(s.responseText,s),r=e[o.responseUrlFieldName],i={status:s.status,body:e,uploadURL:r};return this.uppy.emit("upload-success",t,i),r&&this.uppy.log(`Download ${t.name} from ${r}`),n(t)}const e=o.getResponseData(s.responseText,s),i=f(s,o.getResponseError(s.responseText,s)),a={status:s.status,body:e};return this.uppy.emit("upload-error",t,i,a),r(i)}),s.addEventListener("error",()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null);const e=f(s,o.getResponseError(s.responseText,s));return this.uppy.emit("upload-error",t,e),r(e)}),s.open(o.method.toUpperCase(),o.endpoint,!0),s.withCredentials=o.withCredentials,""!==o.responseType&&(s.responseType=o.responseType),l=this.requests.run(()=>{this.uppy.emit("upload-started",t);const e=this.getOptions(t);return Object.keys(e.headers).forEach(t=>{s.setRequestHeader(t,e.headers[t])}),s.send(i),()=>{c.done(),s.abort()}}),this.onFileRemove(t.id,()=>{l.abort(),r(new Error("File removed"))}),this.onCancelAll(t.id,e=>{let{reason:t}=e;"user"===t&&l.abort(),r(new Error("Upload cancelled"))})})}uploadRemote(e){const n=this.getOptions(e);return new Promise((r,s)=>{this.uppy.emit("upload-started",e);const u={};(Array.isArray(n.metaFields)?n.metaFields:Object.keys(e.meta)).forEach(t=>{u[t]=e.meta[t]});new(e.remote.providerOptions.provider?t.Provider:t.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:u,httpMethod:n.method,useFormData:n.formData,headers:n.headers}).then(u=>{const{token:l}=u,c=i(e.remote.companionUrl),d=new t.Socket({target:`${c}/api/${l}`,autoOpen:!1});let f;this.uploaderEvents[e.id]=new a(this.uppy),this.onFileRemove(e.id,()=>{d.send("cancel",{}),f.abort(),r(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,function(t){let{reason:n}=void 0===t?{}:t;"user"===n&&(d.send("cancel",{}),f.abort()),r(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),this.onRetryAll(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),d.on("progress",t=>o(this,t,e)),d.on("success",t=>{const o=n.getResponseData(t.response.responseText,t.response),i=o[n.responseUrlFieldName],s={status:t.response.status,body:o,uploadURL:i};return this.uppy.emit("upload-success",e,s),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()}),d.on("error",t=>{const r=t.response,o=r?n.getResponseError(r.responseText,r):Object.assign(new Error(t.error.message),{cause:t.error});this.uppy.emit("upload-error",e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),s(o)}),f=this.requests.run(()=>(d.open(),e.isPaused&&d.send("pause",{}),()=>d.close()))}).catch(t=>{this.uppy.emit("upload-error",e,t),s(t)})})}uploadBundle(e){return new Promise((t,n)=>{const{endpoint:r}=this.opts,{method:o}=this.opts,i=this.uppy.getState().xhrUpload,s=this.createBundledUpload(e,{...this.opts,...i||{}}),a=new XMLHttpRequest,l=t=>{e.forEach(e=>{this.uppy.emit("upload-error",e,t)})},c=new u(this.opts.timeout,()=>{a.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)});a.upload.addEventListener("loadstart",()=>{this.uppy.log("[XHRUpload] started uploading bundle"),c.progress()}),a.upload.addEventListener("progress",t=>{c.progress(),t.lengthComputable&&e.forEach(e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),a.addEventListener("load",r=>{if(c.done(),this.opts.validateStatus(r.target.status,a.responseText,a)){const n=this.opts.getResponseData(a.responseText,a),o={status:r.target.status,body:n};return e.forEach(e=>{this.uppy.emit("upload-success",e,o)}),t()}const o=this.opts.getResponseError(a.responseText,a)||new Error("Upload error");return o.request=a,l(o),n(o)}),a.addEventListener("error",()=>{c.done();const e=this.opts.getResponseError(a.responseText,a)||new Error("Upload error");return l(e),n(e)}),this.uppy.on("cancel-all",function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(c.done(),a.abort())}),a.open(o.toUpperCase(),r,!0),a.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(a.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(e=>{a.setRequestHeader(e,this.opts.headers[e])}),a.send(s),e.forEach(e=>{this.uppy.emit("upload-started",e)})})}uploadFiles(e){const t=e.map((t,n)=>{const r=parseInt(n,10)+1,o=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,o):this.upload(t,r,o)});return s(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",n=>{e===n.id&&t(n.id)})}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",n=>{e===n&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",function(){n.uppy.getFile(e)&&t(...arguments)})}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[n.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map(e=>this.uppy.getFile(e));if(this.opts.bundle){if(t.some(e=>e.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}p.VERSION="2.1.3",on=p}();var fn=function(){if(un)return an;un=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",r="[object GeneratorFunction]",o=/^(?:0|[1-9]\d*)$/;function i(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}var s,a,u=Object.prototype,l=u.hasOwnProperty,c=u.toString,d=u.propertyIsEnumerable,f=(s=Object.keys,a=Object,function(e){return s(a(e))});function h(e,n){var r=D(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&C(e)}(e)&&l.call(e,"callee")&&(!d.call(e,"callee")||c.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var s in e)!l.call(e,s)||i&&("length"==s||y(s,o))||r.push(s);return r}var p,g=(p=function(e,t){return e&&v(e,t,b)},function(e,t){if(null==e)return e;if(!C(e))return p(e,t);for(var n=e.length,r=-1,o=Object(e);++r<n&&!1!==t(o[r],r,o););return e}),v=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),s=i.length;s--;){var a=i[++r];if(!1===t(o[a],a,o))break}return e};function m(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||u,t!==r)return f(e);var t,n,r,o=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&o.push(i);return o}function y(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<n}var D=Array.isArray;function C(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?c.call(e):"";return t==n||t==r}(t)}function b(e){return C(e)?h(e):m(e)}function w(e){return e}return an=function(e,t){return(D(e)?i:g)(e,"function"==typeof t?t:w)}}(),hn=f(fn);function pn(e){Promise.resolve().then(e)}function gn(e){return e.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')}var vn=function(e){return Object.prototype.toString.call(e)},mn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=xn.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},yn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Fr.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Dn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=jn.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Cn=new WeakMap,bn=new WeakMap,wn=new WeakMap,En=new WeakMap,Bn=new WeakMap,An=new WeakMap,Fn=new WeakMap,xn={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=xn.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r],i=t[r];if("number"!=typeof o||"number"!=typeof i)throw new Error("Got non-numeric path index");if(o!==i)break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],s=t[n];return xn.equals(r,o)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return xn.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],s=t[n];return xn.equals(r,o)&&i<s},equals:(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===xn.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===xn.compare(e,t),isBefore:(e,t)=>-1===xn.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===xn.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===xn.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===xn.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===xn.compare(e,t),isPath:e=>Array.isArray(e)&&e.every(e=>"number"==typeof e),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&xn.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!xn.isAncestor(t,e)&&!xn.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(xn.equals(i,r)||xn.endsBefore(i,r)||xn.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:s}=t;if(xn.equals(s,r)||xn.isAncestor(s,r))return null;xn.endsBefore(s,r)&&(r[s.length-1]-=1);break;case"merge_node":var{path:a,position:u}=t;xn.equals(a,r)||xn.endsBefore(a,r)?r[a.length-1]-=1:xn.isAncestor(a,r)&&(r[a.length-1]-=1,r[a.length]+=u);break;case"split_node":var{path:l,position:c}=t;if(xn.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else xn.endsBefore(l,r)?r[l.length-1]+=1:xn.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:d,newPath:f}=t;if(xn.equals(d,f))return r;if(xn.isAncestor(d,r)||xn.equals(d,r)){var h=f.slice();return xn.endsBefore(d,f)&&d.length<f.length&&(h[d.length-1]-=1),h.concat(r.slice(d.length))}xn.isSibling(d,f)&&(xn.isAncestor(f,r)||xn.equals(f,r))?xn.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:xn.endsBefore(f,r)||xn.equals(f,r)||xn.isAncestor(f,r)?(xn.endsBefore(d,r)&&(r[d.length-1]-=1),r[f.length-1]+=1):xn.endsBefore(d,r)&&(xn.equals(f,r)&&(r[f.length-1]+=1),r[d.length-1]-=1)}return r}};function On(e){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(e)}function Sn(e){var t=function(e,t){if("object"!==On(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===On(t)?t:String(t)}function _n(e,t,n){return(t=Sn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kn(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Pn=["anchor","focus"];function Nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var jn={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return jn.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=jn.edges(e);return t},equals:(e,t)=>Fr.equals(e.anchor,t.anchor)&&Fr.equals(e.focus,t.focus),surrounds(e,t){var n=jn.intersection(e,t);return!!n&&jn.equals(n,t)},includes(e,t){if(Er.isRange(t)){if(jn.includes(e,t.anchor)||jn.includes(e,t.focus))return!0;var[n,r]=jn.edges(e),[o,i]=jn.edges(t);return Fr.isBefore(n,o)&&Fr.isAfter(r,i)}var[s,a]=jn.edges(e),u=!1,l=!1;return Er.isPoint(t)?(u=Fr.compare(t,s)>=0,l=Fr.compare(t,a)<=0):(u=xn.compare(t,s.path)>=0,l=xn.compare(t,a.path)<=0),u&&l},intersection(e,t){var{anchor:n,focus:r}=e,o=kn(e,Pn),[i,s]=jn.edges(e),[a,u]=jn.edges(t),l=Fr.isBefore(i,a)?a:i,c=Fr.isBefore(s,u)?s:u;return Fr.isBefore(c,l)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({anchor:l,focus:c},o)},isBackward(e){var{anchor:t,focus:n}=e;return Fr.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Fr.equals(t,n)},isExpanded:e=>!jn.isCollapsed(e),isForward:e=>!jn.isBackward(e),isRange:e=>qn(e)&&Fr.isPoint(e.anchor)&&Fr.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=jn.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var s=jn.isCollapsed(e);jn.isForward(e)?(r="forward",o=s?r:"backward"):(r="backward",o=s?r:"forward")}else"outward"===i?jn.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var a=Fr.transform(e.anchor,t,{affinity:r}),u=Fr.transform(e.focus,t,{affinity:o});return a&&u?{anchor:a,focus:u}:null}},Tn=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!qn(e)&&("function"!=typeof e.apply&&(t?Un.isNodeList(e.children):Array.isArray(e.children)))},Rn={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qn(e)&&Un.isNodeList(e.children,{deep:t})},isElement:Tn,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Rn.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Tn(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Ln=["text"],Mn=["children"];function $n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function In(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$n(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Un={ancestor(e,t){var n=Un.get(e,t);if(Un.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Or.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of xn.ancestors(t,n)){var o=[Un.ancestor(e,r),r];yield o}}()},child(e,t){if(Un.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Or.stringify(e)));if("number"!=typeof t)throw new Error("Expected index to be a number");var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Or.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Un.ancestor(e,t),{children:i}=o,s=r?i.length-1:0;r?s>=0:s<i.length;){var a=Un.child(o,s),u=t.concat(s);yield[a,u],s=r?s-1:s+1}}()},common(e,t,n){var r=xn.common(t,n);return[Un.get(e,r),r]},descendant(e,t){var n=Un.get(e,t);if(Un.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Or.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Un.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Un.nodes(e,t))Un.isElement(n)&&(yield[n,r])}()},extractProps(e){if(Un.isText(e)){var{text:t}=e;return kn(e,Ln)}var{children:n}=e;return kn(e,Mn)},first(e,t){for(var n=t.slice(),r=Un.get(e,n);r&&!Un.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,o]=jn.edges(t),i=Un.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!jn.includes(t,n)}}),s=function(){if(!jn.includes(t,a)){var e=a[a.length-1];Ir(n,xn.parent(a),t=>Mr(t,e,1))}xn.equals(a,o.path)&&Ur(n,a,e=>{var t=e.text.slice(0,o.offset);return In(In({},e),{},{text:t})}),xn.equals(a,r.path)&&Ur(n,a,e=>{var t=e.text.slice(r.offset);return In(In({},e),{},{text:t})})};for(var[,a]of i)s();return n.children},get(e,t){var n=Un.getIf(e,t);if(void 0===n)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Or.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(Un.isText(n)||!n.children[o])return;n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(Un.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isAncestor:e=>!Un.isText(e),isEditor:e=>"function"==typeof e.apply,isElement:e=>Array.isArray(e.children)&&"function"!=typeof e.apply,isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Nr.isText(e)||Rn.isElement(e,{deep:t})||wr.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Un.isNode(e,{deep:t}))},isText:e=>"string"==typeof e.text,last(e,t){for(var n=t.slice(),r=Un.get(e,n);r&&!Un.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Un.get(e,t);if(!Un.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Or.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of xn.levels(t,n)){var o=Un.get(e,r);yield[o,r]}}()},matches:(e,t)=>Un.isElement(e)&&Rn.isElementProps(t)&&Rn.matches(e,t)||Un.isText(e)&&Nr.isTextProps(t)&&Nr.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,s=new Set,a=[],u=e;!i||!(r?xn.isBefore(a,i):xn.isAfter(a,i));)if(s.has(u)||(yield[u,a]),s.has(u)||Un.isText(u)||0===u.children.length||null!=n&&!1!==n([u,a])){if(0===a.length)break;if(!r){var l=xn.next(a);if(Un.has(e,l)){a=l,u=Un.get(e,a);continue}}if(r&&0!==a[a.length-1])a=xn.previous(a),u=Un.get(e,a);else a=xn.parent(a),u=Un.get(e,a),s.add(u)}else{s.add(u);var c=r?u.children.length-1:0;xn.isAncestor(a,o)&&(c=o[a.length]),a=a.concat(c),u=Un.get(e,a)}}()},parent(e,t){var n=xn.parent(t),r=Un.get(e,n);if(Un.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>Un.isText(e)?e.text:e.children.map(Un.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Un.nodes(e,t))Un.isText(n)&&(yield[n,r])}()}};function zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vn,Wn={isNodeOperation:e=>Wn.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!qn(e))return!1;switch(e.type){case"insert_node":case"remove_node":return xn.isPath(e.path)&&Un.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&xn.isPath(e.path);case"merge_node":return"number"==typeof e.position&&xn.isPath(e.path)&&qn(e.properties);case"move_node":return xn.isPath(e.path)&&xn.isPath(e.newPath);case"set_node":return xn.isPath(e.path)&&qn(e.properties)&&qn(e.newProperties);case"set_selection":return null===e.properties&&jn.isRange(e.newProperties)||null===e.newProperties&&jn.isRange(e.properties)||qn(e.properties)&&qn(e.newProperties);case"split_node":return xn.isPath(e.path)&&"number"==typeof e.position&&qn(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>Wn.isOperation(e)),isSelectionOperation:e=>Wn.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Wn.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Hn(Hn({},e),{},{type:"remove_node"});case"insert_text":return Hn(Hn({},e),{},{type:"remove_text"});case"merge_node":return Hn(Hn({},e),{},{type:"split_node",path:xn.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(xn.equals(t,n))return e;if(xn.isSibling(n,t))return Hn(Hn({},e),{},{path:t,newPath:n});var r=xn.transform(n,e),o=xn.transform(xn.next(n),e);return Hn(Hn({},e),{},{path:r,newPath:o});case"remove_node":return Hn(Hn({},e),{},{type:"insert_node"});case"remove_text":return Hn(Hn({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:s}=e;return Hn(Hn({},e),{},{properties:s,newProperties:i});case"set_selection":var{properties:a,newProperties:u}=e;return Hn(Hn({},e),{},null==a?{properties:u,newProperties:null}:null==u?{properties:null,newProperties:a}:{properties:u,newProperties:a});case"split_node":return Hn(Hn({},e),{},{type:"merge_node",path:xn.next(e.path)})}}},qn=e=>"object"==typeof e&&null!==e,Kn=(e,t)=>{for(var n in e){var r=Object.hasOwn(e,n)?e[n]:void 0,o=Object.hasOwn(t,n)?t[n]:void 0;if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(qn(r)&&qn(o)){if(!Kn(r,o))return!1}else if(r!==o)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1;return!0},Jn=e=>e.selection?e.selection:e.children.length>0?wr.end(e,[]):[0],Gn=(e,t)=>{var[n]=wr.node(e,t);return e=>e===n},Xn=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?nr(e):e,o=Vn.None,i=Vn.None,s=0,a=null;for(var u of r){var l=u.codePointAt(0);if(!l)break;var c=pr(u,l);if([o,i]=n?[i,c]:[c,o],gr(o,Vn.ZWJ)&&gr(i,Vn.ExtPict)&&!Dr(n?e.substring(0,s):e.substring(0,e.length-s)))break;if(gr(o,Vn.RI)&&gr(i,Vn.RI)&&!(a=null!==a?!a:!!n||br(e.substring(0,e.length-s))))break;if(o!==Vn.None&&i!==Vn.None&&mr(o,i))break;s+=u.length}return s||1},Yn=/\s/,Zn=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Qn=/['\u2018\u2019]/,er=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},tr=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Yn.test(t))return!1;if(Qn.test(t)){var o=Xn(n,r),[i,s]=er(n,o,r);if(e(i,s,r))return!0}return!Zn.test(t)},nr=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(or(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(rr(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},rr=e=>e>=55296&&e<=56319,or=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Vn||(Vn={}));var ir=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,sr=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,ar=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,ur=/^[\u1100-\u115F\uA960-\uA97C]$/,lr=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,cr=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,dr=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,fr=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,hr=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,pr=(e,t)=>{var n=Vn.Any;return-1!==e.search(ir)&&(n|=Vn.Extend),8205===t&&(n|=Vn.ZWJ),t>=127462&&t<=127487&&(n|=Vn.RI),-1!==e.search(sr)&&(n|=Vn.Prepend),-1!==e.search(ar)&&(n|=Vn.SpacingMark),-1!==e.search(ur)&&(n|=Vn.L),-1!==e.search(lr)&&(n|=Vn.V),-1!==e.search(cr)&&(n|=Vn.T),-1!==e.search(dr)&&(n|=Vn.LV),-1!==e.search(fr)&&(n|=Vn.LVT),-1!==e.search(hr)&&(n|=Vn.ExtPict),n};function gr(e,t){return 0!==(e&t)}var vr=[[Vn.L,Vn.L|Vn.V|Vn.LV|Vn.LVT],[Vn.LV|Vn.V,Vn.V|Vn.T],[Vn.LVT|Vn.T,Vn.T],[Vn.Any,Vn.Extend|Vn.ZWJ],[Vn.Any,Vn.SpacingMark],[Vn.Prepend,Vn.Any],[Vn.ZWJ,Vn.ExtPict],[Vn.RI,Vn.RI]];function mr(e,t){return-1===vr.findIndex(n=>gr(e,n[0])&&gr(t,n[1]))}var yr=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Dr=e=>-1!==e.search(yr),Cr=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,br=e=>{var t=e.match(Cr);return null!==t&&t[0].length/2%2==1},wr={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!qn(e))return!1;var n="function"==typeof e.above&&"function"==typeof e.addMark&&"function"==typeof e.after&&"function"==typeof e.apply&&"function"==typeof e.before&&"function"==typeof e.collapse&&"function"==typeof e.delete&&"function"==typeof e.deleteBackward&&"function"==typeof e.deleteForward&&"function"==typeof e.deleteFragment&&"function"==typeof e.deselect&&"function"==typeof e.edges&&"function"==typeof e.elementReadOnly&&"function"==typeof e.end&&"function"==typeof e.first&&"function"==typeof e.fragment&&"function"==typeof e.getDirtyPaths&&"function"==typeof e.getFragment&&"function"==typeof e.getMarks&&"function"==typeof e.hasBlocks&&"function"==typeof e.hasInlines&&"function"==typeof e.hasPath&&"function"==typeof e.hasTexts&&"function"==typeof e.insertBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertNodes&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertText&&"function"==typeof e.isBlock&&"function"==typeof e.isEdge&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isEmpty&&"function"==typeof e.isEnd&&"function"==typeof e.isInline&&"function"==typeof e.isNormalizing&&"function"==typeof e.isSelectable&&"function"==typeof e.isStart&&"function"==typeof e.isVoid&&"function"==typeof e.last&&"function"==typeof e.leaf&&"function"==typeof e.levels&&"function"==typeof e.liftNodes&&"function"==typeof e.markableVoid&&"function"==typeof e.mergeNodes&&"function"==typeof e.move&&"function"==typeof e.moveNodes&&"function"==typeof e.next&&"function"==typeof e.node&&"function"==typeof e.nodes&&"function"==typeof e.normalize&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.parent&&"function"==typeof e.path&&"function"==typeof e.pathRef&&"function"==typeof e.pathRefs&&"function"==typeof e.point&&"function"==typeof e.pointRef&&"function"==typeof e.pointRefs&&"function"==typeof e.positions&&"function"==typeof e.previous&&"function"==typeof e.range&&"function"==typeof e.rangeRef&&"function"==typeof e.rangeRefs&&"function"==typeof e.removeMark&&"function"==typeof e.removeNodes&&"function"==typeof e.select&&"function"==typeof e.setNodes&&"function"==typeof e.setNormalizing&&"function"==typeof e.setPoint&&"function"==typeof e.setSelection&&"function"==typeof e.shouldMergeNodesRemovePrevNode&&"function"==typeof e.shouldNormalize&&"function"==typeof e.splitNodes&&"function"==typeof e.start&&"function"==typeof e.string&&"function"==typeof e.unhangRange&&"function"==typeof e.unsetNodes&&"function"==typeof e.unwrapNodes&&"function"==typeof e.void&&"function"==typeof e.withoutNormalizing&&"function"==typeof e.wrapNodes&&(null===e.marks||qn(e.marks))&&(null===e.selection||jn.isRange(e.selection))&&(t?Un.isNodeList(e.children)&&Wn.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations));return n},isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},Er={isLocation:e=>xn.isPath(e)||Fr.isPoint(e)||jn.isRange(e),isPath:e=>Array.isArray(e),isPoint:e=>"offset"in e,isRange:e=>"anchor"in e,isSpan:e=>Array.isArray(e)&&Array.isArray(e[0])};function Br(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Br(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Br(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fr={compare(e,t){var n=xn.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===Fr.compare(e,t),isBefore:(e,t)=>-1===Fr.compare(e,t),equals:(e,t)=>e.offset===t.offset&&xn.equals(e.path,t.path),isPoint:e=>qn(e)&&"number"==typeof e.offset&&xn.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=xn.transform(o,t,n);break;case"insert_text":xn.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(i+=t.text.length);break;case"merge_node":xn.equals(t.path,o)&&(i+=t.position),o=xn.transform(o,t,n);break;case"remove_text":xn.equals(t.path,o)&&t.offset<=i&&(i-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(xn.equals(t.path,o)||xn.isAncestor(t.path,o))return null;o=xn.transform(o,t,n);break;case"split_node":if(xn.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(i-=t.position,o=xn.transform(o,t,Ar(Ar({},n),{},{affinity:"forward"})))}else o=xn.transform(o,t,n);break;default:return e}return{path:o,offset:i}}},xr=void 0,Or={setScrubber(e){xr=e},stringify:e=>JSON.stringify(e,xr)},Sr=["text"],_r=["anchor","focus","merge"];function kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kr(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Nr={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){var{text:t}=e;return kn(e,Sr)}return Kn(r?o(e):e,r?o(t):t)},isText:e=>qn(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>Nr.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:Pr({},e)}];for(var r of t){var{anchor:o,focus:i,merge:s}=r,a=kn(r,_r),[u,l]=jn.edges(r),c=[],d=0,f=u.offset,h=l.offset,p=null!=s?s:Object.assign;for(var{leaf:g}of n){var{length:v}=g.text,m=d;if(d+=v,f<=m&&d<=h)p(g,a),c.push({leaf:g});else if(f!==h&&(f===d||h===m)||f>d||h<m||h===m&&0!==m)c.push({leaf:g});else{var y=g,D=void 0,C=void 0;if(h<d){var b=h-m;C={leaf:Pr(Pr({},y),{},{text:y.text.slice(b)})},y=Pr(Pr({},y),{},{text:y.text.slice(0,b)})}if(f>m){var w=f-m;D={leaf:Pr(Pr({},y),{},{text:y.text.slice(0,w)})},y=Pr(Pr({},y),{},{text:y.text.slice(w)})}p(y,a),D&&c.push(D),c.push({leaf:y}),C&&c.push(C)}}n=c}if(n.length>1){var E=0;for(var[B,A]of n.entries()){var F=E,x=F+A.leaf.text.length,O={start:F,end:x};0===B&&(O.isFirst=!0),B===n.length-1&&(O.isLast=!0),A.position=O,E=x}}return n}};function jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rr=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return[...e.slice(0,t),...r,...e.slice(t)]},Lr=function(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+n)]},Mr=Lr,$r=(e,t,n)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var r=Un.get(e,t),o=t.slice(),i=n(r);o.length>1;){var s=o.pop(),a=Un.get(e,o);i=Tr(Tr({},a),{},{children:Lr(a.children,s,1,i)})}var u=o.pop();e.children=Lr(e.children,u,1,i)},Ir=(e,t,n)=>{0===t.length?e.children=n(e.children):$r(e,t,e=>{if(Un.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(Or.stringify(e)));return Tr(Tr({},e),{},{children:n(e.children)})})},Ur=(e,t,n)=>$r(e,t,e=>{if(!Un.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Or.stringify(e)));return n(e)});function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zr(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vr=["children","text",...Object.getOwnPropertyNames(Object.prototype)],Wr=Object.getOwnPropertyNames(Object.prototype),qr={transform(e,t){var n=!1;switch(t.type){case"insert_node":var{path:r,node:o}=t;Ir(e,xn.parent(r),e=>{var t=r[r.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));return Rr(e,t,o)}),n=!0;break;case"insert_text":var{path:i,offset:s,text:a}=t;if(0===a.length)break;Ur(e,i,e=>{var t=e.text.slice(0,s),n=e.text.slice(s);return Hr(Hr({},e),{},{text:t+a+n})}),n=!0;break;case"merge_node":var{path:u}=t,l=u[u.length-1],c=xn.previous(u),d=c[c.length-1];if(0===u.length)throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] because the root node cannot be merged."));if("number"!=typeof l||"number"!=typeof d)throw new Error("Index must be number");Ir(e,xn.parent(u),e=>{var t,n=e[l],r=e[d];if(Un.isText(n)&&Un.isText(r))t=Hr(Hr({},r),{},{text:r.text+n.text});else{if(!Un.isElement(n)||!Un.isElement(r))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] to nodes of different interfaces: ").concat(Or.stringify(n)," ").concat(Or.stringify(r)));t=Hr(Hr({},r),{},{children:r.children.concat(n.children)})}return Lr(e,d,2,t)}),n=!0;break;case"move_node":var{path:f,newPath:h}=t,p=f[f.length-1];if(xn.isAncestor(f,h))throw new Error("Cannot move a path [".concat(f,"] to new path [").concat(h,"] because the destination is inside itself."));var g=Un.get(e,f);Ir(e,xn.parent(f),e=>Mr(e,p,1));var v=xn.transform(f,t),m=v[v.length-1];Ir(e,xn.parent(v),e=>Rr(e,m,g)),n=!0;break;case"remove_node":var{path:y}=t,D=y[y.length-1];if(Ir(e,xn.parent(y),e=>Mr(e,D,1)),e.selection){var C=Hr({},e.selection);for(var[b,w]of jn.points(C)){var E=Fr.transform(b,t);if(null!=C&&null!=E)C[w]=E;else{var B=void 0,A=void 0;for(var[F,x]of Un.texts(e)){if(-1!==xn.compare(x,y)){A=[F,x];break}B=[F,x]}var O=!1;B&&A&&(O=!xn.isSibling(B[1],y)&&(!!xn.equals(A[1],y)||xn.common(B[1],y).length<xn.common(A[1],y).length)),B&&!O?C[w]={path:B[1],offset:B[0].text.length}:A?C[w]={path:A[1],offset:0}:C=null}}C&&jn.equals(C,e.selection)||(e.selection=C)}break;case"remove_text":var{path:S,offset:_,text:k}=t;if(0===k.length)break;Ur(e,S,e=>{var t=e.text.slice(0,_),n=e.text.slice(_+k.length);return Hr(Hr({},e),{},{text:t+n})}),n=!0;break;case"set_node":var{path:P,properties:N,newProperties:j}=t;if(0===P.length)throw new Error("Cannot set properties on the root node!");$r(e,P,e=>{var t=Hr({},e);for(var n in j){if(Vr.includes(n))throw new Error('Cannot set the "'.concat(n,'" property of nodes!'));var r=j[n];if("then"===n&&"function"==typeof r)throw new Error('Cannot set the "then" property of a node to a function');null==r?delete t[n]:t[n]=r}for(var o in N)Object.hasOwn(j,o)||delete t[o];return t});break;case"set_selection":var{newProperties:T}=t;if(null==T){e.selection=null;break}if(null==e.selection){if(!T.anchor||!T.focus)throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Or.stringify(T)," when there is no current selection."));e.selection=Hr({},T);break}var R=Hr({},e.selection);for(var L in T){if(Wr.includes(L))throw new Error('Cannot set the "'.concat(L,'" property of the selection!'));var M=T[L];if("then"===L&&"function"==typeof M)throw new Error('Cannot set the "then" property of the selection to a function');if(null==M){if("anchor"===L||"focus"===L)throw new Error('Cannot remove the "'.concat(L,'" selection property'));delete R[L]}else R[L]=M}e.selection=R;break;case"split_node":var{path:$,position:I,properties:U}=t,z=$[$.length-1];if(0===$.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat($,"] because the root node cannot be split."));if("number"!=typeof z)throw new Error("Index must be number");Ir(e,xn.parent($),e=>{var t,n,r=e[z];if(Un.isText(r)){var o=r.text.slice(0,I),i=r.text.slice(I);t=Hr(Hr({},r),{},{text:o}),n={text:i}}else{var s=r.children.slice(0,I),a=r.children.slice(I);t=Hr(Hr({},r),{},{children:s}),n={children:a}}for(var u in U){if(Vr.includes(u))throw new Error('Cannot set the "'.concat(u,'" property of nodes!'));var l=U[u];if("then"===u&&"function"==typeof l)throw new Error('Cannot set the "then" property of a node to a function');null!=l&&(n[u]=l)}return Lr(e,z,1,t,n)}),n=!0}if(n&&e.selection){var H=Hr({},e.selection);for(var[V,W]of jn.points(H))H[W]=Fr.transform(V,t);jn.equals(H,e.selection)||(e.selection=H)}}},Kr={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},Jr={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Gr={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wr.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=Jn(e)}=n;if(Er.isPath(o)&&(o=wr.range(e,o)),Er.isRange(o))if(jn.isCollapsed(o))o=o.anchor;else{var i=jn.end(o);if(!r&&wr.void(e,{at:i}))return;var s=jn.start(o),a=wr.pointRef(e,s),u=wr.pointRef(e,i);Zr.delete(e,{at:o,voids:r});var l=a.unref(),c=u.unref();o=l||c,Zr.setSelection(e,{anchor:o,focus:o})}if(!(!r&&wr.void(e,{at:o})||wr.elementReadOnly(e,{at:o}))){var{path:d,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:f,text:t})}})}};function Xr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xr(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Zr=Yr(Yr(Yr(Yr({},qr),Kr),Jr),Gr),Qr=new WeakMap;function eo(e,t,n){var r,o,i=Cn.get(e)||[],s=bn.get(e)||new Set,a=e=>{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var u of(r=[],o=new Set,i)){a(n(u))}else r=i,o=s;for(var l of t)a(l);Cn.set(e,r),bn.set(e,o)}var to=(e,t)=>{for(var n of wr.pathRefs(e))mn.transform(n,t);for(var r of wr.pointRefs(e))yn.transform(r,t);for(var o of wr.rangeRefs(e))Dn.transform(o,t);if(!(e=>Qr.get(e)||!1)(e)){var i=xn.operationCanTransformPath(t)?e=>xn.transform(e,t):void 0;eo(e,e.getDirtyPaths(t),i)}Zr.transform(e,t),e.operations.push(t),wr.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),wn.get(e)||(wn.set(e,!0),Promise.resolve().then(()=>{wn.set(e,!1),e.onChange({operation:t}),e.operations=[]}))};function no(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ro(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?no(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oo(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function so(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ao(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?so(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):so(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function co(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?co(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):co(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var po=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ho(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({text:t},o);Zr.insertNodes(e,i,{at:n.at,voids:n.voids})}else Zr.insertText(e,t,n);e.marks=null}};var go=["text"],vo=["text"];var mo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>Cn.get(e)||[],i=e=>{var t=o(e).pop(),n=t.join(",");return(e=>bn.get(e)||new Set)(e).delete(n),t};if(wr.isNormalizing(e)){if(n){var s=Array.from(Un.nodes(e),e=>{var[,t]=e;return t}),a=new Set(s.map(e=>e.join(",")));Cn.set(e,s),bn.set(e,a)}0!==o(e).length&&wr.withoutNormalizing(e,()=>{for(var t of o(e))if(Un.has(e,t)){var s=wr.node(e,t),[a,u]=s;Un.isElement(a)&&0===a.children.length&&e.normalizeNode(s,{operation:r,force:n})}for(var l=o(e),c=l.length,d=0;0!==l.length;){if(!e.shouldNormalize({dirtyPaths:l,iteration:d,initialDirtyPathsLength:c,operation:r}))return;var f=i(e);if(Un.has(e,f)){var h=wr.node(e,f);e.normalizeNode(h,{operation:r,force:n})}d++,l=o(e)}})}};function yo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(n){var s=wr.range(e,n),[a,u]=jn.edges(s),l=o?u:a,c=!1,d="",f=0,h=0,p=0,g=[],v=function*(t){var n=g.some(e=>xn.isAncestor(e,t));function*s(e){n||(yield e)}if(Un.isElement(m)){if(!e.isSelectable(m)){if(g.push(t),o)return xn.hasPrevious(t)&&(yield*s(wr.end(e,xn.previous(t)))),0;var v=xn.next(t);return wr.hasPath(e,v)&&(yield*s(wr.start(e,v))),0}if(!i&&(e.isVoid(m)||e.isElementReadOnly(m)))return yield*s(wr.start(e,t)),0;if(e.isInline(m))return 0;if(wr.hasInlines(e,m)){var y=xn.isAncestor(t,u.path)?u:wr.end(e,t),C=xn.isAncestor(t,a.path)?a:wr.start(e,t);d=wr.string(e,{anchor:C,focus:y},{voids:i}),c=!0}}if(Un.isText(m)){var b=xn.equals(t,l.path);for(b?(h=o?l.offset:m.text.length-l.offset,p=l.offset):(h=m.text.length,p=o?h:0),(b||c||"offset"===r)&&(yield*s({path:t,offset:p}),c=!1);;){if(0===f){if(""===d)break;f=D(d,r,o),d=er(d,f,o)[1]}if(p=o?p-f:p+f,(h-=f)<0){f=-h;break}f=0,yield*s({path:t,offset:p})}}};for(var[m,y]of wr.nodes(e,{at:n,reverse:o,voids:i}))yield*v(y)}function D(e,t,n){return"character"===t?Xn(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=Xn(e,t),[i,s]=er(e,o,t);if(tr(i,s,t))r=!0,n+=o;else{if(r)break;n+=o}e=s}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Co=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!Un.isText(t))return!1;var[r,o]=wr.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=jn.isExpanded(n),i=!1;if(!o){var[s,a]=wr.node(e,n);if(s&&r(s,a)){var[u]=wr.parent(e,a);i=u&&e.markableVoid(u)}}if(o||i)Zr.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},wr.marks(e)||{});delete l[t],e.marks=l,wn.get(e)||e.onChange()}}};function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Eo(e,t,n){return("anchor"===e||"focus"===e)&&Fr.isPoint(t)&&Fr.isPoint(n)?!Fr.equals(t,n):t!==n}var Bo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wr.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:s=!0}=n,{at:a,match:u,select:l}=n;if(Un.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(a||(a=Jn(e),!1!==l&&(l=!0)),null==l&&(l=!1),Er.isRange(a))if(r||(a=wr.unhangRange(e,a,{voids:o})),jn.isCollapsed(a))a=a.anchor;else{var[,d]=jn.edges(a),f=wr.pointRef(e,d);Zr.delete(e,{at:a}),a=f.unref()}if(Er.isPoint(a)){null==u&&(u=Un.isText(c)?e=>Un.isText(e):e.isInline(c)?t=>Un.isText(t)||wr.isInline(e,t):t=>Un.isElement(t)&&wr.isBlock(e,t));var[h]=wr.nodes(e,{at:a.path,match:u,mode:i,voids:o});if(!h)return;var[,p]=h,g=wr.pathRef(e,p),v=wr.isEnd(e,a,p);Zr.splitNodes(e,{at:a,match:u,mode:i,voids:o});var m=g.unref();a=v?xn.next(m):m}var y=xn.parent(a),D=a[a.length-1];if(o||!wr.void(e,{at:y})){if(s){var C=[],b=xn.levels(y);((e,t,n)=>{var r=Qr.get(e)||!1;Qr.set(e,!0);try{t(),n()}finally{Qr.set(e,r)}})(e,()=>{var n=function(){var t=y.concat(D);D++;var n={type:"insert_node",path:t,node:r};e.apply(n),a=xn.next(a),C.push(n),Un.isText(r)?b.push(t):b.push(...Array.from(Un.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()},()=>{eo(e,b,e=>{var t=e;for(var n of C)if(xn.operationCanTransformPath(n)&&!(t=xn.transform(t,n)))return null;return t})})}else for(var w of t){var E=y.concat(D);D++,e.apply({type:"insert_node",path:E,node:w}),a=xn.next(a)}if(a=xn.previous(a),l){var B=wr.end(e,a);B&&Zr.select(e,B)}}}})},Ao=["text"],Fo=["children"],xo=(e,t)=>t!==e&&(Un.isText(t)||wr.isVoid(e,t)||1===t.children.length&&xo(e,t.children[0])),Oo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:s=0,always:a=!1}=t;if(i&&(null==o&&(o=t=>Un.isElement(t)&&wr.isBlock(e,t)),!Er.isRange(i)||(i=((e,t)=>{if(jn.isCollapsed(t))return t.anchor;var[,n]=jn.edges(t),r=wr.pointRef(e,n);return Zr.delete(e,{at:t}),r.unref()})(e,i),i))){if(Er.isPath(i)){var u=i,l=wr.point(e,u),[c]=wr.parent(e,u);o=e=>e===c,s=l.path.length-u.length+1,i=l,a=!0}var d,f=wr.pointRef(e,i,{affinity:"backward"});try{var[h]=wr.nodes(e,{at:i,match:o,mode:n,voids:r});if(!h)return;var p=wr.void(e,{at:i,mode:"highest"});if(!r&&p){var[g,v]=p;if(e.isInline(g)){var m=wr.after(e,v);if(!m){var y=xn.next(v);Zr.insertNodes(e,{text:""},{at:y,voids:r}),m=wr.point(e,y)}i=m,a=!0}s=i.path.length-v.length+1,a=!0}d=wr.pointRef(e,i);var D=i.path.length-s,[,C]=h,b=i.path.slice(0,D),w=0===s?i.offset:i.path[D]+0;for(var[E,B]of wr.levels(e,{at:b,reverse:!0,voids:r})){var A=!1;if(B.length<C.length||0===B.length||!r&&Un.isElement(E)&&wr.isVoid(e,E))break;var F=f.current,x=wr.isEnd(e,F,B);if(a||!f||!wr.isEdge(e,F,B)){A=!0;var O=Un.extractProps(E);e.apply({type:"split_node",path:B,position:w,properties:O})}w=B[B.length-1]+(A||x?1:0)}if(null==t.at){var S=d.current||wr.end(e,[]);Zr.select(e,S)}}finally{var _;f.unref(),null===(_=d)||void 0===_||_.unref()}}})};function So(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?So(Object(n),!0).forEach(function(t){_n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ko,Po=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return to(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var{selection:r}=e;if(r){var o=(t,n)=>{if(!Un.isText(t))return!1;var[r,o]=wr.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=jn.isExpanded(r),s=!1;if(!i){var[a,u]=wr.node(e,r);if(a&&o(a,u)){var[l]=wr.parent(e,u);s=l&&e.markableVoid(l)}}if(i||s)Zr.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=ro(ro({},wr.marks(e)||{}),{},{[t]:n});e.marks=c,wn.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&jn.isCollapsed(n)&&Zr.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&jn.isCollapsed(n)&&Zr.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&jn.isExpanded(n)&&Zr.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;return t?Un.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{Zr.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{Zr.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wr.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=Jn(e),batchDirty:s=!0}=n;if(t.length){if(Er.isRange(i))if(r||(i=wr.unhangRange(e,i,{voids:o})),jn.isCollapsed(i))i=i.anchor;else{var[,a]=jn.edges(i);if(!o&&wr.void(e,{at:a}))return;var u=wr.pointRef(e,a);Zr.delete(e,{at:i}),i=u.unref()}else Er.isPath(i)&&(i=wr.start(e,i));if(o||!wr.void(e,{at:i})){var l=wr.above(e,{at:i,match:t=>Un.isElement(t)&&wr.isInline(e,t),mode:"highest",voids:o});if(l){var[,c]=l;wr.isEnd(e,i,c)?i=wr.after(e,c):wr.isStart(e,i,c)&&(i=wr.before(e,c))}var d=wr.above(e,{match:t=>Un.isElement(t)&&wr.isBlock(e,t),at:i,voids:o}),[,f]=d,h=wr.isStart(e,i,f),p=wr.isEnd(e,i,f),g=h&&p,[,v]=Un.first({children:t},[]),[,m]=Un.last({children:t},[]),y=t=>{var[n,r]=t;return!(0===r.length||!g&&(!h&&xn.isAncestor(r,v)&&Un.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!p&&xn.isAncestor(r,m)&&Un.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))},D=!0,C=[],b=[],w=[];for(var E of Un.nodes({children:t},{pass:y})){var[B,A]=E;D&&Un.isElement(B)&&!e.isInline(B)&&!xn.isAncestor(A,v)&&(D=!1),y(E)&&(Un.isElement(B)&&!e.isInline(B)?(D=!1,b.push(B)):D?C.push(B):w.push(B))}var[F]=wr.nodes(e,{at:i,match:t=>Un.isText(t)||wr.isInline(e,t),mode:"highest",voids:o}),[,x]=F,O=wr.isStart(e,i,x),S=wr.isEnd(e,i,x),_=wr.pathRef(e,p&&!w.length?xn.next(f):f),k=wr.pathRef(e,S?xn.next(x):x),P=w.length>0;Zr.splitNodes(e,{at:i,match:t=>P?Un.isElement(t)&&wr.isBlock(e,t):Un.isText(t)||wr.isInline(e,t),mode:P?"lowest":"highest",always:P&&(!h||C.length>0)&&(!p||w.length>0),voids:o});var N,j=wr.pathRef(e,!O||O&&S?xn.next(x):x);if(Zr.insertNodes(e,C,{at:j.current,match:t=>Un.isText(t)||wr.isInline(e,t),mode:"highest",voids:o,batchDirty:s}),g&&!C.length&&b.length&&!w.length&&Zr.delete(e,{at:f,voids:o}),Zr.insertNodes(e,b,{at:_.current,match:t=>Un.isElement(t)&&wr.isBlock(e,t),mode:"lowest",voids:o,batchDirty:s}),Zr.insertNodes(e,w,{at:k.current,match:t=>Un.isText(t)||wr.isInline(e,t),mode:"highest",voids:o,batchDirty:s}),!n.at&&(w.length>0&&k.current?N=xn.previous(k.current):b.length>0&&_.current?N=xn.previous(_.current):j.current&&(N=xn.previous(j.current)),N)){var T=wr.end(e,N);Zr.select(e,T)}j.unref(),_.unref(),k.unref()}}})}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{Zr.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return po(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t;if(!Un.isText(r)){"children"in r||(r.children=[]);var i=r;if(i!==e&&0===i.children.length&&(Zr.insertNodes(e,{text:""},{at:o.concat(0),voids:!0}),i=Un.get(e,o)),i!==e&&(e.isInline(i)||Un.isText(i.children[0])||e.isInline(i.children[0])))for(var s=0;s<i.children.length;s++){var a=i.children[s],u=i.children[s-1];Un.isText(a)?null!=u&&Un.isText(u)&&(""===a.text?(Zr.removeNodes(e,{at:o.concat(s),voids:!0}),i=Un.get(e,o),s--):""===u.text?(Zr.removeNodes(e,{at:o.concat(s-1),voids:!0}),i=Un.get(e,o),s--):Nr.equals(a,u,{loose:!0})&&(Zr.mergeNodes(e,{at:o.concat(s),voids:!0}),i=Un.get(e,o),s--)):e.isInline(a)?(null!=u&&Un.isText(u)||(Zr.insertNodes(e,{text:""},{at:o.concat(s),voids:!0}),i=Un.get(e,o),s++),s===i.children.length-1&&(Zr.insertNodes(e,{text:""},{at:o.concat(s+1),voids:!0}),i=Un.get(e,o),s++)):(Zr.unwrapNodes(e,{at:o.concat(s),voids:!0}),i=Un.get(e,o),s--)}else for(var l=0;l<i.children.length;l++){var c=i.children[l];(Un.isText(c)||e.isInline(c))&&(null!=n&&n.fallbackElement?Zr.wrapNodes(e,n.fallbackElement(),{at:o.concat(l),voids:!0}):Zr.removeNodes(e,{at:o.concat(l),voids:!0}),i=Un.get(e,o),l--)}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Co(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return xn.levels(n);case"insert_node":var{node:r,path:o}=t,i=xn.levels(o),s=Un.isText(r)?[]:Array.from(Un.nodes(r),e=>{var[,t]=e;return o.concat(t)});return[...i,...s];case"merge_node":var{path:a}=t;return[...xn.ancestors(a),xn.previous(a)];case"move_node":var{path:u,newPath:l}=t;if(xn.equals(u,l))return[];var c=[],d=[];for(var f of xn.ancestors(u)){var h=xn.transform(f,t);c.push(h)}for(var p of xn.ancestors(l)){var g=xn.transform(p,t);d.push(g)}var v=d[d.length-1],m=l[l.length-1],y=v.concat(m);return[...c,...d,y];case"remove_node":var{path:D}=t;return[...xn.ancestors(D)];case"split_node":var{path:C}=t;return[...xn.levels(C),xn.next(C)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var s=wr.path(e,o);if(!Er.isRange(o)||xn.equals(o.focus.path,o.anchor.path)){if(0===s.length)return;s=xn.parent(s)}var a="lowest"===r,[u]=wr.levels(e,{at:s,voids:n,match:i,reverse:a});return u}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:wr.point(e,t,{edge:"end"}),focus:wr.end(e,[])},{distance:i=1}=r,s=0;for(var a of wr.positions(e,io(io({},r),{},{at:o}))){if(s>i)break;0!==s&&(n=a),s++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:wr.start(e,[]),focus:wr.point(e,t,{edge:"start"})},{distance:i=1}=r,s=0;for(var a of wr.positions(e,ao(ao({},r),{},{at:o,reverse:!0}))){if(s>i)break;0!==s&&(n=a),s++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)Zr.select(e,r.anchor);else if("focus"===n)Zr.select(e,r.focus);else if("start"===n){var[o]=jn.edges(r);Zr.select(e,o)}else if("end"===n){var[,i]=jn.edges(r);Zr.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr.withoutNormalizing(e,()=>{var n,r,{reverse:o=!1,unit:i="character",distance:s=1,voids:a=!1}=t,{at:u=e.selection,hanging:l=!1}=t;if(u){var c=!1;if(Er.isRange(u)&&jn.isCollapsed(u)&&(c=!0,u=u.anchor),Er.isPoint(u)){var d=wr.void(e,{at:u,mode:"highest"});if(!a&&d){var[,f]=d;u=f}else{var h={unit:i,distance:s};u={anchor:u,focus:o?wr.before(e,u,h)||wr.start(e,[]):wr.after(e,u,h)||wr.end(e,[])},l=!0}}if(Er.isPath(u))Zr.removeNodes(e,{at:u,voids:a});else if(!jn.isCollapsed(u)){if(!l){var[,p]=jn.edges(u),g=wr.end(e,[]);Fr.equals(p,g)||(u=wr.unhangRange(e,u,{voids:a}))}var[v,m]=jn.edges(u),y=wr.above(e,{match:t=>Un.isElement(t)&&wr.isBlock(e,t),at:v,voids:a}),D=wr.above(e,{match:t=>Un.isElement(t)&&wr.isBlock(e,t),at:m,voids:a}),C=y&&D&&!xn.equals(y[1],D[1]),b=xn.equals(v.path,m.path),w=a?null:null!==(n=wr.void(e,{at:v,mode:"highest"}))&&void 0!==n?n:wr.elementReadOnly(e,{at:v,mode:"highest"}),E=a?null:null!==(r=wr.void(e,{at:m,mode:"highest"}))&&void 0!==r?r:wr.elementReadOnly(e,{at:m,mode:"highest"});if(w){var B=wr.before(e,v);B&&y&&xn.isAncestor(y[1],B.path)&&(v=B)}if(E){var A=wr.after(e,m);A&&D&&xn.isAncestor(D[1],A.path)&&(m=A)}var F,x=[];for(var O of wr.nodes(e,{at:u,voids:a})){var[S,_]=O;F&&0===xn.compare(_,F)||(!a&&Un.isElement(S)&&(wr.isVoid(e,S)||wr.isElementReadOnly(e,S))||!xn.isCommon(_,v.path)&&!xn.isCommon(_,m.path))&&(x.push(O),F=_)}var k=Array.from(x,t=>{var[,n]=t;return wr.pathRef(e,n)}),P=wr.pointRef(e,v),N=wr.pointRef(e,m),j="";if(!b&&!w){var T=P.current,[R]=wr.leaf(e,T),{path:L}=T,{offset:M}=v,$=R.text.slice(M);$.length>0&&(e.apply({type:"remove_text",path:L,offset:M,text:$}),j=$)}if(k.reverse().map(e=>e.unref()).filter(e=>null!==e).forEach(t=>Zr.removeNodes(e,{at:t,voids:a})),!E){var I=N.current,[U]=wr.leaf(e,I),{path:z}=I,H=b?v.offset:0,V=U.text.slice(H,m.offset);V.length>0&&(e.apply({type:"remove_text",path:z,offset:H,text:V}),j=V)}!b&&C&&N.current&&P.current&&Zr.mergeNodes(e,{at:N.current,hanging:!0,voids:a}),c&&o&&"character"===i&&j.length>1&&j.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&Zr.insertText(e,j.slice(0,j.length-s));var W=P.unref(),q=N.unref(),K=o?W||q:q||W;null==t.at&&K&&Zr.select(e,K)}}})}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>[wr.start(e,t),wr.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wr.above(e,lo(lo({},t),{},{match:t=>Un.isElement(t)&&wr.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>wr.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=wr.path(e,t,{edge:"start"});return wr.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=wr.range(e,t);return Un.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:o}=n;if(t)return t;if(jn.isExpanded(n)){if(jn.isBackward(n)&&([o,r]=[r,o]),wr.isEnd(e,r,r.path)){var i=wr.after(e,r);i&&(r=i)}var[s]=wr.nodes(e,{match:Un.isText,at:{anchor:r,focus:o}});if(s){var[a]=s,{text:u}=a;return kn(a,go)}return{}}var{path:l}=r,[c]=wr.leaf(e,l);if(0===r.offset){var d=wr.previous(e,{at:l,match:Un.isText}),f=wr.above(e,{match:t=>Un.isElement(t)&&wr.isVoid(e,t)&&e.markableVoid(t)});if(!f){var h=wr.above(e,{match:t=>Un.isElement(t)&&wr.isBlock(e,t)});if(d&&h){var[p,g]=d,[,v]=h;xn.isAncestor(v,g)&&(c=p)}}}var{text:m}=c;return kn(c,vo)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Un.isElement(t)&&wr.isBlock(e,t)))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Un.isText(t)||wr.isInline(e,t)))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Un.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.every(e=>Un.isText(e)))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Bo(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>wr.isStart(e,t,n)||wr.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&Un.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var r=wr.end(e,n);return Fr.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=En.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{if(0!==t.offset)return!1;var r=wr.start(e,n);return Fr.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=wr.path(e,t,{edge:"end"});return wr.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=wr.path(e,t,n);return[Un.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var s=[],a=wr.path(e,n);for(var[u,l]of Un.levels(e,a))if(i(u,l)&&(s.push([u,l]),!o&&Un.isElement(u)&&wr.isVoid(e,u)))break;r&&s.reverse(),yield*s}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(n){null==i&&(i=Er.isPath(n)?Gn(e,n):t=>Un.isElement(t)&&wr.isBlock(e,t));var s=wr.nodes(e,{at:n,match:i,mode:r,voids:o}),a=Array.from(s,t=>{var[,n]=t;return wr.pathRef(e,n)});for(var u of a){var l=u.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=wr.node(e,xn.parent(l)),[d,f]=c,h=l[l.length-1],{length:p}=d.children;if(1===p){var g=xn.next(f);Zr.moveNodes(e,{at:l,to:g,voids:o}),Zr.removeNodes(e,{at:f,voids:o})}else if(0===h)Zr.moveNodes(e,{at:l,to:f,voids:o});else if(h===p-1){var v=xn.next(f);Zr.moveNodes(e,{at:l,to:v,voids:o})}else{var m=xn.next(l),y=xn.next(f);Zr.splitNodes(e,{at:m,voids:o}),Zr.moveNodes(e,{at:l,to:y,voids:o})}}}})}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:s="lowest"}=t;if(r){var a=Er.isPath(r),u=a?r:null,l=null==n&&a;if(null==n)if(a){var[c]=wr.parent(e,r);n=e=>c.children.includes(e)}else n=t=>Un.isElement(t)&&wr.isBlock(e,t);if(!o&&Er.isRange(r)&&(r=wr.unhangRange(e,r,{voids:i})),Er.isRange(r))if(jn.isCollapsed(r))r=r.anchor;else{var[,d]=jn.edges(r),f=wr.pointRef(e,d);Zr.delete(e,{at:r}),r=f.unref(),null==t.at&&Zr.select(e,r)}var[h]=wr.nodes(e,{at:r,match:n,voids:i,mode:s}),p=l&&u&&xn.hasPrevious(u)?xn.previous(u):null,g=p?wr.node(e,p):wr.previous(e,{at:r,match:n,voids:i,mode:s});if(h&&g){var[v,m]=h,[y,D]=g;if(0!==m.length&&0!==D.length){var C,b,w=xn.next(D),E=xn.common(m,D),B=xn.isSibling(m,D),A=Array.from(wr.levels(e,{at:m}),e=>{var[t]=e;return t}).slice(E.length).slice(0,-1),F=wr.above(e,{at:m,mode:"highest",match:t=>A.includes(t)&&xo(e,t)}),x=F&&wr.pathRef(e,F[1]);if(Un.isText(v)&&Un.isText(y)){var{text:O}=v,S=kn(v,Ao);b=y.text.length,C=S}else{if(!Un.isElement(v)||!Un.isElement(y))throw new Error("Cannot merge the node at path [".concat(m,"] with the previous sibling because it is not the same kind: ").concat(Or.stringify(v)," ").concat(Or.stringify(y)));var{children:_}=v;S=kn(v,Fo),b=y.children.length,C=S}B||Zr.moveNodes(e,{at:m,to:w,voids:i}),x&&Zr.removeNodes(e,{at:x.current,voids:i}),wr.shouldMergeNodesRemovePrevNode(e,g,h)?Zr.removeNodes(e,{at:D,voids:i}):e.apply({type:"merge_node",path:w,position:b,properties:C}),x&&x.unref()}}}})}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:s=null}=t;if(n){"start"===s&&(s=jn.isBackward(n)?"focus":"anchor"),"end"===s&&(s=jn.isBackward(n)?"anchor":"focus");var{anchor:a,focus:u}=n,l={distance:r,unit:o},c={};if(null==s||"anchor"===s){var d=i?wr.before(e,a,l):wr.after(e,a,l);d&&(c.anchor=d)}if(null==s||"focus"===s){var f=i?wr.before(e,u,l):wr.after(e,u,l);f&&(c.focus=f)}Zr.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{wr.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:s}=t;if(r){null==s&&(s=Er.isPath(r)?Gn(e,r):t=>Un.isElement(t)&&wr.isBlock(e,t));var a=wr.pathRef(e,n),u=wr.nodes(e,{at:r,match:s,mode:o,voids:i}),l=Array.from(u,t=>{var[,n]=t;return wr.pathRef(e,n)});for(var c of l){var d=c.unref(),f=a.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:f}),a.current&&xn.isSibling(f,d)&&xn.isAfter(f,d)&&(a.current=xn.next(a.current))}a.unref()}})})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var s=wr.after(e,i,{voids:r});if(s){var[,a]=wr.last(e,[]),u=[s.path,a];if(Er.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(Er.isPath(i)){var[l]=wr.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=wr.nodes(e,{at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=wr.path(e,t,n),o=Un.get(e,r);return[o,r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:s=!1,pass:a}=t,{match:u}=t;if(u||(u=()=>!0),n){var l,c;if(Er.isSpan(n))l=n[0],c=n[1];else{var d=wr.path(e,n,{edge:"start"}),f=wr.path(e,n,{edge:"end"});l=i?f:d,c=i?d:f}var h,p=Un.nodes(e,{reverse:i,from:l,to:c,pass:t=>{var[n,r]=t;return!(!a||!a([n,r]))||!!Un.isElement(n)&&!(s||!wr.isVoid(e,n)&&!wr.isElementReadOnly(e,n))}}),g=[];for(var[v,m]of p){var y=h&&0===xn.compare(m,h[1]);if("highest"!==r||!y)if(u(v,m))if("lowest"===r&&y)h=[v,m];else{var D="lowest"===r?h:[v,m];D&&(o?g.push(D):yield D),h=[v,m]}else if(o&&!y&&Un.isText(v))return}"lowest"===r&&h&&(o?g.push(h):yield h),o&&(yield*g)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return mo(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=wr.path(e,t,n),o=xn.parent(r);return wr.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(Er.isPath(t))if("start"===o){var[,i]=Un.first(e,t);t=i}else if("end"===o){var[,s]=Un.last(e,t);t=s}return Er.isRange(t)&&(t="start"===o?jn.start(t):"end"===o?jn.end(t):xn.common(t.anchor.path,t.focus.path)),Er.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return wr.pathRefs(e).delete(o),o.current=null,t}};return wr.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Bn.get(e);return t||(t=new Set,Bn.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(Er.isPath(t)){var o;if("end"===r){var[,i]=Un.last(e,t);o=i}else{var[,s]=Un.first(e,t);o=s}var a=Un.get(e,o);if(!Un.isText(a))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?a.text.length:0}}if(Er.isRange(t)){var[u,l]=jn.edges(t);return"start"===r?u:l}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return wr.pointRefs(e).delete(o),o.current=null,t}};return wr.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=An.get(e);return t||(t=new Set,An.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return yo(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var s=wr.before(e,i,{voids:r});if(s){var[,a]=wr.first(e,[]),u=[s.path,a];if(Er.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(Er.isPath(i)){var[l]=wr.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=wr.nodes(e,{reverse:!0,at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>Er.isRange(t)&&!n?t:{anchor:wr.start(e,t),focus:wr.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return wr.rangeRefs(e).delete(o),o.current=null,t}};return wr.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Fn.get(e);return t||(t=new Set,Fn.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:s}=t;if(i){null==s&&(s=Er.isPath(i)?Gn(e,i):t=>Un.isElement(t)&&wr.isBlock(e,t)),!n&&Er.isRange(i)&&(i=wr.unhangRange(e,i,{voids:r}));var a=wr.nodes(e,{at:i,match:s,mode:o,voids:r}),u=Array.from(a,t=>{var[,n]=t;return wr.pathRef(e,n)});for(var l of u){var c=l.unref();if(c){var[d]=wr.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}})}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;if(t=wr.range(e,t),n)Zr.setSelection(e,t);else{if(!Er.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Or.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wr.withoutNormalizing(e,()=>{var{match:r,at:o=e.selection,compare:i,merge:s}=n,{hanging:a=!1,mode:u="lowest",split:l=!1,voids:c=!1}=n;if(o){if(null==r&&(r=Er.isPath(o)?Gn(e,o):t=>Un.isElement(t)&&wr.isBlock(e,t)),!a&&Er.isRange(o)&&(o=wr.unhangRange(e,o,{voids:c})),l&&Er.isRange(o)){if(jn.isCollapsed(o)&&wr.leaf(e,o.anchor)[0].text.length>0)return;var d=wr.rangeRef(e,o,{affinity:"inward"}),[f,h]=jn.edges(o),p="lowest"===u?"lowest":"highest",g=wr.isEnd(e,h,h.path);Zr.splitNodes(e,{at:h,match:r,mode:p,voids:c,always:!g});var v=wr.isStart(e,f,f.path);Zr.splitNodes(e,{at:f,match:r,mode:p,voids:c,always:!v}),o=d.unref(),null==n.at&&Zr.select(e,o)}for(var[m,y]of(i||(i=(e,t)=>e!==t),wr.nodes(e,{at:o,match:r,mode:u,voids:c}))){var D={},C={};if(0!==y.length){var b=!1;for(var w in t)if(!Vr.includes(w)){var E=Object.hasOwn(m,w)?m[w]:void 0,B=t[w];i(B,E)&&(b=!0,Object.hasOwn(m,w)&&(D[w]=E),s?null!=B&&(C[w]=s(E,B)):null!=B&&(C[w]=B))}b&&e.apply({type:"set_node",path:y,properties:D,newProperties:C})}}}})}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{En.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=jn.isBackward(r)?"focus":"anchor"),"end"===o&&(o=jn.isBackward(r)?"anchor":"focus");var{anchor:i,focus:s}=r,a="anchor"===o?i:s;Zr.setSelection(e,{["anchor"===o?"anchor":"focus"]:wo(wo({},a),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var i in t)Wr.includes(i)||Eo(i,Object.hasOwn(n,i)?n[i]:void 0,t[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Oo(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>wr.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=wr.range(e,t),[i,s]=jn.edges(o),a="";for(var[u,l]of wr.nodes(e,{at:o,match:Un.isText,voids:r})){var c=u.text;xn.equals(l,s.path)&&(c=c.slice(0,s.offset)),xn.equals(l,i.path)&&(c=c.slice(i.offset)),a+=c}return a}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=jn.edges(t);if(0!==o.offset||0!==i.offset||jn.isCollapsed(t)||xn.hasPrevious(i.path))return t;var s=wr.above(e,{at:i,match:t=>Un.isElement(t)&&wr.isBlock(e,t),voids:r}),a=s?s[1]:[],u={anchor:wr.start(e,o),focus:i},l=!0;for(var[c,d]of wr.nodes(e,{at:u,match:Un.isText,reverse:!0,voids:r}))if(l)l=!1;else if(""!==c.text||xn.isBefore(d,a)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;Zr.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr.withoutNormalizing(e,()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:s}=t;if(i){null==s&&(s=Er.isPath(i)?Gn(e,i):t=>Un.isElement(t)&&wr.isBlock(e,t)),Er.isPath(i)&&(i=wr.range(e,i));var a=Er.isRange(i)?wr.rangeRef(e,i):null,u=wr.nodes(e,{at:i,match:s,mode:n,voids:o}),l=Array.from(u,t=>{var[,n]=t;return wr.pathRef(e,n)}).reverse(),c=function(){var t=d.unref(),[n]=wr.node(e,t),i=wr.range(e,t);r&&a&&(i=jn.intersection(a.current,i)),Zr.liftNodes(e,{at:i,match:e=>!Un.isText(n)&&n.children.includes(e),voids:o})};for(var d of l)c();a&&a.unref()}})}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wr.above(e,fo(fo({},t),{},{match:t=>Un.isElement(t)&&wr.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=wr.isNormalizing(e);wr.setNormalizing(e,!1);try{t()}finally{wr.setNormalizing(e,n)}wr.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wr.withoutNormalizing(e,()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:s,at:a=e.selection}=n;if(a){if(null==s&&(s=Er.isPath(a)?Gn(e,a):e.isInline(t)?t=>Un.isElement(t)&&wr.isInline(e,t)||Un.isText(t):t=>Un.isElement(t)&&wr.isBlock(e,t)),o&&Er.isRange(a)){var[u,l]=jn.edges(a),c=wr.rangeRef(e,a,{affinity:"inward"}),d=t=>{var n=wr.above(e,{at:t,match:t=>Un.isElement(t)&&wr.isBlock(e,t)});return n&&wr.isEdge(e,t,n[1])};Zr.splitNodes(e,{at:l,match:s,voids:i,always:!d(l)}),Zr.splitNodes(e,{at:u,match:s,voids:i,always:!d(u)}),a=c.unref(),null==n.at&&Zr.select(e,a)}var f=Array.from(wr.nodes(e,{at:a,match:e.isInline(t)?t=>Un.isElement(t)&&wr.isBlock(e,t):e=>Un.isEditor(e),mode:"lowest",voids:i})),h=function(){var n=Er.isRange(a)?jn.intersection(a,wr.range(e,p)):a;if(!n)return 0;var o=Array.from(wr.nodes(e,{at:n,match:s,mode:r,voids:i}));if(o.length>0){var[u]=o,l=o[o.length-1],[,c]=u,[,d]=l;if(0===c.length&&0===d.length)return 0;var f=xn.equals(c,d)?xn.parent(c):xn.common(c,d),h=wr.range(e,c,d),g=wr.node(e,f),[v]=g,m=f.length+1,y=xn.next(d.slice(0,m)),D=_o(_o({},t),{},{children:[]});Zr.insertNodes(e,D,{at:y,voids:i}),Zr.moveNodes(e,{at:h,match:e=>!Un.isText(v)&&v.children.includes(e),to:y.concat(0),voids:i})}};for(var[,p]of f)h()}})}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t,[i,s]=n;return Un.isElement(r)&&wr.isEmpty(e,r)||Un.isText(r)&&""===r.text&&0!==o[o.length-1]})(e,...n)}};return e},No={exports:{}};var jo=(ko||(ko=1,function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",s="[object Date]",a="[object Function]",u="[object GeneratorFunction]",l="[object Map]",c="[object Number]",f="[object Object]",h="[object Promise]",p="[object RegExp]",g="[object Set]",v="[object String]",m="[object Symbol]",y="[object WeakMap]",D="[object ArrayBuffer]",C="[object DataView]",b="[object Float32Array]",w="[object Float64Array]",E="[object Int8Array]",B="[object Int16Array]",A="[object Int32Array]",F="[object Uint8Array]",x="[object Uint8ClampedArray]",O="[object Uint16Array]",S="[object Uint32Array]",_=/\w*$/,k=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,N={};N[o]=N["[object Array]"]=N[D]=N[C]=N[i]=N[s]=N[b]=N[w]=N[E]=N[B]=N[A]=N[l]=N[c]=N[f]=N[p]=N[g]=N[v]=N[m]=N[F]=N[x]=N[O]=N[S]=!0,N["[object Error]"]=N[a]=N[y]=!1;var j="object"==typeof d&&d&&d.Object===Object&&d,T="object"==typeof self&&self&&self.Object===Object&&self,R=j||T||Function("return this")(),L=t&&!t.nodeType&&t,M=L&&e&&!e.nodeType&&e,$=M&&M.exports===L;function I(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function z(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;)n=t(n,e[o],o,e);return n}function H(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function W(e,t){return function(n){return e(t(n))}}function q(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var K,J=Array.prototype,G=Function.prototype,X=Object.prototype,Y=R["__core-js_shared__"],Z=(K=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",Q=G.toString,ee=X.hasOwnProperty,te=X.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=$?R.Buffer:void 0,oe=R.Symbol,ie=R.Uint8Array,se=W(Object.getPrototypeOf,Object),ae=Object.create,ue=X.propertyIsEnumerable,le=J.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=W(Object.keys,Object),he=Me(R,"DataView"),pe=Me(R,"Map"),ge=Me(R,"Promise"),ve=Me(R,"Set"),me=Me(R,"WeakMap"),ye=Me(Object,"create"),De=He(he),Ce=He(pe),be=He(ge),we=He(ve),Ee=He(me),Be=oe?oe.prototype:void 0,Ae=Be?Be.valueOf:void 0;function Fe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Se(e){this.__data__=new xe(e)}function _e(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&qe(e)}(e)&&ee.call(e,"callee")&&(!ue.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var s in e)!ee.call(e,s)||i&&("length"==s||Ue(s,r))||n.push(s);return n}function ke(e,t,n){var r=e[t];ee.call(e,t)&&Ve(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Pe(e,t){for(var n=e.length;n--;)if(Ve(e[n][0],t))return n;return-1}function Ne(e,t,n,r,d,h,y){var k;if(r&&(k=h?r(e,d,h,y):r(e)),void 0!==k)return k;if(!Ge(e))return e;var P=We(e);if(P){if(k=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,k)}else{var j=Ie(e),T=j==a||j==u;if(Ke(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(j==f||j==o||T&&!h){if(H(e))return h?e:{};if(k=function(e){return"function"!=typeof e.constructor||ze(e)?{}:Ge(t=se(e))?ae(t):{};var t}(T?{}:e),!t)return function(e,t){return Re(e,$e(e),t)}(e,function(e,t){return e&&Re(t,Xe(t),e)}(k,e))}else{if(!N[j])return h?e:{};k=function(e,t,n,r){var o,a=e.constructor;switch(t){case D:return Te(e);case i:case s:return new a(+e);case C:return function(e,t){var n=t?Te(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case b:case w:case E:case B:case A:case F:case x:case O:case S:return function(e,t){var n=t?Te(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(V(e),!0):V(e);return z(r,I,new e.constructor)}(e,r,n);case c:case v:return new a(e);case p:return function(e){var t=new e.constructor(e.source,_.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return function(e,t,n){var r=t?n(q(e),!0):q(e);return z(r,U,new e.constructor)}(e,r,n);case m:return o=e,Ae?Object(Ae.call(o)):{}}}(e,j,Ne,t)}}y||(y=new Se);var R=y.get(e);if(R)return R;if(y.set(e,k),!P)var L=n?function(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Xe,$e)}(e):Xe(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(L||e,function(o,i){L&&(o=e[i=o]),ke(k,i,Ne(o,t,n,r,i,e,y))}),k}function je(e){return!(!Ge(e)||(t=e,Z&&Z in t))&&(Je(e)||H(e)?ne:k).test(He(e));var t}function Te(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Re(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o];ke(n,s,e[s])}return n}function Le(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return je(n)?n:void 0}Fe.prototype.clear=function(){this.__data__=ye?ye(null):{}},Fe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Fe.prototype.get=function(e){var t=this.__data__;if(ye){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Fe.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ee.call(t,e)},Fe.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?n:t,this},xe.prototype.clear=function(){this.__data__=[]},xe.prototype.delete=function(e){var t=this.__data__,n=Pe(t,e);return!(n<0||(n==t.length-1?t.pop():le.call(t,n,1),0))},xe.prototype.get=function(e){var t=this.__data__,n=Pe(t,e);return n<0?void 0:t[n][1]},xe.prototype.has=function(e){return Pe(this.__data__,e)>-1},xe.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Oe.prototype.clear=function(){this.__data__={hash:new Fe,map:new(pe||xe),string:new Fe}},Oe.prototype.delete=function(e){return Le(this,e).delete(e)},Oe.prototype.get=function(e){return Le(this,e).get(e)},Oe.prototype.has=function(e){return Le(this,e).has(e)},Oe.prototype.set=function(e,t){return Le(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new xe},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xe){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Oe(r)}return n.set(e,t),this};var $e=ce?W(ce,Object):function(){return[]},Ie=function(e){return te.call(e)};function Ue(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||P.test(e))&&e>-1&&e%1==0&&e<t}function ze(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function He(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ve(e,t){return e===t||e!=e&&t!=t}(he&&Ie(new he(new ArrayBuffer(1)))!=C||pe&&Ie(new pe)!=l||ge&&Ie(ge.resolve())!=h||ve&&Ie(new ve)!=g||me&&Ie(new me)!=y)&&(Ie=function(e){var t=te.call(e),n=t==f?e.constructor:void 0,r=n?He(n):void 0;if(r)switch(r){case De:return C;case Ce:return l;case be:return h;case we:return g;case Ee:return y}return t});var We=Array.isArray;function qe(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Je(e)}var Ke=de||function(){return!1};function Je(e){var t=Ge(e)?te.call(e):"";return t==a||t==u}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return qe(e)?_e(e):function(e){if(!ze(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Ne(e,!0,!0)}}(No,No.exports)),No.exports),To=f(jo),Ro=new Set(["base","embed","math","meta","object","script","svg"]),Lo=new Set(["href","poster","src","xlink:href"]),Mo=["java","script:"].join("");function $o(e,t,n){var r=function(e){return Array.from(e).filter(function(e){return e>" "}).join("").toLowerCase()}(n);return!r||!r.startsWith(Mo)&&!r.startsWith("vbscript:")&&(!r.startsWith("data:")||"href"!==t&&"xlink:href"!==t&&(("img"===e||"poster"===t)&&r.startsWith("data:image/")))}function Io(e){if(void 0===e&&(e=""),!e)return"";var t=document.createElement("div");t.innerHTML=e;var n=function(e){Array.from(e.childNodes).forEach(function(e){if(e instanceof Element){var t=e,r=t.tagName.toLowerCase();if("template"===r){var o=t,i=Io(o.innerHTML);return i?(o.insertAdjacentHTML("beforebegin",i),void o.remove()):void o.remove()}Ro.has(r)?t.remove():(Array.from(t.attributes).forEach(function(e){var n=e.name.toLowerCase(),o=e.value||"";("srcdoc"===n||n.startsWith("on")||Lo.has(n)&&!$o(r,n,o))&&t.removeAttribute(e.name)}),n(t))}})};return n(t),t.innerHTML}var Uo={};var zo="created",Ho="destroyed",Vo="change",Wo="scroll",qo="fullscreen",Ko="unFullScreen",Jo="modalOrPanelShow",Go="modalOrPanelHide",Xo={};function Yo(e,t){var n=e.key,o=e.factory,i=e.config,s=r(r({},i),t||{});if(null!=Xo[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));Xo[n]=o,function(e,t){null!=t&&(Uo[e]=t)}(n,s)}var Zo=new WeakMap,Qo=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ri=new WeakMap,oi=new WeakMap,ii=new WeakMap,si=new WeakMap,ai=new WeakMap,ui=new WeakMap,li=new WeakMap,ci=new WeakMap,di=new WeakMap,fi=new WeakMap,hi=new WeakMap,pi=new WeakMap,gi=new WeakMap,vi=new WeakMap,mi=new WeakMap,yi=new WeakMap,Di=new WeakMap,Ci=new WeakMap,bi=new WeakMap,wi=new WeakMap,Ei=new WeakMap,Bi=new WeakMap,Ai=new WeakMap,Fi=new WeakMap,xi=function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in Xo)e.push(t);return e},t.getConfig=function(){var e=ai.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t},Oi=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function Si(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function _i(e={},t={}){Object.keys(t).forEach(n=>{void 0===e[n]?e[n]=t[n]:Si(t[n])&&Si(e[n])&&Object.keys(t[n]).length>0&&_i(e[n],t[n])})}const ki={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Pi(){const e="undefined"!=typeof document?document:{};return _i(e,ki),e}const Ni={document:ki,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function ji(){const e="undefined"!=typeof window?window:{};return _i(e,Ni),e}class Ti extends Array{constructor(e){"number"==typeof e?super(e):(super(...e||[]),function(e){const t=e.__proto__;Object.defineProperty(e,"__proto__",{get:()=>t,set(e){t.__proto__=e}})}(this))}}function Ri(e=[]){const t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...Ri(e)):t.push(e)}),t}function Li(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Mi(e,t){const n=ji(),r=Pi();let o=[];if(!t&&e instanceof Ti)return e;if(!e)return new Ti(o);if("string"==typeof e){const n=e.trim();if(n.indexOf("<")>=0&&n.indexOf(">")>=0){let e="div";0===n.indexOf("<li")&&(e="ul"),0===n.indexOf("<tr")&&(e="tbody"),0!==n.indexOf("<td")&&0!==n.indexOf("<th")||(e="tr"),0===n.indexOf("<tbody")&&(e="table"),0===n.indexOf("<option")&&(e="select");const t=r.createElement(e);t.innerHTML=n;for(let e=0;e<t.childNodes.length;e+=1)o.push(t.childNodes[e])}else o=function(e,t){if("string"!=typeof e)return[e];const n=[],r=t.querySelectorAll(e);for(let e=0;e<r.length;e+=1)n.push(r[e]);return n}(e.trim(),t||r)}else if(e.nodeType||e===n||e===r)o.push(e);else if(Array.isArray(e)){if(e instanceof Ti)return e;o=e}return new Ti(function(e){const t=[];for(let n=0;n<e.length;n+=1)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(o))}function $i(...e){const t=Ri(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.add(...t)}),this}function Ii(...e){const t=Ri(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.remove(...t)}),this}function Ui(...e){const t=Ri(e.map(e=>e.split(" ")));return(n=this,r=e=>t.filter(t=>e.classList.contains(t)).length>0,Array.prototype.filter.call(n,r)).length>0;var n,r}function zi(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n<this.length;n+=1)if(2===arguments.length)this[n].setAttribute(e,t);else for(const t in e)this[n][t]=e[t],this[n].setAttribute(t,e[t]);return this}function Hi(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function Vi(){const e=this[0];if(!e)return;const t={};if(e.dataset)for(const n in e.dataset)t[n]=e.dataset[n];else for(let n=0;n<e.attributes.length;n+=1){const r=e.attributes[n];r.name.indexOf("data-")>=0&&(t[Li(r.name.split("data-")[1])]=r.value)}for(const e in t)"false"===t[e]?t[e]=!1:"true"===t[e]?t[e]=!0:parseFloat(t[e])===1*t[e]&&(t[e]*=1);return t}function Wi(e){if(void 0===e){const e=this[0];if(!e)return;if(e.multiple&&"select"===e.nodeName.toLowerCase()){const t=[];for(let n=0;n<e.selectedOptions.length;n+=1)t.push(e.selectedOptions[n].value);return t}return e.value}for(let t=0;t<this.length;t+=1){const n=this[t];if(Array.isArray(e)&&n.multiple&&"select"===n.nodeName.toLowerCase())for(let t=0;t<n.options.length;t+=1)n.options[t].selected=e.indexOf(n.options[t].value)>=0;else n.value=e}return this}function qi(...e){let[t,n,r,o]=e;function i(e){const t=e.target;if(!t)return;const o=e.target.dom7EventData||[];if(o.indexOf(e)<0&&o.unshift(e),Mi(t).is(n))r.apply(t,o);else{const e=Mi(t).parents();for(let t=0;t<e.length;t+=1)Mi(e[t]).is(n)&&r.apply(e[t],o)}}function s(e){const t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const a=t.split(" ");let u;for(let e=0;e<this.length;e+=1){const t=this[e];if(n)for(u=0;u<a.length;u+=1){const e=a[u];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:r,proxyListener:i}),t.addEventListener(e,i,o)}else for(u=0;u<a.length;u+=1){const e=a[u];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:r,proxyListener:s}),t.addEventListener(e,s,o)}}return this}function Ki(){const e=ji();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Ji(){const e=ji();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function Gi(){if(this.length>0){const e=ji(),t=Pi(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,s=n.clientLeft||o.clientLeft||0,a=n===e?e.scrollY:n.scrollTop,u=n===e?e.scrollX:n.scrollLeft;return{top:r.top+a-i,left:r.left+u-s}}return null}function Xi(){for(let e=0;e<this.length;e+=1)this[e].style.display="none";return this}function Yi(){const e=ji();for(let t=0;t<this.length;t+=1){const n=this[t];"none"===n.style.display&&(n.style.display=""),"none"===e.getComputedStyle(n,null).getPropertyValue("display")&&(n.style.display="block")}return this}function Zi(e,t){const n=ji();let r;if(1===arguments.length){if("string"!=typeof e){for(r=0;r<this.length;r+=1)for(const t in e)this[r].style[t]=e[t];return this}if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function Qi(e){return e?(this.forEach((t,n)=>{e.apply(t,[t,n])}),this):this}function es(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function ts(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this}function ns(e){const t=ji(),n=Pi(),r=this[0];let o,i;if(!r||void 0===e)return!1;if("string"==typeof e){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(o=Mi(e),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(e===n)return r===n;if(e===t)return r===t;if(e.nodeType||e instanceof Ti){for(o=e.nodeType?[e]:e,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function rs(...e){let t;const n=Pi();for(let r=0;r<e.length;r+=1){t=e[r];for(let e=0;e<this.length;e+=1)if("string"==typeof t){const r=n.createElement("div");for(r.innerHTML=t;r.firstChild;)this[e].appendChild(r.firstChild)}else if(t instanceof Ti)for(let n=0;n<t.length;n+=1)this[e].appendChild(t[n]);else this[e].appendChild(t)}return this}function os(e){const t=[];for(let n=0;n<this.length;n+=1)null!==this[n].parentNode&&(e?Mi(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return Mi(t)}function is(e){const t=[];for(let n=0;n<this.length;n+=1){let r=this[n].parentNode;for(;r;)e?Mi(r).is(e)&&t.push(r):t.push(r),r=r.parentNode}return Mi(t)}function ss(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].querySelectorAll(e);for(let e=0;e<r.length;e+=1)t.push(r[e])}return Mi(t)}function as(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].children;for(let n=0;n<r.length;n+=1)e&&!Mi(r[n]).is(e)||t.push(r[n])}return Mi(t)}function us(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function ls(){for(let e=0;e<this.length;e+=1){const t=this[e];if(1===t.nodeType){for(let e=0;e<t.childNodes.length;e+=1)t.childNodes[e].parentNode&&t.childNodes[e].parentNode.removeChild(t.childNodes[e]);t.textContent=""}}return this}Mi.fn=Ti.prototype;const cs="resize scroll".split(" ");const ds=(fs="focus",function(...e){if(void 0===e[0]){for(let e=0;e<this.length;e+=1)cs.indexOf(fs)<0&&(fs in this[e]?this[e][fs]():Mi(this[e]).trigger(fs));return this}return this.on(fs,...e)});var fs;const hs=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var ps,gs=globalThis.Node;Zi&&(Mi.fn.css=Zi),rs&&(Mi.fn.append=rs),$i&&(Mi.fn.addClass=$i),Ii&&(Mi.fn.removeClass=Ii),Ui&&(Mi.fn.hasClass=Ui),qi&&(Mi.fn.on=qi),ds&&(Mi.fn.focus=ds),zi&&(Mi.fn.attr=zi),Hi&&(Mi.fn.removeAttr=Hi),Xi&&(Mi.fn.hide=Xi),Yi&&(Mi.fn.show=Yi),Gi&&(Mi.fn.offset=Gi),Ki&&(Mi.fn.width=Ki),Ji&&(Mi.fn.height=Ji),os&&(Mi.fn.parent=os),is&&(Mi.fn.parents=is),ns&&(Mi.fn.is=ns),Vi&&(Mi.fn.dataset=Vi),Wi&&(Mi.fn.val=Wi),ts&&(Mi.fn.text=ts),es&&(Mi.fn.html=es),as&&(Mi.fn.children=as),us&&(Mi.fn.remove=us),ss&&(Mi.fn.find=ss),Qi&&(Mi.fn.each=Qi),ls&&(Mi.fn.empty=ls),function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(ps||(ps={}));var vs=/\[object HTML([A-Z][a-z]*)*Element\]/,ms=function(e){return null!=e&&"number"==typeof e.nodeType},ys=function(e){return ms(e)&&e.nodeType===ps.COMMENT_NODE},Ds=function(e){return ms(e)&&e.nodeType===ps.ELEMENT_NODE},Cs=function(e){return"[object Selection]"===vn(e)},bs=function(e){return ms(e)&&e.nodeType===ps.TEXT_NODE},ws=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,s=!1,a=!1;(ys(o)||Ds(o)&&0===o.childNodes.length||Ds(o)&&"false"===o.getAttribute("contenteditable"))&&(!s||!a);)i>=r.length?(s=!0,i=t-1,n="backward"):i<0?(a=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},Es=function(e,t,n){return i(ws(e,t,n),1)[0]},Bs=function(e){var t,n,r="";if(bs(e)&&e.nodeValue)return e.nodeValue;if(Ds(e)){try{for(var i=o(Array.from(e.childNodes)),s=i.next();!s.done;s=i.next()){var a=s.value;r+=Bs(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}var u=getComputedStyle(e).getPropertyValue("display");"block"!==u&&"list"!==u&&"table-row"!==u&&"BR"!==e.tagName||(r+="\n")}return r};function As(e,t){if(n=e,!vs.test(vn(n))||"true"!==e.dataset.slateVoid)for(var n,r=e.childNodes,o=r.length;o-=1;){var i=r[o],s=i.nodeType;bs(i)?t(i,e):[ps.ELEMENT_NODE,ps.DOCUMENT_NODE,ps.DOCUMENT_FRAGMENT_NODE].includes(s)&&As(i,t)}}function Fs(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==ps.ELEMENT_NODE?"":t.tagName.toLowerCase()}var xs=new RegExp(String.fromCharCode(160),"g");function Os(e){return e.replace(xs," ")}var Ss=["span","b","strong","i","em","s","strike","u","font","sub","sup"],_s=[];var ks=[];var Ps={};function Ns(e,t){var n=e.length;if(n){var r=e[n-1];if(Nr.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text+=t,!0}}return!1}function js(e,t,n){return{type:"paragraph",children:[{text:Mi(e).text().replace(/\s+/gm," ")}]}}function Ts(e,t){var n=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach(function(e){if(Ds(e)){if("BR"===e.nodeName)return void(Ns(n,"\n")||n.push({text:"\n"}));var r=Us(Mi(e),t);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}else if(bs(e)){var o=e.textContent||"";if(""===o.trim()&&o.indexOf("\n")>=0)return;o&&(o=Os(o),Ns(n,o)||n.push({text:o}))}}),n)}(e,t),r=function(e){for(var t in Ps)if(e[0].matches(t))return Ps[t];return js}(e),o=r(e[0],n,t);return Array.isArray(o)||(o=[o]),o.forEach(function(r){wr.isVoid(t,r)||(0===n.length&&(r.children=[{text:e.text().replace(/\s+/gm," ")}]),ks.forEach(function(n){r=n(e[0],r,t)}))}),o}function Rs(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,"").replace(/<br>/g,"\n"));var n=e[0].textContent||"",r={text:n=Os(n=gn(n))};return ks.forEach(function(n){r=n(e[0],r,t)}),r}function Ls(e,t){var n={text:""};return ks.forEach(function(r){n=r(e[0],n,t)}),n}function Ms(e,t){var n=t.parentElement;return null==n?e:(null==n.closest("pre")&&(e=e.replace(/[\r\n\t]+/g,"")),e=Os(e=gn(e)))}function $s(e,t){var n=r(r({},e),t);return Object.keys(t).forEach(function(e){!1===t[e]&&delete n[e]}),n}function Is(e,t,n){var o=e[0];if(Ds(o)){var i=Us(e,n),s=r({},t);return delete s.text,Array.isArray(i)?i.map(function(e){return $s(s,e)}):[$s(s,i)]}return ys(o)?null:[$s(t,bs(o)?{text:Ms(o.textContent||"",o)}:Rs(e,n))]}function Us(e,t){_s.forEach(function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=Mi(r(e[0])))});var n=Fs(e);if("span"===n){if(e.attr("data-w-e-type"))return Ts(e,t);if((o=Array.from(e[0].childNodes)).some(function(e){return!bs(e)&&!ys(e)})){var r=Ls(Mi(e[0]),t);return o.flatMap(function(e){return Is(Mi(e),r,t)||[]})}return Rs(e,t)}if("code"===n)return"pre"===Fs(e.parent())?Ts(e,t):Rs(e,t);if(Ss.includes(n)){var o;if((o=Array.from(e[0].childNodes)).some(function(e){return!bs(e)&&!ys(e)})){var i=Ls(Mi(e[0]),t);return o.flatMap(function(e){return Is(Mi(e),i,t)||[]})}return Rs(e,t)}return Ts(e,t)}function zs(e,t,n){var r=Mi(n);return!!r.attr(t)||(r.attr(t,"true"),e.on(Ho,function(){r.removeAttr(t)}),!1)}function Hs(e,t){void 0===t&&(t="");var n=[],r=e.getConfig().sanitizeHtml;""===t&&(t="<p><br></p>"),0!==t.indexOf("<")&&(t=t.split(/\n/).map(function(e){return"<p>".concat(e,"</p>")}).join("")),t=r?r(t):t;var o=Mi("<div>".concat(t,"</div>"));return Array.from(o.children()).forEach(function(t){var r=Us(Mi(t),e);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}),n}function Vs(e,t){return"w-e-element-".concat(e,"-").concat(t)}var Ws=[];var qs=[];function Ks(e,t,n,r){return void 0===r&&(r={}),qs.reduce(function(e,o){return o(e,t,n,r)},e)}var Js,Gs,Xs={};var Ys=function(){if(Gs)return Js;Gs=1;var e=9007199254740991,t="[object Arguments]",n="[object Map]",r="[object Promise]",o="[object Set]",i="[object WeakMap]",s="[object DataView]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l="\\ud800-\\udfff",c="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",h="\\ufe0e\\ufe0f",p="["+l+"]",g="["+c+f+"]",v="\\ud83c[\\udffb-\\udfff]",m="[^"+l+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",C="\\u200d",b="(?:"+g+"|"+v+")"+"?",w="["+h+"]?",E=w+b+("(?:"+C+"(?:"+[m,y,D].join("|")+")"+w+b+")*"),B="(?:"+[m+g+"?",g,y,D,p].join("|")+")",A=RegExp(v+"(?="+v+")|"+B+E,"g"),F=RegExp("["+C+l+c+f+h+"]"),x="object"==typeof d&&d&&d.Object===Object&&d,O="object"==typeof self&&self&&self.Object===Object&&self,S=x||O||Function("return this")();function _(e,t){return function(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,function(t){return e[t]})}function k(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function P(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function N(e){return function(e){return F.test(e)}(e)?function(e){return e.match(A)||[]}(e):function(e){return e.split("")}(e)}var j,T,R,L=Function.prototype,M=Object.prototype,$=S["__core-js_shared__"],I=(j=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"",U=L.toString,z=M.hasOwnProperty,H=M.toString,V=RegExp("^"+U.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=S.Symbol,q=W?W.iterator:void 0,K=M.propertyIsEnumerable,J=(T=Object.keys,R=Object,function(e){return T(R(e))}),G=ue(S,"DataView"),X=ue(S,"Map"),Y=ue(S,"Promise"),Z=ue(S,"Set"),Q=ue(S,"WeakMap"),ee=de(G),te=de(X),ne=de(Y),re=de(Z),oe=de(Q);function ie(e,n){var r=fe(e)||function(e){return function(e){return ve(e)&&he(e)}(e)&&z.call(e,"callee")&&(!K.call(e,"callee")||H.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var s in e)!z.call(e,s)||i&&("length"==s||ce(s,o))||r.push(s);return r}function se(e){if(!ge(e)||function(e){return!!I&&I in e}(e))return!1;var t=pe(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?V:a;return t.test(de(e))}function ae(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||M,t!==r)return J(e);var t,n,r,o=[];for(var i in Object(e))z.call(e,i)&&"constructor"!=i&&o.push(i);return o}function ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return se(n)?n:void 0}var le=function(e){return H.call(e)};function ce(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<n}function de(e){if(null!=e){try{return U.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(G&&le(new G(new ArrayBuffer(1)))!=s||X&&le(new X)!=n||Y&&le(Y.resolve())!=r||Z&&le(new Z)!=o||Q&&le(new Q)!=i)&&(le=function(e){var t=H.call(e),a="[object Object]"==t?e.constructor:void 0,u=a?de(a):void 0;if(u)switch(u){case ee:return s;case te:return n;case ne:return r;case re:return o;case oe:return i}return t});var fe=Array.isArray;function he(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!pe(t)}function pe(e){var t=ge(e)?H.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ve(e){return!!e&&"object"==typeof e}function me(e){return e?_(e,function(e){return he(e)?ie(e):ae(e)}(e)):[]}return Js=function(e){if(!e)return[];if(he(e))return function(e){return"string"==typeof e||!fe(e)&&ve(e)&&"[object String]"==H.call(e)}(e)?N(e):function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e);if(q&&e[q])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[q]());var t=le(e);return(t==n?k:t==o?P:me)(e)},Js}(),Zs=f(Ys),Qs=0,ea=function(){this.id="".concat(Qs),Qs+=1},ta="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),na="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ra="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),oa="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),ia="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),sa="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),aa=!ia&&!oa&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,ua=function(e,t){return Boolean(e.compareDocumentPosition(t)&gs.DOCUMENT_POSITION_PRECEDING)},la=function(e,t){return Boolean(e.compareDocumentPosition(t)&gs.DOCUMENT_POSITION_FOLLOWING)},ca={getWindow:function(e){var t=Ci.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var n=Di.get(t);return n||(n=new ea,Di.set(t,n)),n},setNewKey:function(e){var t=new ea;Di.set(e,t)},findPath:function(e,t){for(var n=[],r=t;;){var o=pi.get(r);if(null==o){if(wr.isEditor(r))return n;break}var i=hi.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(t)))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=ca.toDOMNode(e,e),n=t.getRootNode();return"[object HTMLDocument]"!==vn(n)&&!function(e){return"[object ShadowRoot]"===vn(e)}(n)||null==Reflect.get(n,"getSelection")?t.ownerDocument:n},getParentNode:function(e,t){return pi.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=ca.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[ca.findPath(e,t)[0]];return Un.get(e,n)},toDOMNode:function(e,t){var n;if(wr.isEditor(t))n=gi.get(e);else{var r=ca.findKey(e,t);n=mi.get(r)}if(!n)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(t)));return n},hasDOMNodeBySlateNode:function(e,t){if(wr.isEditor(t))return!!gi.get(e);var n=ca.findKey(e,t);return!!mi.get(n)},canResolveDOMRange:function(e,t){try{var n=i(wr.node(e,t.anchor.path),1)[0],r=i(jn.isCollapsed(t)?[n]:wr.node(e,t.focus.path),1)[0];return ca.hasDOMNodeBySlateNode(e,n)&&ca.hasDOMNodeBySlateNode(e,r)}catch(e){return!1}},hasDOMNode:function(e,t,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,s=ca.toDOMNode(e,e);try{r=Ds(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!r&&(r.closest("[data-slate-editor]")===s&&(!i||r.isContentEditable||r.closest('[contenteditable="false"]')===s||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,o=jn.isBackward(t),s=ca.toDOMPoint(e,n),a=jn.isCollapsed(t)?s:ca.toDOMPoint(e,r),u=ca.getWindow(e).document.createRange(),l=i(o?a:s,2),c=l[0],d=l[1],f=i(o?s:a,2),h=f[0],p=f[1],g=!!(Ds(c)?c:c.parentElement).getAttribute("data-slate-zero-width"),v=!!(Ds(h)?h:h.parentElement).getAttribute("data-slate-zero-width");return u.setStart(c,g?1:d),u.setEnd(h,v?1:p),u},toDOMPoint:function(e,t){var n,r,s,a=i(wr.node(e,t.path),1)[0],u=ca.toDOMNode(e,a);wr.void(e,{at:t})&&(t={path:t.path,offset:0});var l=Array.from(u.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),c=0;try{for(var d=o(l),f=d.next();!f.done;f=d.next()){var h=f.value,p=h.childNodes[0];if(null!=p&&null!=p.textContent){var g=p.textContent.length,v=h.getAttribute("data-slate-length"),m=c+(null==v?g:parseInt(v,10));if(t.offset<=m){s=[p,Math.min(g,Math.max(0,t.offset-c))];break}c=m}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}if(!s)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(t)));return s},toSlateNode:function(e,t){var n=Ds(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?vi.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var n=t.clientX,r=t.clientY,o=t.target;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,s=ca.toSlateNode(e,t.target),a=ca.findPath(e,s);if(Rn.isElement(s)&&wr.isVoid(e,s)){var u=o.getBoundingClientRect(),l=e.isInline(s)?n-u.left<u.left+u.width-n:r-u.top<u.top+u.height-r,c=wr.point(e,a,{edge:l?"start":"end"}),d=l?wr.before(e,c):wr.after(e,c);if(d)return wr.range(e,d)}var f=this.getWindow(e).document;if(f.caretRangeFromPoint)i=f.caretRangeFromPoint(n,r);else{var h=f.caretPositionFromPoint(n,r);h&&((i=f.createRange()).setStart(h.offsetNode,h.offset),i.setEnd(h.offsetNode,h.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return ca.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(e,t,n){var r,o,i,s,a,u=n.exactMatch,l=n.suppressThrow;if((Cs(t)?t.anchorNode:t.startContainer)&&(Cs(t)?(r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,s=t.focusOffset,a=sa&&window.document.activeElement&&window.document.activeElement.shadowRoot?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(r=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,a=t.collapsed)),null==r||null==i||null==o||null==s){if(l)return null;throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t))}var c=ca.toSlatePoint(e,[r,o],{exactMatch:u,suppressThrow:l});if(!c)return null;var d=a?c:ca.toSlatePoint(e,[i,s],{exactMatch:u,suppressThrow:l,searchDirection:ua(r,i)||r===i&&s<o?"forward":"backward"});if(!d)return null;var f={anchor:c,focus:d};return jn.isExpanded(f)&&jn.isForward(f)&&Ds(i)&&wr.void(e,{at:f.focus,mode:"highest"})&&(f=wr.unhangRange(e,f,{voids:!0})),f},toSlatePoint:function(e,t,n){var r,a,u,l,c=n.exactMatch,d=n.suppressThrow,f=i(c?t:function(e){var t,n=i(e,2),r=n[0],o=n[1];if(Ds(r)&&r.childNodes.length){var s=o===r.childNodes.length,a=s?o-1:o;for(r=(t=i(ws(r,a,s?"backward":"forward"),2))[0],s=(a=t[1])<o;Ds(r)&&r.childNodes.length;){var u=s?r.childNodes.length-1:0;r=Es(r,u,s?"backward":"forward")}o=s&&null!=r.textContent?r.textContent.length:0}return[r,o]}(t),2),h=f[0],p=f[1],g=h.parentNode,v=n.searchDirection,m=null,y=0;if(g){var D=ca.toDOMNode(e,e),C=g.closest('[data-slate-void="true"]'),b=C&&D.contains(C)?C:null,w=g.closest('[contenteditable="false"]'),E=w&&D.contains(w)?w:null,B=g.closest("[data-slate-leaf]"),A=null,F=ca.getWindow(e);if(B&&F.document.createRange){m=B.closest('[data-slate-node="text"]');var x=F.document.createRange();x.setStart(m,0),x.setEnd(h,p);var O=x.cloneContents();s(s([],i(Zs(O.querySelectorAll("[data-slate-zero-width]"))),!1),i(Zs(O.querySelectorAll("[contenteditable=false]"))),!1).forEach(function(e){e.parentNode.removeChild(e)}),y=O.textContent.length,A=m}else if(b)B=Array.from(b.querySelectorAll("[data-slate-leaf]")).find(function(t){return ca.hasDOMNode(e,t)})||null,B?(m=B.closest('[data-slate-node="text"]'),y=(A=B).textContent.length,A.querySelectorAll("[data-slate-zero-width]").forEach(function(e){y-=e.textContent.length})):y=1;else if(E){var S=Boolean(E.closest("[data-w-e-reserve]"));!v&&S&&(v="forward");var _=v,k=function(t){return t?Array.from(t.querySelectorAll("[data-slate-leaf]")).filter(function(t){return ca.hasDOMNode(e,t)}):[]},P=E.closest('[data-slate-node="element"]');if("backward"===v||!v)for(var N=(T=s(s([],i(k(null==P?void 0:P.previousElementSibling)),!1),i(k(P)),!1)).length-1;N>=0;N-=1){var j=T[N];if(ua(E,j)){B=j,v="backward";break}}if(!B&&("forward"===v||!v||S)){var T=s(s([],i(k(P)),!1),i(k(null==P?void 0:P.nextElementSibling)),!1);try{for(var R=o(T),L=R.next();!L.done;L=R.next()){j=L.value;if(la(E,j)){B=j,_="backward"===v&&S?"backward":"forward";break}}}catch(e){r={error:e}}finally{try{L&&!L.done&&(a=R.return)&&a.call(R)}finally{if(r)throw r.error}}}B&&(m=B.closest('[data-slate-node="text"]'),A=B,"forward"===_?y=0:(y=A.textContent.length,A.querySelectorAll("[data-slate-zero-width]").forEach(function(e){y-=e.textContent.length})))}A&&y===A.textContent.length&&(g.hasAttribute("data-slate-zero-width")||na&&(null===(u=A.textContent)||void 0===u?void 0:u.endsWith("\n")))&&(y-=1)}if(!m){if(d)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}try{var M=ca.toSlateNode(e,m);l=ca.findPath(e,M)}catch(e){if(d)return null;throw e}return{path:l,offset:y}},hasRange:function(e,t){var n=t.anchor,r=t.focus;return wr.hasPath(e,n.path)&&wr.hasPath(e,r.path)},getNodeType:function(e){return Rn.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(e){return Un.string(e)}).join("")},getSelectedVoidNode:function(e){var t=e.selection;if(!t)return null;var n=wr.void(e,{at:t});if(!n)return null;var r=i(n,1)[0];return Rn.isElement(r)?r:null},getSelectedElems:function(e){var t,n,r=[],s=ca.getSelectedVoidNode(e);s&&r.push(s);var a=wr.nodes(e,{universal:!0});try{for(var u=o(a),l=u.next();!l.done;l=u.next()){var c=i(l.value,1)[0];Rn.isElement(c)&&c!==s&&r.push(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r},getSelectedNodeByType:function(e,t){var n=this,r=ca.getSelectedVoidNode(e);if(r&&this.checkNodeType(r,t))return r;var o=i(wr.nodes(e,{match:function(e){return n.checkNodeType(e,t)},universal:!0}),1),s=o[0];return null==s?null:s[0]},getSelectedTextNode:function(e){var t=i(wr.nodes(e,{match:function(e){return Nr.isText(e)},universal:!0}),1),n=t[0];return null==n?null:n[0]},isNodeSelected:function(e,t){if(ca.getSelectedVoidNode(e)===t)return!0;var n=i(wr.nodes(e,{match:function(e){return e===t},universal:!0}),1),r=n[0];return null!=r&&i(r,1)[0]===t},isSelectionAtLineEnd:function(e,t){var n=e.selection;return!!n&&(wr.isEnd(e,n.anchor,t)||wr.isEnd(e,n.focus,t))},getTextarea:function(e){var t=Zo.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return ti.get(e)||null},getHoverbar:function(e){return ri.get(e)||null},normalizeContent:function(e){e.children.forEach(function(t,n){e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(e){var t,n,r,i,s=ca.getTextarea(e).$textArea,a=null==s?void 0:s[0].childNodes;if(a)try{for(var u=o(Array.from(a)),l=u.next();!l.done;l=u.next()){var c=l.value;if(!bs(c))break;c.remove()}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}var d=wr.nodes(e,{match:function(t){return!(!Rn.isElement(t)||e.isInline(t))},universal:!0});try{for(var f=o(d),h=f.next();!h.done;h=f.next()){var p=h.value;if(null!=p){var g=p[0];if(!ca.hasDOMNodeBySlateNode(e,g))continue;As(ca.toDOMNode(e,g),function(e,t){var n=Mi(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)})}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){return null!=ca.getSelectedVoidNode(e)},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(jn.isExpanded(t))return!1;var n=[t.focus.path[0]];if(!wr.hasPath(e,n))return!1;var r=i(wr.node(e,n),1)[0];if(!Rn.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children;return 1===o.length&&(""===o[0].text||void 0)},isEmptyPath:function(e,t){var n=wr.node(e,t);if(null==n)return!1;var r=i(n,1)[0].children;if(1===r.length&&""===r[0].text)return!0;return!1}};function da(e,t,n){var r=n.isInline(e)?"span":"div";return"<".concat(r,">").concat(t,"</").concat(r,">")}var fa="data-w-e-id",ha=/^[A-Za-z_:-][A-Za-z0-9_:.-]*$/;function pa(e,t,n,r){if(!r.includeId)return e;var o=function(e){return e&&ha.test(e)?e:fa}(r.idKey),s=ca.findKey(n,t);return function(e,t,n){if(!e)return e;var r=e.match(/^<([A-Za-z][A-Za-z0-9-]*)([^>]*)>/);if(!r)return e;var o=i(r,3),s=o[0],a=o[1],u=o[2],l=void 0===u?"":u;if(new RegExp("\\s".concat(t,"=")).test(l))return e;var c=/\/\s*$/.test(l),d=l.replace(/\s*\/\s*$/,""),f=d.trim()?" ".concat(d.trim()):"",h=c?" /":"";return"<".concat(a).concat(f," ").concat(t,'="').concat(n,'"').concat(h,">")+e.slice(s.length)}(e,o,Vs(ca.getNodeType(t),s.id))}function ga(e,t,n){void 0===n&&(n={});var r=e.type,o=void 0===r?"":r,i=e.children,s=void 0===i?[]:i,a=wr.isVoid(t,e),u="";a||(u=s.map(function(e){return va(e,t,n)}).join(""));var l=function(e){return Xs[e]||da}(o),c=l(e,u,t),d="";if(d="string"==typeof c?c:c.html||"",a||Ws.forEach(function(n){return d=n(e,d,t)}),d=pa(d,e,t,n),"string"==typeof c)return d;var f=c.prefix,h=void 0===f?"":f,p=c.suffix,g=void 0===p?"":p;return h&&(d=h+d),g&&(d+=g),d}function va(e,t,n){return void 0===n&&(n={}),Rn.isElement(e)?ga(e,t,n):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=n;r=function(e){return e.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(r);var o=ca.getParentsNodes(t,e).some(function(e){return"pre"===ca.getNodeType(e)});if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/ /g," ")),""===r){var i=ca.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="<br>"}return Ws.forEach(function(n){return r=n(e,r,t)}),r}(e,t)}var ma=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},ya=function(e,t,n){var r=ca.toDOMRange(e,t).getBoundingClientRect(),o=ca.toDOMRange(e,n).getBoundingClientRect();return ma(r,o)&&ma(o,r)},Da=function(e,t){var n,r,s=[];try{for(var a=o(wr.levels(e,{at:t})),u=a.next();!u.done;u=a.next()){var l=i(u.value,2),c=l[0],d=l[1],f=ca.findKey(e,c);s.push([d,f])}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s};var Ca,ba,wa,Ea,Ba,Aa,Fa,xa,Oa,Sa,_a,ka,Pa,Na,ja,Ta,Ra,La,Ma,$a,Ia,Ua,za,Ha,Va,Wa,qa,Ka,Ja,Ga,Xa,Ya,Za,Qa,eu,tu,nu,ru,ou,iu,su=function(e){var t=e,n=t.onChange,a=t.insertText,u=t.apply,l=t.deleteBackward,c=t.deleteFragment;return t.insertText=function(e){t.getConfig().readOnly||a(e)},t.apply=function(e){var n,r,a,l,c,d,f,h,p=[];switch(e.type){case"insert_text":case"remove_text":case"set_node":case"split_node":p.push.apply(p,s([],i(Da(t,e.path)),!1));break;case"insert_node":case"remove_node":p.push.apply(p,s([],i(Da(t,xn.parent(e.path))),!1));break;case"merge_node":var g=xn.previous(e.path);p.push.apply(p,s([],i(Da(t,g)),!1));break;case"move_node":var v=xn.common(xn.parent(e.path),xn.parent(e.newPath));p.push.apply(p,s([],i(Da(t,v)),!1));break;case"set_selection":(null===(l=null===(a=e.newProperties)||void 0===a?void 0:a.focus)||void 0===l?void 0:l.path)&&(p.push.apply(p,s([],i(Da(t,null===(d=null===(c=e.newProperties)||void 0===c?void 0:c.focus)||void 0===d?void 0:d.path)),!1)),p.push.apply(p,s([],i(Da(t,null===(h=null===(f=e.properties)||void 0===f?void 0:f.focus)||void 0===h?void 0:h.path)),!1)))}u(e);try{for(var m=o(p),y=m.next();!y.done;y=m.next()){var D=i(y.value,2),C=D[0],b=D[1],w=i(wr.node(t,C),1)[0];Di.set(w,b),"type"in w&&(di.has(w)&&di.delete(w),fi.has(w)&&fi.delete(w))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}},t.deleteBackward=function(n){if("line"!==n)return l(n);if(e.selection&&jn.isCollapsed(e.selection)){var r=wr.above(e,{match:function(t){return Rn.isElement(t)&&wr.isBlock(e,t)},at:e.selection});if(r){var o=i(r,2)[1],s=wr.range(e,o,e.selection.anchor),a=function(e,t){var n=wr.range(e,jn.end(t)),r=Array.from(wr.positions(e,{at:t})),o=0,i=r.length,s=Math.floor(i/2);if(ya(e,wr.range(e,r[o]),n))return wr.range(e,r[o],n);if(r.length<2)return wr.range(e,r[r.length-1],n);for(;s!==r.length&&s!==o;)ya(e,wr.range(e,r[s]),n)?i=s:o=s,s=Math.floor((o+i)/2);return wr.range(e,r[i],n)}(t,s);jn.isCollapsed(a)||Zr.delete(e,{at:a})}}},t.deleteFragment=function(e){var n=function(e){var t=e.selection;if(null==t||jn.isCollapsed(t))return!1;var n=i(jn.edges(t),2),r=n[0],o=n[1],s=i(wr.edges(e,[]),2),a=s[0],u=s[1];return Fr.equals(r,a)&&Fr.equals(o,u)}(t);c(e),n&&(!function(e){var t=[{type:"paragraph",children:[{text:""}]}];wr.withoutNormalizing(e,function(){for(var n=e.children.length-1;n>=0;n-=1)Zr.removeNodes(e,{at:[n]});Zr.insertNodes(e,t,{at:[0]})})}(t),t.children.length>0&&Zr.select(t,wr.start(t,[])))},t.onChange=function(){var e=t.selection;null!=e&&wi.set(t,e),t.emit(Vo),n()},t.handleTab=function(){t.insertText(" ")},t.getHtml=function(){var e=t.children,n=void 0===e?[]:e,r=t.getConfig().skipCacheTypes,o=void 0===r?["list-item"]:r;return Ks(n.map(function(e){var n=ca.getNodeType(e);if(o.includes(n))return va(e,t);var r=fi.get(e);if(r)return r.toString();var i=va(e,t);return fi.set(e,i),i}),n,t).join("")},t.getHtmlWithId=function(e){void 0===e&&(e="data-w-e-id");var n=t.children,r=void 0===n?[]:n;return Ks(r.map(function(n){return va(n,t,{includeId:!0,idKey:e})}),r,t,{includeId:!0,idKey:e}).join("")},t.getText=function(){var e=t.children;return(void 0===e?[]:e).map(function(e){return Un.string(e)}).join("\n")},t.getSelectionText=function(){var n=t.selection;return null==n?"":wr.string(e,n)},t.getElemsByType=function(e,n){var s,a;void 0===n&&(n=!1);var u=[],l=wr.nodes(t,{at:[],universal:!0});try{for(var c=o(l),d=c.next();!d.done;d=c.next()){var f=i(d.value,1)[0];if(Rn.isElement(f))if(n?f.type.indexOf(e)>=0:f.type===e){var h=ca.findKey(t,f),p=Vs(f.type,h.id);u.push(r(r({},f),{id:p}))}}}catch(e){s={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(s)throw s.error}}return u},t.getElemsByTypePrefix=function(e){return t.getElemsByType(e,!0)},t.isEmpty=function(){var e=t.children,n=void 0===e?[]:e;if(n.length>1)return!1;var r=n[0];if(null==r)return!0;if(!Rn.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children,i=void 0===o?[]:o;if(i.length>1)return!1;var s=i[0];return null==s||Nr.isText(s)&&""===s.text},t.clear=function(){for(var e=t.children.length-1;e>=0;e-=1)Zr.removeNodes(t,{at:[e]});0!==t.children.length?function(e){var t=e.children[0];if(1===e.children.length&&Rn.isElement(t)&&("paragraph"!==t.type||""!==Un.string(t))&&""===Un.string(t)){var n=[{type:"paragraph",children:[{text:""}]}];wr.withoutNormalizing(e,function(){Zr.removeNodes(e,{at:[0]}),Zr.insertNodes(e,n,{at:[0]})})}}(t):Zr.insertNodes(t,[{type:"paragraph",children:[{text:""}]}])},t.getParentNode=function(e){return ca.getParentNode(t,e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e){var r=document.createElement("div");r.innerHTML=e;var o=Array.from(r.childNodes);if(o=o.filter(function(e){var t=e.nodeName;return!!bs(e)||!!Ds(e)&&!Oi.has(t.toLowerCase())}),0!==o.length){var s=t.selection;if(null!=s){var a=null;if(ca.isSelectedEmptyParagraph(t)&&!n)a=[s.focus.path[0]];r.setAttribute("hidden","true"),document.body.appendChild(r);var u=0;o.forEach(function(e,n){var r=e.nodeName,s=e.textContent,a=void 0===s?"":s;if(bs(e)){if(!a||!a.trim())return;t.insertNode({text:a})}else if("BR"!==r){var l=e,c=!1;if(Ss.includes(r.toLowerCase()))c=!0;else for(var d in Ps)if(l.matches(d)){c=!0;break}if(c){var f=Us(Mi(l),t),h=Array.isArray(f)?f:[f];if(h.forEach(function(e){return function(e,t){if(Nr.isText(t))e.insertNode(t);else if(Rn.isElement(t))if(e.isInline(t))e.insertNode(t),"link"===t.type&&e.insertFragment([{text:""}]);else{var n=e.selection;if(!n)return;var r=[n.focus.path[0]];if(ca.isSelectedEmptyParagraph(e))return Zr.removeNodes(e,{at:r}),Zr.insertNodes(e,t,{at:r}),void Zr.select(e,wr.end(e,r));var o=xn.next(r);Zr.insertNodes(e,t,{at:o}),Zr.select(e,wr.end(e,o))}}(t,e)}),u+=h.length,ca.isSelectedVoidNode(t)&&t.move(1),h.some(function(e){return!!Rn.isElement(e)&&(!!t.isInline(e)||e.children.some(function(e){return Rn.isElement(e)&&t.isInline(e)}))})&&t.selection){var p=wr.nodes(t,{at:t.selection,match:function(e){return Rn.isElement(e)&&t.isInline(e)},universal:!0}),g=p.next().value;if(g){var v=i(g,2)[1],m=xn.next(v);wr.hasPath(t,m)?Zr.select(t,{anchor:{path:m,offset:0},focus:{path:m,offset:0}}):t.move(1)}}}else{var y=window.getComputedStyle(l).display;if(!ca.isSelectedEmptyParagraph(t)&&y.indexOf("inline")<0){if(n>=1)(function(e){return"matches"in e&&/^[ou]l$/i.test(e.tagName)&&!e.hasAttribute("data-w-e-type")})(o[n-1])&&t.insertBreak();t.insertBreak()}t.dangerouslyInsertHtml(l.innerHTML,!0)}}else t.insertText("\n")}),u&&a&&ca.isEmptyPath(t,a)&&Zr.removeNodes(t,{at:a}),r.remove()}}}},t.setHtml=function(e){void 0===e&&(e="");var n=t.isDisabled(),r=t.isFocused(),o=JSON.stringify(t.selection);t.enable(),wi.delete(t),t.focus(),t.clear();var i=Hs(t,null==e?"":e);if(Zr.insertFragment(t,i),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{var s=JSON.parse(o);jn.isRange(s)&&ca.hasRange(t,s)?t.select(s):t.select(wr.start(t,[]))}catch(e){t.select(wr.start(t,[]))}},t},au=1,uu=function(e){var t=e;return t.id="wangEditor-".concat(au),au+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=function(e){if(ca.toDOMNode(t,t).focus({preventScroll:!0}),bi.set(t,!0),e){var n=wr.end(t,[]);Zr.select(t,n)}else{var r=wi.get(t);r?Zr.select(t,r):Zr.select(t,wr.start(t,[]))}},t.isFocused=function(){return!!bi.get(t)},t.blur=function(){ca.toDOMNode(t,t).blur(),Zr.deselect(t),bi.set(t,!1)},t.updateView=function(){ca.getTextarea(t).changeViewState();var e=ca.getToolbar(t);e&&e.changeToolbarState();var n=ca.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=function(){if(!t.isDestroyed){var e=ca.getTextarea(t);e.destroy(),Zo.delete(t),Qo.delete(e);var n=ca.getToolbar(t);n&&(n.destroy(),ti.delete(t),ei.delete(n));var r=ca.getHoverbar(t);r&&(r.destroy(),ri.delete(t),ni.delete(r)),t.isDestroyed=!0,t.emit(Ho)}},t.scrollToElem=function(e){if(!t.getConfig().scroll){var n="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return n+="\nYou has disabled editor scroll, please do this yourself",void console.warn(n)}var r=Mi("#".concat(e));if(0!==r.length){var o=r[0];if(!ca.hasDOMNode(t,o)){n="Element (found by id is '".concat(e,"') is not in editor DOM");return n+="\n 通过 id '".concat(e,"' 找到的 element 不在 editor DOM 之内"),void console.error(n,o)}var i=ca.getTextarea(t),s=i.$textAreaContainer,a=i.$scroll,u=r.offset().top,l=s.offset().top;a[0].scrollBy({top:u-l,behavior:"smooth"})}},t.showProgressBar=function(e){e<1||ca.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=function(){var e=ii.get(t);null!=e&&e.forEach(function(e){return e.hide()})},t.enable=function(){t.getConfig().readOnly=!1,t.updateView()},t.disable=function(){t.getConfig().readOnly=!0,t.updateView()},t.isDisabled=function(){return t.getConfig().readOnly},t.toDOMNode=function(e){return ca.toDOMNode(t,e)},t.fullScreen=function(){if(!t.isFullScreen){var e=null,n=ca.getToolbar(t);n&&(e=n.$box);var r=ca.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0]){throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致")}r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),t.isFullScreen=!0,t.emit(qo)}},t.unFullScreen=function(){if(t.isFullScreen){var e=ca.getTextarea(t).$box.parent();setTimeout(function(){e.removeClass("w-e-full-screen-container"),t.isFullScreen=!1,t.emit(Ko)},200)}},t.getEditableContainer=function(){return ca.getTextarea(t).$textAreaContainer[0]},t},lu={exports:{}},cu={exports:{}};function du(){if(ba)return Ca;ba=1;return Ca=function(e){return null!=e}}function fu(){if(Aa)return Ba;Aa=1;var e=function(){if(Ea)return wa;Ea=1;var e=du(),t={object:!0,function:!0,undefined:!0};return wa=function(n){return!!e(n)&&hasOwnProperty.call(t,typeof n)}}();return Ba=function(t){if(!e(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(e){return!1}}}function hu(){if(Sa)return Oa;Sa=1;var e=function(){if(xa)return Fa;xa=1;var e=fu();return Fa=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(e){return!1}return!e(t)}}(),t=/^\s*class[\s{/}]/,n=Function.prototype.toString;return Oa=function(r){return!!e(r)&&!t.test(n.call(r))}}function pu(){if(La)return Ra;La=1;var e=(Ta?ja:(Ta=1,ja=function(){}))();return Ra=function(t){return t!==e&&null!==t},Ra}function gu(){return Ua||(Ua=1,Ia=(Na?Pa:(Na=1,Pa=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}))()?Object.keys:function(){if($a)return Ma;$a=1;var e=pu(),t=Object.keys;return Ma=function(n){return t(e(n)?Object(n):n)}}()),Ia}function vu(){if(Wa)return Va;Wa=1;var e=gu(),t=function(){if(Ha)return za;Ha=1;var e=pu();return za=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}(),n=Math.max;return Va=function(r,o){var i,s,a,u=n(arguments.length,2);for(r=Object(t(r)),a=function(e){try{r[e]=o[e]}catch(e){i||(i=e)}},s=1;s<u;++s)e(o=arguments[s]).forEach(a);if(void 0!==i)throw i;return r},Va}function mu(){return Ka?qa:(Ka=1,qa=(ka||(ka=1,_a=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),_a)()?Object.assign:vu())}function yu(){return tu||(tu=1,eu=function(){if(Ya)return Xa;Ya=1;var e="razdwatrzy";return Xa=function(){return"function"==typeof e.contains&&!0===e.contains("dwa")&&!1===e.contains("foo")}}()()?String.prototype.contains:function(){if(Qa)return Za;Qa=1;var e=String.prototype.indexOf;return Za=function(t){return e.call(this,t,arguments[1])>-1},Za}()),eu}function Du(){if(nu)return cu.exports;nu=1;var e=du(),t=hu(),n=mu(),r=function(){if(Ga)return Ja;Ga=1;var e=pu(),t=Array.prototype.forEach,n=Object.create;return Ja=function(r){var o=n(null);return t.call(arguments,function(t){e(t)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(t),o)}),o},Ja}(),o=yu(),i=cu.exports=function(t,i){var s,a,u,l,c;return arguments.length<2||"string"!=typeof t?(l=i,i=t,t=null):l=arguments[2],e(t)?(s=o.call(t,"c"),a=o.call(t,"e"),u=o.call(t,"w")):(s=u=!0,a=!1),c={value:i,configurable:s,enumerable:a,writable:u},l?n(r(l),c):c};return i.gs=function(i,s,a){var u,l,c,d;return"string"!=typeof i?(c=a,a=s,s=i,i=null):c=arguments[3],e(s)?t(s)?e(a)?t(a)||(c=a,a=void 0):a=void 0:(c=s,s=a=void 0):s=void 0,e(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),d={get:s,set:a,configurable:u,enumerable:l},c?n(r(c),d):d},cu.exports}var Cu=(iu||(iu=1,function(e,t){var n,r,o,i,s,a,u,l=Du(),c=ou?ru:(ou=1,ru=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}),d=Function.prototype.apply,f=Function.prototype.call,h=Object.create,p=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var r,i;return c(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},o=function(e,t){var n,r,o,i;if(c(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},i=function(e){var t,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)d.call(r,this,i)}else switch(arguments.length){case 1:f.call(o,this);break;case 2:f.call(o,this,arguments[1]);break;case 3:f.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];d.call(o,this,i)}},s={on:n=function(e,t){var n;return c(t),v.call(this,"__ee__")?n=this.__ee__:(n=m.value=h(null),p(this,"__ee__",m),m.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:r,off:o,emit:i},a={on:l(n),once:l(r),off:l(o),emit:l(i)},u=g({},a),e.exports=t=function(e){return null==e?h(u):g(Object(e),a)},t.methods=s}(lu,lu.exports)),lu.exports),bu=f(Cu);function wu(e){var t=Ei.get(e);return null==t&&(t=bu(),Ei.set(e,t)),t}var Eu=new WeakMap;function Bu(e,t){var n=Eu.get(e);null==n&&(n=new Set,Eu.set(e,n)),n.add(t)}var Au=function(e){var t=e;return t.on=function(e,n){var r=wu(t);if(r.on(e,n),"destroyed"===e&&Bu(t,n),"destroyed"!==e){var o=function(){return r.off(e,n)};r.on("destroyed",o),Bu(t,o)}},t.once=function(e,n){wu(t).once(e,n)},t.off=function(e,n){wu(t).off(e,n)},t.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=wu(t);if(o.emit.apply(o,s([e],i(n),!1)),"destroyed"===e){var a=function(e){return Eu.get(e)||new Set}(t);a.forEach(function(e){return o.off("destroyed",e)}),function(e){Eu.set(e,new Set)}(t)}},t};var Fu=function(e){var t=e;return t.setFragmentData=function(e){var n=t.selection;if(n){var r=i(jn.edges(n),2),o=r[0],s=r[1],a=wr.void(t,{at:o.path}),u=wr.void(t,{at:s.path});if(!jn.isCollapsed(n)||a){var l=ca.toDOMRange(t,n),c=l.cloneContents(),d=c.childNodes[0];if(c.childNodes.forEach(function(e){e.textContent&&""!==e.textContent.trim()&&(d=e)}),u){var f=i(u,1)[0],h=l.cloneRange(),p=ca.toDOMNode(t,f);h.setEndAfter(p),c=h.cloneContents()}if(a&&(d=c.querySelector("[data-slate-spacer]")),Array.from(c.querySelectorAll("[data-slate-zero-width]")).forEach(function(e){var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""}),bs(d)){var g=d.ownerDocument.createElement("span");g.style.whiteSpace="pre",g.appendChild(d),c.appendChild(g),d=g}var v=t.getFragment(),m=JSON.stringify(v),y=window.btoa(encodeURIComponent(m));d.setAttribute("data-slate-fragment",y),e.setData("application/x-slate-fragment",y);var D=c.ownerDocument.createElement("div");return D.appendChild(c),D.setAttribute("hidden","true"),c.ownerDocument.body.appendChild(D),e.setData("text/html",D.innerHTML),e.setData("text/plain",Bs(D)),c.ownerDocument.body.removeChild(D),e}}},t.insertData=function(e){var n=e.getData("application/x-slate-fragment");if(n){var r=decodeURIComponent(window.atob(n)),o=JSON.parse(r);t.insertFragment(o)}else{var i=e.getData("text/plain"),s=e.getData("text/html");if(s){var a=t.getConfig().sanitizeHtml;t.dangerouslyInsertHtml(a?a(s):s)}else if(i){if(!/[\r\n]/.test(i))return void t.insertText(i);var u=function(e){return e.replace(/\n\r|\r\n|\r/g,"\n").split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}})}(i);t.insertFragment(u)}}},t},xu={isHistory:e=>qn(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||Wn.isOperationList(e.redos[0].operations))&&(0===e.undos.length||Wn.isOperationList(e.undos[0].operations))},Ou=new WeakMap,Su=new WeakMap,_u=new WeakMap,ku={isHistoryEditor:e=>xu.isHistory(e.history)&&wr.isEditor(e),isMerging:e=>Su.get(e),isSplittingOnce:e=>_u.get(e),setSplittingOnce(e,t){_u.set(e,t)},isSaving:e=>Ou.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=ku.isMerging(e);Su.set(e,!0),t(),Su.set(e,n)},withNewBatch(e,t){var n=ku.isMerging(e);Su.set(e,!0),_u.set(e,!0),t(),Su.set(e,n),_u.delete(e)},withoutMerging(e,t){var n=ku.isMerging(e);Su.set(e,!1),t(),Su.set(e,n)},withoutSaving(e,t){var n=ku.isSaving(e);Ou.set(e,!1);try{t()}finally{Ou.set(e,n)}}},Pu=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!xn.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!xn.equals(e.path,t.path)),Nu=(e,t)=>"set_selection"!==e.type,ju=function(e){var t=(e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&Zr.setSelection(t,r.selectionBefore),ku.withoutSaving(t,()=>{wr.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];ku.withoutSaving(t,()=>{wr.withoutNormalizing(t,()=>{var e=r.operations.map(Wn.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&Zr.setSelection(t,r.selectionBefore)})}),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,s=i[i.length-1],a=s&&s.operations[s.operations.length-1],u=ku.isSaving(t),l=ku.isMerging(t);if(null==u&&(u=Nu(e)),u){if(null==l&&(l=null!=s&&(!!r.includes(a)||Pu(e,a))),ku.isSplittingOnce(t)&&(l=!1,ku.setSplittingOnce(t,void 0)),s&&l)s.operations.push(e);else{var c={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",c)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t})(e);return t.clearHistory=function(){t.history.undos=[],t.history.redos=[]},t};function Tu(e){return e.replace(/\n\r|\r\n|\r|\n/g,"").length}function Ru(e,t){var n,r;if(t<=0)return"";var i=t,s="";try{for(var a=o(e),u=a.next();!u.done;u=a.next()){var l=u.value;if(/\r|\n/.test(l))s+=l;else{if(i<=0)break;s+=l,i-=1}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s}var Lu=function(e){var t=e,n=t.insertText,r=t.insertNode,o=t.insertFragment,i=t.dangerouslyInsertHtml;return t.insertText=function(e){if(t.getConfig().maxLength){var r=ca.getLeftLengthOfMaxLength(t);r<=0||(r<e.length?n(e.slice(0,r)):n(e))}else n(e)},t.insertNode=function(e){if(t.getConfig().maxLength){var n=ca.getLeftLengthOfMaxLength(t);if(!(n<=0))n<Un.string(e).length||r(e)}else r(e)},t.insertFragment=function(e){if(t.getConfig().maxLength){if(e.length>0){var n=e[0];if(ca.getLeftLengthOfMaxLength(t)<Un.string(n).length)return;o([n]);for(var r=1;r<e.length;r+=1)t.insertNode(e[r])}}else o(e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e)if(t.getConfig().maxLength){var r=ca.getLeftLengthOfMaxLength(t);if(!(r<=0)){var o=function(e,t){if(t<=0)return"";var n=document.createElement("div");n.innerHTML=e;var r=function(e){e.forEach(function(e){return e.remove()})},o=function(e){for(var n=Array.from(e.childNodes),i=0;i<n.length;i+=1){var s=n[i];if(bs(s)){var a=s.textContent||"",u=Tu(a);if(u<=t){t-=u;continue}return s.textContent=Ru(a,t),t=0,r(n.slice(i+1)),!1}if(Ds(s)){if(Oi.has(s.nodeName.toLowerCase())){s.remove();continue}if(!o(s))return r(n.slice(i+1)),!1}else s.remove()}return t>0};return o(n),n.innerHTML}(e,r);o&&i(o,n)}}else i(e,n)},t};function Mu(e){return e<0?0:e}function $u(e){var t=ca.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function Iu(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=$u(e);if(null==r)return t;var o=r.top,i=r.left,s=r.width,a=r.height,u=ca.toDOMRange(e,n).getClientRects(),l=u?u[0]:null;if(null==l)return t;var c={},d=l.top-o,f=l.left-i;if(f>s/2){var h=Mu(s-f);c.right="".concat(h+5,"px")}else{var p=Mu(f);c.left="".concat(p+5,"px")}if(d>a/2){var g=Mu(a-d);c.bottom="".concat(g+5,"px")}else{var v=u[u.length-1],m=v.top-o+v.height;m<0&&(m=0),c.top="".concat(m+5,"px")}return c}function Uu(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=Rn.isElement(t)&&e.isVoid(t),i=Rn.isElement(t)&&e.isInline(t),s=yi.get(t);if(null==s)return r;var a=s.getBoundingClientRect(),u=a.top,l=a.left,c=a.height,d=a.width;if(o){var f=function(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if((n+=1)>1e4)break;var o=r.nodeName;if(r.nodeType===ps.ELEMENT_NODE){var i=o.toLowerCase();if(hs.includes(i)||"iframe"===i||"video"===i)return r;var s=r.children||[],a=s.length;if(a)for(var u=a-1;u>=0;u-=1)t.push(s[u])}}return null}(s);if(null!=f){var h=f.getBoundingClientRect();u=h.top,c=h.height}}var p=$u(e);if(null==p)return r;var g=p.top,v=p.left,m=p.width,y=p.height,D={},C=u-g,b=l-v;if("bar"===n){if(D.left="".concat(Mu(b),"px"),C>40){var w=Mu(y-C);D.bottom="".concat(w+5,"px")}else D.top="".concat(C+c+5,"px");return D}if("modal"===n){if(o)if(i)if(b>(m-d)/2){var E=Mu(m-b);D.right="".concat(E+5,"px")}else{var B=Mu(b+d);D.left="".concat(B+5,"px")}else D.left="20px";else D.left="".concat(Mu(b),"px");if(o)(A=C)<0&&(A=0),D.top="".concat(A,"px");else if(C>(y-c)/2){w=Mu(y-C);D.bottom="".concat(w+5,"px")}else{var A;(A=C+c)<0&&(A=0),D.top="".concat(A+5,"px")}return D}throw new Error("type '".concat(n,"' is invalid"))}function zu(e,t){pn(function(){var n=$u(e);if(null!=n){var r,o=n.top,i=n.left,s=n.width,a=n.height,u=t.offset(),l=u.top,c=u.left,d=t.width(),f=t.height(),h=l-o,p=c-i,g=t.attr("style");if(g.indexOf("top")>=0)if((r=h+f-a)>0){var v=t.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),t.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=t.css("bottom"),D=parseInt(y.toString(),10)-Math.abs(l);t.css("bottom","".concat(D,"px"))}if(g.indexOf("left")>=0)if((r=p+d-s)>0){var C=t.css("left"),b=parseInt(C.toString(),10)-r;b<0&&(b=0),t.css("left","".concat(b,"px"))}if(g.indexOf("right")>=0&&p<0){var w=t.css("right"),E=parseInt(w.toString(),10)-Math.abs(p);t.css("right","".concat(E,"px"))}}})}var Hu,Vu,Wu=function(e){var t=e,n=t.select,r=t.deselect,o=t.move;return t.select=function(e){n(e)},t.deselect=function(){var e=t.selection,n=ca.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&ca.hasDOMNode(t,n.anchorNode)&&ca.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=function(e,t){void 0===t&&(t=!1),"number"==typeof e?e&&(e<0||o({distance:e,unit:"character",reverse:t})):o(e)},t.moveReverse=function(e){t.move(e,!0)},t.restoreSelection=function(){var e=wi.get(t);null!=e&&(t.focus(),n(e))},t.getSelectionPosition=function(){return Iu(t)},t.getNodePosition=function(e){return Uu(t,e)},t.isSelectedAll=function(){var e=t.selection;if(null==e)return!1;var n=i(jn.edges(e),2),r=n[0],o=n[1],s=i(wr.edges(t,[]),2),a=s[0],u=s[1];return!(!Fr.equals(r,a)||!Fr.equals(o,u))},t.selectAll=function(){var e=wr.start(t,[]),r=wr.end(t,[]);n({anchor:e,focus:r})},t};var qu=function(){if(Vu)return Hu;Vu=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,i="object"==typeof d&&d&&d.Object===Object&&d,s="object"==typeof self&&self&&self.Object===Object&&self,a=i||s||Function("return this")(),u=Object.prototype.toString,l=Math.max,c=Math.min,f=function(){return a.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(i){if("number"==typeof i)return i;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(i))return NaN;if(h(i)){var s="function"==typeof i.valueOf?i.valueOf():i;i=h(s)?s+"":s}if("string"!=typeof i)return 0===i?i:+i;i=i.replace(e,"");var a=n.test(i);return a||r.test(i)?o(i.slice(2),a?2:8):t.test(i)?NaN:+i}return Hu=function(e,t,n){var r,o,i,s,a,u,d=0,g=!1,v=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,d=t,s=e.apply(i,n)}function D(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-d>=i}function C(){var e=f();if(D(e))return b(e);a=setTimeout(C,function(e){var n=t-(e-u);return v?c(n,i-(e-d)):n}(e))}function b(e){return a=void 0,m&&r?y(e):(r=o=void 0,s)}function w(){var e=f(),n=D(e);if(r=arguments,o=this,u=e,n){if(void 0===a)return function(e){return d=e,a=setTimeout(C,t),g?y(e):s}(u);if(v)return a=setTimeout(C,t),y(u)}return void 0===a&&(a=setTimeout(C,t)),s}return t=p(t)||0,h(n)&&(g=!!n.leading,i=(v="maxWait"in n)?l(p(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),w.cancel=function(){void 0!==a&&clearTimeout(a),d=0,r=u=o=a=void 0},w.flush=function(){return void 0===a?s:b(f())},w},Hu}(),Ku=f(qu);const Ju=e=>"string"==typeof e,Gu=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Xu=e=>null==e?"":""+e,Yu=/###/g,Zu=e=>e&&e.indexOf("###")>-1?e.replace(Yu,"."):e,Qu=e=>!e||Ju(e),el=(e,t,n)=>{const r=Ju(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Qu(e))return{};const t=Zu(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Qu(e)?{}:{obj:e,k:Zu(r[o])}},tl=(e,t,n)=>{const{obj:r,k:o}=el(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=el(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=el(e,s,Object),a&&a.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},nl=(e,t)=>{const{obj:n,k:r}=el(e,t);if(n)return n[r]},rl=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Ju(e[r])||e[r]instanceof String||Ju(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):rl(e[r],t[r],n):e[r]=t[r]);return e},ol=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var il={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const sl=e=>Ju(e)?e.replace(/[&<>"'\/]/g,e=>il[e]):e;const al=[" ",",","?","!",";"],ul=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),ll=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let s=e;s<r.length;++s)if(s!==e&&(i+=n),i+=r[s],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;e+=s-e+1;break}o=t}return o},cl=e=>e&&e.replace("_","-"),dl={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class fl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||dl,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Ju(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new fl(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new fl(this.logger,e)}}var hl=new fl;class pl{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(e=>{let[t,r]=e;for(let e=0;e<r;e++)t(...n)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(t=>{let[r,o]=t;for(let t=0;t<o;t++)r.apply(r,[e,...n])})}}}class gl extends pl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):Ju(n)&&o?s.push(...n.split(o)):s.push(n)));const a=nl(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Ju(n)?ll(this.data&&this.data[e]&&this.data[e][t],n,o):a}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),tl(this.data,s,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)(Ju(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=n,n=t,t=s[1]),this.addNamespaces(t);let a=nl(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?rl(a,n,o):a={...a,...n},tl(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var vl={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};const ml={};class yl extends pl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=hl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=al.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=ul.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Ju(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Ju(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:s}=this.extractFromKey(e[e.length-1],t),a=s[s.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${a}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:i}const c=this.resolve(e,t);let d=c&&c.res;const f=c&&c.usedKey||i,h=c&&c.exactUsedKey||i,p=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!Ju(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(v&&d&&m&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0)||Ju(g)&&Array.isArray(d))if(v&&Ju(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,s=!1;const l=void 0!==t.count&&!Ju(t.count),f=yl.hasDefaultValue(t),h=l?this.pluralResolver.getSuffix(u,t.count,t):"",p=t.ordinal&&l?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",g=l&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${h}`]||t[`defaultValue${p}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=v),this.isValidLookup(d)||(s=!0,d=i);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:d,y=f&&v!==d&&this.options.updateMissing;if(s||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,a,i,y?v:d),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,a,n,o,y,t),this.emit("missingKey",e,a,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?e.forEach(e=>{const n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||v)})}):r(e,i,v))}d=this.extendTranslation(d,e,t,c,n),s&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${a}:${i}`),(s||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,r?d:void 0):this.options.parseMissingKeyHandler(d))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:s}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(o){const e=Array.isArray(d),n=e?[]:{},r=e?h:f;for(const e in d)if(Object.prototype.hasOwnProperty.call(d,e)){const i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:s}),n[e]===i&&(n[e]=d[e])}d=n}}return r?(c.res=d,c.usedParams=this.getUsedParamsDetails(t),c):d}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const s=Ju(e)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(s){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let u=n.replace&&!Ju(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),s){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):i.translate(...r,t)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,a=Ju(s)?[s]:s;return null!=e&&a&&a.length&&!1!==n.applyPostProcessor&&(e=vl.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,o,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ju(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,s),u=a.key;n=u;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==s.count&&!Ju(s.count),d=c&&!s.ordinal&&0===s.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&(Ju(s.context)||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(i=e,!ml[`${h[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(ml[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${h.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(n=>{if(this.isValidLookup(t))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,e,s);else{let e;c&&(e=this.pluralResolver.getSuffix(n,s.count,s));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+e),s.ordinal&&0===e.indexOf(r)&&i.push(u+e.replace(r,this.options.pluralSeparator)),d&&i.push(u+t)),f){const n=`${u}${this.options.contextSeparator}${s.context}`;i.push(n),c&&(i.push(n+e),s.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),d&&i.push(n+t))}}let a;for(;a=i.pop();)this.isValidLookup(t)||(r=a,t=this.getResource(n,e,a,s))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Ju(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}const Dl=e=>e.charAt(0).toUpperCase()+e.slice(1);class Cl{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hl.create("languageUtils")}getScriptPartFromCode(e){if(!(e=cl(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=cl(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ju(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Dl(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Dl(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Dl(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Ju(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Ju(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Ju(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}let bl=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],wl={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const El=["v1","v2","v3"],Bl=["v4"],Al={zero:0,one:1,two:2,few:3,many:4,other:5};class Fl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=hl.create("pluralResolver"),this.options.compatibilityJSON&&!Bl.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return bl.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:wl[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const n=cl("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!e.match(/-|_/))return;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Al[e]-Al[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!El.includes(this.options.compatibilityJSON)}}const xl=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const r=nl(e,n);return void 0!==r?r:nl(t,n)})(e,t,n);return!i&&o&&Ju(n)&&(i=ll(e,n,r),void 0===i&&(i=ll(t,n,r))),i},Ol=e=>e.replace(/\$/g,"$$$$");class Sl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=hl.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:h,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:sl,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?ol(o):i||"{{",this.suffix=s?ol(s):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=d?ol(d):f||ol("$t("),this.nestingSuffix=h?ol(h):p||ol(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const o=xl(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(xl(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,d=[{regex:this.regexpUnescape,safeValue:e=>Ol(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Ol(this.escape(e)):Ol(e)}];return d.forEach(t=>{for(s=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const t=l(e,o,r);i=Ju(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Ju(i)||this.useRawValueToEscape||(i=Xu(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const s=i.match(/'/g),a=i.match(/"/g);(s&&s.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];o={...i},o=o.replace&&!Ju(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),a=e,u=!0}if(r=t(s.call(this,n[1].trim(),o),o),r&&n[0]===e&&!Ju(r))return r;Ju(r)||(r=Xu(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=a.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const _l=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=t[s];return a||(a=e(cl(r),o),t[s]=a),a(n)}};class kl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=hl.create("formatter"),this.options=e,this.formats={number:_l((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:_l((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:_l((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:_l((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:_l((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=_l(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const s=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},a=s.locale||s.lng||r.locale||r.lng||n;t=this.formats[o](e,a,{...i,...r,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Pl extends pl{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=hl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},s={},a={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))}),r||(s[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=el(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"==typeof n.then?n.then(e=>s(null,e)).catch(s):s(null,n)}catch(e){s(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Ju(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ju(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const a={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(e,t,n,r,a):u(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else u(e,t,n,r,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const Nl=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Ju(e[1])&&(t.defaultValue=e[1]),Ju(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),jl=e=>(Ju(e.ns)&&(e.ns=[e.ns]),Ju(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ju(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Tl=()=>{};class Rl extends pl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=jl(e),this.services={},this.logger=hl,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(Ju(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Nl();this.options={...r,...this.options,...jl(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?hl.init(o(this.modules.logger),this.options):hl.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=kl);const n=new Cl(this.options);this.store=new gl(this.options.resources,this.options);const i=this.services;i.logger=hl,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Fl(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Sl(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Pl(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new yl(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Tl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const i=Gu(),s=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tl;const n=Ju(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e))}this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){const r=Gu();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Tl),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&vl.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=Gu();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},s=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Ju(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var s=arguments.length,a=new Array(s>2?s-2:0),u=2;u<s;u++)a[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([e,t].concat(a))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const l=r.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(e)?e.map(e=>`${i.keyPrefix}${l}${e}`):i.keyPrefix?`${i.keyPrefix}${l}${e}`:e,r.t(c,i)};return Ju(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=Gu();return this.options.ns?(Ju(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Gu();Ju(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new Cl(Nl());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Rl(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tl;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Rl(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new gl(this.store.data,r),o.services.resourceStore=o.store),o.translator=new yl(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit(e,...n)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ll=Rl.createInstance();Ll.createInstance=Rl.createInstance,Ll.createInstance,Ll.dir,Ll.init,Ll.loadResources,Ll.reloadResources,Ll.use,Ll.changeLanguage,Ll.getFixedT,Ll.t,Ll.exists,Ll.setDefaultNamespace,Ll.hasLoadedNamespace,Ll.loadNamespaces,Ll.loadLanguages;var Ml="translation";function $l(e,t){Ll.addResourceBundle(e,Ml,t,!0,!0)}function Il(e){Ll.changeLanguage(e)}function Ul(e){return Ll.getResourceBundle(e,Ml)}function zl(e){return Ll.on("languageChanged",e),function(){return Ll.off("languageChanged",e)}}Ll.init({lng:"zh-CN",resources:{}});var Hl=Ll.t.bind(Ll);function Vl(e){if(e.removeAttr){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&Vl(t)}}function Wl(){return Mi('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function ql(){return Mi('<div class="w-e-bar-divider"></div>')}var Kl=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=ii.get(e);null==t&&(t=new Set,ii.set(e,t)),t.add(this),si.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=si.get(this);e&&e.emit(Jo,this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=si.get(this);e&&e.emit(Go)}},e}(),Jl=function(e){function n(){var t=e.apply(this,s([],i(arguments),!1))||this;return t.type="dropPanel",t.$elem=Mi('<div class="w-e-drop-panel"></div>'),t}return t(n,e),n.prototype.genSelfElem=function(){return null},n}(Kl);function Gl(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=ta?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var s=r?"".concat(n,"\n").concat(r):n;e.attr("data-tooltip",s),e.addClass("w-e-menu-tooltip-v5")}}}var Xl=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=Mi('<div class="w-e-bar-item"></div>'),this.$button=Mi('<button type="button"></button>'),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'button'"));var s=t.title,a=t.hotkey,u=void 0===a?"":a,l=t.iconSvg,c=void 0===l?"":l,d=this.$button;if(c){var f=Mi(c);Vl(f),d.append(f)}else d.text(s);Gl(d,c,s,u,n),n&&c&&d.append(Mi('<span class="title">'.concat(s,"</span>"))),i&&d.css("width","".concat(i,"px")),d.attr("data-menu-key",e),this.$elem.append(d),pn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(t){t.preventDefault(),uc(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())})},e.prototype.exec=function(){var e=uc(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()},e.prototype.setActive=function(){var e=uc(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=uc(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=uc(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=Mi(n);Vl(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=uc(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&Gl(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()},e}(),Yl=function(e){function n(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=Wl();o.$button.append(i)}return o}return t(n,e),n.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},n.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=uc(this);if(null==this.dropPanel){var n=new Jl(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=e.getPanelContentElem(t);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var s=this.$elem,a=s.offset().left,u=s.parents(".w-e-bar");a-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},n}(Xl),Zl=function(){function e(e){this.$elem=Mi('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=Mi('<div class="w-e-bar-item-menus-container"></div>'),this.$button=Mi('<button type="button"></button>');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var s=Mi(n);Vl(s),i.append(s)}else i.text(r);i.attr("data-menu-key",t);var a=Wl();i.append(a),o.append(i);var u=this.$container;o.append(u);var l=this.createObserver();this.observe(l)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver(function(){var o=t.find("button"),i=o.length;if(0!==i){var s=0;o.each(function(e){Mi(e).hasClass("disabled")&&(s+=1)}),r.disconnect(),s===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}});return r},e}(),Ql=function(e){function n(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=Mi('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",function(e){return e.stopPropagation()}),o.on("keyup",function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())}),r}return t(n,e),n.prototype.genSelfElem=function(){var e=this,t=Mi('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=si.get(this);return t.on("click",function(){e.hide(),null==n||n.restoreSelection()}),t},n.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width","".concat(t,"px")),n.css(e)},n}(Kl);function ec(e,t,n){var r=Mi('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=Mi('<input type="text" id="'.concat(t,'" placeholder="').concat(n||"",'">'));return r.append(o),[r[0],o[0]]}function tc(e,t,n){var r=Mi('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=Mi('<textarea type="text" id="'.concat(t,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(o),[r[0],o[0]]}function nc(e,t){var n=Mi('<div class="button-container"></div>'),r=Mi('<button type="button" id="'.concat(e,'">').concat(t,"</button>"));return n.append(r),[n[0],r[0]]}var rc=function(e){function n(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=Mi("body"),o.modal=null,o.menu=n,o}return t(n,e),n.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},n.prototype.getPosition=function(){var e=uc(this),t=this.menu.getModalPositionNode(e);return Rn.isElement(t)?Uu(e,t,"modal"):Iu(e)},n.prototype.handleModal=function(){var e=uc(this),t=this.menu;if(null==this.modal){var n=new Ql(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},n.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=uc(this),r=this.menu;if(null!=r.getModalContentElem){var o=ca.getTextarea(n),i=ca.getToolbar(n),s=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,a=r.getModalContentElem(n);if(e.renderContent(a),s)e.setStyle({left:"0",right:"0"});else{var u=this.getPosition();e.setStyle(u)}t&&(s?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),s||zu(n,e.$elem),setTimeout(function(){n.blur()})}},n}(Xl);var oc=function(e){function n(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=Mi('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",function(e){e.stopPropagation()}),r}return t(n,e),n.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=Mi("<ul></ul>");e.forEach(function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,s=Mi('<li data-value="'.concat(t,'"></li>'));if(i&&s.css(i),o){var a=Mi('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');s.append(a),s.addClass("selected")}s.append(Mi('<span data-value="'.concat(t,'">').concat(r,"</span>"))),s.attr("title",r),n.append(s)}),t.append(n)},n.prototype.genSelfElem=function(){return null},n}(Kl);var ic=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=Mi('<div class="w-e-bar-item"></div>'),this.$button=Mi('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,s=t.width,a=t.iconSvg,u=void 0===a?"":a,l=t.hotkey,c=void 0===l?"":l;if("select"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'select'"));var d=this.$button;s&&d.css("width","".concat(s,"px")),d.attr("data-menu-key",e),Gl(d,u,i,c,n),this.$elem.append(d),this.menu=t,pn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",function(t){t.preventDefault(),uc(e).hidePanelOrModal(),e.trigger()})},e.prototype.trigger=function(){var e=this,t=uc(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new oc(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=Mi(n).attr("data-value");e.onChange(r)}})}else{if((r=this.selectList).isShow)r.hide();else{o=n.getOptions(t);r.renderList(o),r.show()}}}},e.prototype.onChange=function(e){var t=uc(this),n=this.menu;null!=n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=uc(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o<n;o+=1){var i=e[o];if(i.value===t){r=i.text;break}}return r}(t.getOptions(e),n.toString()),o=this.$button,i=Wl();o.empty(),o.text(r),o.append(i)},e.prototype.setDisabled=function(){var e=uc(this),t=this.menu.isDisabled(e),n=this.$button;(null==e.selection||e.isDisabled())&&(t=!0);var r="disabled";t?n.addClass(r):n.removeClass(r),this.disabled=t},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),sc=function(e){function n(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return t(n,e),n.prototype.onButtonClick=function(){},n}(Xl),ac=new WeakMap;function uc(e){var t=oi.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function lc(e,t,n){void 0===n&&(n=!1);var r=ac.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,s=t.showModal;r=i?new Yl(e,t,n):s?new rc(e,t,n):new sc(e,t,n)}if("select"===o&&(r=new ic(e,t,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(t)));return ac.set(t,r),r}function cc(e,t){var n=e.selection;return null!=n&&(!jn.isCollapsed(n)&&(!ca.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)})&&!!Nr.isText(t)))}var dc=function(){function e(){var e=this;this.$elem=Mi('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=Ku(function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,i=n.menuKeys,s=void 0===i?[]:i,a=e.getEditorInstance();if(null!=o&&e.changeItemsState(),o&&Rn.isElement(o)&&t){var u=e.isSamePath(o,e.prevSelectedNode);if(!wr.isBlock(a,o)&&u)return}e.hideAndClean(),null!=o&&(e.registerItems(s),e.setPosition(o),e.show()),e.prevSelectedNode=o},200),pn(function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),ca.getTextarea(t).$textAreaContainer.append(n),t.on(Vo,e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on(Wo,r),t.on(qo,r),t.on(Ko,r)}),this.lngListen=zl(function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&(n-e[0].getBoundingClientRect().bottom<360&&(t=!0));t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var e=this;pn(function(){e.hoverbarItems.forEach(function(e){e.changeMenuState()})})},e.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach(function(e){if("|"!==e)t.registerSingleItem(e);else{var r=ql();n.append(r)}})},e.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=Xo[e];if(null==o)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var s=lc(e,r);this.hoverbarItems.push(s),oi.set(s,t),this.$elem.append(s.$elem)},e.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Rn.isElement(e)){var r=Uu(t,e,"bar");return n.css(r),void zu(t,n)}if(Nr.isText(e)){r=Iu(t);return n.css(r),void zu(t,n)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var e=this.getEditorInstance();if(null==e.selection)return null;var t=this.getHoverbarKeysConf(),n=null,r=[],o=function(o){var s=t[o],a=s.match,u=s.menuKeys,l=void 0===u?[]:u,c=a||function(e,t){return ca.checkNodeType(t,o)},d=a?null:ca.getSelectedNodeByType(e,o),f=i(d?[[d]]:wr.nodes(e,{match:function(t){return c(e,t)},universal:!0}),1),h=f[0];if(null!=h)return n=h[0],r=l,"break"};for(var s in t){if("break"===o(s))break}return null==n||0===r.length?null:{node:n,menuKeys:r}},e.prototype.getEditorInstance=function(){var e=ni.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=cc),t},e.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var n=ca.findPath(null,e),r=ca.findPath(null,t);return xn.equals(n,r)},e.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}(),fc=f(le());function hc(e,t){return ms(t)&&ca.hasDOMNode(e,t,{editable:!0})}function pc(e,t){return ms(t)&&ca.hasDOMNode(e,t)}function gc(e,t){if(hc(e,t))return!0;if(!pc(e,t))return!1;var n=null;return Ds(t)?n=t:bs(t)&&(n=t.parentElement),!!(null==n?void 0:n.closest("[data-w-e-reserve]"))||function(e,t){if(e.getConfig().readOnly)return!1;var n=pc(e,t)&&ca.toSlateNode(e,t);return!!n&&Rn.isElement(n)&&wr.isVoid(e,n)}(e,t)}const vc=e=>"object"==typeof e&&null!=e&&1===e.nodeType,mc=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,yc=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return mc(n.overflowY,t)||mc(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Dc=(e,t,n,r,o,i,s,a)=>i<e&&s>t||i>e&&s<t?0:i<=e&&a<=n||s>=t&&a>=n?i-e-r:s>t&&a<n||i<e&&a>n?s-t+o:0,Cc=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},bc=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:s,block:a,inline:u,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!vc(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,h=[];let p=e;for(;vc(p)&&d(p);){if(p=Cc(p),p===f){h.push(p);break}null!=p&&p===document.body&&yc(p)&&!yc(document.documentElement)||null!=p&&yc(p,c)&&h.push(p)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:D,width:C,top:b,right:w,bottom:E,left:B}=e.getBoundingClientRect(),{top:A,right:F,bottom:x,left:O}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let S="start"===a||"nearest"===a?b-A:"end"===a?E+x:b+D/2-A+x,_="center"===u?B+C/2-O+F:"end"===u?w+F:B-O;const k=[];for(let e=0;e<h.length;e++){const t=h[e],{height:n,width:r,top:o,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===s&&b>=0&&B>=0&&E<=v&&w<=g&&(t===f&&!yc(t)||b>=o&&E<=l&&B>=c&&w<=i))return k;const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),A=parseInt(d.borderTopWidth,10),F=parseInt(d.borderRightWidth,10),x=parseInt(d.borderBottomWidth,10);let O=0,P=0;const N="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-F:0,j="offsetHeight"in t?t.offsetHeight-t.clientHeight-A-x:0,T="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,R="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)O="start"===a?S:"end"===a?S-v:"nearest"===a?Dc(y,y+v,v,A,x,y+S,y+S+D,D):S-v/2,P="start"===u?_:"center"===u?_-g/2:"end"===u?_-g:Dc(m,m+g,g,p,F,m+_,m+_+C,C),O=Math.max(0,O+y),P=Math.max(0,P+m);else{O="start"===a?S-o-A:"end"===a?S-l+x+j:"nearest"===a?Dc(o,l,n,A,x+j,S,S+D,D):S-(o+n/2)+j/2,P="start"===u?_-c-p:"center"===u?_-(c+r/2)+N/2:"end"===u?_-i+F+N:Dc(c,i,r,p,F+N,_,_+C,C);const{scrollLeft:e,scrollTop:s}=t;O=0===R?0:Math.max(0,Math.min(s+O/R,t.scrollHeight-n/R+j)),P=0===T?0:Math.max(0,Math.min(e+P/T,t.scrollWidth-r/T+N)),S+=s-O,_+=e-P}k.push({el:t,top:O,left:P})}return k};function wc(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(bc(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:s}of bc(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=s-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}function Ec(e){null!=e.selection&&(e.selection=null,e.onChange())}function Bc(e,t,n){void 0===n&&(n=!1);var r=t.selection,o=t.getConfig(),i=ca.findDocumentOrShadowRoot(t).getSelection();if(i&&(!e.isComposing||n)&&t.isFocused()){var s="None"!==i.type;if(r||s){var a=gi.get(t),u=!1;if(a.contains(i.anchorNode)&&a.contains(i.focusNode)&&(u=!0),s&&u&&r){var l=ca.toSlateRange(t,i,{exactMatch:!0,suppressThrow:!0});if(l&&jn.equals(l,r)){var c=!0;if(jn.isCollapsed(r)){var d=i.anchorNode,f=i.anchorOffset;if(d===a){var h=a.childNodes,p=void 0;(p=h[f])&&p.matches("table")&&(c=!1),(p=h[f-1])&&p.matches("table")&&(c=!1)}}if(c)return}}if(!r||ca.hasRange(t,r)){e.isUpdatingSelection=!0;var g=null;try{g=r&&ca.toDOMRange(t,r)}catch(e){g=null}if(g){jn.isBackward(r)?i.setBaseAndExtent(g.endContainer,g.endOffset,g.startContainer,g.startOffset):i.setBaseAndExtent(g.startContainer,g.startOffset,g.endContainer,g.endOffset);var v=g.startContainer.parentElement;if(!v.closest("[data-slate-spacer]")&&g.getBoundingClientRect){var m=g.getBoundingClientRect.bind(g)();0===m.top&&0===m.right&&0===m.bottom&&0===m.left&&0===m.height&&0===m.width||(v.getBoundingClientRect=g.getBoundingClientRect.bind(g));var y=document.body;if(wc(v,{scrollMode:"if-needed",boundary:o.scroll&&a.parentElement||y,block:"end",behavior:"auto"}),o.scroll){var D=a.parentElement;if(D){var C=function(){var e=g.getBoundingClientRect(),t=D.getBoundingClientRect(),n=e.bottom-t.bottom,r=t.top-e.top;n>0?D.scrollTop+=n+1:r>0&&(D.scrollTop-=r+1)};C(),requestAnimationFrame(C)}}delete v.getBoundingClientRect}}else i.removeAllRanges();setTimeout(function(){g&&na&&a.focus(),e.isUpdatingSelection=!1})}else t.selection=ca.toSlateRange(t,i,{exactMatch:!1,suppressThrow:!0})}}}var Ac=new WeakMap,Fc=new WeakMap;function xc(e){var t;try{t=ca.findDocumentOrShadowRoot(e)}catch(e){return null}var n=t.getSelection();if(!n||n.rangeCount<=0)return null;try{return n.getRangeAt(0).startContainer}catch(e){return null}}var Oc,Sc={};var _c=function(){if(Oc)return Sc;Oc=1,Object.defineProperty(Sc,"__esModule",{value:!0});for(var e="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function i(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return s(e,t)}),o=function(e){return r.some(function(t){return a(t,e)})};return null==n?o:o(n)}function s(e,o){var i=o&&o.byKey,s={},a=(e=e.replace("++","+add")).split("+"),c=a.length;for(var d in t)s[t[d]]=!1;var f=!0,h=!1,p=void 0;try{for(var g,v=a[Symbol.iterator]();!(f=(g=v.next()).done);f=!0){var m=g.value,y=m.endsWith("?")&&m.length>1;y&&(m=m.slice(0,-1));var D=l(m),C=t[D];if(m.length>1&&!C&&!n[m]&&!r[D])throw new TypeError('Unknown modifier: "'+m+'"');1!==c&&C||(i?s.key=D:s.which=u(m)),C&&(s[C]=!y||null)}}catch(e){h=!0,p=e}finally{try{!f&&v.return&&v.return()}finally{if(h)throw p}}return s}function a(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function u(e){return e=l(e),r[e]||e.toUpperCase().charCodeAt(0)}function l(e){return e=e.toLowerCase(),e=n[e]||e}return Sc.default=i,Sc.isHotkey=i,Sc.isCodeHotkey=function(e,t){return i(e,t)},Sc.isKeyHotkey=function(e,t){return i(e,{byKey:!0},t)},Sc.parseHotkey=s,Sc.compareHotkey=a,Sc.toKeyCode=u,Sc.toKeyName=l,Sc}(),kc={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Pc={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Nc={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},jc=function(e){var t=kc[e],n=Pc[e],r=Nc[e],o=t&&_c.isKeyHotkey(t),i=n&&_c.isKeyHotkey(n),s=r&&_c.isKeyHotkey(r);return function(e){return!(!o||!o(e))||(!!(ta&&i&&i(e))||!(ta||!s||!s(e)))}},Tc={isBold:jc("bold"),isCompose:jc("compose"),isMoveBackward:jc("moveBackward"),isMoveForward:jc("moveForward"),isDeleteBackward:jc("deleteBackward"),isDeleteForward:jc("deleteForward"),isDeleteLineBackward:jc("deleteLineBackward"),isDeleteLineForward:jc("deleteLineForward"),isDeleteWordBackward:jc("deleteWordBackward"),isDeleteWordForward:jc("deleteWordForward"),isExtendBackward:jc("extendBackward"),isExtendForward:jc("extendForward"),isExtendLineBackward:jc("extendLineBackward"),isExtendLineForward:jc("extendLineForward"),isItalic:jc("italic"),isMoveLineBackward:jc("moveLineBackward"),isMoveLineForward:jc("moveLineForward"),isMoveWordBackward:jc("moveWordBackward"),isMoveWordForward:jc("moveWordForward"),isRedo:jc("redo"),isSplitBlock:jc("splitBlock"),isTransposeCharacter:jc("transposeCharacter"),isUndo:jc("undo"),isTab:jc("tab"),isSelectAll:jc("selectAll")};function Rc(e){e.preventDefault()}var Lc={beforeinput:function(e,t,n){var r,o,s=e,a=n.getConfig().readOnly;if(aa&&!a&&hc(n,s.target)){null===(r=t.flushDOMSelectionChange)||void 0===r||r.call(t);var u=n.selection,l=s.inputType,c=s.dataTransfer||s.data||void 0;if("insertCompositionText"!==l&&"deleteCompositionText"!==l){if(s.preventDefault(),!l.startsWith("delete")||l.startsWith("deleteBy")){var d=i(s.getTargetRanges(),1)[0];if(d){var f=null;try{f=ca.toSlateRange(n,d,{exactMatch:!1,suppressThrow:!0})}catch(e){f=null}!f||u&&jn.equals(u,f)||(Zr.select(n,f),u=f)}}if(u&&jn.isExpanded(u)){var h=ca.getSelectedElems(n),p="table"===h[0].type,g="table-cell"!==h[h.length-1].type;if(p&&g)return;if(l.startsWith("delete")){var v=l.endsWith("Backward")?"backward":"forward";return void wr.deleteFragment(n,{direction:v})}}if(null==u&&l.startsWith("insert")){var m=ca.findDocumentOrShadowRoot(n).getSelection();if(m){var y=ca.toSlateRange(n,m,{exactMatch:!1,suppressThrow:!0});y&&(Zr.select(n,y),u=y)}if(null==u){try{null===(o=n.restoreSelection)||void 0===o||o.call(n)}catch(e){}u=n.selection}if(null==u){var D=wr.end(n,[]),C={anchor:D,focus:D};Zr.select(n,C),u=C}}switch(l){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":wr.deleteFragment(n);break;case"deleteContent":case"deleteContentForward":wr.deleteForward(n);break;case"deleteContentBackward":wr.deleteBackward(n);break;case"deleteEntireSoftLine":wr.deleteBackward(n,{unit:"line"}),wr.deleteForward(n,{unit:"line"});break;case"deleteHardLineBackward":wr.deleteBackward(n,{unit:"block"});break;case"deleteSoftLineBackward":wr.deleteBackward(n,{unit:"line"});break;case"deleteHardLineForward":wr.deleteForward(n,{unit:"block"});break;case"deleteSoftLineForward":wr.deleteForward(n,{unit:"line"});break;case"deleteWordBackward":wr.deleteBackward(n,{unit:"word"});break;case"deleteWordForward":wr.deleteForward(n,{unit:"word"});break;case"insertLineBreak":wr.insertText(n,"\n");break;case"insertParagraph":wr.insertBreak(n);break;case"insertFromDrop":case"insertFromComposition":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromComposition"===l&&(t.isComposing=!1,Ai.set(n,!0)),"insertFromPaste"===l&&!Bi.get(n))break;"[object DataTransfer]"===vn(c)?n.insertData(c):"string"==typeof c&&wr.insertText(n,c)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,i=t.latestElement;if(!n.getConfig().readOnly&&!o&&hc(n,r.target)){var s=ca.findDocumentOrShadowRoot(n);if(i!==s.activeElement){var a=r.relatedTarget;if(!(a===ca.toDOMNode(n,n)||Ds(a)&&a.hasAttribute("data-slate-spacer"))){if(null!=a&&ms(a)&&ca.hasDOMNode(n,a)){var u=ca.toSlateNode(n,a);if(Rn.isElement(u)&&!n.isVoid(u))return}if(ra){var l=s.getSelection();null==l||l.removeAllRanges()}bi.delete(n)}}}},focus:function(e,t,n){var r=ca.toDOMNode(n,n),o=ca.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,na&&e.target!==r?r.focus():bi.set(n,!0)},click:function(e,t,n){if(!n.getConfig().readOnly&&pc(n,e.target)&&ms(e.target)){var r=ca.toSlateNode(n,e.target),o=ca.findPath(n,r);if(wr.hasPath(n,o))if(Un.get(n,o)===r){var i=wr.start(n,o),s=wr.end(n,o),a=wr.void(n,{at:i}),u=wr.void(n,{at:s});if(a&&u&&xn.equals(a[1],u[1])){var l=wr.range(n,i);Zr.select(n,l)}}}},compositionstart:function(e,t,n){if(hc(n,e.target)){Fi.delete(n),t.isComposing=!0;var r=n.selection;if(r&&jn.isCollapsed(r)){var o=xc(n);if(o){var i=o.textContent||"";Ac.set(n,i),Fc.set(n,o)}}r&&jn.isExpanded(r)&&(wr.deleteFragment(n),t.changeViewState(),Promise.resolve().then(function(){Bc(t,n,!0)})),function(e,t){var n;t.getConfig().placeholder&&t.isEmpty()&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}(t,n)}},compositionend:function(e,t,n){var r=e;if(hc(n,r.target)){t.isComposing=!1;var o=!0===Ai.get(n);o?(Ai.delete(n),Fi.delete(n)):Fi.delete(n);var s=function(e){var t,n=e.selection;if(n)return n;try{var r=ca.findDocumentOrShadowRoot(e).getSelection();if(r){var o=ca.toSlateRange(e,r,{exactMatch:!1,suppressThrow:!0});o&&(Zr.select(e,o),n=o)}}catch(e){}if(!n){try{null===(t=e.restoreSelection)||void 0===t||t.call(e)}catch(e){}n=e.selection}if(!n){var i=wr.end(e,[]),s={anchor:i,focus:i};Zr.select(e,s),n=s}return n}(n);if(null!=s){(sa||na)&&ca.cleanExposedTexNodeInSelectionBlock(n);for(var a=jn.isBackward(s)?s.focus:s.anchor,u=i(wr.node(n,[a.path[0]]),1)[0],l=0;l<a.path.length;l+=1){var c=i(wr.node(n,a.path.slice(0,l+1)),1)[0];if(Rn.isElement(c)&&((ra||na)&&"link"===c.type||"code"===c.type)){ca.setNewKey(u);break}}var d=r.data;if(d&&!o){if(n.getConfig().maxLength){var f=ca.getLeftLengthOfMaxLength(n);if(f<d.length){var h=xc(n);h&&h.nodeType===Node.TEXT_NODE&&(h.textContent=Ac.get(n)||""),f>0&&wr.insertText(n,d.slice(0,f)),t.changeViewState()}else wr.insertText(n,d)}else{var p=ca.findDocumentOrShadowRoot(n).getSelection();if(p&&function(e,t){if(jn.isCollapsed(t)){var n=t.anchor,r=t.focus;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(0===n.offset||0===r.offset)){var o=wr.node(e,n.path),i=0===n.offset?n.path:r.path,s=[i[0],i[1]-1];if(0===i[1])return!1;var a=wr.node(e,s);if(Nr.isText(a[0])&&Nr.isText(o[0]))return!0}}}(n,s)){var g=ca.toSlateRange(n,p,{exactMatch:!1,suppressThrow:!1});g&&(n.selection=g)}wr.insertText(n,d)}ra||setTimeout(function(){if(null!=n.selection){var e=Fc.get(n);if(null!=e&&e.nodeType===Node.TEXT_NODE){var t=xc(n);null!=t&&t.nodeType===Node.TEXT_NODE&&t!==e&&(e.textContent=Ac.get(n)||"")}}})}}}},compositionupdate:function(e,t,n){hc(n,e.target)&&(t.isComposing=!0)},keydown:function(e,t,n){var i=e,s=n.selection;if(!n.getConfig().readOnly&&!t.isComposing&&hc(n,i.target)){if(function(e,t){var n,i,s=ti.get(e),a=s&&s.getMenus(),u=ri.get(e),l=u&&u.getMenus(),c=r(r({},a),l);try{for(var d=o(Object.keys(c)),f=d.next();!f.done;f=d.next()){var h=c[f.value],p=h.hotkey;if(p&&_c.isHotkey(p,t)&&!h.isDisabled(e)){var g=h.getValue(e);h.exec(e,g)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}(n,i),Tc.isTab(i))return Rc(i),void n.handleTab();if(Tc.isRedo(i))return Rc(i),void("function"==typeof n.redo&&n.redo());if(Tc.isUndo(i))return Rc(i),void("function"==typeof n.undo&&n.undo());if(Tc.isMoveLineBackward(i))return Rc(i),void Zr.move(n,{unit:"line",reverse:!0});if(Tc.isMoveLineForward(i))return Rc(i),void Zr.move(n,{unit:"line"});if(Tc.isExtendLineBackward(i))return Rc(i),void Zr.move(n,{unit:"line",edge:"focus",reverse:!0});if(Tc.isExtendLineForward(i))return Rc(i),void Zr.move(n,{unit:"line",edge:"focus"});if(Tc.isMoveBackward(i))return Rc(i),void(s&&jn.isCollapsed(s)?Zr.move(n,{reverse:!0}):Zr.collapse(n,{edge:"start"}));if(Tc.isMoveForward(i))return Rc(i),void(s&&jn.isCollapsed(s)?Zr.move(n):Zr.collapse(n,{edge:"end"}));if(Tc.isMoveWordBackward(i))return Rc(i),s&&jn.isExpanded(s)&&Zr.collapse(n,{edge:"focus"}),void Zr.move(n,{unit:"word",reverse:!0});if(Tc.isMoveWordForward(i))return Rc(i),s&&jn.isExpanded(s)&&Zr.collapse(n,{edge:"focus"}),void Zr.move(n,{unit:"word"});if(Tc.isSelectAll(i))return Rc(i),void n.selectAll();if(aa){if((sa||ra)&&s&&(Tc.isDeleteBackward(i)||Tc.isDeleteForward(i))&&jn.isCollapsed(s)){var a=Un.parent(n,s.anchor.path);Rn.isElement(a)&&wr.isVoid(n,a)&&wr.isInline(n,a)&&(i.preventDefault(),Zr.delete(n,{unit:"block"}))}}else{if(Tc.isBold(i)||Tc.isItalic(i)||Tc.isTransposeCharacter(i))return void Rc(i);if(Tc.isSplitBlock(i))return Rc(i),void(i.shiftKey?wr.insertText(n,"\n"):wr.insertBreak(n));if(Tc.isDeleteBackward(i))return Rc(i),void(s&&jn.isExpanded(s)?wr.deleteFragment(n,{direction:"backward"}):wr.deleteBackward(n));if(Tc.isDeleteForward(i))return Rc(i),void(s&&jn.isExpanded(s)?wr.deleteFragment(n,{direction:"forward"}):wr.deleteForward(n));if(Tc.isDeleteLineBackward(i))return Rc(i),void(s&&jn.isExpanded(s)?wr.deleteFragment(n,{direction:"backward"}):wr.deleteBackward(n,{unit:"line"}));if(Tc.isDeleteLineForward(i))return Rc(i),void(s&&jn.isExpanded(s)?wr.deleteFragment(n,{direction:"forward"}):wr.deleteForward(n,{unit:"line"}));if(Tc.isDeleteWordBackward(i))return Rc(i),void(s&&jn.isExpanded(s)?wr.deleteFragment(n,{direction:"backward"}):wr.deleteBackward(n,{unit:"word"}));Tc.isDeleteWordForward(i)&&(Rc(i),s&&jn.isExpanded(s)?wr.deleteFragment(n,{direction:"forward"}):wr.deleteForward(n,{unit:"word"}))}}},keypress:function(e,t,n){if(!aa&&!n.getConfig().readOnly&&hc(n,e.target)){e.preventDefault();var r=e.key;wr.insertText(n,r)}},copy:function(e,t,n){var r=e;if(hc(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&(r.preventDefault(),hc(n,r.target))){var i=r.clipboardData;if(null!=i&&(n.setFragmentData(i),o))if(jn.isExpanded(o))wr.deleteFragment(n);else{var s=Un.parent(n,o.anchor.path);Rn.isElement(s)&&wr.isVoid(n,s)&&Zr.delete(n)}}},paste:function(e,t,n){Bi.set(n,!0);var r=e;if(!n.getConfig().readOnly&&hc(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return Bi.set(n,!1),void r.preventDefault();if(ra||!aa||function(e){return e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length}(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(e,t,n){if(pc(n,e.target)){var r=ca.toSlateNode(n,e.target);Rn.isElement(r)&&wr.isVoid(n,r)&&e.preventDefault()}},dragstart:function(e,t,n){var r=e;if(pc(n,r.target)&&!n.getConfig().readOnly){var o=ca.toSlateNode(n,r.target),i=ca.findPath(n,o);if(Rn.isElement(o)&&wr.isVoid(n,o)||wr.void(n,{at:i,voids:!0})){var s=wr.range(n,i);Zr.select(n,s)}var a=r.dataTransfer;if(null!=a)ca.getSelectedNodeByType(n,"table")||(t.isDraggingInternally=!0,n.setFragmentData(a))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&pc(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,n){var r=e,o=r.dataTransfer;if(!n.getConfig().readOnly&&pc(n,r.target)&&null!=o&&!(aa&&ra&&o.files.length>0)){r.preventDefault();var i=n.selection,s=ca.findEventRange(n,r);Zr.select(n,s),t.isDraggingInternally&&(i&&Zr.delete(n,{at:i}),t.isDraggingInternally=!1),n.insertData(o),n.isFocused()||n.focus()}}};function Mc(e){if($c(e)){for(;e&&$c(e);){e=Ic(e).parent}return null!=e?e:null}return e.parentNode}function $c(e){return 11===e.nodeType}function Ic(e,t){var n,r,o;const i=e;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=t?t:null),null!==(r=i.firstChildNode)&&void 0!==r||(i.firstChildNode=e.firstChild),null!==(o=i.lastChildNode)&&void 0!==o||(i.lastChildNode=e.lastChild),i}const Uc={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return Ic(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if($c(e)){let t=e;for(;t&&$c(t);){t=Ic(t).parent}e=null!=t?t:e}$c(t)&&(t=Ic(t,e)),n&&$c(n)&&(n=Ic(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){$c(t)&&(t=Ic(t,e)),e.appendChild(t)},parentNode:Mc,nextSibling:function(e){var t;if($c(e)){const n=Ic(e),r=Mc(n);if(r&&n.lastChildNode){const e=Array.from(r.childNodes),o=e.indexOf(n.lastChildNode);return null!==(t=e[o+1])&&void 0!==t?t:null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:$c};function zc(e,t,n,r,o){return{sel:e,data:t,children:n,text:r,elm:o,key:void 0===t?void 0:t.key}}const Hc=Array.isArray;function Vc(e){return"string"==typeof e||"number"==typeof e||e instanceof String||e instanceof Number}const Wc=zc("",{},[],void 0,void 0);function qc(e,t){var n,r;const o=e.key===t.key,i=(null===(n=e.data)||void 0===n?void 0:n.is)===(null===(r=t.data)||void 0===r?void 0:r.is),s=e.sel===t.sel,a=!(!e.sel&&e.sel===t.sel)||typeof e.text==typeof t.text;return s&&o&&i&&a}function Kc(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const t=null===(r=e[i])||void 0===r?void 0:r.key;void 0!==t&&(o[t]=i)}return o}const Jc=["create","update","remove","destroy","pre","post"];function Gc(e,t,n){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},o=Uc;for(const t of Jc)for(const n of e){const e=n[t];void 0!==e&&r[t].push(e)}function i(e){const t=e.id?"#"+e.id:"",n=e.getAttribute("class"),r=n?"."+n.split(" ").join("."):"";return zc(o.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function s(e){return zc(void 0,{},[],void 0,e)}function a(e,t){return function(){if(0===--t){const t=o.parentNode(e);null!==t&&o.removeChild(t,e)}}}function u(e,t){var n,i,s;let a;const l=e.data,c=null==l?void 0:l.hook;null===(n=null==c?void 0:c.init)||void 0===n||n.call(c,e);const d=e.children,f=e.sel;if("!"===f)null!==(i=e.text)&&void 0!==i||(e.text=""),e.elm=o.createComment(e.text);else if(""===f)e.elm=o.createTextNode(e.text);else if(void 0!==f){const n=f.indexOf("#"),i=f.indexOf(".",n),h=n>0?n:f.length,p=i>0?i:f.length,g=-1!==n||-1!==i?f.slice(0,Math.min(h,p)):f,v=null==l?void 0:l.ns,m=void 0===v?o.createElement(g,l):o.createElementNS(v,g,l);for(e.elm=m,h<p&&m.setAttribute("id",f.slice(h+1,p)),i>0&&m.setAttribute("class",f.slice(p+1).replace(/\./g," ")),a=0;a<r.create.length;++a)r.create[a](Wc,e);if(!Vc(e.text)||Hc(d)&&0!==d.length||o.appendChild(m,o.createTextNode(e.text)),Hc(d))for(a=0;a<d.length;++a){const e=d[a];null!=e&&o.appendChild(m,u(e,t))}void 0!==c&&(null===(s=c.create)||void 0===s||s.call(c,Wc,e),void 0!==c.insert&&t.push(e))}else e.elm=o.createTextNode(e.text);return e.elm}function l(e,t,n,r,i,s){for(;r<=i;++r){const i=n[r];null!=i&&o.insertBefore(e,u(i,s),t)}}function c(e){var t,n;const o=e.data;if(void 0!==o){null===(n=null===(t=null==o?void 0:o.hook)||void 0===t?void 0:t.destroy)||void 0===n||n.call(t,e);for(let t=0;t<r.destroy.length;++t)r.destroy[t](e);if(void 0!==e.children)for(let t=0;t<e.children.length;++t){const n=e.children[t];null!=n&&"string"!=typeof n&&c(n)}}}function d(e,t,n,i){for(var s,u;n<=i;++n){let i;const l=t[n];if(null!=l)if(void 0!==l.sel){c(l),i=r.remove.length+1;const e=a(l.elm,i);for(let t=0;t<r.remove.length;++t)r.remove[t](l,e);const t=null===(u=null===(s=null==l?void 0:l.data)||void 0===s?void 0:s.hook)||void 0===u?void 0:u.remove;void 0!==t?t(l,e):e()}else l.children?(c(l),d(e,l.children,0,l.children.length-1)):o.removeChild(e,l.elm)}}function f(e,t,n){var i,s,a,c,h,p,g,v;const m=null===(i=t.data)||void 0===i?void 0:i.hook;null===(s=null==m?void 0:m.prepatch)||void 0===s||s.call(m,e,t);const y=t.elm=e.elm;if(e===t)return;if(void 0!==t.data||void 0!==t.text&&t.text!==e.text){null!==(a=t.data)&&void 0!==a||(t.data={}),null!==(c=e.data)&&void 0!==c||(e.data={});for(let n=0;n<r.update.length;++n)r.update[n](e,t);null===(g=null===(p=null===(h=t.data)||void 0===h?void 0:h.hook)||void 0===p?void 0:p.update)||void 0===g||g.call(p,e,t)}const D=e.children,C=t.children;void 0===t.text?void 0!==D&&void 0!==C?D!==C&&function(e,t,n,r){let i,s,a,c,h=0,p=0,g=t.length-1,v=t[0],m=t[g],y=n.length-1,D=n[0],C=n[y];for(;h<=g&&p<=y;)null==v?v=t[++h]:null==m?m=t[--g]:null==D?D=n[++p]:null==C?C=n[--y]:qc(v,D)?(f(v,D,r),v=t[++h],D=n[++p]):qc(m,C)?(f(m,C,r),m=t[--g],C=n[--y]):qc(v,C)?(f(v,C,r),o.insertBefore(e,v.elm,o.nextSibling(m.elm)),v=t[++h],C=n[--y]):qc(m,D)?(f(m,D,r),o.insertBefore(e,m.elm,v.elm),m=t[--g],D=n[++p]):(void 0===i&&(i=Kc(t,h,g)),s=i[D.key],void 0===s?(o.insertBefore(e,u(D,r),v.elm),D=n[++p]):void 0===i[C.key]?(o.insertBefore(e,u(C,r),o.nextSibling(m.elm)),C=n[--y]):(a=t[s],a.sel!==D.sel?o.insertBefore(e,u(D,r),v.elm):(f(a,D,r),t[s]=void 0,o.insertBefore(e,a.elm,v.elm)),D=n[++p]));p<=y&&(c=null==n[y+1]?null:n[y+1].elm,l(e,c,n,p,y,r)),h<=g&&d(e,t,h,g)}(y,D,C,n):void 0!==C?(void 0!==e.text&&o.setTextContent(y,""),l(y,null,C,0,C.length-1,n)):void 0!==D?d(y,D,0,D.length-1):void 0!==e.text&&o.setTextContent(y,""):e.text!==t.text&&(void 0!==D&&d(y,D,0,D.length-1),o.setTextContent(y,t.text)),null===(v=null==m?void 0:m.postpatch)||void 0===v||v.call(m,e,t)}return function(e,t){let n,a,l;const c=[];for(n=0;n<r.pre.length;++n)r.pre[n]();for(!function(e,t){return e.isElement(t)}(o,e)?function(e,t){return e.isDocumentFragment(t)}(o,e)&&(e=s(e)):e=i(e),qc(e,t)?f(e,t,c):(a=e.elm,l=o.parentNode(a),u(t,c),null!==l&&(o.insertBefore(l,t.elm,o.nextSibling(a)),d(l,[e],0,0))),n=0;n<c.length;++n)c[n].data.hook.insert(c[n]);for(n=0;n<r.post.length;++n)r.post[n]();return t}}function Xc(e,t,n){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==t)for(let e=0;e<t.length;++e){const n=t[e];if("string"==typeof n)continue;const r=n.data;void 0!==r&&Xc(r,n.children,n.sel)}}function Yc(e,t,n){let r,o,i,s={};if(void 0!==n?(null!==t&&(s=t),Hc(n)?r=n:Vc(n)?o=n.toString():n&&n.sel&&(r=[n])):null!=t&&(Hc(t)?r=t:Vc(t)?o=t.toString():t&&t.sel?r=[t]:s=t),void 0!==r)for(i=0;i<r.length;++i)Vc(r[i])&&(r[i]=zc(void 0,void 0,void 0,r[i],void 0));return!e.startsWith("svg")||3!==e.length&&"."!==e[3]&&"#"!==e[3]||Xc(s,r,e),zc(e,s,r,o,void 0)}function Zc(e,t){let n;const r=t.elm;let o=e.data.attrs,i=t.data.attrs;if((o||i)&&o!==i){for(n in o=o||{},i=i||{},i){const e=i[n];o[n]!==e&&(!0===e?r.setAttribute(n,""):!1===e?r.removeAttribute(n):120!==n.charCodeAt(0)?r.setAttribute(n,e):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,e):58===n.charCodeAt(5)?109===n.charCodeAt(1)?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,e):r.setAttributeNS("http://www.w3.org/1999/xlink",n,e):r.setAttribute(n,e))}for(n in o)n in i||r.removeAttribute(n)}}const Qc={create:Zc,update:Zc};function ed(e,t){let n,r;const o=t.elm;let i=e.data.class,s=t.data.class;if((i||s)&&i!==s){for(r in i=i||{},s=s||{},i)i[r]&&!Object.prototype.hasOwnProperty.call(s,r)&&o.classList.remove(r);for(r in s)n=s[r],n!==i[r]&&o.classList[n?"add":"remove"](r)}}const td={create:ed,update:ed},nd=/[A-Z]/g;function rd(e,t){const n=t.elm;let r,o=e.data.dataset,i=t.data.dataset;if(!o&&!i)return;if(o===i)return;o=o||{},i=i||{};const s=n.dataset;for(r in o)r in i||(s?r in s&&delete s[r]:n.removeAttribute("data-"+r.replace(nd,"-$&").toLowerCase()));for(r in i)o[r]!==i[r]&&(s?s[r]=i[r]:n.setAttribute("data-"+r.replace(nd,"-$&").toLowerCase(),i[r]))}const od={create:rd,update:rd};function id(e,t,n){if("function"==typeof e)e.call(t,n,t);else if("object"==typeof e)for(let r=0;r<e.length;r++)id(e[r],t,n)}function sd(e,t){const n=e.type,r=t.data.on;r&&r[n]&&id(r[n],t,e)}function ad(e,t){const n=e.data.on,r=e.listener,o=e.elm,i=t&&t.data.on,s=t&&t.elm;let a;if(n!==i){if(n&&r)if(i)for(a in n)i[a]||o.removeEventListener(a,r,!1);else for(a in n)o.removeEventListener(a,r,!1);if(i){const r=t.listener=e.listener||function e(t){sd(t,e.vnode)};if(r.vnode=t,n)for(a in i)n[a]||s.addEventListener(a,r,!1);else for(a in i)s.addEventListener(a,r,!1)}}}const ud={create:ad,update:ad,destroy:ad};function ld(e,t){let n,r,o;const i=t.elm;let s=e.data.props,a=t.data.props;if((s||a)&&s!==a)for(n in s=s||{},a=a||{},a)r=a[n],o=s[n],o===r||"value"===n&&i[n]===r||(i[n]=r)}const cd={create:ld,update:ld},dd="function"==typeof(null===window||void 0===window?void 0:window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):setTimeout;let fd=!1;function hd(e,t,n){var r;r=()=>{e[t]=n},dd(()=>{dd(r)})}function pd(e,t){let n,r;const o=t.elm;let i=e.data.style,s=t.data.style;if(!i&&!s)return;if(i===s)return;i=i||{},s=s||{};const a="delayed"in i;for(r in i)r in s||("-"===r[0]&&"-"===r[1]?o.style.removeProperty(r):o.style[r]="");for(r in s)if(n=s[r],"delayed"===r&&s.delayed)for(const e in s.delayed)n=s.delayed[e],a&&n===i.delayed[e]||hd(o.style,e,n);else"remove"!==r&&n!==i[r]&&("-"===r[0]&&"-"===r[1]?o.style.setProperty(r,n):o.style[r]=n)}const gd={pre:function(){fd=!1},create:pd,update:pd,destroy:function(e){let t,n;const r=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(n in t)r.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let r;fd||(e.elm.offsetLeft,fd=!0);const o=e.elm;let i=0;const s=n.remove;let a=0;const u=[];for(r in s)u.push(r),o.style[r]=s[r];const l=getComputedStyle(o)["transition-property"].split(", ");for(;i<l.length;++i)-1!==u.indexOf(l[i])&&a++;o.addEventListener("transitionend",e=>{e.target===o&&--a,0===a&&t()})}};function vd(e,t){for(const n of e)null!=n&&!1!==n&&""!==n&&(Array.isArray(n)?vd(n,t):"string"==typeof n||"number"==typeof n||"boolean"==typeof n?t.push(zc(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function md(e,t,...n){const r=vd(n,[]);return"function"==typeof e?e(t,r):1===r.length&&!r[0].sel&&r[0].text?Yc(e,t,r[0].text):Yc(e,t,r)}var yd=[];var Dd,Cd,bd={};function wd(e,t,n){return md(n.isInline(e)?"span":"div",null,t)}function Ed(e,t){var n,r=ca.findKey(t,e),o=t.isInline(e),s=wr.isVoid(t,e),a=Vs(e.type,r.id),u={id:a,key:r.id,"data-slate-node":"element","data-slate-inline":o},l=e.type,c=e.children,d=void 0===c?[]:c,f=function(e){return bd[e]||wd}(l);n=s?null:d.map(function(n,r){return xd(n,r,e,t)});var h=f(e,n,t);if(s){u["data-slate-void"]=!0;var p=o?"span":"div",g=i(Un.texts(e),1),v=i(g[0],1)[0],m=md(p,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},xd(v,0,e,t));h=md(p,{style:{position:"relative"}},h,m),hi.set(v,0),pi.set(v,e)}return null==h.data&&(h.data={}),Object.assign(h.data,u),s||o||(h=function(e,t,n){var r=t;return yd.forEach(function(t){r=t(e,r,n)}),r}(e,h,t)),pn(function(){var n=gi.get(t),o=null==n?void 0:n.querySelector("#".concat(a));null!=o&&(mi.set(r,o),yi.set(e,o),vi.set(o,e))}),h}function Bd(e,t){return void 0===t&&(t=!1),md("span",{"data-slate-string":!0},t?"".concat(e,"\n"):e)}function Ad(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),md("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?md("br",null):null)}function Fd(e,t,n){if(null==e.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=ca.findKey(n,e),o=n.getConfig().decorate;if(null==o)throw new Error("Can not get config.decorate");var i,s=ca.findPath(n,e),a=o([e,s]),u=Nr.decorations(e,a),l=u.map(function(r){var o,i=r.leaf,s=r.position,a=null!==(o=null==s?void 0:s.isLast)&&void 0!==o?o:1===u.length,l=function(e,t,n,r,o){void 0===o&&(o=!1);var i=e.text,s=ca.findPath(r,t),a=xn.parent(s);if(wr.isEditor(n))throw new Error("Text node ".concat(JSON.stringify(t)," parent is Editor"));return r.isVoid(n)?Ad(Un.string(n).length):""!==i||n.children[n.children.length-1]!==t||r.isInline(n)||""!==wr.string(r,a)?""===i?Ad():o&&"\n"===i.slice(-1)?Bd(i,!0):Bd(i):Ad(0,!0)}(i,e,t,n,a);return l=function(e,t,n){var r=t;return yd.forEach(function(t){r=t(e,r,n)}),r}(i,l,n),md("span",{"data-slate-leaf":!0},l)}),c=(i=r.id,"w-e-text-".concat(i)),d=md("span",{"data-slate-node":"text",id:c,key:r.id},l);return pn(function(){var t=gi.get(n),o=null==t?void 0:t.querySelector("#".concat(c));null!=o&&(mi.set(r,o),yi.set(e,o),vi.set(o,e))}),d}function xd(e,t,n,r){return hi.set(e,t),pi.set(e,n),Rn.isElement(e)?Ed(e,r):Fd(e,n,r)}var Od=function(){if(Cd)return Dd;Cd=1;var e,t="[object Symbol]",n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",s="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",c="\\ufe0e\\ufe0f",f="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",h="['’]",p="["+o+"]",g="["+f+"]",v="["+i+s+"]",m="\\d+",y="["+a+"]",D="["+u+"]",C="[^"+o+f+m+a+u+l+"]",b="\\ud83c[\\udffb-\\udfff]",w="[^"+o+"]",E="(?:\\ud83c[\\udde6-\\uddff]){2}",B="[\\ud800-\\udbff][\\udc00-\\udfff]",A="["+l+"]",F="\\u200d",x="(?:"+D+"|"+C+")",O="(?:"+A+"|"+C+")",S="(?:['’](?:d|ll|m|re|s|t|ve))?",_="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:"+v+"|"+b+")"+"?",P="["+c+"]?",N=P+k+("(?:"+F+"(?:"+[w,E,B].join("|")+")"+P+k+")*"),j="(?:"+[y,E,B].join("|")+")"+N,T="(?:"+[w+v+"?",v,E,B,p].join("|")+")",R=RegExp(h,"g"),L=RegExp(v,"g"),M=RegExp(b+"(?="+b+")|"+T+N,"g"),$=RegExp([A+"?"+D+"+"+S+"(?="+[g,A,"$"].join("|")+")",O+"+"+_+"(?="+[g,A+x,"$"].join("|")+")",A+"?"+x+"+"+S,A+"+"+_,m,j].join("|"),"g"),I=RegExp("["+F+o+i+s+c+"]"),U=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,z="object"==typeof d&&d&&d.Object===Object&&d,H="object"==typeof self&&self&&self.Object===Object&&self,V=z||H||Function("return this")(),W=(e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==e?void 0:e[t]});function q(e){return I.test(e)}function K(e){return q(e)?function(e){return e.match(M)||[]}(e):function(e){return e.split("")}(e)}var J=Object.prototype.toString,G=V.Symbol,X=G?G.prototype:void 0,Y=X?X.toString:void 0;function Z(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&J.call(e)==t}(e))return Y?Y.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function Q(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,t,n)}function ee(e){return null==e?"":Z(e)}var te,ne,re=(te=function(e,t,n){return t=t.toLowerCase(),e+(n?function(e){return oe(ee(e).toLowerCase())}(t):t)},function(e){return function(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)n=t(n,e[r],r,e);return n}(function(e,t){return e=ee(e),void 0===t?function(e){return U.test(e)}(e)?function(e){return e.match($)||[]}(e):function(e){return e.match(n)||[]}(e):e.match(t)||[]}(function(e){return(e=ee(e))&&e.replace(r,W).replace(L,"")}(e).replace(R,"")),te,"")}),oe=(ne="toUpperCase",function(e){var t=q(e=ee(e))?K(e):void 0,n=t?t[0]:e.charAt(0),r=t?Q(t,1).join(""):e.slice(1);return n[ne]()+r});return Dd=re}(),Sd=f(Od);var _d=["props","attrs","style","dataset","on","hook","ns"];function kd(e){var t=e.data,n=void 0===t?{}:t,r=e.children,o=void 0===r?[]:r;Object.keys(n).forEach(function(t){var r,o,i=n[t];if("key"!==t){if(!_d.includes(t)){if(t.startsWith("data-")){var s=t.slice(5);return s=Sd(s),function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,((r={})[s]=i,r)),void delete n[t]}!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={}),Object.assign(n.props,t)}(e,(o={},o[t]=i,o)),delete n[t]}}else e.key=i}),o.length>0&&o.forEach(function(e){"string"!=typeof e&&kd(e)})}function Pd(e,t){var n,r,o=e.$scroll,s=(n=e.id,"w-e-textarea-".concat(n)),a=t.getConfig(),u=a.readOnly,l=a.autoFocus,c=function(e,t){return void 0===t&&(t=!1),Yc("div#".concat(e),{props:{contentEditable:!t}})}(s,u),d=t.children||[];c.children=d.map(function(e,n){if(di.has(e)){var r=di.get(e);if(r){var o=i(r,2),s=o[0],a=o[1];if(a)return s!==n&&(hi.set(e,n),di.set(e,[n,a])),a}}var u=xd(e,n,t,t);kd(u);var l=t.getConfig().skipCacheTypes,c=void 0===l?["list-item"]:l;return Rn.isElement(e)&&c.includes(e.type)||di.set(e,[n,u]),u});var f,h=ui.get(e);if(null==h&&(h=!0),h){var p=function(e){return Mi('<div\n id="'.concat(e,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(s);o.append(p),e.$textArea=p,r=p[0],gi.set(t,r),yi.set(t,r),vi.set(r,t),(v=Gc([td,cd,gd,od,ud,Qc]))(r,c),ui.set(e,!1),li.set(e,v)}else{var g=ci.get(e),v=li.get(e);if(null==g||null==v)return;r=g.elm,v(g,c)}if(null==r){var m=o[0];if(r=(null==m?void 0:m.querySelector("#".concat(s)))||function(e){var t,n,r;return null!==(t=window&&window.document.getElementById(e))&&void 0!==t?t:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null}(s),null==r)return}if((h?l:t.isFocused())&&r.focus({preventScroll:!0}),h){var y=(f=r)&&f.ownerDocument&&f.ownerDocument.defaultView||null;y&&Ci.set(t,y)}gi.set(t,r),yi.set(t,r),vi.set(r,t),ci.set(e,c)}var Nd=1,jd=function(){function e(e){var t=this;this.selectionChangeRoot=null,this.destroyed=!1,this.id=Nd++,this.$textArea=null,this.$progressBar=Mi('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=Mi('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=fc(function(e){var n=Ds(null==e?void 0:e.target)?e.target:null,r=null==n?void 0:n.tagName;if("INPUT"!==r&&"TEXTAREA"!==r){var o=t.getActiveEditor();null!=o&&function(e,t){var n=e.isComposing,r=e.isUpdatingSelection,o=e.isDraggingInternally,i=t.getConfig();if(!r&&!o){var s=ca.findDocumentOrShadowRoot(t),a=s.activeElement,u=ca.toDOMNode(t,t),l=s.getSelection();if(a!==u)return bi.delete(t),void Ec(t);if(e.latestElement=a,bi.set(t,!0),!l)return Ec(t);var c=l.anchorNode,d=l.focusNode,f=gc(t,c),h=pc(t,d);if(!n)if(f&&h){var p=ca.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});p&&Zr.select(t,p)}else i.readOnly&&Ec(t)}}(t,o)}},100);var n=Mi(e);if(0===n.length)throw new Error("Cannot find textarea DOM by selector '".concat(e,"'"));this.$box=n;var r=Mi('<div class="w-e-text-container"></div>');r.append(this.$progressBar),r.append(this.$maxLengthInfo),n.append(r);var o=Mi('<div class="w-e-scroll"></div>');r.append(o),this.$scroll=o,this.$textAreaContainer=r,pn(function(){var e=t.getActiveEditor();if(null!=e){t.bindSelectionChange(e),r.on("click",function(){return e.hidePanelOrModal()}),e.on(Vo,t.changeViewState.bind(t));var o=e.getConfig(),i=o.onChange,s=o.scroll;i&&e.on(Vo,function(){return i(e)}),s||(n.css("position","relative"),r.addClass("no-scroll")),t.onFocusAndOnBlur(),e.on(Vo,t.changeMaxLengthInfo.bind(t)),t.bindEvent()}})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var e=Qo.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),e.prototype.getActiveEditor=function(){if(this.destroyed)return null;var e=Qo.get(this);return null==e||e.isDestroyed?null:e},e.prototype.bindSelectionChange=function(e,t){var n=this;if(void 0===t&&(t=5),null==this.selectionChangeRoot&&!e.isDestroyed){try{var r=ca.findDocumentOrShadowRoot(e);r.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=r}catch(r){if(t>0)return void setTimeout(function(){return n.bindSelectionChange(e,t-1)},0);window.document.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(Ho,function(){var e;null===(e=n.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",n.onDOMSelectionChange),n.selectionChangeRoot=null})}},e.prototype.flushDOMSelectionChange=function(){this.onDOMSelectionChange.flush()},e.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(hn(Lc,function(n,o){t.on(o,function(t){n(t,e,r)})}),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",fc(function(){r.emit(Wo)},100))))},e.prototype.onFocusAndOnBlur=function(){var e=this,t=this.getActiveEditor();if(null!=t){var n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on(Vo,function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout(function(){e.destroyed||t.isDestroyed||o&&o(t)}):null!=e.latestEditorSelection&&null==t.selection&&setTimeout(function(){e.destroyed||t.isDestroyed||r&&r(t)}),e.latestEditorSelection=t.selection})}},e.prototype.changeMaxLengthInfo=function(){var e=this.getActiveEditor();if(null!=e){var t=e.getConfig().maxLength;if(t){var n=t-ca.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(t)}}},e.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width","".concat(e,"%")),e>=100&&setTimeout(function(){t.hide(),t.css("width","0"),t.show()},1e3)},e.prototype.changeViewState=function(){var e=this,t=this.getActiveEditor();null!=t&&(Pd(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=Mi('<div class="w-e-text-placeholder">'.concat(r,"</div>"));e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),pn(function(){e.destroyed||t.isDestroyed||Bc(e,t)}))},e.prototype.destroy=function(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),null===(e=this.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()},e}();function Td(e,t,n,r){if(hi.set(e,t),pi.set(e,n),Rn.isElement(e)){var o=e.children;if((void 0===o?[]:o).forEach(function(t,n){return Td(t,n,e,r)}),wr.isVoid(r,e)){var s=i(Un.texts(e),1),a=i(s[0],1)[0];hi.set(a,0),pi.set(a,e)}}}function Rd(e){var t=e.selector,n=void 0===t?"":t,o=e.config,i=void 0===o?{}:o,s=e.content,a=e.html,u=e.plugins,l=void 0===u?[]:u,c=function(e){return[Fu,uu,xi,su,Wu,Au,Lu,ju].reduce(function(e,t){return t(e)},e)}(Po());if(n&&function(e,t){return zs(e,"data-w-e-textarea",t)}(c,n))throw new Error("Repeated create editor by selector '".concat(n,"'"));var d=function(e){void 0===e&&(e={});var t=To(Uo),n={},o=e.MENU_CONF,i=void 0===o?{}:o;return hn(t,function(e,t){n[t]=r(r({},e),i[t]||{})}),delete e.MENU_CONF,r({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:n,hoverbarKeys:{},textStyleMode:"inline",classStylePolicy:"preserve-data",sanitizeHtml:Io,customAlert:function(e,t){window.alert("".concat(t,":\n").concat(e))}},e)}(i);ai.set(c,d);var f=d.hoverbarKeys,h=void 0===f?{}:f;if(l.forEach(function(e){c=e(c)}),function(e,t){var n,r=t.html,o=t.content;null!=r?n=Hs(e,r):o&&o.length&&(n=o),n&&(e.children=e.transformInitialContent?e.transformInitialContent(n):n),0===e.children.length&&(e.children=[{type:"paragraph",children:[{text:""}]}])}(c,{html:a,content:s}),n){var p=new jd(n);Zo.set(c,p),Qo.set(p,c),p.changeViewState();var g=void 0;Object.keys(h).length>0&&(g=new dc,ni.set(g,c),ri.set(c,g)),c.on(Vo,function(){c.hidePanelOrModal()}),c.on(Wo,function(){c.hidePanelOrModal()})}else c.children.forEach(function(e,t){return Td(e,t,c,c)});var v=d.onCreated,m=d.onDestroyed;return v&&c.on(zo,function(){return v(c)}),m&&c.on(Ho,function(){return m(c)}),pn(function(){return c.emit(zo)}),c}var Ld=function(){function e(e,t){var n=this;this.$toolbar=Mi('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.syncToolbarState=function(){n.toolbarItems.forEach(function(e){e.changeMenuState()})},this.changeToolbarState=Ku(function(){n.syncToolbarState()},200),this.config=t;var r=Mi(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(e,"'"));this.$box=r;var o=this.$toolbar;o.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),r.append(o),pn(function(){n.initToolbar(),n.lngListen=zl(function(){return n.initToolbar()});var e=n.getEditorInstance();e.on(Vo,n.changeToolbarState),e.on(qo,n.syncToolbarState),e.on(Ko,n.syncToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,s=r.insertKeys,a=void 0===s?{index:0,keys:[]}:s,u=r.excludeKeys,l=void 0===u?[]:u,c=To(i),d=[];d=Array.isArray(a)?a:[a];var f=0;d.forEach(function(e){var t=e.index+f;if(e.replaceFn&&c[t]){var n=e.replaceFn(c[t]);if(!n)throw new Error("This function needs to return the menu configuration: IToolbarMenuKey");c[t]=n}e.keys.length>0&&("string"==typeof e.keys&&(e.keys=[e.keys]),e.keys.forEach(function(e,n){c.splice(t+n,0,e)}),f+=e.keys.length)});var h=c.filter(function(e){var t="string"==typeof e?e:e.key;return!l.includes(t)}),p=h.length;h.forEach(function(r,o){if("|"===r){if(0===o)return;if(o+1===p)return;if("|"===t)return;var i=ql();return n.append(i),void(t=r)}return"string"==typeof r?(e.registerSingleItem(r,e),void(t=r)):e.isMenuGroup(r)?(e.registerGroup(r),void(t="group")):(e.registerSingleMenuByConf(r),void(t=r.key))})},e.prototype.isMenuGroup=function(e){return"string"!=typeof e&&Array.isArray(e.menuKeys)},e.prototype.registerSingleMenuByConf=function(e){var t=e.key,n=e.title,r=e.iconSvg;this.registerSingleItem(t,this,{title:n,iconSvg:r})},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=function(e){return new Zl(e)}(e),o=e.menuKeys,i=void 0===o?[]:o,s=this.config.excludeKeys,a=void 0===s?[]:s;i.forEach(function(e){a.includes(e)||t.registerSingleItem(e,r)}),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t,n){void 0===n&&(n={});var r=this.getEditorInstance(),o=t instanceof Zl,i=this.menus,s=i[e];if(null==s){var a=Xo[e];if(null==a)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof a)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));s=a(),i[e]=s}else console.warn("Duplicated toolbar menu key '".concat(e,"'\n重复注册了菜单栏 menu '").concat(e,"'"));var u=r.getMenuConfig(e);u&&void 0!==u.iconSvg&&(s.iconSvg=u.iconSvg),void 0!==n.iconSvg&&(s.iconSvg=n.iconSvg),void 0!==n.title&&(s.title=n.title);var l=lc(e,s,o);(this.toolbarItems.push(l),oi.set(l,r),o)?t.appendBarItem(l):t.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var e=ei.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function Md(e,t){if(null==e)throw new Error("Cannot create toolbar, because editor is null");var n=t.selector,o=t.config,i=void 0===o?{}:o;if(function(e,t){return zs(e,"data-w-e-toolbar",t)}(e,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var s=r({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},i||{}),a=new Ld(n,s);return ei.set(a,e),ti.set(e,a),a}function $d(e){return e&&"class"===e.getConfig().textStyleMode?"class":"inline"}function Id(e){if(!e)return"preserve-data";var t=e.getConfig().classStylePolicy;return"fallback-inline"===t?"fallback-inline":"strict"===t?"strict":"preserve-data"}function Ud(e,t){var n=null==e?void 0:e.getConfig().onClassStyleUnsupported;n?n(t):console.warn(t.message)}function zd(e){var t=e.menus,n=e.renderElems,r=e.renderStyle,o=e.elemsToHtml,i=e.styleToHtml,s=e.htmlTransform,a=e.preParseHtml,u=e.parseElemsHtml,l=e.parseStyleHtml,c=e.editorPlugin;t&&t.forEach(function(e){return Hd.registerMenu(e)}),n&&n.forEach(function(e){return Hd.registerRenderElem(e)}),r&&Hd.registerRenderStyle(r),o&&o.forEach(function(e){return Hd.registerElemToHtml(e)}),i&&Hd.registerStyleToHtml(i),s&&Hd.registerHtmlTransform(s),a&&a.forEach(function(e){return Hd.registerPreParseHtml(e)}),u&&u.forEach(function(e){return Hd.registerParseElemHtml(e)}),l&&Hd.registerParseStyleHtml(l),c&&Hd.registerPlugin(c)}$l("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),$l("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}});var Hd=function(){function e(){throw new Error("不能实例化\nCan not construct a instance")}return e.setEditorConfig=function(e){void 0===e&&(e={}),this.editorConfig=r(r({},this.editorConfig),e)},e.setSimpleEditorConfig=function(e){void 0===e&&(e={}),this.simpleEditorConfig=r(r({},this.simpleEditorConfig),e)},e.setToolbarConfig=function(e){void 0===e&&(e={}),this.toolbarConfig=r(r({},this.toolbarConfig),e)},e.setSimpleToolbarConfig=function(e){void 0===e&&(e={}),this.simpleToolbarConfig=r(r({},this.simpleToolbarConfig),e)},e.registerPlugin=function(e){this.plugins.push(e)},e.registerMenu=function(e,t){Yo(e,t)},e.registerRenderElem=function(e){var t,n,r;n=(t=e).type,r=t.renderElem,bd[n||""]=r},e.registerRenderStyle=function(e){!function(e){yd.push(e)}(e)},e.registerElemToHtml=function(e){!function(e){var t=e.type,n=e.elemToHtml;Xs[t||""]=n}(e)},e.registerStyleToHtml=function(e){!function(e){Ws.push(e)}(e)},e.registerHtmlTransform=function(e){!function(e){qs.push(e)}(e)},e.registerPreParseHtml=function(e){var t;t=e,_s.push(t)},e.registerParseElemHtml=function(e){!function(e){var t=e.selector,n=e.parseElemHtml;Ps[t]=n}(e)},e.registerParseStyleHtml=function(e){!function(e){ks.push(e)}(e)},e.registerModule=function(e){zd(e)},e.editorConfig={},e.simpleEditorConfig={},e.toolbarConfig={},e.simpleToolbarConfig={},e.plugins=[],e}();function Vd(e){void 0===e&&(e={});var t=e.selector,n=void 0===t?"":t,o=e.content,i=void 0===o?[]:o,s=e.html,a=e.config,u=void 0===a?{}:a,l=e.mode,c="simple"===(void 0===l?"default":l)?Hd.simpleEditorConfig:Hd.editorConfig,d=r(r({},c.hoverbarKeys||{}),u.hoverbarKeys||{});return Rd({selector:n,config:r(r(r({},c),u),{hoverbarKeys:d}),content:i,html:s,plugins:Hd.plugins})}function Wd(e){var t=e.selector,n=e.editor,o=e.config,i=void 0===o?{}:o,s=e.mode,a=void 0===s?"default":s;if(!t)throw new Error("Cannot find 'selector' when create toolbar");var u="simple"===a?Hd.simpleToolbarConfig:Hd.toolbarConfig;return Md(n,{selector:t,config:r(r({},u),i)})}var qd=new Set,Kd=new WeakSet;function Jd(e){void 0===e&&(e=[]),e.forEach(function(e){return function(e){var t=function(e){return function(e){return"object"==typeof e&&null!==e&&"module"in e}(e)?e:{module:e}}(e),n=t.key,r=t.module;if(!n||!qd.has(n)){if(null==r||"object"!=typeof r)throw new Error("Invalid extension module. Expect an object that follows IModuleConf.");Kd.has(r)||(Hd.registerModule(r),n&&qd.add(n),Kd.add(r))}}(e)})}function Gd(e){void 0===e&&(e={});var t=e.extensions,n=void 0===t?[]:t,o=e.editorConfig,i=void 0===o?{}:o,s=e.toolbarConfig,a=void 0===s?{}:s;Jd(n);var u=function(e){void 0===e&&(e={});var t,n,o=(t=i,void 0===(n=e.config||{})&&(n={}),r(r(r({},t),n),{hoverbarKeys:r(r({},t.hoverbarKeys||{}),n.hoverbarKeys||{})}));return Vd(r(r({},e),{config:o}))},l=function(e){return Wd(r(r({},e),{config:r(r({},a),e.config||{})}))};return{create:function(e){void 0===e&&(e={});var t=e.editor,n=void 0===t?{}:t,o=e.toolbar,i=u(n);return{editor:i,toolbar:o?l(r(r({},o),{editor:i})):null}},createEditor:u,createToolbar:l,registerExtensions:Jd}}var Xd={};export{Hd as Boot,ca as DomEditor,wr as SlateEditor,Rn as SlateElement,Un as SlateNode,xn as SlatePath,Fr as SlatePoint,jn as SlateRange,Nr as SlateText,Zr as SlateTransforms,Ld as Toolbar,Vd as createEditor,Gd as createEditorFactory,Wd as createToolbar,Xd as default,nc as genModalButtonElems,ec as genModalInputElems,tc as genModalTextareaElems,Id as getClassStylePolicy,$d as getTextStyleMode,$l as i18nAddResources,Il as i18nChangeLanguage,Ul as i18nGetResources,Jd as registerExtensions,Ud as reportUnsupportedClassStyle,Hl as t};
|
|
13
|
-
//# sourceMappingURL=core.mjs.map
|
|
4
|
+
* Takes a string with placeholder variables like `%{smart_count} file selected`
|
|
5
|
+
* and replaces it with values from options `{smart_count: 5}`
|
|
6
|
+
*
|
|
7
|
+
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
|
|
8
|
+
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
|
|
9
|
+
*
|
|
10
|
+
* @param {string} phrase that needs interpolation, with placeholders
|
|
11
|
+
* @param {object} options with values that will be used to replace placeholders
|
|
12
|
+
* @returns {any[]} interpolated
|
|
13
|
+
*/
|
|
14
|
+
function s(e,t){let n=/\$/g,r=[e];if(t==null)return r;for(let e of Object.keys(t))if(e!==`_`){let i=t[e];typeof i==`string`&&(i=n[Symbol.replace](i,`$$$$`)),r=o(r,RegExp(`%\\{${e}\\}`,`g`),i)}return r}var c=i(`apply`),l=class{constructor(e){Object.defineProperty(this,c,{value:u}),this.locale={strings:{},pluralize(e){return e===1?0:1}},Array.isArray(e)?e.forEach(n(this,c)[c],this):n(this,c)[c](e)}translate(e,t){return this.translateArray(e,t).join(``)}translateArray(e,t){if(!a(this.locale.strings,e))throw Error(`missing string: ${e}`);let n=this.locale.strings[e];if(typeof n==`object`){if(t&&t.smart_count!==void 0)return s(n[this.locale.pluralize(t.smart_count)],t);throw Error(`Attempted to use a string with plural forms, but no value was given for %{smart_count}`)}return s(n,t)}};function u(e){if(!(e!=null&&e.strings))return;let t=this.locale;this.locale=E(E({},t),{},{strings:E(E({},t.strings),e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}t.exports=l})),ne=s(((e,t)=>{t.exports=function(){var e={},t=e._fns={};e.emit=function(e,t,i,a,o,s,c){var l=n(e);l.length&&r(e,l,[t,i,a,o,s,c])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){function r(){n.apply(this,arguments),e.off(t,r)}this.on(t,r)},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],i=0,a=r?r.length:0;i<a;i++)r[i]!==t&&n.push(r[i]);n.length?this._fns[e]=n:delete this._fns[e]};function n(e){for(var n=t[e]?t[e]:[],r=e.indexOf(`:`),i=r===-1?[e]:[e.substring(0,r),e.substring(r+1)],a=Object.keys(t),o=0,s=a.length;o<s;o++){var c=a[o];if(c===`*`&&(n=n.concat(t[c])),i.length===2&&i[0]===c){n=n.concat(t[c]);break}}return n}function r(e,t,n){for(var r=0,i=t.length;r<i&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}return e}})),re=s(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=S(t)||0,y(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(S(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function v(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function x(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(x(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=x(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return v(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e,t,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(n);return y(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),_(e,t,{leading:i,maxWait:t,trailing:a})}function y(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function b(e){return!!e&&typeof e==`object`}function x(e){return typeof e==`symbol`||b(e)&&p.call(e)==i}function S(e){if(typeof e==`number`)return e;if(x(e))return r;if(y(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=y(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=v})),ie=s(((e,t)=>{D();function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}let a={version:`2.1.1`};var o=i(`publish`),s=class{constructor(){Object.defineProperty(this,o,{value:c}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){let t=E({},this.state),r=E(E({},this.state),e);this.state=r,n(this,o)[o](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}};function c(){var e=[...arguments];this.callbacks.forEach(t=>{t(...e)})}s.VERSION=a.version;function l(){return new s}t.exports=l})),ae=s(((e,t)=>{function n(e){let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}t.exports=n})),oe=s(((e,t)=>{t.exports={md:`text/markdown`,markdown:`text/markdown`,mp4:`video/mp4`,mp3:`audio/mp3`,svg:`image/svg+xml`,jpg:`image/jpeg`,png:`image/png`,gif:`image/gif`,heic:`image/heic`,heif:`image/heif`,yaml:`text/yaml`,yml:`text/yaml`,csv:`text/csv`,tsv:`text/tab-separated-values`,tab:`text/tab-separated-values`,avi:`video/x-msvideo`,mks:`video/x-matroska`,mkv:`video/x-matroska`,mov:`video/quicktime`,dicom:`application/dicom`,doc:`application/msword`,docm:`application/vnd.ms-word.document.macroenabled.12`,docx:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,dot:`application/msword`,dotm:`application/vnd.ms-word.template.macroenabled.12`,dotx:`application/vnd.openxmlformats-officedocument.wordprocessingml.template`,xla:`application/vnd.ms-excel`,xlam:`application/vnd.ms-excel.addin.macroenabled.12`,xlc:`application/vnd.ms-excel`,xlf:`application/x-xliff+xml`,xlm:`application/vnd.ms-excel`,xls:`application/vnd.ms-excel`,xlsb:`application/vnd.ms-excel.sheet.binary.macroenabled.12`,xlsm:`application/vnd.ms-excel.sheet.macroenabled.12`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,xlt:`application/vnd.ms-excel`,xltm:`application/vnd.ms-excel.template.macroenabled.12`,xltx:`application/vnd.openxmlformats-officedocument.spreadsheetml.template`,xlw:`application/vnd.ms-excel`,txt:`text/plain`,text:`text/plain`,conf:`text/plain`,log:`text/plain`,pdf:`application/pdf`,zip:`application/zip`,"7z":`application/x-7z-compressed`,rar:`application/x-rar-compressed`,tar:`application/x-tar`,gz:`application/gzip`,dmg:`application/x-apple-diskimage`}})),se=s(((e,t)=>{let n=ae(),r=oe();function i(e){var t;if(e.type)return e.type;let i=e.name?(t=n(e.name).extension)==null?void 0:t.toLowerCase():null;return i&&i in r?r[i]:`application/octet-stream`}t.exports=i})),ce=s(((e,t)=>{function n(e){return e.charCodeAt(0).toString(32)}function r(e){let t=``;return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${n(e)}`,`/`))+t}function i(e){let t=`uppy`;return typeof e.name==`string`&&(t+=`-${r(e.name.toLowerCase())}`),e.type!==void 0&&(t+=`-${e.type}`),e.meta&&typeof e.meta.relativePath==`string`&&(t+=`-${r(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(t+=`-${e.data.size}`),e.data.lastModified!==void 0&&(t+=`-${e.data.lastModified}`),t}t.exports=i})),le=s(((e,t)=>{function n(e){if(e==null&&typeof navigator<`u`&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let[n,r]=t[1].split(`.`);return n=parseInt(n,10),r=parseInt(r,10),n<15||n===15&&r<15063||n>18||n===18&&r>=18218}t.exports=n})),ue=s(((e,t)=>{function n(e,t){return t.name?t.name:e.split(`/`)[0]===`image`?`${e.split(`/`)[0]}.${e.split(`/`)[1]}`:`noname`}t.exports=n})),de=s(((e,t)=>{t.exports={strings:{addBulkFilesFailed:{0:`Failed to add %{smart_count} file due to an internal error`,1:`Failed to add %{smart_count} files due to internal errors`},youCanOnlyUploadX:{0:`You can only upload %{smart_count} file`,1:`You can only upload %{smart_count} files`},youHaveToAtLeastSelectX:{0:`You have to select at least %{smart_count} file`,1:`You have to select at least %{smart_count} files`},exceedsSize:`%{file} exceeds maximum allowed size of %{size}`,missingRequiredMetaField:`Missing required meta fields`,missingRequiredMetaFieldOnFile:`Missing required meta fields in %{fileName}`,inferiorSize:`This file is smaller than the allowed size of %{size}`,youCanOnlyUploadFileTypes:`You can only upload: %{types}`,noMoreFilesAllowed:`Cannot add more files`,noDuplicates:`Cannot add the duplicate file '%{fileName}', it already exists`,companionError:`Connection with Companion failed`,authAborted:`Authentication aborted`,companionUnauthorizeHint:`To unauthorize to your %{provider} account, please go to %{url}`,failedToUpload:`Failed to upload %{file}`,noInternetConnection:`No Internet connection`,connectedToInternet:`Connected to the Internet`,noFilesFound:`You have no files or folders here`,selectX:{0:`Select %{smart_count}`,1:`Select %{smart_count}`},allFilesFromFolderNamed:`All files from folder %{name}`,openFolderNamed:`Open folder %{name}`,cancel:`Cancel`,logOut:`Log out`,filter:`Filter`,resetFilter:`Reset filter`,loading:`Loading...`,authenticateWithTitle:`Please authenticate with %{pluginName} to select files`,authenticateWith:`Connect to %{pluginName}`,signInWithGoogle:`Sign in with Google`,searchImages:`Search for images`,enterTextToSearch:`Enter text to search for images`,search:`Search`,emptyFolderAdded:`No files were added from empty folder`,folderAlreadyAdded:`The folder "%{folder}" was already added`,folderAdded:{0:`Added %{smart_count} file from %{folder}`,1:`Added %{smart_count} files from %{folder}`}}}})),fe=s(((e,t)=>{D(),A();var n=j(),r=g(),i=ee();let a,o;function s(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var c=0;function l(e){return`__private_`+ c+++`_`+e}let u=te(),d=ne(),f=re(),p=ie(),m=se(),h=ae(),_=ce(),v=le(),y=ue(),b={version:`2.3.4`},x=de();var S=l(`plugins`),C=l(`restricter`),w=l(`storeUnsubscribe`),T=l(`emitter`),O=l(`preProcessors`),M=l(`uploaders`),N=l(`postProcessors`),P=l(`informAndEmit`),F=l(`checkRequiredMetaFieldsOnFile`),oe=l(`checkRequiredMetaFields`),fe=l(`assertNewUploadAllowed`),pe=l(`checkAndCreateFileStateObject`),me=l(`startIfAutoProceed`),he=l(`addListeners`),ge=l(`updateOnlineStatus`),_e=l(`createUpload`),ve=l(`getUpload`),ye=l(`removeUpload`),be=l(`runUpload`);a=Symbol.for(`uppy test: getPlugins`),o=Symbol.for(`uppy test: createUpload`);var xe=class{constructor(e){Object.defineProperty(this,be,{value:Me}),Object.defineProperty(this,ye,{value:je}),Object.defineProperty(this,ve,{value:Ae}),Object.defineProperty(this,_e,{value:ke}),Object.defineProperty(this,he,{value:Oe}),Object.defineProperty(this,me,{value:De}),Object.defineProperty(this,pe,{value:Ee}),Object.defineProperty(this,fe,{value:Te}),Object.defineProperty(this,oe,{value:we}),Object.defineProperty(this,F,{value:Ce}),Object.defineProperty(this,P,{value:Se}),Object.defineProperty(this,S,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:d()}),Object.defineProperty(this,O,{writable:!0,value:new Set}),Object.defineProperty(this,M,{writable:!0,value:new Set}),Object.defineProperty(this,N,{writable:!0,value:new Set}),Object.defineProperty(this,ge,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=x;let t={id:`uppy`,autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:i.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:p(),logger:r.justErrorsLogger,infoTimeout:5e3};this.opts=E(E(E({},t),e),{},{restrictions:E(E({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.",`warning`):e&&e.debug&&(this.opts.logger=r.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=f(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:v(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:E({},this.opts.meta),info:[],recoveredState:null}),s(this,C)[C]=new i.Restricter(()=>this.opts,this.i18n),s(this,w)[w]=this.store.subscribe((e,t,n)=>{this.emit(`state-update`,e,t,n),this.updateAll(t)}),this.opts.debug&&typeof window<`u`&&(window[this.opts.id]=this),s(this,he)[he]()}emit(e){var t=[...arguments].slice(1);s(this,T)[T].emit(e,...t)}on(e,t){return s(this,T)[T].on(e,t),this}once(e,t){return s(this,T)[T].once(e,t),this}off(e,t){return s(this,T)[T].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:E(E({},this.getState().files),{},{[e]:E(E({},this.getState().files[e]),t)})})}i18nInit(){let e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts=E(E(E({},this.opts),e),{},{restrictions:E(E({},this.opts.restrictions),e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){let e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=E({},this.getState().files),n={};Object.keys(t).forEach(r=>{let i=E({},t[r]);i.progress=E(E({},i.progress),e),n[r]=i}),this.setState({files:n,totalProgress:0}),this.emit(`reset-progress`)}addPreProcessor(e){s(this,O)[O].add(e)}removePreProcessor(e){return s(this,O)[O].delete(e)}addPostProcessor(e){s(this,N)[N].add(e)}removePostProcessor(e){return s(this,N)[N].delete(e)}addUploader(e){s(this,M)[M].add(e)}removeUploader(e){return s(this,M)[M].delete(e)}setMeta(e){let t=E(E({},this.getState().meta),e),n=E({},this.getState().files);Object.keys(n).forEach(t=>{n[t]=E(E({},n[t]),{},{meta:E(E({},n[t].meta),e)})}),this.log(`Adding metadata:`),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){let n=E({},this.getState().files);if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: `,e);return}let r=E(E({},n[e].meta),t);n[e]=E(E({},n[e]),{},{meta:r}),this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),i=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),a=r.filter(e=>!e.progress.uploadStarted),o=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),s=r.filter(e=>e.progress.uploadStarted),c=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),u=r.filter(e=>e.error),d=i.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:a,startedFiles:o,uploadStartedFiles:s,pausedFiles:c,completeFiles:l,erroredFiles:u,inProgressFiles:i,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:t===100&&l.length===r.length&&f.length===0,isAllErrored:!!n&&u.length===r.length,isAllPaused:i.length!==0&&c.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{return s(this,C)[C].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){s(this,fe)[fe](e);let{files:t}=this.getState(),n=s(this,pe)[pe](t,e);return t[n.id]&&t[n.id].isGhost&&(n=E(E({},t[n.id]),{},{data:e.data,isGhost:!1}),this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:E(E({},t),{},{[n.id]:n})}),this.emit(`file-added`,n),this.emit(`files-added`,[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),s(this,me)[me](),n.id}addFiles(e){s(this,fe)[fe]();let t=E({},this.getState().files),n=[],r=[];for(let i=0;i<e.length;i++)try{let r=s(this,pe)[pe](t,e[i]);t[r.id]&&t[r.id].isGhost&&(r=E(E({},t[r.id]),{},{data:e[i].data,isGhost:!1}),this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach(e=>{this.emit(`file-added`,e)}),this.emit(`files-added`,n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&s(this,me)[me](),r.length>0){let e=`Multiple errors occurred while adding files:
|
|
15
|
+
`;if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n(`addBulkFilesFailed`,{smart_count:r.length}),details:e},`error`,this.opts.infoTimeout),typeof AggregateError==`function`)throw AggregateError(r,e);{let t=Error(e);throw t.errors=r,t}}}removeFiles(e,t){let{files:n,currentUploads:r}=this.getState(),i=E({},n),a=E({},r),o=Object.create(null);e.forEach(e=>{n[e]&&(o[e]=n[e],delete i[e])});function s(e){return o[e]===void 0}Object.keys(a).forEach(e=>{let t=r[e].fileIDs.filter(s);if(t.length===0){delete a[e];return}let{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw Error(`individualCancellation is disabled`);a[e]=E(E({},r[e]),{},{fileIDs:t})});let c={currentUploads:a,files:i};Object.keys(i).length===0&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),this.calculateTotalProgress();let l=Object.keys(o);l.forEach(e=>{this.emit(`file-removed`,o[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(`, `)}`)}removeFile(e,t){t===void 0&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;let t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit(`upload-pause`,e,t),t}pauseAll(){let e=E({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{e[t]=E(E({},e[t]),{},{isPaused:!0})}),this.setState({files:e}),this.emit(`pause-all`)}resumeAll(){let e=E({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{e[t]=E(E({},e[t]),{},{isPaused:!1,error:null})}),this.setState({files:e}),this.emit(`resume-all`)}retryAll(){let e=E({},this.getState().files),t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{e[t]=E(E({},e[t]),{},{isPaused:!1,error:null})}),this.setState({files:e,error:null}),this.emit(`retry-all`,t),t.length===0)return Promise.resolve({successful:[],failed:[]});let n=s(this,_e)[_e](t,{forceAllowNewUpload:!0});return s(this,be)[be](n)}cancelAll(e){let{reason:t=`user`}=e===void 0?{}:e;if(this.emit(`cancel-all`,{reason:t}),t===`user`){let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,`cancel-all`),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit(`upload-retry`,e);let t=s(this,_e)[_e]([e],{forceAllowNewUpload:!0});return s(this,be)[be](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:E(E({},this.getFile(e.id).progress),{},{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this.calculateTotalProgress()}calculateTotalProgress(){let e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(e.length===0){this.emit(`progress`,0),this.setState({totalProgress:0});return}let t=e.filter(e=>e.progress.bytesTotal!=null),n=e.filter(e=>e.progress.bytesTotal==null);if(t.length===0){let t=e.length*100,r=n.reduce((e,t)=>e+t.progress.percentage,0),i=Math.round(r/t*100);this.setState({totalProgress:i});return}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0),i=r/t.length;r+=i*n.length;let a=0;t.forEach(e=>{a+=e.progress.bytesUploaded}),n.forEach(e=>{a+=i*(e.progress.percentage||0)/100});let o=r===0?0:Math.round(a/r*100);o>100&&(o=100),this.setState({totalProgress:o}),this.emit(`progress`,o)}updateOnlineStatus(){window.navigator.onLine===void 0||window.navigator.onLine?(this.emit(`is-online`),this.wasOffline&&(this.emit(`back-online`),this.info(this.i18n(`connectedToInternet`),`success`,3e3),this.wasOffline=!1)):(this.emit(`is-offline`),this.info(this.i18n(`noInternetConnection`),`error`,0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if(typeof e!=`function`){let t=`Expected a plugin class, but got ${e===null?`null`:typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw TypeError(t)}let n=new e(this,t),r=n.id;if(!r)throw Error(`Your plugin must have an id`);if(!n.type)throw Error(`Your plugin must have a type`);let i=this.getPlugin(r);if(i){let e=`Already found a plugin named '${i.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in s(this,S)[S]?s(this,S)[S][n.type].push(n):s(this,S)[S][n.type]=[n],n.install(),this}getPlugin(e){for(let t of Object.values(s(this,S)[S])){let n=t.find(t=>t.id===e);if(n!=null)return n}}[a](e){return s(this,S)[S][e]}iteratePlugins(e){Object.values(s(this,S)[S]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit(`plugin-remove`,e),e.uninstall&&e.uninstall();let t=s(this,S)[S][e.type],n=t.findIndex(t=>t.id===e.id);n!==-1&&t.splice(n,1);let r={plugins:E(E({},this.getState().plugins),{},{[e.id]:void 0})};this.setState(r)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),s(this,w)[w](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<`u`&&window.removeEventListener&&(window.removeEventListener(`online`,s(this,ge)[ge]),window.removeEventListener(`offline`,s(this,ge)[ge]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit(`info-hidden`)}info(e,t,n){t===void 0&&(t=`info`),n===void 0&&(n=3e3);let r=typeof e==`object`;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit(`info-visible`)}log(e,t){let{logger:n}=this.opts;switch(t){case`error`:n.error(e);break;case`warning`:n.warn(e);break;default:n.debug(e);break}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?s(this,be)[be](e):(s(this,ye)[ye](e),Promise.reject(Error(`Nonexistent upload`)))}[o](){return s(this,_e)[_e](...arguments)}addResultData(e,t){if(!s(this,ve)[ve](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:n}=this.getState(),r=E(E({},n[e]),{},{result:E(E({},n[e].result),t)});this.setState({currentUploads:E(E({},n),{},{[e]:r})})}upload(){var e;(e=s(this,S)[S].uploader)!=null&&e.length||this.log(`No uploader type plugins are used`,`warning`);let{files:t}=this.getState(),n=this.opts.onBeforeUpload(t);return n===!1?Promise.reject(Error(`Not starting the upload because onBeforeUpload returned false`)):(n&&typeof n==`object`&&(t=n,this.setState({files:t})),Promise.resolve().then(()=>s(this,C)[C].validateMinNumberOfFiles(t)).catch(e=>{throw s(this,P)[P](e),e}).then(()=>{if(!s(this,oe)[oe](t))throw new i.RestrictionError(this.i18n(`missingRequiredMetaField`))}).catch(e=>{throw e}).then(()=>{let{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{let t=this.getFile(e);!t.progress.uploadStarted&&n.indexOf(e)===-1&&r.push(t.id)});let i=s(this,_e)[_e](r);return s(this,be)[be](i)}).catch(e=>{throw this.emit(`error`,e),this.log(e,`error`),e}))}};function Se(e,t){let{message:n,details:r=``}=e;e.isRestriction?this.emit(`restriction-failed`,t,e):this.emit(`error`,e),this.info({message:n,details:r},`error`,this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),`error`)}function Ce(e){let{missingFields:t,error:n}=s(this,C)[C].getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit(`restriction-failed`,e,n),!1):!0}function we(e){let t=!0;for(let n of Object.values(e))s(this,F)[F](n)||(t=!1);return t}function Te(e){let{allowNewUpload:t}=this.getState();if(t===!1){let t=new i.RestrictionError(this.i18n(`noMoreFilesAllowed`));throw s(this,P)[P](t,e),t}}function Ee(e,t){let n=m(t),r=y(n,t),a=h(r).extension,o=!!t.isRemote,c=_(E(E({},t),{},{type:n}));if(this.checkIfFileAlreadyExists(c)){let e=new i.RestrictionError(this.i18n(`noDuplicates`,{fileName:r}));throw s(this,P)[P](e,t),e}let l=t.meta||{};l.name=r,l.type=n;let u=Number.isFinite(t.data.size)?t.data.size:null,d={source:t.source||``,id:c,name:r,extension:a||``,meta:E(E({},this.getState().meta),l),type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:u,uploadComplete:!1,uploadStarted:null},size:u,isRemote:o,remote:t.remote||``,preview:t.preview},f=this.opts.onBeforeFileAdded(d,e);if(f===!1){let e=new i.RestrictionError(`Cannot add the file because onBeforeFileAdded returned false.`);throw this.emit(`restriction-failed`,t,e),e}else typeof f==`object`&&f&&(d=f);try{let t=Object.keys(e).map(t=>e[t]);s(this,C)[C].validate(d,t)}catch(e){throw s(this,P)[P](e,d),e}return d}function De(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function Oe(){let e=(e,t,n)=>{let r=e.message||`Unknown error`;e.details&&(r+=` ${e.details}`),this.setState({error:r}),t!=null&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on(`error`,e),this.on(`upload-error`,(t,n,r)=>{if(e(n,t,r),typeof n==`object`&&n.message){let e=Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n(`failedToUpload`,{file:t==null?void 0:t.name}),s(this,P)[P](e)}else s(this,P)[P](n)}),this.on(`upload`,()=>{this.setState({error:null})}),this.on(`upload-started`,e=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}})}),this.on(`upload-progress`,this.calculateProgress),this.on(`upload-success`,(e,t)=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:E(E({},n),{},{postprocess:s(this,N)[N].size>0?{mode:`indeterminate`}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:t,uploadURL:t.uploadURL,isPaused:!1}),e.size==null&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on(`preprocess-progress`,(e,t)=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}this.setFileState(e.id,{progress:E(E({},this.getFile(e.id).progress),{},{preprocess:t})})}),this.on(`preprocess-complete`,e=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let t=E({},this.getState().files);t[e.id]=E(E({},t[e.id]),{},{progress:E({},t[e.id].progress)}),delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on(`postprocess-progress`,(e,t)=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}this.setFileState(e.id,{progress:E(E({},this.getState().files[e.id].progress),{},{postprocess:t})})}),this.on(`postprocess-complete`,e=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let t=E({},this.getState().files);t[e.id]=E(E({},t[e.id]),{},{progress:E({},t[e.id].progress)}),delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on(`restored`,()=>{this.calculateTotalProgress()}),this.on(`dashboard:file-edit-complete`,e=>{e&&s(this,F)[F](e)}),typeof window<`u`&&window.addEventListener&&(window.addEventListener(`online`,s(this,ge)[ge]),window.addEventListener(`offline`,s(this,ge)[ge]),setTimeout(s(this,ge)[ge],3e3))}function ke(e,t){t===void 0&&(t={});let{forceAllowNewUpload:r=!1}=t,{allowNewUpload:i,currentUploads:a}=this.getState();if(!i&&!r)throw Error(`Cannot create a new upload: already uploading.`);let o=(0,n.nanoid)();return this.emit(`upload`,{id:o,fileIDs:e}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:E(E({},a),{},{[o]:{fileIDs:e,step:0,result:{}}})}),o}function Ae(e){let{currentUploads:t}=this.getState();return t[e]}function je(e){let t=E({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})}function Me(e){return Ne.apply(this,arguments)}function Ne(){return Ne=k(function*(e){let{currentUploads:t}=this.getState(),n=t[e],r=n.step||0,i=[...s(this,O)[O],...s(this,M)[M],...s(this,N)[N]];try{for(let a=r;a<i.length&&n;a++){let r=i[a],o=E(E({},n),{},{step:a});this.setState({currentUploads:E(E({},t),{},{[e]:o})}),yield r(o.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw s(this,ye)[ye](e),t}if(n){n.fileIDs.forEach(e=>{let t=this.getFile(e);t&&t.progress.postprocess&&this.emit(`postprocess-complete`,t)});let r=n.fileIDs.map(e=>this.getFile(e)),i=r.filter(e=>!e.error),a=r.filter(e=>e.error);yield this.addResultData(e,{successful:i,failed:a,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit(`complete`,a),s(this,ye)[ye](e)),a==null&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}),Ne.apply(this,arguments)}xe.VERSION=b.version,t.exports=xe})),pe=c({Component:()=>be,Fragment:()=>ye,cloneElement:()=>Ue,createContext:()=>We,createElement:()=>ge,createRef:()=>ve,h:()=>ge,hydrate:()=>He,isValidElement:()=>qe,options:()=>I,render:()=>Ve,toChildArray:()=>Oe});function me(e,t){for(var n in t)e[n]=t[n];return e}function he(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ge(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Ge.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return _e(e,o,r,i,null)}function _e(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Ke:i,__i:-1,__u:0};return i==null&&I.vnode!=null&&I.vnode(a),a}function ve(){return{current:null}}function ye(e){return e.children}function be(e,t){this.props=e,this.context=t}function xe(e,t){if(t==null)return e.__?xe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?xe(e):null}function Se(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Se(e)}}function Ce(e){(!e.__d&&(e.__d=!0)&&Je.push(e)&&!we.__r++||Ye!=I.debounceRendering)&&((Ye=I.debounceRendering)||Xe)(we)}function we(){for(var e,t,n,r,i,a,o,s=1;Je.length;)Je.length>s&&Je.sort(Ze),e=Je.shift(),s=Je.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,a=[],o=[],t.__P&&((n=me({},r)).__v=r.__v+1,I.vnode&&I.vnode(n),Ne(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,a,i==null?xe(r):i,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,Fe(a,n,o),r.__e=r.__=null,n.__e!=i&&Se(n)));we.__r=0}function Te(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=r&&r.__k||it,y=t.length;for(c=Ee(n,t,v,c,y),d=0;d<y;d++)(p=n.__k[d])!=null&&(f=p.__i==-1?rt:v[p.__i]||rt,p.__i=d,g=Ne(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Re(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(_=!!(4&p.__u))||f.__k===p.__k?c=De(p,c,e,_):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function Ee(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?_e(null,o,null,null,null):ot(o)?_e(ye,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?_e(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=ke(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=xe(s)),ze(s,s));return r}function De(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=De(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=xe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Oe(e,t){return t=t||[],e==null||typeof e==`boolean`||(ot(e)?e.some(function(e){Oe(e,t)}):t.push(e)),t}function ke(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Ae(e,t,n){t[0]==`-`?e.setProperty(t,n==null?``:n):e[t]=n==null?``:typeof n!=`number`||at.test(t)?n:n+`px`}function je(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Ae(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Ae(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Qe,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=$e,e.addEventListener(t,a?tt:et,a)):e.removeEventListener(t,a?tt:et,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n==null?``:n;break n}catch(e){}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Me(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=$e++;else if(t.t<n.u)return;return n(I.event?I.event(t):t)}}}function Ne(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=I.__b)&&u(t);n:if(typeof D==`function`)try{if(_=t.props,v=`prototype`in D&&D.prototype.render,y=(u=D.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(v?t.__c=d=new D(_,b):(t.__c=d=new be(_,b),d.constructor=D,d.render=Be),y&&y.sub(d),d.props=_,d.state||(d.state={}),d.context=b,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=me({},d.__s)),me(d.__s,D.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)v&&D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&D.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,b),!d.__e&&d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,b)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,b),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=b,d.props=_,d.__P=e,d.__e=!1,S=I.__r,C=0,v){for(d.state=d.__s,d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[]}else do d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(r=me(me({},r),d.getChildContext())),v&&!f&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(p,m)),T=u,u!=null&&u.type===ye&&u.key==null&&(T=Ie(u.props.children)),s=Te(e,ot(T)?T:[T],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(E=a.length;E--;)he(a[E]);Pe(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Pe(t);I.__e(e,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Le(n.__e,t,n,r,i,a,o,c,l);return(u=I.diffed)&&u(t),128&t.__u?void 0:s}function Pe(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Pe)}function Fe(e,t,n){for(var r=0;r<n.length;r++)Re(n[r],n[++r],n[++r]);I.__c&&I.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){I.__e(e,t.__v)}})}function Ie(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ot(e)?e.map(Ie):me({},e)}function Le(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||(i=`http://www.w3.org/1999/xhtml`),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&(I.__m&&I.__m(t,a),s=!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=a&&Ge.call(e.childNodes),g=n.props||rt,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)if(p=g[l],l!=`children`){if(l==`dangerouslySetInnerHTML`)d=p;else if(!(l in _)){if(l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _)continue;je(e,l,null,p,i)}}for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||je(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),Te(t.type==`template`?e.content:e,ot(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&xe(n,0),s,c),a!=null)for(l=a.length;l--;)he(a[l]);s||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&je(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&je(e,l,h,g[l],i))}return e}function Re(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){I.__e(e,n)}}function ze(e,t,n){var r,i;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Re(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){I.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ze(r[i],t,n||typeof e.type!=`function`);n||he(e.__e),e.__c=e.__=e.__e=void 0}function Be(e,t,n){return this.constructor(e,n)}function Ve(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),I.__&&I.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],Ne(t,e=(!r&&n||t).__k=ge(ye,null,[e]),i||rt,rt,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?Ge.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),Fe(a,e,o)}function He(e,t){Ve(e,t,He)}function Ue(e,t,n){var r,i,a,o,s=me({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)a==`key`?r=t[a]:a==`ref`?i=t[a]:s[a]=t[a]===void 0&&o!=null?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?Ge.call(arguments,2):n),_e(e.type,s,r||e.key,i||e.ref,null)}function We(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,Ce(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ nt++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}var Ge,I,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st=o((()=>{rt={},it=[],at=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ot=Array.isArray,Ge=it.slice,I={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Ke=0,qe=function(e){return e!=null&&e.constructor===void 0},be.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=me({},this.state);typeof e==`function`&&(e=e(me({},n),this.props)),e&&me(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ce(this))},be.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ce(this))},be.prototype.render=ye,Je=[],Xe=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ze=function(e,t){return e.__v.__b-t.__v.__b},we.__r=0,Qe=/(PointerCapture)$|Capture$/i,$e=0,et=Me(!1),tt=Me(!0),nt=0})),ct=s(((e,t)=>{function n(e){return(e==null?void 0:e.nodeType)===Node.ELEMENT_NODE}t.exports=n})),lt=s(((e,t)=>{let n=ct();function r(e,t){return t===void 0&&(t=document),typeof e==`string`?t.querySelector(e):n(e)?e:null}t.exports=r})),ut=s(((e,t)=>{function n(e){for(var t;e&&!e.dir;)e=e.parentNode;return(t=e)==null?void 0:t.dir}t.exports=n})),dt=s(((e,t)=>{D();let n=te();t.exports=class{constructor(e,t){t===void 0&&(t={}),this.uppy=e,this.opts=t}getPluginState(){let{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:E(E({},t),{},{[this.id]:E(E({},t[this.id]),e)})})}setOptions(e){this.opts=E(E({},this.opts),e),this.setPluginState(),this.i18nInit()}i18nInit(){let e=new n([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw Error(`Extend the addTarget method to add your plugin to another plugin's target`)}install(){}uninstall(){}render(){throw Error(`Extend the render method to add your plugin to a DOM element`)}update(){}afterUpdate(){}}})),ft=s(((e,t)=>{var n=(st(),d(pe));function r(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var i=0;function a(e){return`__private_`+ i+++`_`+e}let o=lt(),s=ut(),c=dt();function l(e){let t=null,n=null;return function(){return n=[...arguments],t||(t=Promise.resolve().then(()=>(t=null,e(...n)))),t}}var u=a(`updateUI`);t.exports=class e extends c{constructor(){super(...arguments),Object.defineProperty(this,u,{writable:!0,value:void 0})}mount(t,i){let a=i.id,c=o(t);if(c){this.isTargetDOMEl=!0;let e=document.createElement(`div`);return e.classList.add(`uppy-Root`),r(this,u)[u]=l(t=>{this.uppy.getPlugin(this.id)&&((0,n.render)(this.render(t),e),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(c.innerHTML=``),(0,n.render)(this.render(this.uppy.getState()),e),this.el=e,c.appendChild(e),e.dir=this.opts.direction||s(e)||`ltr`,this.onMount(),this.el}let d;if(typeof t==`object`&&t instanceof e)d=t;else if(typeof t==`function`){let e=t;this.uppy.iteratePlugins(t=>{t instanceof e&&(d=t)})}if(d)return this.uppy.log(`Installing ${a} to ${d.id}`),this.parent=d,this.el=d.addTarget(i),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let f=`Invalid target option given to ${a}.`;throw typeof t==`function`?f+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":f+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",Error(f)}update(e){if(this.el!=null){var t,n;(t=(n=r(this,u))[u])==null||t.call(n,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}})),pt=s(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Uppy=e.UIPlugin=e.BasePlugin=void 0,Object.defineProperty(e,`debugLogger`,{enumerable:!0,get:function(){return n.debugLogger}});var n=g();t.exports=fe(),e.UIPlugin=ft(),e.BasePlugin=dt();let r=fe();e.Uppy=r;let i=ft(),a=dt();r.Uppy=r,r.UIPlugin=i,r.BasePlugin=a,r.debugLogger=n.debugLogger})),mt=s(((e,t)=>{t.exports=class extends Error{constructor(e,t){t===void 0&&(t=null),super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`),this.cause=e,this.isNetworkError=!0,this.request=t}}})),ht=s(((e,t)=>{let n=mt();function r(){return fetch(...arguments).catch(e=>{throw e.name===`AbortError`?e:new n(e)})}t.exports=r})),gt=s(((e,t)=>{let n=F();t.exports=class extends Error{constructor(e,t){t===void 0&&(t={}),super(e),this.cause=t.cause,this.cause&&n(this.cause,`isNetworkError`)&&(this.isNetworkError=this.cause.isNetworkError)}}})),_t=s(((e,t)=>{t.exports=class extends Error{constructor(){super(`Authorization required`),this.name=`AuthError`,this.isAuthError=!0}}})),vt=s(((e,t)=>{A(),D();let n;function r(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var i=0;function a(e){return`__private_`+ i+++`_`+e}let o=ht(),s=gt(),c=_t(),l={version:`2.2.2`};function u(e){return e.replace(/\/$/,``)}function d(e){return f.apply(this,arguments)}function f(){return f=k(function*(e){if(e.status===401)throw new c;let t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{let e=yield t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw Error(n)}}return t}),f.apply(this,arguments)}var p=a(`companionHeaders`),m=a(`getPostResponseFunc`),h=a(`getUrl`),g=a(`errorHandler`);n=Symbol.for(`uppy test: getCompanionHeaders`);var _=class e{constructor(e,t){Object.defineProperty(this,g,{value:y}),Object.defineProperty(this,h,{value:v}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=[`accept`,`content-type`,`uppy-auth-token`],this.preflightDone=!1,r(this,p)[p]=t==null?void 0:t.companionHeaders}setCompanionHeaders(e){r(this,p)[p]=e}[n](){return r(this,p)[p]}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return u(e&&e[t]?e[t]:t)}headers(){return Promise.resolve(E(E({},e.defaultHeaders),r(this,p)[p]))}onReceiveResponse(e){let t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has(`i-am`)&&r.get(`i-am`)!==t[n]&&this.uppy.setState({companion:E(E({},t),{},{[n]:r.get(`i-am`)})}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(r(this,h)[h](e),{method:`OPTIONS`}).then(e=>(e.headers.has(`access-control-allow-headers`)&&(this.allowedHeaders=e.headers.get(`access-control-allow-headers`).split(`,`).map(e=>e.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,`warning`),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then(e=>{let[t,n]=e;return Object.keys(n).forEach(e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])}),n})}get(e,t){return this.preflightAndHeaders(e).then(t=>o(r(this,h)[h](e),{method:`get`,headers:t,credentials:this.opts.companionCookiesRule||`same-origin`})).then(r(this,m)[m](t)).then(d).catch(r(this,g)[g](`get`,e))}post(e,t,n){let i=`post`;return this.preflightAndHeaders(e).then(n=>o(r(this,h)[h](e),{method:i,headers:n,credentials:this.opts.companionCookiesRule||`same-origin`,body:JSON.stringify(t)})).then(r(this,m)[m](n)).then(d).catch(r(this,g)[g](i,e))}delete(e,t,n){let i=`delete`;return this.preflightAndHeaders(e).then(n=>o(`${this.hostname}/${e}`,{method:i,headers:n,credentials:this.opts.companionCookiesRule||`same-origin`,body:t?JSON.stringify(t):null})).then(r(this,m)[m](n)).then(d).catch(r(this,g)[g](i,e))}};function v(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function y(e,t){return n=>{var i;return(i=n)!=null&&i.isAuthError||(n=new s(`Could not ${e} ${r(this,h)[h](t)}`,{cause:n})),Promise.reject(n)}}_.VERSION=l.version,_.defaultHeaders={Accept:`application/json`,"Content-Type":`application/json`,"Uppy-Versions":`@uppy/companion-client=${_.VERSION}`},t.exports=_})),yt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getItem=n,e.removeItem=r,e.setItem=t;function t(e,t){return new Promise(n=>{localStorage.setItem(e,t),n()})}function n(e){return Promise.resolve(localStorage.getItem(e))}function r(e){return new Promise(t=>{localStorage.removeItem(e),t()})}})),bt=s(((e,t)=>{D(),A();var n=yt();let r=vt(),i=e=>e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);t.exports=class extends r{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||i(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,n]=e,r={};return n&&(r[`uppy-auth-token`]=n),this.companionKeysParams&&(r[`uppy-credentials-params`]=btoa(JSON.stringify({params:this.companionKeysParams}))),E(E({},t),r)})}onReceiveResponse(e){e=super.onReceiveResponse(e);let t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?e.status!==401:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}ensurePreAuth(){var e=this;return k(function*(){if(e.companionKeysParams&&!e.preAuthToken&&(yield e.fetchPreAuthToken(),!e.preAuthToken))throw Error(`Could not load authentication data required for third-party login. Please try again later.`)})()}authUrl(e){e===void 0&&(e={});let t=new URLSearchParams(e);return this.preAuthToken&&t.set(`uppyPreAuthToken`,this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}fetchPreAuthToken(){var e=this;return k(function*(){if(e.companionKeysParams)try{e.preAuthToken=(yield e.post(`${e.id}/preauth/`,{params:e.companionKeysParams})).token}catch(t){e.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${t}`,`warning`)}})()}list(e){return this.get(`${this.id}/list/${e||``}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(e,t,r){if(e.type=`acquirer`,e.files=[],r&&(e.opts=E(E({},r),t)),t.serverUrl||t.serverPattern)throw Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){let n=t.companionAllowedHosts;if(typeof n!=`string`&&!Array.isArray(n)&&!(n instanceof RegExp))throw TypeError(`${e.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);e.opts.companionAllowedHosts=n}else /^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts=`https://${t.companionUrl.replace(/^\/\//,``)}`:e.opts.companionAllowedHosts=new URL(t.companionUrl).origin;e.storage=e.opts.storage||n}}})),xt=s(((e,t)=>{let n=vt(),r=e=>e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);t.exports=class extends n{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||r(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:``}`)}}})),St=s(((e,t)=>{let n,r;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var a=0;function o(e){return`__private_`+ a+++`_`+e}let s=ne();var c=o(`queued`),l=o(`emitter`),u=o(`isOpen`),d=o(`socket`),f=o(`handleMessage`);n=Symbol.for(`uppy test: getSocket`),r=Symbol.for(`uppy test: getQueued`),t.exports=class{constructor(e){Object.defineProperty(this,c,{writable:!0,value:[]}),Object.defineProperty(this,l,{writable:!0,value:s()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:e=>{try{let t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,(!e||e.autoOpen!==!1)&&this.open()}get isOpen(){return i(this,u)[u]}[n](){return i(this,d)[d]}[r](){return i(this,c)[c]}open(){i(this,d)[d]=new WebSocket(this.opts.target),i(this,d)[d].onopen=()=>{for(i(this,u)[u]=!0;i(this,c)[c].length>0&&i(this,u)[u];){let e=i(this,c)[c].shift();this.send(e.action,e.payload)}},i(this,d)[d].onclose=()=>{i(this,u)[u]=!1},i(this,d)[d].onmessage=i(this,f)[f]}close(){var e;(e=i(this,d)[d])==null||e.close()}send(e,t){if(!i(this,u)[u]){i(this,c)[c].push({action:e,payload:t});return}i(this,d)[d].send(JSON.stringify({action:e,payload:t}))}on(e,t){i(this,l)[l].on(e,t)}emit(e,t){i(this,l)[l].emit(e,t)}once(e,t){i(this,l)[l].once(e,t)}}})),Ct=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Socket=e.SearchProvider=e.RequestClient=e.Provider=void 0,e.RequestClient=vt(),e.Provider=bt(),e.SearchProvider=xt(),e.Socket=St()})),wt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.internalRateLimitedQueue=e.RateLimitedQueue=void 0;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var n=0;function r(e){return`__private_`+ n+++`_`+e}function i(){return Error(`Cancelled`)}var a=r(`activeRequests`),o=r(`queuedHandlers`),s=r(`paused`),c=r(`pauseTimer`),l=r(`downLimit`),u=r(`upperLimit`),d=r(`rateLimitingTimer`),f=r(`call`),p=r(`queueNext`),m=r(`next`),h=r(`queue`),g=r(`dequeue`),_=r(`resume`),v=r(`increaseLimit`);e.RateLimitedQueue=class{constructor(e){Object.defineProperty(this,g,{value:C}),Object.defineProperty(this,h,{value:S}),Object.defineProperty(this,m,{value:x}),Object.defineProperty(this,p,{value:b}),Object.defineProperty(this,f,{value:y}),Object.defineProperty(this,a,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:!1}),Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(t(this,s)[s]){t(this,d)[d]=setTimeout(t(this,v)[v],0);return}t(this,l)[l]=this.limit,this.limit=Math.ceil((t(this,u)[u]+t(this,l)[l])/2);for(let e=t(this,l)[l];e<=this.limit;e++)t(this,p)[p]();t(this,u)[u]-t(this,l)[l]>3?t(this,d)[d]=setTimeout(t(this,v)[v],2e3):t(this,l)[l]=Math.floor(t(this,l)[l]/2)}}),typeof e!=`number`||e===0?this.limit=1/0:this.limit=e}run(e,n){return!t(this,s)[s]&&t(this,a)[a]<this.limit?t(this,f)[f](e):t(this,h)[h](e,n)}wrapPromiseFunction(e,t){var n=this;return function(){var r=[...arguments];let a,o=new Promise((o,s)=>{a=n.run(()=>{let t,n;try{n=Promise.resolve(e(...r))}catch(e){n=Promise.reject(e)}return n.then(e=>{t?s(t):(a.done(),o(e))},e=>{t?s(t):(a.done(),s(e))}),()=>{t=i()}},t)});return o.abort=()=>{a.abort()},o}}resume(){t(this,s)[s]=!1,clearTimeout(t(this,c)[c]);for(let e=0;e<this.limit;e++)t(this,p)[p]()}pause(e){e===void 0&&(e=null),t(this,s)[s]=!0,clearTimeout(t(this,c)[c]),e!=null&&(t(this,c)[c]=setTimeout(t(this,_)[_],e))}rateLimit(e){clearTimeout(t(this,d)[d]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(t(this,u)[u]=this.limit-1,this.limit=t(this,l)[l],t(this,d)[d]=setTimeout(t(this,v)[v],e))}get isPaused(){return t(this,s)[s]}};function y(e){t(this,a)[a]+=1;let n=!1,r;try{r=e()}catch(e){throw--t(this,a)[a],e}return{abort:()=>{n||(n=!0,--t(this,a)[a],r(),t(this,p)[p]())},done:()=>{n||(n=!0,--t(this,a)[a],t(this,p)[p]())}}}function b(){queueMicrotask(()=>t(this,m)[m]())}function x(){if(t(this,s)[s]||t(this,a)[a]>=this.limit||t(this,o)[o].length===0)return;let e=t(this,o)[o].shift(),n=t(this,f)[f](e.fn);e.abort=n.abort,e.done=n.done}function S(e,n){n===void 0&&(n={});let r={fn:e,priority:n.priority||0,abort:()=>{t(this,g)[g](r)},done:()=>{throw Error(`Cannot mark a queued request as done: this indicates a bug`)}},i=t(this,o)[o].findIndex(e=>r.priority>e.priority);return i===-1?t(this,o)[o].push(r):t(this,o)[o].splice(i,0,r),r}function C(e){let n=t(this,o)[o].indexOf(e);n!==-1&&t(this,o)[o].splice(n,1)}e.internalRateLimitedQueue=Symbol(`__queue`)})),Tt=s(((e,t)=>{let n=re();function r(e,t,n){let{progress:r,bytesUploaded:i,bytesTotal:a}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit(`upload-progress`,n,{uploader:e,bytesUploaded:i,bytesTotal:a}))}t.exports=n(r,300,{leading:!0,trailing:!0})})),Et=s(((e,t)=>{function n(e){let t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?`ws`:`wss`}://${t}`}t.exports=n})),Dt=s(((e,t)=>{function n(e){let t=[],n=[];function r(e){t.push(e)}function i(e){n.push(e)}return Promise.all(e.map(e=>e.then(r,i))).then(()=>({successful:t,failed:n}))}t.exports=n})),Ot=s(((e,t)=>{function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}var a=i(`emitter`),o=i(`events`);t.exports=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),n(this,a)[a]=e}on(e,t){return n(this,o)[o].push([e,t]),n(this,a)[a].on(e,t)}remove(){for(let[e,t]of n(this,o)[o].splice(0))n(this,a)[a].off(e,t)}}})),kt=s(((e,t)=>{function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}var a=i(`aliveTimer`),o=i(`isDone`),s=i(`onTimedOut`),c=i(`timeout`);t.exports=class{constructor(e,t){Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),n(this,c)[c]=e,n(this,s)[s]=t}progress(){n(this,o)[o]||n(this,c)[c]>0&&(clearTimeout(n(this,a)[a]),n(this,a)[a]=setTimeout(n(this,s)[s],n(this,c)[c]))}done(){n(this,o)[o]||(clearTimeout(n(this,a)[a]),n(this,a)[a]=null,n(this,o)[o]=!0)}}})),At=s(((e,t)=>{function n(e){return e?e.readyState!==0&&e.readyState!==4||e.status===0:!1}t.exports=n})),jt=s(((e,t)=>{t.exports={strings:{timedOut:`Upload stalled for %{seconds} seconds, aborting.`}}})),Mt=s(((e,t)=>{D();var n=j(),r=Ct(),i=wt();let a=dt(),o=Tt(),s=Et(),c=Dt(),l=Ot(),u=kt(),d=mt(),f=At(),p={version:`2.1.3`},m=jt();function h(e,t){let n=t;return n||(n=Error(`Upload error`)),typeof n==`string`&&(n=Error(n)),n instanceof Error||(n=Object.assign(Error(`Upload error`),{data:n})),f(e)?(n=new d(n,e),n):(n.request=e,n)}function g(e){return e.data.slice(0,e.data.size,e.meta.type)}var _=class extends a{constructor(e,t){if(super(e,t),this.type=`uploader`,this.id=this.opts.id||`XHRUpload`,this.title=`XHRUpload`,this.defaultLocale=m,this.opts=E(E({},{formData:!0,fieldName:t.bundle?`files[]`:`file`,method:`post`,metaFields:null,responseUrlFieldName:`url`,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:``,getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=Error(`Upload error`);return f(t)&&(n=new d(n,t)),n},validateStatus(e){return e>=200&&e<300}}),t),this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),i.internalRateLimitedQueue in this.opts?this.requests=this.opts[i.internalRateLimitedQueue]:this.requests=new i.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r=E(E(E(E({},this.opts),t||{}),e.xhrUpload||{}),{},{headers:{}});return typeof n==`function`?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){let n=new FormData;this.addMetadata(n,e.meta,t);let r=g(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){let n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach(e=>{let t=this.getOptions(e),r=g(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)}),n}upload(e,t,r){let i=this.getOptions(e);return this.uppy.log(`uploading ${t} of ${r}`),new Promise((t,r)=>{this.uppy.emit(`upload-started`,e);let a=i.formData?this.createFormDataUpload(e,i):e.data,o=new XMLHttpRequest;this.uploaderEvents[e.id]=new l(this.uppy);let s,c=new u(i.timeout,()=>{o.abort(),s.done();let t=Error(this.i18n(`timedOut`,{seconds:Math.ceil(i.timeout/1e3)}));this.uppy.emit(`upload-error`,e,t),r(t)}),d=(0,n.nanoid)();o.upload.addEventListener(`loadstart`,()=>{this.uppy.log(`[XHRUpload] ${d} started`)}),o.upload.addEventListener(`progress`,t=>{this.uppy.log(`[XHRUpload] ${d} progress: ${t.loaded} / ${t.total}`),c.progress(),t.lengthComputable&&this.uppy.emit(`upload-progress`,e,{uploader:this,bytesUploaded:t.loaded,bytesTotal:t.total})}),o.addEventListener(`load`,()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),i.validateStatus(o.status,o.responseText,o)){let n=i.getResponseData(o.responseText,o),r=n[i.responseUrlFieldName],a={status:o.status,body:n,uploadURL:r};return this.uppy.emit(`upload-success`,e,a),r&&this.uppy.log(`Download ${e.name} from ${r}`),t(e)}let n=i.getResponseData(o.responseText,o),a=h(o,i.getResponseError(o.responseText,o)),l={status:o.status,body:n};return this.uppy.emit(`upload-error`,e,a,l),r(a)}),o.addEventListener(`error`,()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);let t=h(o,i.getResponseError(o.responseText,o));return this.uppy.emit(`upload-error`,e,t),r(t)}),o.open(i.method.toUpperCase(),i.endpoint,!0),o.withCredentials=i.withCredentials,i.responseType!==``&&(o.responseType=i.responseType),s=this.requests.run(()=>{this.uppy.emit(`upload-started`,e);let t=this.getOptions(e);return Object.keys(t.headers).forEach(e=>{o.setRequestHeader(e,t.headers[e])}),o.send(a),()=>{c.done(),o.abort()}}),this.onFileRemove(e.id,()=>{s.abort(),r(Error(`File removed`))}),this.onCancelAll(e.id,e=>{let{reason:t}=e;t===`user`&&s.abort(),r(Error(`Upload cancelled`))})})}uploadRemote(e){let t=this.getOptions(e);return new Promise((n,i)=>{this.uppy.emit(`upload-started`,e);let a={};(Array.isArray(t.metaFields)?t.metaFields:Object.keys(e.meta)).forEach(t=>{a[t]=e.meta[t]}),new(e.remote.providerOptions.provider?r.Provider:r.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,E(E({},e.remote.body),{},{endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:a,httpMethod:t.method,useFormData:t.formData,headers:t.headers})).then(a=>{let{token:c}=a,u=s(e.remote.companionUrl),d=new r.Socket({target:`${u}/api/${c}`,autoOpen:!1});this.uploaderEvents[e.id]=new l(this.uppy);let f;this.onFileRemove(e.id,()=>{d.send(`cancel`,{}),f.abort(),n(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,function(t){let{reason:r}=t===void 0?{}:t;r===`user`&&(d.send(`cancel`,{}),f.abort()),n(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{d.send(`pause`,{}),d.send(`resume`,{})}),this.onRetryAll(e.id,()=>{d.send(`pause`,{}),d.send(`resume`,{})}),d.on(`progress`,t=>o(this,t,e)),d.on(`success`,r=>{let i=t.getResponseData(r.response.responseText,r.response),a=i[t.responseUrlFieldName],o={status:r.response.status,body:i,uploadURL:a};return this.uppy.emit(`upload-success`,e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),n()}),d.on(`error`,n=>{let r=n.response,a=r?t.getResponseError(r.responseText,r):Object.assign(Error(n.error.message),{cause:n.error});this.uppy.emit(`upload-error`,e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),i(a)}),f=this.requests.run(()=>(d.open(),e.isPaused&&d.send(`pause`,{}),()=>d.close()))}).catch(t=>{this.uppy.emit(`upload-error`,e,t),i(t)})})}uploadBundle(e){return new Promise((t,n)=>{let{endpoint:r}=this.opts,{method:i}=this.opts,a=this.uppy.getState().xhrUpload,o=this.createBundledUpload(e,E(E({},this.opts),a||{})),s=new XMLHttpRequest,c=t=>{e.forEach(e=>{this.uppy.emit(`upload-error`,e,t)})},l=new u(this.opts.timeout,()=>{s.abort();let e=Error(this.i18n(`timedOut`,{seconds:Math.ceil(this.opts.timeout/1e3)}));c(e),n(e)});s.upload.addEventListener(`loadstart`,()=>{this.uppy.log(`[XHRUpload] started uploading bundle`),l.progress()}),s.upload.addEventListener(`progress`,t=>{l.progress(),t.lengthComputable&&e.forEach(e=>{this.uppy.emit(`upload-progress`,e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),s.addEventListener(`load`,r=>{if(l.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){let n=this.opts.getResponseData(s.responseText,s),i={status:r.target.status,body:n};return e.forEach(e=>{this.uppy.emit(`upload-success`,e,i)}),t()}let i=this.opts.getResponseError(s.responseText,s)||Error(`Upload error`);return i.request=s,c(i),n(i)}),s.addEventListener(`error`,()=>{l.done();let e=this.opts.getResponseError(s.responseText,s)||Error(`Upload error`);return c(e),n(e)}),this.uppy.on(`cancel-all`,function(e){let{reason:t}=e===void 0?{}:e;t===`user`&&(l.done(),s.abort())}),s.open(i.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,this.opts.responseType!==``&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(e=>{s.setRequestHeader(e,this.opts.headers[e])}),s.send(o),e.forEach(e=>{this.uppy.emit(`upload-started`,e)})})}uploadFiles(e){return c(e.map((t,n)=>{let r=parseInt(n,10)+1,i=e.length;return t.error?Promise.reject(Error(t.error)):t.isRemote?this.uploadRemote(t,r,i):this.upload(t,r,i)}))}onFileRemove(e,t){this.uploaderEvents[e].on(`file-removed`,n=>{e===n.id&&t(n.id)})}onRetry(e,t){this.uploaderEvents[e].on(`upload-retry`,n=>{e===n&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on(`retry-all`,()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on(`cancel-all`,function(){n.uppy.getFile(e)&&t(...arguments)})}handleUpload(e){if(e.length===0)return this.uppy.log(`[XHRUpload] No files to upload!`),Promise.resolve();this.opts.limit===0&&!this.opts[i.internalRateLimitedQueue]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0",`warning`),this.uppy.log(`[XHRUpload] Uploading...`);let t=e.map(e=>this.uppy.getFile(e));if(this.opts.bundle){if(t.some(e=>e.isRemote))throw Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers==`function`)throw TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:E(E({},e),{},{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:E(E({},e),{},{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)}};_.VERSION=p.version,t.exports=_})),Nt=s(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=/^(?:0|[1-9]\d*)$/;function s(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function c(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function l(e,t){return function(n){return e(t(n))}}var u=Object.prototype,d=u.hasOwnProperty,f=u.toString,p=u.propertyIsEnumerable,m=l(Object.keys,Object);function h(e,t){var n=E(e)||T(e)?c(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||d.call(e,a))&&!(i&&(a==`length`||S(a,r)))&&n.push(a);return n}var g=b(v),_=x();function v(e,t){return e&&_(e,t,N)}function y(e){if(!C(e))return m(e);var t=[];for(var n in Object(e))d.call(e,n)&&n!=`constructor`&&t.push(n);return t}function b(e,t){return function(n,r){if(n==null)return n;if(!D(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function x(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function S(e,t){return t=t==null?n:t,!!t&&(typeof e==`number`||o.test(e))&&e>-1&&e%1==0&&e<t}function C(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||u)}function w(e,t){return(E(e)?s:g)(e,typeof t==`function`?t:P)}function T(e){return O(e)&&d.call(e,`callee`)&&(!p.call(e,`callee`)||f.call(e)==r)}var E=Array.isArray;function D(e){return e!=null&&A(e.length)&&!k(e)}function O(e){return M(e)&&D(e)}function k(e){var t=j(e)?f.call(e):``;return t==i||t==a}function A(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function j(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function M(e){return!!e&&typeof e==`object`}function N(e){return D(e)?h(e):y(e)}function P(e){return e}t.exports=w}));Mt(),pt();var Pt=u(Nt(),1);function Ft(e){Promise.resolve().then(e)}function It(e){return e.replace(/ {2}/g,` `).replace(/</g,`<`).replace(/>/g,`>`).replace(/®/g,`®`).replace(/©/g,`©`).replace(/™/g,`™`)}function Lt(e){return e.replace(/ /g,` `).replace(/</g,`<`).replace(/>/g,`>`).replace(/®/g,`®`).replace(/©/g,`©`).replace(/™/g,`™`).replace(/"/g,`"`)}const Rt=e=>Object.prototype.toString.call(e);var zt={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var i=L.transform(n,t,{affinity:r});e.current=i,i==null&&e.unref()}}},Bt={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var i=G.transform(n,t,{affinity:r});e.current=i,i==null&&e.unref()}}},Vt={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var i=R.transform(n,t,{affinity:r});e.current=i,i==null&&e.unref()}}},Ht=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,L={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=L.levels(e,t);return r=n?r.slice(1):r.slice(0,-1),r},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var i=e[r],a=t[r];if(typeof i!=`number`||typeof a!=`number`)throw Error(`Got non-numeric path index`);if(i!==a)break;n.push(i)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),i=t.slice(0,n),a=e[n],o=t[n];return L.equals(r,i)&&a>o},endsAt(e,t){var n=e.length,r=e.slice(0,n),i=t.slice(0,n);return L.equals(r,i)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),i=t.slice(0,n),a=e[n],o=t[n];return L.equals(r,i)&&a<o},equals(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return L.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&L.compare(e,t)===0},isBefore(e,t){return L.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&L.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&L.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&L.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&L.compare(e,t)===0},isPath(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&L.equals(n,r)},levels(e){for(var{reverse:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=0;r<=e.length;r++)n.push(e.slice(0,r));return t&&n.reverse(),n},next(e){if(e.length===0)throw Error(`Cannot get the next path of a root path [${e}], because it has no next index.`);var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case`insert_node`:case`remove_node`:case`merge_node`:case`split_node`:case`move_node`:return!0;default:return!1}},parent(e){if(e.length===0)throw Error(`Cannot get the parent path of the root path [${e}].`);return e.slice(0,-1)},previous(e){if(e.length===0)throw Error(`Cannot get the previous path of a root path [${e}], because it has no previous index.`);var t=e[e.length-1];if(t<=0)throw Error(`Cannot get the previous path of a first child path [${e}] because it would result in a negative index.`);return e.slice(0,-1).concat(t-1)},relative(e,t){if(!L.isAncestor(t,e)&&!L.equals(e,t))throw Error(`Cannot get the relative path of [${e}] inside ancestor [${t}], because it is not above or equal to the path.`);return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:i=`forward`}=n;if(e.length===0)return r;switch(t.type){case`insert_node`:var{path:a}=t;(L.equals(a,r)||L.endsBefore(a,r)||L.isAncestor(a,r))&&(r[a.length-1]+=1);break;case`remove_node`:var{path:o}=t;if(L.equals(o,r)||L.isAncestor(o,r))return null;L.endsBefore(o,r)&&--r[o.length-1];break;case`merge_node`:var{path:s,position:c}=t;L.equals(s,r)||L.endsBefore(s,r)?--r[s.length-1]:L.isAncestor(s,r)&&(--r[s.length-1],r[s.length]+=c);break;case`split_node`:var{path:l,position:u}=t;if(L.equals(l,r)){if(i===`forward`)r[r.length-1]+=1;else if(i!==`backward`)return null}else L.endsBefore(l,r)?r[l.length-1]+=1:L.isAncestor(l,r)&&e[l.length]>=u&&(r[l.length-1]+=1,r[l.length]-=u);break;case`move_node`:var{path:d,newPath:f}=t;if(L.equals(d,f))return r;if(L.isAncestor(d,r)||L.equals(d,r)){var p=f.slice();return L.endsBefore(d,f)&&d.length<f.length&&--p[d.length-1],p.concat(r.slice(d.length))}else L.isSibling(d,f)&&(L.isAncestor(f,r)||L.equals(f,r))?L.endsBefore(d,r)?--r[d.length-1]:r[d.length-1]+=1:L.endsBefore(f,r)||L.equals(f,r)||L.isAncestor(f,r)?(L.endsBefore(d,r)&&--r[d.length-1],r[f.length-1]+=1):L.endsBefore(d,r)&&(L.equals(f,r)&&(r[f.length-1]+=1),--r[d.length-1]);break}return r}};function Yt(e){"@babel/helpers - typeof";return Yt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Yt(e)}function Xt(e,t){if(Yt(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yt(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Zt(e){var t=Xt(e,`string`);return Yt(t)===`symbol`?t:String(t)}function Qt(e,t,n){return t=Zt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $t(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function en(e,t){if(e==null)return{};var n=$t(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var tn=[`anchor`,`focus`];function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nn(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var R={edges(e){var{reverse:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{anchor:n,focus:r}=e;return R.isBackward(e)===t?[n,r]:[r,n]},end(e){var[,t]=R.edges(e);return t},equals(e,t){return G.equals(e.anchor,t.anchor)&&G.equals(e.focus,t.focus)},surrounds(e,t){var n=R.intersection(e,t);return n?R.equals(n,t):!1},includes(e,t){if(W.isRange(t)){if(R.includes(e,t.anchor)||R.includes(e,t.focus))return!0;var[n,r]=R.edges(e),[i,a]=R.edges(t);return G.isBefore(n,i)&&G.isAfter(r,a)}var[o,s]=R.edges(e),c=!1,l=!1;return W.isPoint(t)?(c=G.compare(t,o)>=0,l=G.compare(t,s)<=0):(c=L.compare(t,o.path)>=0,l=L.compare(t,s.path)<=0),c&&l},intersection(e,t){var{anchor:n,focus:r}=e,i=en(e,tn),[a,o]=R.edges(e),[s,c]=R.edges(t),l=G.isBefore(a,s)?s:a,u=G.isBefore(o,c)?o:c;return G.isBefore(u,l)?null:rn({anchor:l,focus:u},i)},isBackward(e){var{anchor:t,focus:n}=e;return G.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return G.equals(t,n)},isExpanded(e){return!R.isCollapsed(e)},isForward(e){return!R.isBackward(e)},isRange(e){return fn(e)&&G.isPoint(e.anchor)&&G.isPoint(e.focus)},*points(e){yield[e.anchor,`anchor`],yield[e.focus,`focus`]},start(e){var[t]=R.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e===null)return null;var{affinity:r=`inward`}=n,i,a;if(r===`inward`){var o=R.isCollapsed(e);R.isForward(e)?(i=`forward`,a=o?i:`backward`):(i=`backward`,a=o?i:`forward`)}else r===`outward`?R.isForward(e)?(i=`backward`,a=`forward`):(i=`forward`,a=`backward`):(i=r,a=r);var s=G.transform(e.anchor,t,{affinity:i}),c=G.transform(e.focus,t,{affinity:a});return!s||!c?null:{anchor:s,focus:c}}},an=function(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return!fn(e)||typeof e.apply==`function`?!1:t?B.isNodeList(e.children):Array.isArray(e.children)},z={isAncestor(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return fn(e)&&B.isNodeList(e.children,{deep:t})},isElement:an,isElementList(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Array.isArray(e)&&e.every(e=>z.isElement(e,{deep:t}))},isElementProps(e){return e.children!==void 0},isElementType:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`type`;return an(e)&&e[n]===t},matches(e,t){for(var n in t)if(n!==`children`&&e[n]!==t[n])return!1;return!0}},on=[`text`],sn=[`children`];function cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cn(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var B={ancestor(e,t){var n=B.get(e,t);if(B.isText(n))throw Error(`Cannot get the ancestor node at path [${t}] because it refers to a text node instead: ${Kn.stringify(n)}`);return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of L.ancestors(t,n))yield[B.ancestor(e,r),r]}()},child(e,t){if(B.isText(e))throw Error(`Cannot get the child of a text node: ${Kn.stringify(e)}`);if(typeof t!=`number`)throw Error(`Expected index to be a number`);var n=e.children[t];if(n==null)throw Error(`Cannot get child at index \`${t}\` in node: ${Kn.stringify(e)}`);return n},children(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,i=B.ancestor(e,t),{children:a}=i,o=r?a.length-1:0;r?o>=0:o<a.length;)yield[B.child(i,o),t.concat(o)],o=r?o-1:o+1}()},common(e,t,n){var r=L.common(t,n);return[B.get(e,r),r]},descendant(e,t){var n=B.get(e,t);if(B.isEditor(n))throw Error(`Cannot get the descendant node at path [${t}] because it refers to the root editor node instead: ${Kn.stringify(n)}`);return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of B.nodes(e,t))r.length!==0&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of B.nodes(e,t))B.isElement(n)&&(yield[n,r])}()},extractProps(e){if(B.isText(e)){var{text:t}=e,n=en(e,on);return n}else{var{children:r}=e,n=en(e,sn);return n}},first(e,t){for(var n=t.slice(),r=B.get(e,n);r&&!(B.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,i]=R.edges(t),a=B.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!R.includes(t,n)}}),o=function(){if(!R.includes(t,s)){var e=s[s.length-1];ir(n,L.parent(s),t=>nr(t,e,1))}L.equals(s,i.path)&&ar(n,s,e=>{var t=e.text.slice(0,i.offset);return ln(ln({},e),{},{text:t})}),L.equals(s,r.path)&&ar(n,s,e=>{var t=e.text.slice(r.offset);return ln(ln({},e),{},{text:t})})};for(var[,s]of a)o();return n.children},get(e,t){var n=B.getIf(e,t);if(n===void 0)throw Error(`Cannot find a descendant at path [${t}] in node: ${Kn.stringify(e)}`);return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(typeof i!=`number`)throw Error(`Got non-numeric path index`);if(B.isText(n)||!n.children[i])return;n=n.children[i]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(typeof i!=`number`)throw Error(`Got non-numeric path index`);if(B.isText(n)||!n.children[i])return!1;n=n.children[i]}return!0},isAncestor(e){return!B.isText(e)},isEditor(e){return typeof e.apply==`function`},isElement(e){return Array.isArray(e.children)&&typeof e.apply!=`function`},isNode(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Zn.isText(e)||z.isElement(e,{deep:t})||U.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Array.isArray(e)&&e.every(e=>B.isNode(e,{deep:t}))},isText(e){return typeof e.text==`string`},last(e,t){for(var n=t.slice(),r=B.get(e,n);r&&!(B.isText(r)||r.children.length===0);){var i=r.children.length-1;r=r.children[i],n.push(i)}return[r,n]},leaf(e,t){var n=B.get(e,t);if(!B.isText(n))throw Error(`Cannot get the leaf node at path [${t}] because it refers to a non-leaf node: ${Kn.stringify(n)}`);return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of L.levels(t,n))yield[B.get(e,r),r]}()},matches(e,t){return B.isElement(e)&&z.isElementProps(t)&&z.matches(e,t)||B.isText(e)&&Zn.isTextProps(t)&&Zn.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:i=[],to:a}=t,o=new Set,s=[],c=e;!(a&&(r?L.isBefore(s,a):L.isAfter(s,a)));){if(o.has(c)||(yield[c,s]),!o.has(c)&&!B.isText(c)&&c.children.length!==0&&(n==null||n([c,s])===!1)){o.add(c);var l=r?c.children.length-1:0;L.isAncestor(s,i)&&(l=i[s.length]),s=s.concat(l),c=B.get(e,s);continue}if(s.length===0)break;if(!r){var u=L.next(s);if(B.has(e,u)){s=u,c=B.get(e,s);continue}}if(r&&s[s.length-1]!==0){s=L.previous(s),c=B.get(e,s);continue}s=L.parent(s),c=B.get(e,s),o.add(c)}}()},parent(e,t){var n=L.parent(t),r=B.get(e,n);if(B.isText(r))throw Error(`Cannot get the parent of path [${t}] because it does not exist in the root.`);return r},string(e){return B.isText(e)?e.text:e.children.map(B.string).join(``)},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of B.nodes(e,t))B.isText(n)&&(yield[n,r])}()}};function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?un(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dn={isNodeOperation(e){return dn.isOperation(e)&&e.type.endsWith(`_node`)},isOperation(e){if(!fn(e))return!1;switch(e.type){case`insert_node`:return L.isPath(e.path)&&B.isNode(e.node);case`insert_text`:return typeof e.offset==`number`&&typeof e.text==`string`&&L.isPath(e.path);case`merge_node`:return typeof e.position==`number`&&L.isPath(e.path)&&fn(e.properties);case`move_node`:return L.isPath(e.path)&&L.isPath(e.newPath);case`remove_node`:return L.isPath(e.path)&&B.isNode(e.node);case`remove_text`:return typeof e.offset==`number`&&typeof e.text==`string`&&L.isPath(e.path);case`set_node`:return L.isPath(e.path)&&fn(e.properties)&&fn(e.newProperties);case`set_selection`:return e.properties===null&&R.isRange(e.newProperties)||e.newProperties===null&&R.isRange(e.properties)||fn(e.properties)&&fn(e.newProperties);case`split_node`:return L.isPath(e.path)&&typeof e.position==`number`&&fn(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(e=>dn.isOperation(e))},isSelectionOperation(e){return dn.isOperation(e)&&e.type.endsWith(`_selection`)},isTextOperation(e){return dn.isOperation(e)&&e.type.endsWith(`_text`)},inverse(e){switch(e.type){case`insert_node`:return V(V({},e),{},{type:`remove_node`});case`insert_text`:return V(V({},e),{},{type:`remove_text`});case`merge_node`:return V(V({},e),{},{type:`split_node`,path:L.previous(e.path)});case`move_node`:var{newPath:t,path:n}=e;if(L.equals(t,n))return e;if(L.isSibling(n,t))return V(V({},e),{},{path:t,newPath:n});var r=L.transform(n,e),i=L.transform(L.next(n),e);return V(V({},e),{},{path:r,newPath:i});case`remove_node`:return V(V({},e),{},{type:`insert_node`});case`remove_text`:return V(V({},e),{},{type:`insert_text`});case`set_node`:var{properties:a,newProperties:o}=e;return V(V({},e),{},{properties:o,newProperties:a});case`set_selection`:var{properties:s,newProperties:c}=e;return s==null?V(V({},e),{},{properties:c,newProperties:null}):c==null?V(V({},e),{},{properties:null,newProperties:s}):V(V({},e),{},{properties:c,newProperties:s});case`split_node`:return V(V({},e),{},{type:`merge_node`,path:L.next(e.path)})}}},fn=e=>typeof e==`object`&&!!e,pn=(e,t)=>{for(var n in e){var r=Object.hasOwn(e,n)?e[n]:void 0,i=Object.hasOwn(t,n)?t[n]:void 0;if(Array.isArray(r)&&Array.isArray(i)){if(r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==i[a])return!1}else if(fn(r)&&fn(i)){if(!pn(r,i))return!1}else if(r!==i)return!1}for(var o in t)if(e[o]===void 0&&t[o]!==void 0)return!1;return!0},mn=e=>e.selection?e.selection:e.children.length>0?U.end(e,[]):[0],hn=(e,t)=>{var[n]=U.node(e,t);return e=>e===n},gn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=!t,r=t?Cn(e):e,i=H.None,a=H.None,o=0,s=null,c=null;for(var l of r){var u=l.codePointAt(0);if(!u)break;var d=Fn(l,u);if([i,a]=n?[a,d]:[d,i],In(i,H.ZWJ)&&In(a,H.ExtPict)&&(s=Bn(n?e.substring(0,o):e.substring(0,e.length-o)),!s)||In(i,H.RI)&&In(a,H.RI)&&(c=c===null?n?!0:Hn(e.substring(0,e.length-o)):!c,!c)||i!==H.None&&a!==H.None&&Rn(i,a))break;o+=l.length}return o||1},_n=/\s/,vn=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,yn=/['\u2018\u2019]/,bn=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=0,r=!1;e.length>0;){var i=gn(e,t),[a,o]=xn(e,i,t);if(Sn(a,o,t))r=!0,n+=i;else if(!r)n+=i;else break;e=o}return n},xn=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},Sn=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(_n.test(t))return!1;if(yn.test(t)){var[i,a]=xn(n,gn(n,r),r);if(e(i,a,r))return!0}return!vn.test(t)},Cn=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(Tn(r.charCodeAt(0))){var i=e.charAt(t-n-1);if(wn(i.charCodeAt(0))){yield i+r,n++;continue}}yield r}},wn=e=>e>=55296&&e<=56319,Tn=e=>e>=56320&&e<=57343,H;(function(e){e[e.None=0]=`None`,e[e.Extend=1]=`Extend`,e[e.ZWJ=2]=`ZWJ`,e[e.RI=4]=`RI`,e[e.Prepend=8]=`Prepend`,e[e.SpacingMark=16]=`SpacingMark`,e[e.L=32]=`L`,e[e.V=64]=`V`,e[e.T=128]=`T`,e[e.LV=256]=`LV`,e[e.LVT=512]=`LVT`,e[e.ExtPict=1024]=`ExtPict`,e[e.Any=2048]=`Any`})(H||(H={}));var En=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Dn=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,On=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,kn=/^[\u1100-\u115F\uA960-\uA97C]$/,An=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,jn=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Mn=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,Nn=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Pn=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Fn=(e,t)=>{var n=H.Any;return e.search(En)!==-1&&(n|=H.Extend),t===8205&&(n|=H.ZWJ),t>=127462&&t<=127487&&(n|=H.RI),e.search(Dn)!==-1&&(n|=H.Prepend),e.search(On)!==-1&&(n|=H.SpacingMark),e.search(kn)!==-1&&(n|=H.L),e.search(An)!==-1&&(n|=H.V),e.search(jn)!==-1&&(n|=H.T),e.search(Mn)!==-1&&(n|=H.LV),e.search(Nn)!==-1&&(n|=H.LVT),e.search(Pn)!==-1&&(n|=H.ExtPict),n};function In(e,t){return(e&t)!==0}var Ln=[[H.L,H.L|H.V|H.LV|H.LVT],[H.LV|H.V,H.V|H.T],[H.LVT|H.T,H.T],[H.Any,H.Extend|H.ZWJ],[H.Any,H.SpacingMark],[H.Prepend,H.Any],[H.ZWJ,H.ExtPict],[H.RI,H.RI]];function Rn(e,t){return Ln.findIndex(n=>In(e,n[0])&&In(t,n[1]))===-1}var zn=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Bn=e=>e.search(zn)!==-1,Vn=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Hn=e=>{var t=e.match(Vn);return t===null?!1:t[0].length/2%2==1},U={above(e,t){return e.above(t)},addMark(e,t,n){e.addMark(t,n)},after(e,t,n){return e.after(t,n)},before(e,t,n){return e.before(t,n)},deleteBackward(e){var{unit:t=`character`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.deleteBackward(t)},deleteForward(e){var{unit:t=`character`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.deleteForward(t)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,n){return e.isEdge(t,n)},isEditor:function(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return fn(e)?typeof e.above==`function`&&typeof e.addMark==`function`&&typeof e.after==`function`&&typeof e.apply==`function`&&typeof e.before==`function`&&typeof e.collapse==`function`&&typeof e.delete==`function`&&typeof e.deleteBackward==`function`&&typeof e.deleteForward==`function`&&typeof e.deleteFragment==`function`&&typeof e.deselect==`function`&&typeof e.edges==`function`&&typeof e.elementReadOnly==`function`&&typeof e.end==`function`&&typeof e.first==`function`&&typeof e.fragment==`function`&&typeof e.getDirtyPaths==`function`&&typeof e.getFragment==`function`&&typeof e.getMarks==`function`&&typeof e.hasBlocks==`function`&&typeof e.hasInlines==`function`&&typeof e.hasPath==`function`&&typeof e.hasTexts==`function`&&typeof e.insertBreak==`function`&&typeof e.insertFragment==`function`&&typeof e.insertNode==`function`&&typeof e.insertNodes==`function`&&typeof e.insertSoftBreak==`function`&&typeof e.insertText==`function`&&typeof e.isBlock==`function`&&typeof e.isEdge==`function`&&typeof e.isElementReadOnly==`function`&&typeof e.isEmpty==`function`&&typeof e.isEnd==`function`&&typeof e.isInline==`function`&&typeof e.isNormalizing==`function`&&typeof e.isSelectable==`function`&&typeof e.isStart==`function`&&typeof e.isVoid==`function`&&typeof e.last==`function`&&typeof e.leaf==`function`&&typeof e.levels==`function`&&typeof e.liftNodes==`function`&&typeof e.markableVoid==`function`&&typeof e.mergeNodes==`function`&&typeof e.move==`function`&&typeof e.moveNodes==`function`&&typeof e.next==`function`&&typeof e.node==`function`&&typeof e.nodes==`function`&&typeof e.normalize==`function`&&typeof e.normalizeNode==`function`&&typeof e.onChange==`function`&&typeof e.parent==`function`&&typeof e.path==`function`&&typeof e.pathRef==`function`&&typeof e.pathRefs==`function`&&typeof e.point==`function`&&typeof e.pointRef==`function`&&typeof e.pointRefs==`function`&&typeof e.positions==`function`&&typeof e.previous==`function`&&typeof e.range==`function`&&typeof e.rangeRef==`function`&&typeof e.rangeRefs==`function`&&typeof e.removeMark==`function`&&typeof e.removeNodes==`function`&&typeof e.select==`function`&&typeof e.setNodes==`function`&&typeof e.setNormalizing==`function`&&typeof e.setPoint==`function`&&typeof e.setSelection==`function`&&typeof e.shouldMergeNodesRemovePrevNode==`function`&&typeof e.shouldNormalize==`function`&&typeof e.splitNodes==`function`&&typeof e.start==`function`&&typeof e.string==`function`&&typeof e.unhangRange==`function`&&typeof e.unsetNodes==`function`&&typeof e.unwrapNodes==`function`&&typeof e.void==`function`&&typeof e.withoutNormalizing==`function`&&typeof e.wrapNodes==`function`&&(e.marks===null||fn(e.marks))&&(e.selection===null||R.isRange(e.selection))&&(t?B.isNodeList(e.children)&&dn.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations)):!1},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,n){return e.isEnd(t,n)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,n){return e.isStart(t,n)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,n){return e.leaf(t,n)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,n){return e.node(t,n)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,n){return e.parent(t,n)},path(e,t,n){return e.path(t,n)},pathRef(e,t,n){return e.pathRef(t,n)},pathRefs(e){return e.pathRefs()},point(e,t,n){return e.point(t,n)},pointRef(e,t,n){return e.pointRef(t,n)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,n){return e.range(t,n)},rangeRef(e,t,n){return e.rangeRef(t,n)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,n){return e.string(t,n)},unhangRange(e,t,n){return e.unhangRange(t,n)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},W={isLocation(e){return L.isPath(e)||G.isPoint(e)||R.isRange(e)},isPath(e){return Array.isArray(e)},isPoint(e){return`offset`in e},isRange(e){return`anchor`in e},isSpan(e){return Array.isArray(e)&&Array.isArray(e[0])}};function Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Un(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var G={compare(e,t){var n=L.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return G.compare(e,t)===1},isBefore(e,t){return G.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&L.equals(e.path,t.path)},isPoint(e){return fn(e)&&typeof e.offset==`number`&&L.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e===null)return null;var{affinity:r=`forward`}=n,{path:i,offset:a}=e;switch(t.type){case`insert_node`:case`move_node`:i=L.transform(i,t,n);break;case`insert_text`:L.equals(t.path,i)&&(t.offset<a||t.offset===a&&r===`forward`)&&(a+=t.text.length);break;case`merge_node`:L.equals(t.path,i)&&(a+=t.position),i=L.transform(i,t,n);break;case`remove_text`:L.equals(t.path,i)&&t.offset<=a&&(a-=Math.min(a-t.offset,t.text.length));break;case`remove_node`:if(L.equals(t.path,i)||L.isAncestor(t.path,i))return null;i=L.transform(i,t,n);break;case`split_node`:if(L.equals(t.path,i)){if(t.position===a&&r==null)return null;(t.position<a||t.position===a&&r===`forward`)&&(a-=t.position,i=L.transform(i,t,Wn(Wn({},n),{},{affinity:`forward`})))}else i=L.transform(i,t,n);break;default:return e}return{path:i,offset:a}}},Gn=void 0,Kn={setScrubber(e){Gn=e},stringify(e){return JSON.stringify(e,Gn)}},qn=[`text`],Jn=[`anchor`,`focus`,`merge`];function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yn(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Zn={equals(e,t){var{loose:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function r(e){var{text:t}=e;return en(e,qn)}return pn(n?r(e):e,n?r(t):t)},isText(e){return fn(e)&&typeof e.text==`string`},isTextList(e){return Array.isArray(e)&&e.every(e=>Zn.isText(e))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var n in t)if(n!==`text`&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:Xn({},e)}];for(var r of t){var{anchor:i,focus:a,merge:o}=r,s=en(r,Jn),[c,l]=R.edges(r),u=[],d=0,f=c.offset,p=l.offset,m=o==null?Object.assign:o;for(var{leaf:h}of n){var{length:g}=h.text,_=d;if(d+=g,f<=_&&d<=p){m(h,s),u.push({leaf:h});continue}if(f!==p&&(f===d||p===_)||f>d||p<_||p===_&&_!==0){u.push({leaf:h});continue}var v=h,y=void 0,b=void 0;if(p<d){var x=p-_;b={leaf:Xn(Xn({},v),{},{text:v.text.slice(x)})},v=Xn(Xn({},v),{},{text:v.text.slice(0,x)})}if(f>_){var S=f-_;y={leaf:Xn(Xn({},v),{},{text:v.text.slice(0,S)})},v=Xn(Xn({},v),{},{text:v.text.slice(S)})}m(v,s),y&&u.push(y),u.push({leaf:v}),b&&u.push(b)}n=u}if(n.length>1){var C=0;for(var[w,T]of n.entries()){var E=C,D=E+T.leaf.text.length,O={start:E,end:D};w===0&&(O.isFirst=!0),w===n.length-1&&(O.isLast=!0),T.position=O,C=D}}return n}};function Qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qn(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var er=function(e,t){var n=[...arguments].slice(2);return[...e.slice(0,t),...n,...e.slice(t)]},tr=function(e,t,n){var r=[...arguments].slice(3);return[...e.slice(0,t),...r,...e.slice(t+n)]},nr=tr,rr=(e,t,n)=>{if(t.length===0)throw Error(`Cannot modify the editor`);for(var r=B.get(e,t),i=t.slice(),a=n(r);i.length>1;){var o=i.pop(),s=B.get(e,i);a=$n($n({},s),{},{children:tr(s.children,o,1,a)})}var c=i.pop();e.children=tr(e.children,c,1,a)},ir=(e,t,n)=>{t.length===0?e.children=n(e.children):rr(e,t,e=>{if(B.isText(e))throw Error(`Cannot get the element at path [${t}] because it refers to a leaf node: ${Kn.stringify(e)}`);return $n($n({},e),{},{children:n(e.children)})})},ar=(e,t,n)=>rr(e,t,e=>{if(!B.isText(e))throw Error(`Cannot get the leaf node at path [${t}] because it refers to a non-leaf node: ${Kn.stringify(e)}`);return n(e)});function or(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?or(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):or(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var cr=[`children`,`text`,...Object.getOwnPropertyNames(Object.prototype)],lr=Object.getOwnPropertyNames(Object.prototype),ur={transform(e,t){var n=!1;switch(t.type){case`insert_node`:var{path:r,node:i}=t;ir(e,L.parent(r),e=>{var t=r[r.length-1];if(t>e.length)throw Error(`Cannot apply an "insert_node" operation at path [${r}] because the destination is past the end of the node.`);return er(e,t,i)}),n=!0;break;case`insert_text`:var{path:a,offset:o,text:s}=t;if(s.length===0)break;ar(e,a,e=>{var t=e.text.slice(0,o),n=e.text.slice(o);return sr(sr({},e),{},{text:t+s+n})}),n=!0;break;case`merge_node`:var{path:c}=t,l=c[c.length-1],u=L.previous(c),d=u[u.length-1];if(c.length===0)throw Error(`Cannot apply a "merge_node" operation at path [${c}] because the root node cannot be merged.`);if(typeof l!=`number`||typeof d!=`number`)throw Error(`Index must be number`);ir(e,L.parent(c),e=>{var t=e[l],n=e[d],r;if(B.isText(t)&&B.isText(n))r=sr(sr({},n),{},{text:n.text+t.text});else if(B.isElement(t)&&B.isElement(n))r=sr(sr({},n),{},{children:n.children.concat(t.children)});else throw Error(`Cannot apply a "merge_node" operation at path [${c}] to nodes of different interfaces: ${Kn.stringify(t)} ${Kn.stringify(n)}`);return tr(e,d,2,r)}),n=!0;break;case`move_node`:var{path:f,newPath:p}=t,m=f[f.length-1];if(L.isAncestor(f,p))throw Error(`Cannot move a path [${f}] to new path [${p}] because the destination is inside itself.`);var h=B.get(e,f);ir(e,L.parent(f),e=>nr(e,m,1));var g=L.transform(f,t),_=g[g.length-1];ir(e,L.parent(g),e=>er(e,_,h)),n=!0;break;case`remove_node`:var{path:v}=t,y=v[v.length-1];if(ir(e,L.parent(v),e=>nr(e,y,1)),e.selection){var b=sr({},e.selection);for(var[x,S]of R.points(b)){var C=G.transform(x,t);if(b!=null&&C!=null)b[S]=C;else{var w=void 0,T=void 0;for(var[E,D]of B.texts(e))if(L.compare(D,v)===-1)w=[E,D];else{T=[E,D];break}var O=!1;w&&T&&(O=L.isSibling(w[1],v)?!1:L.equals(T[1],v)?!0:L.common(w[1],v).length<L.common(T[1],v).length),w&&!O?b[S]={path:w[1],offset:w[0].text.length}:T?b[S]={path:T[1],offset:0}:b=null}}(!b||!R.equals(b,e.selection))&&(e.selection=b)}break;case`remove_text`:var{path:k,offset:A,text:j}=t;if(j.length===0)break;ar(e,k,e=>{var t=e.text.slice(0,A),n=e.text.slice(A+j.length);return sr(sr({},e),{},{text:t+n})}),n=!0;break;case`set_node`:var{path:M,properties:N,newProperties:P}=t;if(M.length===0)throw Error(`Cannot set properties on the root node!`);rr(e,M,e=>{var t=sr({},e);for(var n in P){if(cr.includes(n))throw Error(`Cannot set the "${n}" property of nodes!`);var r=P[n];if(n===`then`&&typeof r==`function`)throw Error(`Cannot set the "then" property of a node to a function`);r==null?delete t[n]:t[n]=r}for(var i in N)Object.hasOwn(P,i)||delete t[i];return t});break;case`set_selection`:var{newProperties:ee}=t;if(ee==null){e.selection=null;break}if(e.selection==null){if(!(ee.anchor&&ee.focus))throw Error(`Cannot apply an incomplete "set_selection" operation properties ${Kn.stringify(ee)} when there is no current selection.`);e.selection=sr({},ee);break}var F=sr({},e.selection);for(var te in ee){if(lr.includes(te))throw Error(`Cannot set the "${te}" property of the selection!`);var ne=ee[te];if(te===`then`&&typeof ne==`function`)throw Error(`Cannot set the "then" property of the selection to a function`);if(ne==null){if(te===`anchor`||te===`focus`)throw Error(`Cannot remove the "${te}" selection property`);delete F[te]}else F[te]=ne}e.selection=F;break;case`split_node`:var{path:re,position:ie,properties:ae}=t,oe=re[re.length-1];if(re.length===0)throw Error(`Cannot apply a "split_node" operation at path [${re}] because the root node cannot be split.`);if(typeof oe!=`number`)throw Error(`Index must be number`);ir(e,L.parent(re),e=>{var t=e[oe],n,r;if(B.isText(t)){var i=t.text.slice(0,ie),a=t.text.slice(ie);n=sr(sr({},t),{},{text:i}),r={text:a}}else{var o=t.children.slice(0,ie),s=t.children.slice(ie);n=sr(sr({},t),{},{children:o}),r={children:s}}for(var c in ae){if(cr.includes(c))throw Error(`Cannot set the "${c}" property of nodes!`);var l=ae[c];if(c===`then`&&typeof l==`function`)throw Error(`Cannot set the "then" property of a node to a function`);l!=null&&(r[c]=l)}return tr(e,oe,1,n,r)}),n=!0;break}if(n&&e.selection){var se=sr({},e.selection);for(var[ce,le]of R.points(se))se[le]=G.transform(ce,t);R.equals(se,e.selection)||(e.selection=se)}}},dr={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},fr={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},pr={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};U.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:i=mn(e)}=n;if(W.isPath(i)&&(i=U.range(e,i)),W.isRange(i))if(R.isCollapsed(i))i=i.anchor;else{var a=R.end(i);if(!r&&U.void(e,{at:a}))return;var o=R.start(i),s=U.pointRef(e,o),c=U.pointRef(e,a);K.delete(e,{at:i,voids:r});var l=s.unref(),u=c.unref();i=l||u,K.setSelection(e,{anchor:i,focus:i})}if(!(!r&&U.void(e,{at:i})||U.elementReadOnly(e,{at:i}))){var{path:d,offset:f}=i;t.length>0&&e.apply({type:`insert_text`,path:d,offset:f,text:t})}})}};function mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mr(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var K=hr(hr(hr(hr({},ur),dr),fr),pr),gr=new WeakMap,_r=e=>gr.get(e)||!1,vr=(e,t,n)=>{var r=gr.get(e)||!1;gr.set(e,!0);try{t(),n()}finally{gr.set(e,r)}};function yr(e,t,n){var r=Ht.get(e)||[],i=Ut.get(e)||new Set,a,o,s=e=>{if(e){var t=e.join(`,`);o.has(t)||(o.add(t),a.push(e))}};if(n){a=[],o=new Set;for(var c of r)s(n(c))}else a=r,o=i;for(var l of t)s(l);Ht.set(e,a),Ut.set(e,o)}var br=(e,t)=>{for(var n of U.pathRefs(e))zt.transform(n,t);for(var r of U.pointRefs(e))Bt.transform(r,t);for(var i of U.rangeRefs(e))Vt.transform(i,t);if(!_r(e)){var a=L.operationCanTransformPath(t)?e=>L.transform(e,t):void 0;yr(e,e.getDirtyPaths(t),a)}K.transform(e,t),e.operations.push(t),U.normalize(e,{operation:t}),t.type===`set_selection`&&(e.marks=null),Wt.get(e)||(Wt.set(e,!0),Promise.resolve().then(()=>{Wt.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},xr=(e,t)=>{switch(t.type){case`insert_text`:case`remove_text`:case`set_node`:var{path:n}=t;return L.levels(n);case`insert_node`:var{node:r,path:i}=t,a=L.levels(i),o=B.isText(r)?[]:Array.from(B.nodes(r),e=>{var[,t]=e;return i.concat(t)});return[...a,...o];case`merge_node`:var{path:s}=t,c=L.ancestors(s),l=L.previous(s);return[...c,l];case`move_node`:var{path:u,newPath:d}=t;if(L.equals(u,d))return[];var f=[],p=[];for(var m of L.ancestors(u)){var h=L.transform(m,t);f.push(h)}for(var g of L.ancestors(d)){var _=L.transform(g,t);p.push(_)}var v=p[p.length-1],y=d[d.length-1],b=v.concat(y);return[...f,...p,b];case`remove_node`:var{path:x}=t;return[...L.ancestors(x)];case`split_node`:var{path:S}=t,C=L.levels(S),w=L.next(S);return[...C,w];default:return[]}},Sr=e=>{var{selection:t}=e;return t?B.fragment(e,t):[]},Cr=(e,t,n)=>{var[r,i]=t;if(!B.isText(r)){`children`in r||(r.children=[]);var a=r;if(a!==e&&a.children.length===0&&(K.insertNodes(e,{text:``},{at:i.concat(0),voids:!0}),a=B.get(e,i)),a!==e&&(e.isInline(a)||B.isText(a.children[0])||e.isInline(a.children[0])))for(var o=0;o<a.children.length;o++){var s=a.children[o],c=a.children[o-1];B.isText(s)?c!=null&&B.isText(c)&&(s.text===``?(K.removeNodes(e,{at:i.concat(o),voids:!0}),a=B.get(e,i),o--):c.text===``?(K.removeNodes(e,{at:i.concat(o-1),voids:!0}),a=B.get(e,i),o--):Zn.equals(s,c,{loose:!0})&&(K.mergeNodes(e,{at:i.concat(o),voids:!0}),a=B.get(e,i),o--)):e.isInline(s)?((c==null||!B.isText(c))&&(K.insertNodes(e,{text:``},{at:i.concat(o),voids:!0}),a=B.get(e,i),o++),o===a.children.length-1&&(K.insertNodes(e,{text:``},{at:i.concat(o+1),voids:!0}),a=B.get(e,i),o++)):(K.unwrapNodes(e,{at:i.concat(o),voids:!0}),a=B.get(e,i),o--)}else for(var l=0;l<a.children.length;l++){var u=a.children[l];(B.isText(u)||e.isInline(u))&&(n!=null&&n.fallbackElement?K.wrapNodes(e,n.fallbackElement(),{at:i.concat(l),voids:!0}):K.removeNodes(e,{at:i.concat(l),voids:!0}),a=B.get(e,i),l--)}}},wr=(e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,i=r*42;if(n>i)throw Error(`Could not completely normalize the editor after ${i} iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state.`);return!0},Tr=function(e){var{voids:t=!1,mode:n=`lowest`,at:r=e.selection,match:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r){var a=U.path(e,r);if(!W.isRange(r)||L.equals(r.focus.path,r.anchor.path)){if(a.length===0)return;a=L.parent(a)}var o=n===`lowest`,[s]=U.levels(e,{at:a,voids:t,match:i,reverse:o});return s}};function Er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Er(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Or=(e,t,n)=>{var{selection:r}=e;if(r){var i=(t,n)=>{if(!B.isText(t))return!1;var[r,i]=U.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},a=R.isExpanded(r),o=!1;if(!a){var[s,c]=U.node(e,r);if(s&&i(s,c)){var[l]=U.parent(e,c);o=l&&e.markableVoid(l)}}a||o?K.setNodes(e,{[t]:n},{match:i,split:!0,voids:!0}):(e.marks=Dr(Dr({},U.marks(e)||{}),{},{[t]:n}),Wt.get(e)||e.onChange())}};function kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kr(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var jr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={anchor:U.point(e,t,{edge:`end`}),focus:U.end(e,[])},{distance:i=1}=n,a=0,o;for(var s of U.positions(e,Ar(Ar({},n),{},{at:r}))){if(a>i)break;a!==0&&(o=s),a++}return o};function Mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Mr(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Pr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={anchor:U.start(e,[]),focus:U.point(e,t,{edge:`start`})},{distance:i=1}=n,a=0,o;for(var s of U.positions(e,Nr(Nr({},n),{},{at:r,reverse:!0}))){if(a>i)break;a!==0&&(o=s),a++}return o},Fr=(e,t)=>{var{selection:n}=e;n&&R.isCollapsed(n)&&K.delete(e,{unit:t,reverse:!0})},Ir=(e,t)=>{var{selection:n}=e;n&&R.isCollapsed(n)&&K.delete(e,{unit:t})},Lr=function(e){var{direction:t=`forward`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e;n&&R.isExpanded(n)&&K.delete(e,{reverse:t===`backward`})},Rr=(e,t)=>[U.start(e,t),U.end(e,t)];function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zr(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return U.above(e,Br(Br({},t),{},{match:t=>B.isElement(t)&&U.isElementReadOnly(e,t)}))},Hr=(e,t)=>U.point(e,t,{edge:`end`}),Ur=(e,t)=>{var n=U.path(e,t,{edge:`start`});return U.node(e,n)},Wr=(e,t)=>{var n=U.range(e,t);return B.fragment(e,n)};function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gr(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var qr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return U.above(e,Kr(Kr({},t),{},{match:t=>B.isElement(t)&&U.isVoid(e,t)}))},Jr=(e,t)=>t.children.some(t=>B.isElement(t)&&U.isBlock(e,t)),Yr=(e,t)=>t.children.some(t=>B.isText(t)||U.isInline(e,t)),Xr=(e,t)=>B.has(e,t),Zr=(e,t)=>t.children.every(e=>B.isText(e)),Qr=e=>{K.splitNodes(e,{always:!0})},$r=(e,t,n)=>{K.insertNodes(e,t,n)},ei=e=>{K.splitNodes(e,{always:!0})};function ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ti(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ri=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:r,marks:i}=e;if(r){if(i){var a=ni({text:t},i);K.insertNodes(e,a,{at:n.at,voids:n.voids})}else K.insertText(e,t,n);e.marks=null}},ii=(e,t)=>!e.isInline(t),ai=(e,t,n)=>U.isStart(e,t,n)||U.isEnd(e,t,n),oi=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&B.isText(r)&&r.text===``&&!e.isVoid(t)},si=(e,t,n)=>{var r=U.end(e,n);return G.equals(t,r)},ci=e=>{var t=Gt.get(e);return t===void 0?!0:t},li=(e,t,n)=>{if(t.offset!==0)return!1;var r=U.start(e,n);return G.equals(t,r)},ui=(e,t)=>{var n=U.path(e,t,{edge:`end`});return U.node(e,n)},di=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=U.path(e,t,n);return[B.leaf(e,r),r]};function fi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:i=!1}=t,{match:a}=t;if(a==null&&(a=()=>!0),n){var o=[],s=U.path(e,n);for(var[c,l]of B.levels(e,s))if(a(c,l)&&(o.push([c,l]),!i&&B.isElement(c)&&U.isVoid(e,c)))break;r&&o.reverse(),yield*o}}()}var pi=[`text`],mi=[`text`],hi=function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:i}=n;if(t)return t;if(R.isExpanded(n)){if(R.isBackward(n)&&([i,r]=[r,i]),U.isEnd(e,r,r.path)){var a=U.after(e,r);a&&(r=a)}var[o]=U.nodes(e,{match:B.isText,at:{anchor:r,focus:i}});if(o){var[s]=o,{text:c}=s;return en(s,pi)}else return{}}var{path:l}=r,[u]=U.leaf(e,l);if(r.offset===0){var d=U.previous(e,{at:l,match:B.isText});if(!U.above(e,{match:t=>B.isElement(t)&&U.isVoid(e,t)&&e.markableVoid(t)})){var f=U.above(e,{match:t=>B.isElement(t)&&U.isBlock(e,t)});if(d&&f){var[p,m]=d,[,h]=f;L.isAncestor(h,m)&&(u=p)}}}var{text:g}=u;return en(u,mi)},gi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n=`lowest`,voids:r=!1}=t,{match:i,at:a=e.selection}=t;if(a){var o=U.after(e,a,{voids:r});if(o){var[,s]=U.last(e,[]),c=[o.path,s];if(W.isPath(a)&&a.length===0)throw Error(`Cannot get the next node from the root node!`);if(i==null)if(W.isPath(a)){var[l]=U.parent(e,a);i=e=>l.children.includes(e)}else i=()=>!0;var[u]=U.nodes(e,{at:c,match:i,mode:n,voids:r});return u}}},_i=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=U.path(e,t,n);return[B.get(e,r),r]};function vi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r=`all`,universal:i=!1,reverse:a=!1,voids:o=!1,pass:s}=t,{match:c}=t;if(c||(c=()=>!0),n){var l,u;if(W.isSpan(n))l=n[0],u=n[1];else{var d=U.path(e,n,{edge:`start`}),f=U.path(e,n,{edge:`end`});l=a?f:d,u=a?d:f}var p=B.nodes(e,{reverse:a,from:l,to:u,pass:t=>{var[n,r]=t;return s&&s([n,r])?!0:B.isElement(n)?!!(!o&&(U.isVoid(e,n)||U.isElementReadOnly(e,n))):!1}}),m=[],h;for(var[g,_]of p){var v=h&&L.compare(_,h[1])===0;if(!(r===`highest`&&v)){if(!c(g,_)){if(i&&!v&&B.isText(g))return;continue}if(r===`lowest`&&v){h=[g,_];continue}var y=r===`lowest`?h:[g,_];y&&(i?m.push(y):yield y),h=[g,_]}}r===`lowest`&&h&&(i?m.push(h):yield h),i&&(yield*m)}}()}var yi=function(e){var{force:t=!1,operation:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e=>Ht.get(e)||[],i=e=>Ut.get(e)||new Set,a=e=>{var t=r(e).pop(),n=t.join(`,`);return i(e).delete(n),t};if(U.isNormalizing(e)){if(t){var o=Array.from(B.nodes(e),e=>{var[,t]=e;return t}),s=new Set(o.map(e=>e.join(`,`)));Ht.set(e,o),Ut.set(e,s)}r(e).length!==0&&U.withoutNormalizing(e,()=>{for(var i of r(e))if(B.has(e,i)){var o=U.node(e,i),[s,c]=o;B.isElement(s)&&s.children.length===0&&e.normalizeNode(o,{operation:n,force:t})}for(var l=r(e),u=l.length,d=0;l.length!==0;){if(!e.shouldNormalize({dirtyPaths:l,iteration:d,initialDirtyPathsLength:u,operation:n}))return;var f=a(e);if(B.has(e,f)){var p=U.node(e,f);e.normalizeNode(p,{operation:n,force:t})}d++,l=r(e)}})}},bi=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=U.path(e,t,n),i=L.parent(r);return U.node(e,i)},xi=function(e,t){var{affinity:n=`forward`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={current:t,affinity:n,unref(){var{current:t}=r;return U.pathRefs(e).delete(r),r.current=null,t}};return U.pathRefs(e).add(r),r},Si=e=>{var t=Kt.get(e);return t||(t=new Set,Kt.set(e,t)),t},Ci=function(e,t){var{depth:n,edge:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(W.isPath(t)){if(r===`start`){var[,i]=B.first(e,t);t=i}else if(r===`end`){var[,a]=B.last(e,t);t=a}}return W.isRange(t)&&(t=r===`start`?R.start(t):r===`end`?R.end(t):L.common(t.anchor.path,t.focus.path)),W.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},wi=function(e,t){var{affinity:n=`forward`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={current:t,affinity:n,unref(){var{current:t}=r;return U.pointRefs(e).delete(r),r.current=null,t}};return U.pointRefs(e).add(r),r},Ti=e=>{var t=qt.get(e);return t||(t=new Set,qt.set(e,t)),t},Ei=function(e,t){var{edge:n=`start`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(W.isPath(t)){var r;if(n===`end`){var[,i]=B.last(e,t);r=i}else{var[,a]=B.first(e,t);r=a}var o=B.get(e,r);if(!B.isText(o))throw Error(`Cannot get the ${n} point in the node at path [${t}] because it has no ${n} text node.`);return{path:r,offset:n===`end`?o.text.length:0}}if(W.isRange(t)){var[s,c]=R.edges(t);return n===`start`?s:c}return t};function Di(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r=`offset`,reverse:i=!1,voids:a=!1}=t;if(!n)return;var o=U.range(e,n),[s,c]=R.edges(o),l=i?c:s,u=!1,d=``,f=0,p=0,m=0,h=[],g=function*(t){var n=h.some(e=>L.isAncestor(e,t));function*o(e){n||(yield e)}if(B.isElement(_)){if(!e.isSelectable(_)){if(h.push(t),i)return L.hasPrevious(t)&&(yield*o(U.end(e,L.previous(t)))),0;var g=L.next(t);return U.hasPath(e,g)&&(yield*o(U.start(e,g))),0}if(!a&&(e.isVoid(_)||e.isElementReadOnly(_)))return yield*o(U.start(e,t)),0;if(e.isInline(_))return 0;if(U.hasInlines(e,_)){var v=L.isAncestor(t,c.path)?c:U.end(e,t),b=L.isAncestor(t,s.path)?s:U.start(e,t);d=U.string(e,{anchor:b,focus:v},{voids:a}),u=!0}}if(B.isText(_)){var x=L.equals(t,l.path);for(x?(p=i?l.offset:_.text.length-l.offset,m=l.offset):(p=_.text.length,m=i?p:0),(x||u||r===`offset`)&&(yield*o({path:t,offset:m}),u=!1);;){if(f===0){if(d===``)break;f=y(d,r,i),d=xn(d,f,i)[1]}if(m=i?m-f:m+f,p-=f,p<0){f=-p;break}f=0,yield*o({path:t,offset:m})}}};for(var[_,v]of U.nodes(e,{at:n,reverse:i,voids:a}))yield*g(v);function y(e,t,n){return t===`character`?gn(e,n):t===`word`?bn(e,n):t===`line`||t===`block`?e.length:1}}()}var Oi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n=`lowest`,voids:r=!1}=t,{match:i,at:a=e.selection}=t;if(a){var o=U.before(e,a,{voids:r});if(o){var[,s]=U.first(e,[]),c=[o.path,s];if(W.isPath(a)&&a.length===0)throw Error(`Cannot get the previous node from the root node!`);if(i==null)if(W.isPath(a)){var[l]=U.parent(e,a);i=e=>l.children.includes(e)}else i=()=>!0;var[u]=U.nodes(e,{reverse:!0,at:c,match:i,mode:n,voids:r});return u}}},ki=function(e,t){var{affinity:n=`forward`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={current:t,affinity:n,unref(){var{current:t}=r;return U.rangeRefs(e).delete(r),r.current=null,t}};return U.rangeRefs(e).add(r),r},Ai=e=>{var t=Jt.get(e);return t||(t=new Set,Jt.set(e,t)),t},ji=(e,t,n)=>W.isRange(t)&&!n?t:{anchor:U.start(e,t),focus:U.end(e,n||t)};function Mi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Mi(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Pi=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!B.isText(t))return!1;var[r,i]=U.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=R.isExpanded(n),a=!1;if(!i){var[o,s]=U.node(e,n);if(o&&r(o,s)){var[c]=U.parent(e,s);a=c&&e.markableVoid(c)}}if(i||a)K.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=Ni({},U.marks(e)||{});delete l[t],e.marks=l,Wt.get(e)||e.onChange()}}},Fi=(e,t)=>{Gt.set(e,t)},Ii=(e,t)=>U.point(e,t,{edge:`start`}),Li=function(e,t){var{voids:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=U.range(e,t),[i,a]=R.edges(r),o=``;for(var[s,c]of U.nodes(e,{at:r,match:B.isText,voids:n})){var l=s.text;L.equals(c,a.path)&&(l=l.slice(0,a.offset)),L.equals(c,i.path)&&(l=l.slice(i.offset)),o+=l}return o},Ri=function(e,t){var{voids:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=R.edges(t);if(r.offset!==0||i.offset!==0||R.isCollapsed(t)||L.hasPrevious(i.path))return t;var a=U.above(e,{at:i,match:t=>B.isElement(t)&&U.isBlock(e,t),voids:n}),o=a?a[1]:[],s={anchor:U.start(e,r),focus:i},c=!0;for(var[l,u]of U.nodes(e,{at:s,match:B.isText,reverse:!0,voids:n})){if(c){c=!1;continue}if(l.text!==``||L.isBefore(u,o)){i={path:u,offset:l.text.length};break}}return{anchor:r,focus:i}},zi=(e,t)=>{var n=U.isNormalizing(e);U.setNormalizing(e,!1);try{t()}finally{U.setNormalizing(e,n)}U.normalize(e)},Bi=(e,t,n)=>{var[r,i]=t,[a,o]=n;return B.isElement(r)&&U.isEmpty(e,r)||B.isText(r)&&r.text===``&&i[i.length-1]!==0},Vi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.withoutNormalizing(e,()=>{var n,r,{reverse:i=!1,unit:a=`character`,distance:o=1,voids:s=!1}=t,{at:c=e.selection,hanging:l=!1}=t;if(c){var u=!1;if(W.isRange(c)&&R.isCollapsed(c)&&(u=!0,c=c.anchor),W.isPoint(c)){var d=U.void(e,{at:c,mode:`highest`});if(!s&&d){var[,f]=d;c=f}else{var p={unit:a,distance:o},m=i?U.before(e,c,p)||U.start(e,[]):U.after(e,c,p)||U.end(e,[]);c={anchor:c,focus:m},l=!0}}if(W.isPath(c)){K.removeNodes(e,{at:c,voids:s});return}if(!R.isCollapsed(c)){if(!l){var[,h]=R.edges(c),g=U.end(e,[]);G.equals(h,g)||(c=U.unhangRange(e,c,{voids:s}))}var[_,v]=R.edges(c),y=U.above(e,{match:t=>B.isElement(t)&&U.isBlock(e,t),at:_,voids:s}),b=U.above(e,{match:t=>B.isElement(t)&&U.isBlock(e,t),at:v,voids:s}),x=y&&b&&!L.equals(y[1],b[1]),S=L.equals(_.path,v.path),C=s?null:(n=U.void(e,{at:_,mode:`highest`}))==null?U.elementReadOnly(e,{at:_,mode:`highest`}):n,w=s?null:(r=U.void(e,{at:v,mode:`highest`}))==null?U.elementReadOnly(e,{at:v,mode:`highest`}):r;if(C){var T=U.before(e,_);T&&y&&L.isAncestor(y[1],T.path)&&(_=T)}if(w){var E=U.after(e,v);E&&b&&L.isAncestor(b[1],E.path)&&(v=E)}var D=[],O;for(var k of U.nodes(e,{at:c,voids:s})){var[A,j]=k;O&&L.compare(j,O)===0||(!s&&B.isElement(A)&&(U.isVoid(e,A)||U.isElementReadOnly(e,A))||!L.isCommon(j,_.path)&&!L.isCommon(j,v.path))&&(D.push(k),O=j)}var M=Array.from(D,t=>{var[,n]=t;return U.pathRef(e,n)}),N=U.pointRef(e,_),P=U.pointRef(e,v),ee=``;if(!S&&!C){var F=N.current,[te]=U.leaf(e,F),{path:ne}=F,{offset:re}=_,ie=te.text.slice(re);ie.length>0&&(e.apply({type:`remove_text`,path:ne,offset:re,text:ie}),ee=ie)}if(M.reverse().map(e=>e.unref()).filter(e=>e!==null).forEach(t=>K.removeNodes(e,{at:t,voids:s})),!w){var ae=P.current,[oe]=U.leaf(e,ae),{path:se}=ae,ce=S?_.offset:0,le=oe.text.slice(ce,v.offset);le.length>0&&(e.apply({type:`remove_text`,path:se,offset:ce,text:le}),ee=le)}!S&&x&&P.current&&N.current&&K.mergeNodes(e,{at:P.current,hanging:!0,voids:s}),u&&i&&a===`character`&&ee.length>1&&ee.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&K.insertText(e,ee.slice(0,ee.length-o));var ue=N.unref(),de=P.unref(),fe=i?ue||de:de||ue;t.at==null&&fe&&K.select(e,fe)}}})},Hi=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};U.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:i=!1}=n,{at:a=mn(e),batchDirty:o=!0}=n;if(t.length){if(W.isRange(a))if(r||(a=U.unhangRange(e,a,{voids:i})),R.isCollapsed(a))a=a.anchor;else{var[,s]=R.edges(a);if(!i&&U.void(e,{at:s}))return;var c=U.pointRef(e,s);K.delete(e,{at:a}),a=c.unref()}else W.isPath(a)&&(a=U.start(e,a));if(!(!i&&U.void(e,{at:a}))){var l=U.above(e,{at:a,match:t=>B.isElement(t)&&U.isInline(e,t),mode:`highest`,voids:i});if(l){var[,u]=l;U.isEnd(e,a,u)?a=U.after(e,u):U.isStart(e,a,u)&&(a=U.before(e,u))}var[,d]=U.above(e,{match:t=>B.isElement(t)&&U.isBlock(e,t),at:a,voids:i}),f=U.isStart(e,a,d),p=U.isEnd(e,a,d),m=f&&p,[,h]=B.first({children:t},[]),[,g]=B.last({children:t},[]),_=t=>{var[n,r]=t;return r.length===0?!1:m?!0:!(!f&&L.isAncestor(r,h)&&B.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!p&&L.isAncestor(r,g)&&B.isElement(n)&&!e.isVoid(n)&&!e.isInline(n))},v=!0,y=[],b=[],x=[];for(var S of B.nodes({children:t},{pass:_})){var[C,w]=S;v&&B.isElement(C)&&!e.isInline(C)&&!L.isAncestor(w,h)&&(v=!1),_(S)&&(B.isElement(C)&&!e.isInline(C)?(v=!1,b.push(C)):v?y.push(C):x.push(C))}var[T]=U.nodes(e,{at:a,match:t=>B.isText(t)||U.isInline(e,t),mode:`highest`,voids:i}),[,E]=T,D=U.isStart(e,a,E),O=U.isEnd(e,a,E),k=U.pathRef(e,p&&!x.length?L.next(d):d),A=U.pathRef(e,O?L.next(E):E),j=x.length>0;K.splitNodes(e,{at:a,match:t=>j?B.isElement(t)&&U.isBlock(e,t):B.isText(t)||U.isInline(e,t),mode:j?`lowest`:`highest`,always:j&&(!f||y.length>0)&&(!p||x.length>0),voids:i});var M=U.pathRef(e,!D||D&&O?L.next(E):E);if(K.insertNodes(e,y,{at:M.current,match:t=>B.isText(t)||U.isInline(e,t),mode:`highest`,voids:i,batchDirty:o}),m&&!y.length&&b.length&&!x.length&&K.delete(e,{at:d,voids:i}),K.insertNodes(e,b,{at:k.current,match:t=>B.isElement(t)&&U.isBlock(e,t),mode:`lowest`,voids:i,batchDirty:o}),K.insertNodes(e,x,{at:A.current,match:t=>B.isText(t)||U.isInline(e,t),mode:`highest`,voids:i,batchDirty:o}),!n.at){var N;if(x.length>0&&A.current?N=L.previous(A.current):b.length>0&&k.current?N=L.previous(k.current):M.current&&(N=L.previous(M.current)),N){var P=U.end(e,N);K.select(e,P)}}M.unref(),k.unref(),A.unref()}}})},Ui=function(e){var{edge:t=`anchor`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e;if(n){if(t===`anchor`)K.select(e,n.anchor);else if(t===`focus`)K.select(e,n.focus);else if(t===`start`){var[r]=R.edges(n);K.select(e,r)}else if(t===`end`){var[,i]=R.edges(n);K.select(e,i)}}else return},Wi=e=>{var{selection:t}=e;t&&e.apply({type:`set_selection`,properties:t,newProperties:null})},Gi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:i=`character`,reverse:a=!1}=t,{edge:o=null}=t;if(n){o===`start`&&(o=R.isBackward(n)?`focus`:`anchor`),o===`end`&&(o=R.isBackward(n)?`anchor`:`focus`);var{anchor:s,focus:c}=n,l={distance:r,unit:i},u={};if(o==null||o===`anchor`){var d=a?U.before(e,s,l):U.after(e,s,l);d&&(u.anchor=d)}if(o==null||o===`focus`){var f=a?U.before(e,c,l):U.after(e,c,l);f&&(u.focus=f)}K.setSelection(e,u)}},Ki=(e,t)=>{var{selection:n}=e;if(t=U.range(e,t),n){K.setSelection(e,t);return}if(!W.isRange(t))throw Error(`When setting the selection and the current selection is \`null\` you must provide at least an \`anchor\` and \`focus\`, but you passed: ${Kn.stringify(t)}`);e.apply({type:`set_selection`,properties:n,newProperties:t})};function qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qi(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Yi=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:r}=e,{edge:i=`both`}=n;if(r){i===`start`&&(i=R.isBackward(r)?`focus`:`anchor`),i===`end`&&(i=R.isBackward(r)?`anchor`:`focus`);var{anchor:a,focus:o}=r,s=i===`anchor`?a:o;K.setSelection(e,{[i===`anchor`?`anchor`:`focus`]:Ji(Ji({},s),t)})}},Xi=(e,t)=>{var{selection:n}=e,r={},i={};if(n){for(var a in t)if(!lr.includes(a)){var o=Object.hasOwn(n,a)?n[a]:void 0,s=t[a];Zi(a,o,s)&&(r[a]=n[a],i[a]=t[a])}Object.keys(r).length>0&&e.apply({type:`set_selection`,properties:r,newProperties:i})}};function Zi(e,t,n){return(e===`anchor`||e===`focus`)&&G.isPoint(t)&&G.isPoint(n)?!G.equals(t,n):t!==n}var Qi=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};U.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:i=!1,mode:a=`lowest`,batchDirty:o=!0}=n,{at:s,match:c,select:l}=n;if(B.isNode(t)&&(t=[t]),t.length!==0){var[u]=t;if(s||(s=mn(e),l!==!1&&(l=!0)),l==null&&(l=!1),W.isRange(s))if(r||(s=U.unhangRange(e,s,{voids:i})),R.isCollapsed(s))s=s.anchor;else{var[,d]=R.edges(s),f=U.pointRef(e,d);K.delete(e,{at:s}),s=f.unref()}if(W.isPoint(s)){c==null&&(c=B.isText(u)?e=>B.isText(e):e.isInline(u)?t=>B.isText(t)||U.isInline(e,t):t=>B.isElement(t)&&U.isBlock(e,t));var[p]=U.nodes(e,{at:s.path,match:c,mode:a,voids:i});if(p){var[,m]=p,h=U.pathRef(e,m),g=U.isEnd(e,s,m);K.splitNodes(e,{at:s,match:c,mode:a,voids:i});var _=h.unref();s=g?L.next(_):_}else return}var v=L.parent(s),y=s[s.length-1];if(!(!i&&U.void(e,{at:v}))){if(o){var b=[],x=L.levels(v);vr(e,()=>{var n=function(){var t=v.concat(y);y++;var n={type:`insert_node`,path:t,node:r};e.apply(n),s=L.next(s),b.push(n),B.isText(r)?x.push(t):x.push(...Array.from(B.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()},()=>{yr(e,x,e=>{var t=e;for(var n of b)if(L.operationCanTransformPath(n)&&(t=L.transform(t,n),!t))return null;return t})})}else for(var S of t){var C=v.concat(y);y++,e.apply({type:`insert_node`,path:C,node:S}),s=L.next(s)}if(s=L.previous(s),l){var w=U.end(e,s);w&&K.select(e,w)}}}})},$i=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r=`lowest`,voids:i=!1}=t,{match:a}=t;if(n){a==null&&(a=W.isPath(n)?hn(e,n):t=>B.isElement(t)&&U.isBlock(e,t));var o=U.nodes(e,{at:n,match:a,mode:r,voids:i});for(var s of Array.from(o,t=>{var[,n]=t;return U.pathRef(e,n)})){var c=s.unref();if(c.length<2)throw Error(`Cannot lift node at a path [${c}] because it has a depth of less than \`2\`.`);var[l,u]=U.node(e,L.parent(c)),d=c[c.length-1],{length:f}=l.children;if(f===1){var p=L.next(u);K.moveNodes(e,{at:c,to:p,voids:i}),K.removeNodes(e,{at:u,voids:i})}else if(d===0)K.moveNodes(e,{at:c,to:u,voids:i});else if(d===f-1){var m=L.next(u);K.moveNodes(e,{at:c,to:m,voids:i})}else{var h=L.next(c),g=L.next(u);K.splitNodes(e,{at:h,voids:i}),K.moveNodes(e,{at:c,to:g,voids:i})}}}})},ea=[`text`],ta=[`children`],na=(e,t)=>t!==e&&(B.isText(t)||U.isVoid(e,t)||t.children.length===1&&na(e,t.children[0])),ra=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:i=!1,voids:a=!1,mode:o=`lowest`}=t;if(r){var s=W.isPath(r),c=s?r:null,l=n==null&&s;if(n==null)if(s){var[u]=U.parent(e,r);n=e=>u.children.includes(e)}else n=t=>B.isElement(t)&&U.isBlock(e,t);if(!i&&W.isRange(r)&&(r=U.unhangRange(e,r,{voids:a})),W.isRange(r))if(R.isCollapsed(r))r=r.anchor;else{var[,d]=R.edges(r),f=U.pointRef(e,d);K.delete(e,{at:r}),r=f.unref(),t.at==null&&K.select(e,r)}var[p]=U.nodes(e,{at:r,match:n,voids:a,mode:o}),m=l&&c&&L.hasPrevious(c)?L.previous(c):null,h=m?U.node(e,m):U.previous(e,{at:r,match:n,voids:a,mode:o});if(!(!p||!h)){var[g,_]=p,[v,y]=h;if(!(_.length===0||y.length===0)){var b=L.next(y),x=L.common(_,y),S=L.isSibling(_,y),C=Array.from(U.levels(e,{at:_}),e=>{var[t]=e;return t}).slice(x.length).slice(0,-1),w=U.above(e,{at:_,mode:`highest`,match:t=>C.includes(t)&&na(e,t)}),T=w&&U.pathRef(e,w[1]),E,D;if(B.isText(g)&&B.isText(v)){var{text:O}=g,k=en(g,ea);D=v.text.length,E=k}else if(B.isElement(g)&&B.isElement(v)){var{children:A}=g,k=en(g,ta);D=v.children.length,E=k}else throw Error(`Cannot merge the node at path [${_}] with the previous sibling because it is not the same kind: ${Kn.stringify(g)} ${Kn.stringify(v)}`);S||K.moveNodes(e,{at:_,to:b,voids:a}),T&&K.removeNodes(e,{at:T.current,voids:a}),U.shouldMergeNodesRemovePrevNode(e,h,p)?K.removeNodes(e,{at:y,voids:a}):e.apply({type:`merge_node`,path:b,position:D,properties:E}),T&&T.unref()}}}})},ia=(e,t)=>{U.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:i=`lowest`,voids:a=!1}=t,{match:o}=t;if(r){o==null&&(o=W.isPath(r)?hn(e,r):t=>B.isElement(t)&&U.isBlock(e,t));var s=U.pathRef(e,n),c=U.nodes(e,{at:r,match:o,mode:i,voids:a});for(var l of Array.from(c,t=>{var[,n]=t;return U.pathRef(e,n)})){var u=l.unref(),d=s.current;u.length!==0&&e.apply({type:`move_node`,path:u,newPath:d}),s.current&&L.isSibling(d,u)&&L.isAfter(d,u)&&(s.current=L.next(s.current))}s.unref()}})},aa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:i=`lowest`}=t,{at:a=e.selection,match:o}=t;if(a){o==null&&(o=W.isPath(a)?hn(e,a):t=>B.isElement(t)&&U.isBlock(e,t)),!n&&W.isRange(a)&&(a=U.unhangRange(e,a,{voids:r}));var s=U.nodes(e,{at:a,match:o,mode:i,voids:r});for(var c of Array.from(s,t=>{var[,n]=t;return U.pathRef(e,n)})){var l=c.unref();if(l){var[u]=U.node(e,l);e.apply({type:`remove_node`,path:l,node:u})}}}})},oa=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};U.withoutNormalizing(e,()=>{var{match:r,at:i=e.selection,compare:a,merge:o}=n,{hanging:s=!1,mode:c=`lowest`,split:l=!1,voids:u=!1}=n;if(i){if(r==null&&(r=W.isPath(i)?hn(e,i):t=>B.isElement(t)&&U.isBlock(e,t)),!s&&W.isRange(i)&&(i=U.unhangRange(e,i,{voids:u})),l&&W.isRange(i)){if(R.isCollapsed(i)&&U.leaf(e,i.anchor)[0].text.length>0)return;var d=U.rangeRef(e,i,{affinity:`inward`}),[f,p]=R.edges(i),m=c===`lowest`?`lowest`:`highest`,h=U.isEnd(e,p,p.path);K.splitNodes(e,{at:p,match:r,mode:m,voids:u,always:!h});var g=U.isStart(e,f,f.path);K.splitNodes(e,{at:f,match:r,mode:m,voids:u,always:!g}),i=d.unref(),n.at==null&&K.select(e,i)}a||(a=(e,t)=>e!==t);for(var[_,v]of U.nodes(e,{at:i,match:r,mode:c,voids:u})){var y={},b={};if(v.length!==0){var x=!1;for(var S in t)if(!cr.includes(S)){var C=Object.hasOwn(_,S)?_[S]:void 0,w=t[S];a(w,C)&&(x=!0,Object.hasOwn(_,S)&&(y[S]=C),o?w!=null&&(b[S]=o(C,w)):w!=null&&(b[S]=w))}x&&e.apply({type:`set_node`,path:v,properties:y,newProperties:b})}}}})},sa=(e,t)=>{if(R.isCollapsed(t))return t.anchor;var[,n]=R.edges(t),r=U.pointRef(e,n);return K.delete(e,{at:t}),r.unref()},ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.withoutNormalizing(e,()=>{var{mode:n=`lowest`,voids:r=!1}=t,{match:i,at:a=e.selection,height:o=0,always:s=!1}=t;if(a&&(i==null&&(i=t=>B.isElement(t)&&U.isBlock(e,t)),!(W.isRange(a)&&(a=sa(e,a),!a)))){if(W.isPath(a)){var c=a,l=U.point(e,c),[u]=U.parent(e,c);i=e=>e===u,o=l.path.length-c.length+1,a=l,s=!0}var d=U.pointRef(e,a,{affinity:`backward`}),f;try{var[p]=U.nodes(e,{at:a,match:i,mode:n,voids:r});if(!p)return;var m=U.void(e,{at:a,mode:`highest`}),h=0;if(!r&&m){var[g,_]=m;if(e.isInline(g)){var v=U.after(e,_);if(!v){var y={text:``},b=L.next(_);K.insertNodes(e,y,{at:b,voids:r}),v=U.point(e,b)}a=v,s=!0}o=a.path.length-_.length+1,s=!0}f=U.pointRef(e,a);var x=a.path.length-o,[,S]=p,C=a.path.slice(0,x),w=o===0?a.offset:a.path[x]+h;for(var[T,E]of U.levels(e,{at:C,reverse:!0,voids:r})){var D=!1;if(E.length<S.length||E.length===0||!r&&B.isElement(T)&&U.isVoid(e,T))break;var O=d.current,k=U.isEnd(e,O,E);if(s||!d||!U.isEdge(e,O,E)){D=!0;var A=B.extractProps(T);e.apply({type:`split_node`,path:E,position:w,properties:A})}w=E[E.length-1]+(D||k?1:0)}if(t.at==null){var j=f.current||U.end(e,[]);K.select(e,j)}}finally{var M;d.unref(),(M=f)==null||M.unref()}}})},la=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var i of t)r[i]=null;K.setNodes(e,r,n)},ua=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.withoutNormalizing(e,()=>{var{mode:n=`lowest`,split:r=!1,voids:i=!1}=t,{at:a=e.selection,match:o}=t;if(a){o==null&&(o=W.isPath(a)?hn(e,a):t=>B.isElement(t)&&U.isBlock(e,t)),W.isPath(a)&&(a=U.range(e,a));var s=W.isRange(a)?U.rangeRef(e,a):null,c=U.nodes(e,{at:a,match:o,mode:n,voids:i}),l=Array.from(c,t=>{var[,n]=t;return U.pathRef(e,n)}).reverse(),u=function(){var t=d.unref(),[n]=U.node(e,t),a=U.range(e,t);r&&s&&(a=R.intersection(s.current,a)),K.liftNodes(e,{at:a,match:e=>!B.isText(n)&&n.children.includes(e),voids:i})};for(var d of l)u();s&&s.unref()}})};function da(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?da(Object(n),!0).forEach(function(t){Qt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):da(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pa=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};U.withoutNormalizing(e,()=>{var{mode:r=`lowest`,split:i=!1,voids:a=!1}=n,{match:o,at:s=e.selection}=n;if(s){if(o==null&&(o=W.isPath(s)?hn(e,s):e.isInline(t)?t=>B.isElement(t)&&U.isInline(e,t)||B.isText(t):t=>B.isElement(t)&&U.isBlock(e,t)),i&&W.isRange(s)){var[c,l]=R.edges(s),u=U.rangeRef(e,s,{affinity:`inward`}),d=t=>{var n=U.above(e,{at:t,match:t=>B.isElement(t)&&U.isBlock(e,t)});return n&&U.isEdge(e,t,n[1])};K.splitNodes(e,{at:l,match:o,voids:a,always:!d(l)}),K.splitNodes(e,{at:c,match:o,voids:a,always:!d(c)}),s=u.unref(),n.at==null&&K.select(e,s)}var f=Array.from(U.nodes(e,{at:s,match:e.isInline(t)?t=>B.isElement(t)&&U.isBlock(e,t):e=>B.isEditor(e),mode:`lowest`,voids:a})),p=function(){var n=W.isRange(s)?R.intersection(s,U.range(e,m)):s;if(!n)return 0;var i=Array.from(U.nodes(e,{at:n,match:o,mode:r,voids:a}));if(i.length>0){var[c]=i,l=i[i.length-1],[,u]=c,[,d]=l;if(u.length===0&&d.length===0)return 0;var f=L.equals(u,d)?L.parent(u):L.common(u,d),p=U.range(e,u,d),[h]=U.node(e,f),g=f.length+1,_=L.next(d.slice(0,g)),v=fa(fa({},t),{},{children:[]});K.insertNodes(e,v,{at:_,voids:a}),K.moveNodes(e,{at:p,match:e=>!B.isText(h)&&h.children.includes(e),to:_.concat(0),voids:a})}};for(var[,m]of f)p()}})},ma=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){return br(e,...arguments)},addMark:function(){return Or(e,...arguments)},deleteBackward:function(){return Fr(e,...arguments)},deleteForward:function(){return Ir(e,...arguments)},deleteFragment:function(){return Lr(e,...arguments)},getFragment:function(){return Sr(e,...arguments)},insertBreak:function(){return Qr(e,...arguments)},insertSoftBreak:function(){return ei(e,...arguments)},insertFragment:function(){return Hi(e,...arguments)},insertNode:function(){return $r(e,...arguments)},insertText:function(){return ri(e,...arguments)},normalizeNode:function(){return Cr(e,...arguments)},removeMark:function(){return Pi(e,...arguments)},getDirtyPaths:function(){return xr(e,...arguments)},shouldNormalize:function(){return wr(e,...arguments)},above:function(){return Tr(e,...arguments)},after:function(){return jr(e,...arguments)},before:function(){return Pr(e,...arguments)},collapse:function(){return Ui(e,...arguments)},delete:function(){return Vi(e,...arguments)},deselect:function(){return Wi(e,...arguments)},edges:function(){return Rr(e,...arguments)},elementReadOnly:function(){return Vr(e,...arguments)},end:function(){return Hr(e,...arguments)},first:function(){return Ur(e,...arguments)},fragment:function(){return Wr(e,...arguments)},getMarks:function(){return hi(e,...arguments)},hasBlocks:function(){return Jr(e,...arguments)},hasInlines:function(){return Yr(e,...arguments)},hasPath:function(){return Xr(e,...arguments)},hasTexts:function(){return Zr(e,...arguments)},insertNodes:function(){return Qi(e,...arguments)},isBlock:function(){return ii(e,...arguments)},isEdge:function(){return ai(e,...arguments)},isEmpty:function(){return oi(e,...arguments)},isEnd:function(){return si(e,...arguments)},isNormalizing:function(){return ci(e,...arguments)},isStart:function(){return li(e,...arguments)},last:function(){return ui(e,...arguments)},leaf:function(){return di(e,...arguments)},levels:function(){return fi(e,...arguments)},liftNodes:function(){return $i(e,...arguments)},mergeNodes:function(){return ra(e,...arguments)},move:function(){return Gi(e,...arguments)},moveNodes:function(){return ia(e,...arguments)},next:function(){return gi(e,...arguments)},node:function(){return _i(e,...arguments)},nodes:function(){return vi(e,...arguments)},normalize:function(){return yi(e,...arguments)},parent:function(){return bi(e,...arguments)},path:function(){return Ci(e,...arguments)},pathRef:function(){return xi(e,...arguments)},pathRefs:function(){return Si(e,...arguments)},point:function(){return Ei(e,...arguments)},pointRef:function(){return wi(e,...arguments)},pointRefs:function(){return Ti(e,...arguments)},positions:function(){return Di(e,...arguments)},previous:function(){return Oi(e,...arguments)},range:function(){return ji(e,...arguments)},rangeRef:function(){return ki(e,...arguments)},rangeRefs:function(){return Ai(e,...arguments)},removeNodes:function(){return aa(e,...arguments)},select:function(){return Ki(e,...arguments)},setNodes:function(){return oa(e,...arguments)},setNormalizing:function(){return Fi(e,...arguments)},setPoint:function(){return Yi(e,...arguments)},setSelection:function(){return Xi(e,...arguments)},splitNodes:function(){return ca(e,...arguments)},start:function(){return Ii(e,...arguments)},string:function(){return Li(e,...arguments)},unhangRange:function(){return Ri(e,...arguments)},unsetNodes:function(){return la(e,...arguments)},unwrapNodes:function(){return ua(e,...arguments)},void:function(){return qr(e,...arguments)},withoutNormalizing:function(){return zi(e,...arguments)},wrapNodes:function(){return pa(e,...arguments)},shouldMergeNodesRemovePrevNode:function(){return Bi(e,...arguments)}};return e},ha=u(s(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=9007199254740991,a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object GeneratorFunction]`,f=`[object Map]`,p=`[object Number]`,m=`[object Object]`,h=`[object Promise]`,g=`[object RegExp]`,_=`[object Set]`,v=`[object String]`,y=`[object Symbol]`,b=`[object WeakMap]`,x=`[object ArrayBuffer]`,S=`[object DataView]`,C=`[object Float32Array]`,w=`[object Float64Array]`,T=`[object Int8Array]`,E=`[object Int16Array]`,D=`[object Int32Array]`,O=`[object Uint8Array]`,k=`[object Uint8ClampedArray]`,A=`[object Uint16Array]`,j=`[object Uint32Array]`,M=/[\\^$.*+?()[\]{}|]/g,N=/\w*$/,P=/^\[object .+?Constructor\]$/,ee=/^(?:0|[1-9]\d*)$/,F={};F[a]=F[o]=F[x]=F[S]=F[s]=F[c]=F[C]=F[w]=F[T]=F[E]=F[D]=F[f]=F[p]=F[m]=F[g]=F[_]=F[v]=F[y]=F[O]=F[k]=F[A]=F[j]=!0,F[l]=F[u]=F[b]=!1;var te=typeof global==`object`&&global&&global.Object===Object&&global,ne=typeof self==`object`&&self&&self.Object===Object&&self,re=te||ne||Function(`return this`)(),ie=typeof e==`object`&&e&&!e.nodeType&&e,ae=ie&&typeof t==`object`&&t&&!t.nodeType&&t,oe=ae&&ae.exports===ie;function se(e,t){return e.set(t[0],t[1]),e}function ce(e,t){return e.add(t),e}function le(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function ue(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function de(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function fe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function pe(e,t){return e==null?void 0:e[t]}function me(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch(e){}return t}function he(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function ge(e,t){return function(n){return e(t(n))}}function _e(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ve=Array.prototype,ye=Function.prototype,be=Object.prototype,xe=re[`__core-js_shared__`],Se=function(){var e=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),Ce=ye.toString,we=be.hasOwnProperty,Te=be.toString,Ee=RegExp(`^`+Ce.call(we).replace(M,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),De=oe?re.Buffer:void 0,Oe=re.Symbol,ke=re.Uint8Array,Ae=ge(Object.getPrototypeOf,Object),je=Object.create,Me=be.propertyIsEnumerable,Ne=ve.splice,Pe=Object.getOwnPropertySymbols,Fe=De?De.isBuffer:void 0,Ie=ge(Object.keys,Object),Le=Ht(re,`DataView`),Re=Ht(re,`Map`),ze=Ht(re,`Promise`),Be=Ht(re,`Set`),Ve=Ht(re,`WeakMap`),He=Ht(Object,`create`),Ue=Zt(Le),We=Zt(Re),Ge=Zt(ze),I=Zt(Be),Ke=Zt(Ve),qe=Oe?Oe.prototype:void 0,Je=qe?qe.valueOf:void 0;function Ye(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xe(){this.__data__=He?He(null):{}}function Ze(e){return this.has(e)&&delete this.__data__[e]}function Qe(e){var t=this.__data__;if(He){var n=t[e];return n===r?void 0:n}return we.call(t,e)?t[e]:void 0}function $e(e){var t=this.__data__;return He?t[e]!==void 0:we.call(t,e)}function et(e,t){var n=this.__data__;return n[e]=He&&t===void 0?r:t,this}Ye.prototype.clear=Xe,Ye.prototype.delete=Ze,Ye.prototype.get=Qe,Ye.prototype.has=$e,Ye.prototype.set=et;function tt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nt(){this.__data__=[]}function rt(e){var t=this.__data__,n=xt(t,e);return n<0?!1:(n==t.length-1?t.pop():Ne.call(t,n,1),!0)}function it(e){var t=this.__data__,n=xt(t,e);return n<0?void 0:t[n][1]}function at(e){return xt(this.__data__,e)>-1}function ot(e,t){var n=this.__data__,r=xt(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}tt.prototype.clear=nt,tt.prototype.delete=rt,tt.prototype.get=it,tt.prototype.has=at,tt.prototype.set=ot;function st(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ct(){this.__data__={hash:new Ye,map:new(Re||tt),string:new Ye}}function lt(e){return Vt(this,e).delete(e)}function ut(e){return Vt(this,e).get(e)}function dt(e){return Vt(this,e).has(e)}function ft(e,t){return Vt(this,e).set(e,t),this}st.prototype.clear=ct,st.prototype.delete=lt,st.prototype.get=ut,st.prototype.has=dt,st.prototype.set=ft;function pt(e){this.__data__=new tt(e)}function mt(){this.__data__=new tt}function ht(e){return this.__data__.delete(e)}function gt(e){return this.__data__.get(e)}function _t(e){return this.__data__.has(e)}function vt(e,t){var r=this.__data__;if(r instanceof tt){var i=r.__data__;if(!Re||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new st(i)}return r.set(e,t),this}pt.prototype.clear=mt,pt.prototype.delete=ht,pt.prototype.get=gt,pt.prototype.has=_t,pt.prototype.set=vt;function yt(e,t){var n=tn(e)||en(e)?fe(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||we.call(e,a))&&!(i&&(a==`length`||Jt(a,r)))&&n.push(a);return n}function bt(e,t,n){var r=e[t];(!(we.call(e,t)&&$t(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function xt(e,t){for(var n=e.length;n--;)if($t(e[n][0],t))return n;return-1}function St(e,t){return e&&Rt(t,cn(t),e)}function Ct(e,t,n,r,i,o,s){var c;if(r&&(c=o?r(e,i,o,s):r(e)),c!==void 0)return c;if(!on(e))return e;var l=tn(e);if(l){if(c=Gt(e),!t)return Lt(e,c)}else{var f=Wt(e),p=f==u||f==d;if(R(e))return kt(e,t);if(f==m||f==a||p&&!o){if(me(e))return o?e:{};if(c=Kt(p?{}:e),!t)return zt(e,St(c,e))}else{if(!F[f])return o?e:{};c=qt(e,f,Ct,t)}}s||(s=new pt);var h=s.get(e);if(h)return h;if(s.set(e,c),!l)var g=n?Bt(e):cn(e);return le(g||e,function(i,a){g&&(a=i,i=e[a]),bt(c,a,Ct(i,t,n,r,a,e,s))}),c}function wt(e){return on(e)?je(e):{}}function Tt(e,t,n){var r=t(e);return tn(e)?r:ue(r,n(e))}function Et(e){return Te.call(e)}function Dt(e){return!on(e)||Yt(e)?!1:(an(e)||me(e)?Ee:P).test(Zt(e))}function Ot(e){if(!Xt(e))return Ie(e);var t=[];for(var n in Object(e))we.call(e,n)&&n!=`constructor`&&t.push(n);return t}function kt(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function At(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function jt(e,t){var n=t?At(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Mt(e,t,n){return de(t?n(he(e),!0):he(e),se,new e.constructor)}function Nt(e){var t=new e.constructor(e.source,N.exec(e));return t.lastIndex=e.lastIndex,t}function Pt(e,t,n){return de(t?n(_e(e),!0):_e(e),ce,new e.constructor)}function Ft(e){return Je?Object(Je.call(e)):{}}function It(e,t){var n=t?At(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Lt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Rt(e,t,n,r){n||(n={});for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;bt(n,o,s===void 0?e[o]:s)}return n}function zt(e,t){return Rt(e,Ut(e),t)}function Bt(e){return Tt(e,cn,Ut)}function Vt(e,t){var n=e.__data__;return L(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Ht(e,t){var n=pe(e,t);return Dt(n)?n:void 0}var Ut=Pe?ge(Pe,Object):ln,Wt=Et;(Le&&Wt(new Le(new ArrayBuffer(1)))!=S||Re&&Wt(new Re)!=f||ze&&Wt(ze.resolve())!=h||Be&&Wt(new Be)!=_||Ve&&Wt(new Ve)!=b)&&(Wt=function(e){var t=Te.call(e),n=t==m?e.constructor:void 0,r=n?Zt(n):void 0;if(r)switch(r){case Ue:return S;case We:return f;case Ge:return h;case I:return _;case Ke:return b}return t});function Gt(e){var t=e.length,n=e.constructor(t);return t&&typeof e[0]==`string`&&we.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Kt(e){return typeof e.constructor==`function`&&!Xt(e)?wt(Ae(e)):{}}function qt(e,t,n,r){var i=e.constructor;switch(t){case x:return At(e);case s:case c:return new i(+e);case S:return jt(e,r);case C:case w:case T:case E:case D:case O:case k:case A:case j:return It(e,r);case f:return Mt(e,r,n);case p:case v:return new i(e);case g:return Nt(e);case _:return Pt(e,r,n);case y:return Ft(e)}}function Jt(e,t){return t=t==null?i:t,!!t&&(typeof e==`number`||ee.test(e))&&e>-1&&e%1==0&&e<t}function L(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Yt(e){return!!Se&&Se in e}function Xt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||be)}function Zt(e){if(e!=null){try{return Ce.call(e)}catch(e){}try{return e+``}catch(e){}}return``}function Qt(e){return Ct(e,!0,!0)}function $t(e,t){return e===t||e!==e&&t!==t}function en(e){return rn(e)&&we.call(e,`callee`)&&(!Me.call(e,`callee`)||Te.call(e)==a)}var tn=Array.isArray;function nn(e){return e!=null&&z(e.length)&&!an(e)}function rn(e){return sn(e)&&nn(e)}var R=Fe||B;function an(e){var t=on(e)?Te.call(e):``;return t==u||t==d}function z(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=i}function on(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function sn(e){return!!e&&typeof e==`object`}function cn(e){return nn(e)?yt(e):Ot(e)}function ln(){return[]}function B(){return!1}t.exports=Qt}))(),1);const ga=new Set([`base`,`embed`,`math`,`meta`,`object`,`script`,`svg`]),_a=new Set([`href`,`poster`,`src`,`xlink:href`]),va=[`java`,`script:`].join(``);function ya(e){return Array.from(e).filter(e=>e>` `).join(``).toLowerCase()}function ba(e,t,n){let r=ya(n);return r?r.startsWith(va)||r.startsWith(`vbscript:`)?!1:r.startsWith(`data:`)?t===`href`||t===`xlink:href`?!1:e===`img`||t===`poster`?r.startsWith(`data:image/`):!1:!0:!0}function xa(e=``){if(!e)return``;let t=document.createElement(`div`);t.innerHTML=e;let n=e=>{Array.from(e.childNodes).forEach(e=>{if(!(e instanceof Element))return;let t=e,r=t.tagName.toLowerCase();if(r===`template`){let e=t,n=xa(e.innerHTML);if(!n){e.remove();return}e.insertAdjacentHTML(`beforebegin`,n),e.remove();return}if(ga.has(r)){t.remove();return}Array.from(t.attributes).forEach(e=>{let n=e.name.toLowerCase(),i=e.value||``;if(n===`srcdoc`||n.startsWith(`on`)){t.removeAttribute(e.name);return}_a.has(n)&&!ba(r,n,i)&&t.removeAttribute(e.name)}),n(t)})};return n(t),t.innerHTML}const Sa={};function Ca(e,t){t!=null&&(Sa[e]=t)}D();function wa(e={}){let t=(0,ha.default)(Sa),n={},{MENU_CONF:r={}}=e;return(0,Pt.default)(t,(e,t)=>{n[t]=E(E({},e),r[t]||{})}),delete e.MENU_CONF,E({scroll:!0,readOnly:!1,autoFocus:!0,decorate:()=>[],maxLength:0,imageResize:{},MENU_CONF:n,hoverbarKeys:{},textStyleMode:`inline`,classStylePolicy:`preserve-data`,sanitizeHtml:xa,customAlert(e,t){window.alert(`${t}:\n${e}`)}},e)}function Ta(e){return E({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},e||{})}const q={CREATED:`created`,DESTROYED:`destroyed`,CHANGE:`change`,SCROLL:`scroll`,FULLSCREEN:`fullscreen`,UNFULLSCREEN:`unFullScreen`,MODALORPANELSHOW:`modalOrPanelShow`,MODALORPANELHIDE:`modalOrPanelHide`};D();const Ea={};function Da(e,t){let{key:n,factory:r,config:i}=e,a=E(E({},i),t||{});if(Ea[n]!=null)throw Error(`Duplicated key '${n}' in menu items`);Ea[n]=r,Ca(n,a)}const Oa=new WeakMap,ka=new WeakMap,Aa=new WeakMap,ja=new WeakMap,Ma=new WeakMap,Na=new WeakMap,Pa=new WeakMap,Fa=new WeakMap,Ia=new WeakMap,La=new WeakMap,Ra=new WeakMap,za=new WeakMap,Ba=new WeakMap,Va=new WeakMap,Ha=new WeakMap,Ua=new WeakMap,Wa=new WeakMap,Ga=new WeakMap,Ka=new WeakMap,qa=new WeakMap,Ja=new WeakMap,Ya=new WeakMap,Xa=new WeakMap,Za=new WeakMap,Qa=new WeakMap,$a=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ro=e=>{let t=e;return t.getAllMenuKeys=()=>{let e=[];for(let t in Ea)e.push(t);return e},t.getConfig=()=>{let e=La.get(t);if(e==null)throw Error(`Can not get editor config`);return e},t.getMenuConfig=e=>{let{MENU_CONF:n={}}=t.getConfig();return n[e]||{}},t.alert=(e,n=`info`)=>{let{customAlert:r}=t.getConfig();r&&r(e,n)},t},io=new Set([`doctype`,`!doctype`,`meta`,`script`,`style`,`link`,`frame`,`iframe`,`title`,`svg`]);function ao(e){return typeof e==`object`&&!!e&&`constructor`in e&&e.constructor===Object}function oo(e={},t={}){Object.keys(t).forEach(n=>{e[n]===void 0?e[n]=t[n]:ao(t[n])&&ao(e[n])&&Object.keys(t[n]).length>0&&oo(e[n],t[n])})}const so={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:``},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:``,host:``,hostname:``,href:``,origin:``,pathname:``,protocol:``,search:``}};function co(){let e=typeof document<`u`?document:{};return oo(e,so),e}const lo={document:so,navigator:{userAgent:``},location:{hash:``,host:``,hostname:``,href:``,origin:``,pathname:``,protocol:``,search:``},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return``}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>`u`?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>`u`||clearTimeout(e)}};function uo(){let e=typeof window<`u`?window:{};return oo(e,lo),e}function fo(e){let t=e.__proto__;Object.defineProperty(e,`__proto__`,{get(){return t},set(e){t.__proto__=e}})}var po=class extends Array{constructor(e){typeof e==`number`?super(e):(super(...e||[]),fo(this))}};function mo(e=[]){let t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...mo(e)):t.push(e)}),t}function ho(e,t){return Array.prototype.filter.call(e,t)}function go(e){let t=[];for(let n=0;n<e.length;n+=1)t.indexOf(e[n])===-1&&t.push(e[n]);return t}function _o(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function vo(e,t){if(typeof e!=`string`)return[e];let n=[],r=t.querySelectorAll(e);for(let e=0;e<r.length;e+=1)n.push(r[e]);return n}function yo(e,t){let n=uo(),r=co(),i=[];if(!t&&e instanceof po)return e;if(!e)return new po(i);if(typeof e==`string`){let n=e.trim();if(n.indexOf(`<`)>=0&&n.indexOf(`>`)>=0){let e=`div`;n.indexOf(`<li`)===0&&(e=`ul`),n.indexOf(`<tr`)===0&&(e=`tbody`),(n.indexOf(`<td`)===0||n.indexOf(`<th`)===0)&&(e=`tr`),n.indexOf(`<tbody`)===0&&(e=`table`),n.indexOf(`<option`)===0&&(e=`select`);let t=r.createElement(e);t.innerHTML=n;for(let e=0;e<t.childNodes.length;e+=1)i.push(t.childNodes[e])}else i=vo(e.trim(),t||r)}else if(e.nodeType||e===n||e===r)i.push(e);else if(Array.isArray(e)){if(e instanceof po)return e;i=e}return new po(go(i))}yo.fn=po.prototype;function bo(...e){let t=mo(e.map(e=>e.split(` `)));return this.forEach(e=>{e.classList.add(...t)}),this}function xo(...e){let t=mo(e.map(e=>e.split(` `)));return this.forEach(e=>{e.classList.remove(...t)}),this}function So(...e){let t=mo(e.map(e=>e.split(` `)));return ho(this,e=>t.filter(t=>e.classList.contains(t)).length>0).length>0}function Co(e,t){if(arguments.length===1&&typeof e==`string`)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n<this.length;n+=1)if(arguments.length===2)this[n].setAttribute(e,t);else for(let t in e)this[n][t]=e[t],this[n].setAttribute(t,e[t]);return this}function wo(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function To(){let e=this[0];if(!e)return;let t={};if(e.dataset)for(let n in e.dataset)t[n]=e.dataset[n];else for(let n=0;n<e.attributes.length;n+=1){let r=e.attributes[n];r.name.indexOf(`data-`)>=0&&(t[_o(r.name.split(`data-`)[1])]=r.value)}for(let e in t)t[e]===`false`?t[e]=!1:t[e]===`true`?t[e]=!0:parseFloat(t[e])===t[e]*1&&(t[e]*=1);return t}function Eo(e){if(e===void 0){let e=this[0];if(!e)return;if(e.multiple&&e.nodeName.toLowerCase()===`select`){let t=[];for(let n=0;n<e.selectedOptions.length;n+=1)t.push(e.selectedOptions[n].value);return t}return e.value}for(let t=0;t<this.length;t+=1){let n=this[t];if(Array.isArray(e)&&n.multiple&&n.nodeName.toLowerCase()===`select`)for(let t=0;t<n.options.length;t+=1)n.options[t].selected=e.indexOf(n.options[t].value)>=0;else n.value=e}return this}function Do(...e){let[t,n,r,i]=e;typeof e[1]==`function`&&([t,r,i]=e,n=void 0),i||(i=!1);function a(e){let t=e.target;if(!t)return;let i=e.target.dom7EventData||[];if(i.indexOf(e)<0&&i.unshift(e),yo(t).is(n))r.apply(t,i);else{let e=yo(t).parents();for(let t=0;t<e.length;t+=1)yo(e[t]).is(n)&&r.apply(e[t],i)}}function o(e){let t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}let s=t.split(` `),c;for(let e=0;e<this.length;e+=1){let t=this[e];if(n)for(c=0;c<s.length;c+=1){let e=s[c];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:r,proxyListener:a}),t.addEventListener(e,a,i)}else for(c=0;c<s.length;c+=1){let e=s[c];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:r,proxyListener:o}),t.addEventListener(e,o,i)}}return this}function Oo(){let e=uo();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css(`width`)):null}function ko(){let e=uo();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css(`height`)):null}function Ao(){if(this.length>0){let e=uo(),t=co(),n=this[0],r=n.getBoundingClientRect(),i=t.body,a=n.clientTop||i.clientTop||0,o=n.clientLeft||i.clientLeft||0,s=n===e?e.scrollY:n.scrollTop,c=n===e?e.scrollX:n.scrollLeft;return{top:r.top+s-a,left:r.left+c-o}}return null}function jo(){for(let e=0;e<this.length;e+=1)this[e].style.display=`none`;return this}function Mo(){let e=uo();for(let t=0;t<this.length;t+=1){let n=this[t];n.style.display===`none`&&(n.style.display=``),e.getComputedStyle(n,null).getPropertyValue(`display`)===`none`&&(n.style.display=`block`)}return this}function No(e,t){let n=uo(),r;if(arguments.length===1)if(typeof e==`string`){if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}else{for(r=0;r<this.length;r+=1)for(let t in e)this[r].style[t]=e[t];return this}if(arguments.length===2&&typeof e==`string`){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function Po(e){return e&&this.forEach((t,n)=>{e.apply(t,[t,n])}),this}function Fo(e){if(e===void 0)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function Io(e){if(e===void 0)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this}function Lo(e){let t=uo(),n=co(),r=this[0],i,a;if(!r||e===void 0)return!1;if(typeof e==`string`){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(i=yo(e),a=0;a<i.length;a+=1)if(i[a]===r)return!0;return!1}if(e===n)return r===n;if(e===t)return r===t;if(e.nodeType||e instanceof po){for(i=e.nodeType?[e]:e,a=0;a<i.length;a+=1)if(i[a]===r)return!0;return!1}return!1}function Ro(...e){let t,n=co();for(let r=0;r<e.length;r+=1){t=e[r];for(let e=0;e<this.length;e+=1)if(typeof t==`string`){let r=n.createElement(`div`);for(r.innerHTML=t;r.firstChild;)this[e].appendChild(r.firstChild)}else if(t instanceof po)for(let n=0;n<t.length;n+=1)this[e].appendChild(t[n]);else this[e].appendChild(t)}return this}function zo(e){let t=[];for(let n=0;n<this.length;n+=1)this[n].parentNode!==null&&(e?yo(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return yo(t)}function Bo(e){let t=[];for(let n=0;n<this.length;n+=1){let r=this[n].parentNode;for(;r;)e?yo(r).is(e)&&t.push(r):t.push(r),r=r.parentNode}return yo(t)}function Vo(e){let t=[];for(let n=0;n<this.length;n+=1){let r=this[n].querySelectorAll(e);for(let e=0;e<r.length;e+=1)t.push(r[e])}return yo(t)}function Ho(e){let t=[];for(let n=0;n<this.length;n+=1){let r=this[n].children;for(let n=0;n<r.length;n+=1)(!e||yo(r[n]).is(e))&&t.push(r[n])}return yo(t)}function Uo(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function Wo(){for(let e=0;e<this.length;e+=1){let t=this[e];if(t.nodeType===1){for(let e=0;e<t.childNodes.length;e+=1)t.childNodes[e].parentNode&&t.childNodes[e].parentNode.removeChild(t.childNodes[e]);t.textContent=``}}return this}const Go=`resize scroll`.split(` `);function Ko(e){function t(...t){if(t[0]===void 0){for(let t=0;t<this.length;t+=1)Go.indexOf(e)<0&&(e in this[t]?this[t][e]():yo(this[t]).trigger(e));return this}return this.on(e,...t)}return t}const qo=Ko(`focus`);var J=yo;const Jo=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var Yo=globalThis.Node;globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,No&&(J.fn.css=No),Ro&&(J.fn.append=Ro),bo&&(J.fn.addClass=bo),xo&&(J.fn.removeClass=xo),So&&(J.fn.hasClass=So),Do&&(J.fn.on=Do),qo&&(J.fn.focus=qo),Co&&(J.fn.attr=Co),wo&&(J.fn.removeAttr=wo),jo&&(J.fn.hide=jo),Mo&&(J.fn.show=Mo),Ao&&(J.fn.offset=Ao),Oo&&(J.fn.width=Oo),ko&&(J.fn.height=ko),zo&&(J.fn.parent=zo),Bo&&(J.fn.parents=Bo),Lo&&(J.fn.is=Lo),To&&(J.fn.dataset=To),Eo&&(J.fn.val=Eo),Io&&(J.fn.text=Io),Fo&&(J.fn.html=Fo),Ho&&(J.fn.children=Ho),Uo&&(J.fn.remove=Uo),Vo&&(J.fn.find=Vo),Po&&(J.fn.each=Po),Wo&&(J.fn.empty=Wo);var Y=J;let Xo=function(e){return e[e.ELEMENT_NODE=1]=`ELEMENT_NODE`,e[e.TEXT_NODE=3]=`TEXT_NODE`,e[e.CDATA_SECTION_NODE=4]=`CDATA_SECTION_NODE`,e[e.PROCESSING_INSTRUCTION_NODE=7]=`PROCESSING_INSTRUCTION_NODE`,e[e.COMMENT_NODE=8]=`COMMENT_NODE`,e[e.DOCUMENT_NODE=9]=`DOCUMENT_NODE`,e[e.DOCUMENT_TYPE_NODE=10]=`DOCUMENT_TYPE_NODE`,e[e.DOCUMENT_FRAGMENT_NODE=11]=`DOCUMENT_FRAGMENT_NODE`,e}({});const Zo=e=>Rt(e)===`[object HTMLDocument]`,Qo=e=>Rt(e)===`[object ShadowRoot]`,$o=e=>Rt(e)===`[object DataTransfer]`,es=/\[object HTML([A-Z][a-z]*)*Element\]/,ts=e=>`matches`in e&&/^[ou]l$/i.test(e.tagName)&&!e.hasAttribute(`data-w-e-type`),ns=e=>es.test(Rt(e)),rs=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,is=e=>e!=null&&typeof e.nodeType==`number`,as=e=>is(e)&&e.nodeType===Xo.COMMENT_NODE,os=e=>is(e)&&e.nodeType===Xo.ELEMENT_NODE,ss=e=>Rt(e)===`[object Selection]`,cs=e=>is(e)&&e.nodeType===Xo.TEXT_NODE,ls=e=>e.clipboardData&&e.clipboardData.getData(`text/plain`)!==``&&e.clipboardData.types.length===1,us=e=>{let[t,n]=e;if(os(t)&&t.childNodes.length){let e=n===t.childNodes.length,r=e?n-1:n;for([t,r]=ps(t,r,e?`backward`:`forward`),e=r<n;os(t)&&t.childNodes.length;){let n=e?t.childNodes.length-1:0;t=ms(t,n,e?`backward`:`forward`)}n=e&&t.textContent!=null?t.textContent.length:0}return[t,n]},ds=()=>!!(window.document.activeElement&&window.document.activeElement.shadowRoot),fs=e=>{var t,n;return(t=window&&window.document.getElementById(e))==null?window&&((n=window.document.activeElement)==null||(n=n.shadowRoot)==null?void 0:n.getElementById(e))||null:t},ps=(e,t,n)=>{let{childNodes:r}=e,i=r[t],a=t,o=!1,s=!1;for(;(as(i)||os(i)&&i.childNodes.length===0||os(i)&&i.getAttribute(`contenteditable`)===`false`)&&!(o&&s);){if(a>=r.length){o=!0,a=t-1,n=`backward`;continue}if(a<0){s=!0,a=t+1,n=`forward`;continue}i=r[a],t=a,a+=n===`forward`?1:-1}return[i,t]},ms=(e,t,n)=>{let[r]=ps(e,t,n);return r},hs=e=>{let t=``;if(cs(e)&&e.nodeValue)return e.nodeValue;if(os(e)){for(let n of Array.from(e.childNodes))t+=hs(n);let n=getComputedStyle(e).getPropertyValue(`display`);(n===`block`||n===`list`||n===`table-row`||e.tagName===`BR`)&&(t+=`
|
|
16
|
+
`)}return t};function gs(e){let t=[];t.push(e);let n=0;for(;t.length>0;){let e=t.pop();if(e==null||(n+=1,n>1e4))break;let{nodeName:r,nodeType:i}=e;if(i===Xo.ELEMENT_NODE){let n=r.toLowerCase();if(Jo.includes(n)||n===`iframe`||n===`video`)return e;let i=e.children||[],a=i.length;if(a)for(let e=a-1;e>=0;--e)t.push(i[e])}}return null}function _s(e,t){if(!(ns(e)&&e.dataset.slateVoid===`true`))for(let n=e.childNodes,r=n.length;--r;){let i=n[r],a=i.nodeType;cs(i)?t(i,e):[Xo.ELEMENT_NODE,Xo.DOCUMENT_NODE,Xo.DOCUMENT_FRAGMENT_NODE].includes(a)&&_s(i,t)}}function vs(e){if(e.length===0)return``;let t=e[0];return t.nodeType===Xo.ELEMENT_NODE?t.tagName.toLowerCase():``}const ys=RegExp(`\xA0`,`g`);function bs(e){return e.replace(ys,` `)}const xs=[`span`,`b`,`strong`,`i`,`em`,`s`,`strike`,`u`,`font`,`sub`,`sup`],Ss=[];function Cs(e){Ss.push(e)}const ws=[];function Ts(e){ws.push(e)}const Es={};function Ds(e){let{selector:t,parseElemHtml:n}=e;Es[t]=n}function Os(e,t){let n=e.length;if(n){let r=e[n-1];if(Zn.isText(r)){let e=Object.keys(r);if(e.length===1&&e[0]===`text`)return r.text+=t,!0}}return!1}function ks(e,t){let n=[];if(e.attr(`data-w-e-is-void`)!=null)return n;let r=e[0].childNodes;return r.length===1&&r[0].nodeName===`BR`?(n.push({text:``}),n):(r.forEach(e=>{if(os(e)){if(e.nodeName===`BR`){Os(n,`
|
|
17
|
+
`)||n.push({text:`
|
|
18
|
+
`});return}let r=Vs(J(e),t);Array.isArray(r)?r.forEach(e=>n.push(e)):n.push(r);return}if(cs(e)){let t=e.textContent||``;if(t.trim()===``&&t.indexOf(`
|
|
19
|
+
`)>=0)return;t&&(t=bs(t),Os(n,t)||n.push({text:t}))}}),n)}function As(e,t,n){return{type:`paragraph`,children:[{text:J(e).text().replace(/\s+/gm,` `)}]}}function js(e){for(let t in Es)if(e[0].matches(t))return Es[t];return As}function Ms(e,t){let n=ks(e,t),r=js(e)(e[0],n,t);return Array.isArray(r)||(r=[r]),r.forEach(r=>{U.isVoid(t,r)||(n.length===0&&(r.children=[{text:e.text().replace(/\s+/gm,` `)}]),ws.forEach(n=>{r=n(e[0],r,t)}))}),r}var Ns=Ms;function Ps(e,t){e.parents(`pre`).length===0&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,``).replace(/<br>/g,`
|
|
20
|
+
`));let n=e[0].textContent||``;n=Lt(n),n=bs(n);let r={text:n};return ws.forEach(n=>{r=n(e[0],r,t)}),r}function Fs(e,t){let n={text:``};return ws.forEach(r=>{n=r(e[0],n,t)}),n}var Is=Ps;D();function Ls(e,t){let n=t.parentElement;return n==null?e:(n.closest(`pre`)==null&&(e=e.replace(/[\r\n\t]+/g,``)),e=Lt(e),e=bs(e),e)}function Rs(e,t){let n=E(E({},e),t);return Object.keys(t).forEach(e=>{t[e]===!1&&delete n[e]}),n}function zs(e,t,n){let r=e[0];if(os(r)){let r=Bs(e,n),i=E({},t);return delete i.text,Array.isArray(r)?r.map(e=>Rs(i,e)):[Rs(i,r)]}return as(r)?null:[Rs(t,cs(r)?{text:Ls(r.textContent||``,r)}:Is(e,n))]}function Bs(e,t){Ss.forEach(t=>{let{selector:n,preParseHtml:r}=t;e[0].matches(n)&&(e=J(r(e[0])))});let n=vs(e);if(n===`span`){if(e.attr(`data-w-e-type`))return Ns(e,t);let n=Array.from(e[0].childNodes);if(n.some(e=>!cs(e)&&!as(e))){let r=Fs(J(e[0]),t);return n.flatMap(e=>zs(J(e),r,t)||[])}return Is(e,t)}if(n===`code`)return vs(e.parent())===`pre`?Ns(e,t):Is(e,t);if(xs.includes(n)){let n=Array.from(e[0].childNodes);if(n.some(e=>!cs(e)&&!as(e))){let r=Fs(J(e[0]),t);return n.flatMap(e=>zs(J(e),r,t)||[])}return Is(e,t)}return Ns(e,t)}var Vs=Bs;function Hs(e,t,n){let r=Y(n);return r.attr(t)?!0:(r.attr(t,`true`),e.on(q.DESTROYED,()=>{r.removeAttr(t)}),!1)}function Us(e,t){return Hs(e,`data-w-e-textarea`,t)}function Ws(e,t){return Hs(e,`data-w-e-toolbar`,t)}function Gs(){return[{type:`paragraph`,children:[{text:``}]}]}function Ks(e,t=``){let n=[],{sanitizeHtml:r}=e.getConfig();t===``&&(t=`<p><br></p>`),t.indexOf(`<`)!==0&&(t=t.split(/\n/).map(e=>`<p>${e}</p>`).join(``)),t=r?r(t):t;let i=Y(`<div>${t}</div>`);return Array.from(i.children()).forEach(t=>{let r=Vs(Y(t),e);Array.isArray(r)?r.forEach(e=>n.push(e)):n.push(r)}),n}function qs(e,t){let{html:n,content:r}=t,i;n==null?r&&r.length&&(i=r):i=Ks(e,n),i&&(e.children=e.transformInitialContent?e.transformInitialContent(i):i),e.children.length===0&&(e.children=Gs())}function Js(e,t){return`w-e-element-${e}-${t}`}function Ys(e){return`w-e-text-${e}`}const Xs=[];function Zs(e){Xs.push(e)}const Qs=[];function $s(e){Qs.push(e)}function ec(e,t,n,r={}){return Qs.reduce((e,i)=>i(e,t,n,r),e)}const tc={};function nc(e){let{type:t,elemToHtml:n}=e,r=t||``;tc[r]=n}var rc=u(s(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=`[object Map]`,s=`[object Object]`,c=`[object Promise]`,l=`[object Set]`,u=`[object String]`,d=`[object WeakMap]`,f=`[object DataView]`,p=/[\\^$.*+?()[\]{}|]/g,m=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,g=`\\ud800-\\udfff`,_=`\\u0300-\\u036f\\ufe20-\\ufe23`,v=`\\u20d0-\\u20f0`,y=`\\ufe0e\\ufe0f`,b=`[`+g+`]`,x=`[`+_+v+`]`,S=`\\ud83c[\\udffb-\\udfff]`,C=`(?:`+x+`|`+S+`)`,w=`[^`+g+`]`,T=`(?:\\ud83c[\\udde6-\\uddff]){2}`,E=`[\\ud800-\\udbff][\\udc00-\\udfff]`,D=`\\u200d`,O=C+`?`,k=`[`+y+`]?`,A=`(?:`+D+`(?:`+[w,T,E].join(`|`)+`)`+k+O+`)*`,j=k+O+A,M=`(?:`+[w+x+`?`,x,T,E,b].join(`|`)+`)`,N=RegExp(S+`(?=`+S+`)|`+M+j,`g`),P=RegExp(`[`+D+g+_+v+y+`]`),ee=typeof global==`object`&&global&&global.Object===Object&&global,F=typeof self==`object`&&self&&self.Object===Object&&self,te=ee||F||Function(`return this`)();function ne(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function re(e){return e.split(``)}function ie(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function ae(e,t){return ne(t,function(t){return e[t]})}function oe(e,t){return e==null?void 0:e[t]}function se(e){return P.test(e)}function ce(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch(e){}return t}function le(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function ue(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function de(e,t){return function(n){return e(t(n))}}function fe(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function pe(e){return se(e)?me(e):re(e)}function me(e){return e.match(N)||[]}var he=Function.prototype,ge=Object.prototype,_e=te[`__core-js_shared__`],ve=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),ye=he.toString,be=ge.hasOwnProperty,xe=ge.toString,Se=RegExp(`^`+ye.call(be).replace(p,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Ce=te.Symbol,we=Ce?Ce.iterator:void 0,Te=ge.propertyIsEnumerable,Ee=de(Object.keys,Object),De=He(te,`DataView`),Oe=He(te,`Map`),ke=He(te,`Promise`),Ae=He(te,`Set`),je=He(te,`WeakMap`),Me=Ke(De),Ne=Ke(Oe),Pe=Ke(ke),Fe=Ke(Ae),Ie=Ke(je);function Le(e,t){var n=Je(e)||qe(e)?ie(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||be.call(e,a))&&!(i&&(a==`length`||We(a,r)))&&n.push(a);return n}function Re(e){return xe.call(e)}function ze(e){return!$e(e)||Ge(e)?!1:(Ze(e)||ce(e)?Se:m).test(Ke(e))}function Be(e){if(!I(e))return Ee(e);var t=[];for(var n in Object(e))be.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Ve(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function He(e,t){var n=oe(e,t);return ze(n)?n:void 0}var Ue=Re;(De&&Ue(new De(new ArrayBuffer(1)))!=f||Oe&&Ue(new Oe)!=o||ke&&Ue(ke.resolve())!=c||Ae&&Ue(new Ae)!=l||je&&Ue(new je)!=d)&&(Ue=function(e){var t=xe.call(e),n=t==s?e.constructor:void 0,r=n?Ke(n):void 0;if(r)switch(r){case Me:return f;case Ne:return o;case Pe:return c;case Fe:return l;case Ie:return d}return t});function We(e,t){return t=t==null?n:t,!!t&&(typeof e==`number`||h.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){return!!ve&&ve in e}function I(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ge)}function Ke(e){if(e!=null){try{return ye.call(e)}catch(e){}try{return e+``}catch(e){}}return``}function qe(e){return Xe(e)&&be.call(e,`callee`)&&(!Te.call(e,`callee`)||xe.call(e)==r)}var Je=Array.isArray;function Ye(e){return e!=null&&Qe(e.length)&&!Ze(e)}function Xe(e){return et(e)&&Ye(e)}function Ze(e){var t=$e(e)?xe.call(e):``;return t==i||t==a}function Qe(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function $e(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function et(e){return!!e&&typeof e==`object`}function tt(e){return typeof e==`string`||!Je(e)&&et(e)&&xe.call(e)==u}function nt(e){if(!e)return[];if(Ye(e))return tt(e)?pe(e):Ve(e);if(we&&e[we])return le(e[we]());var t=Ue(e);return(t==o?ue:t==l?fe:it)(e)}function rt(e){return Ye(e)?Le(e):Be(e)}function it(e){return e?ae(e,rt(e)):[]}t.exports=nt}))(),1);let ic=0;var ac=class{constructor(){this.id=`${ic}`,ic+=1}};globalThis.navigator!==void 0&&globalThis.window!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;const oc=typeof navigator<`u`&&/Mac OS X/.test(navigator.userAgent),sc=typeof navigator<`u`&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);typeof navigator<`u`&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);const cc=typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),lc=typeof navigator<`u`&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),uc=typeof navigator<`u`&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),dc=typeof navigator<`u`&&/Chrome/i.test(navigator.userAgent);typeof navigator<`u`&&/.*QQBrowser/.test(navigator.userAgent);const fc=!uc&&!lc&&typeof globalThis<`u`&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges==`function`,pc=(e,t)=>!!(e.compareDocumentPosition(t)&Yo.DOCUMENT_POSITION_PRECEDING),mc=(e,t)=>!!(e.compareDocumentPosition(t)&Yo.DOCUMENT_POSITION_FOLLOWING),X={getWindow(e){let t=Xa.get(e);if(!t)throw Error(`Unable to find a host window element for this editor`);return t},findKey(e,t){let n=Ya.get(t);return n||(n=new ac,Ya.set(t,n)),n},setNewKey(e){let t=new ac;Ya.set(e,t)},findPath(e,t){let n=[],r=t;for(;;){let e=Wa.get(r);if(e==null){if(U.isEditor(r))return n;break}let t=Ua.get(r);if(t==null)break;n.unshift(t),r=e}throw Error(`Unable to find the path for Slate node: ${JSON.stringify(t)}`)},findDocumentOrShadowRoot(e){if(e.isDestroyed)return window.document;let t=X.toDOMNode(e,e),n=t.getRootNode();return(Zo(n)||Qo(n))&&Reflect.get(n,`getSelection`)!=null?n:t.ownerDocument},getParentNode(e,t){return Wa.get(t)||null},getParentsNodes(e,t){let n=[],r=t;for(;r!==e&&r!=null;){let t=X.getParentNode(e,r);if(t==null)break;n.push(t),r=t}return n},getTopNode(e,t){let n=[X.findPath(e,t)[0]];return B.get(e,n)},toDOMNode(e,t){let n;if(U.isEditor(t))n=Ga.get(e);else{let r=X.findKey(e,t);n=qa.get(r)}if(!n)throw Error(`Cannot resolve a DOM node from Slate node: ${JSON.stringify(t)}`);return n},hasDOMNodeBySlateNode(e,t){if(U.isEditor(t))return!!Ga.get(e);let n=X.findKey(e,t);return!!qa.get(n)},canResolveDOMRange(e,t){try{let[n]=U.node(e,t.anchor.path),[r]=R.isCollapsed(t)?[n]:U.node(e,t.focus.path);return X.hasDOMNodeBySlateNode(e,n)&&X.hasDOMNodeBySlateNode(e,r)}catch(e){return!1}},hasDOMNode(e,t,n={}){let{editable:r=!1}=n,i=X.toDOMNode(e,e),a;try{a=os(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes(`Permission denied to access property "nodeType"`))throw e}return a?a.closest(`[data-slate-editor]`)===i&&(!r||a.isContentEditable||a.closest(`[contenteditable="false"]`)===i||!!a.getAttribute(`data-slate-zero-width`))||!!a.getAttribute(`data-slate-string`):!1},toDOMRange(e,t){let{anchor:n,focus:r}=t,i=R.isBackward(t),a=X.toDOMPoint(e,n),o=R.isCollapsed(t)?a:X.toDOMPoint(e,r),s=X.getWindow(e).document.createRange(),[c,l]=i?o:a,[u,d]=i?a:o,f=!!(os(c)?c:c.parentElement).getAttribute(`data-slate-zero-width`),p=!!(os(u)?u:u.parentElement).getAttribute(`data-slate-zero-width`);return s.setStart(c,f?1:l),s.setEnd(u,p?1:d),s},toDOMPoint(e,t){let[n]=U.node(e,t.path),r=X.toDOMNode(e,n),i;U.void(e,{at:t})&&(t={path:t.path,offset:0});let a=Array.from(r.querySelectorAll(`[data-slate-string], [data-slate-zero-width]`)),o=0;for(let e of a){let n=e.childNodes[0];if(n==null||n.textContent==null)continue;let{length:r}=n.textContent,a=e.getAttribute(`data-slate-length`),s=o+(a==null?r:parseInt(a,10));if(t.offset<=s){i=[n,Math.min(r,Math.max(0,t.offset-o))];break}o=s}if(!i)throw Error(`Cannot resolve a DOM point from Slate point: ${JSON.stringify(t)}`);return i},toSlateNode(e,t){let n=os(t)?t:t.parentElement;n&&!n.hasAttribute(`data-slate-node`)&&(n=n.closest(`[data-slate-node]`));let r=n?Ka.get(n):null;if(!r)throw Error(`Cannot resolve a Slate node from DOM node: ${n}`);return r},findEventRange(e,t){`nativeEvent`in t&&(t=t.nativeEvent);let{clientX:n,clientY:r,target:i}=t;if(n==null||r==null)throw Error(`Cannot resolve a Slate range from a DOM event: ${t}`);let a=X.toSlateNode(e,t.target),o=X.findPath(e,a);if(z.isElement(a)&&U.isVoid(e,a)){let t=i.getBoundingClientRect(),s=e.isInline(a)?n-t.left<t.left+t.width-n:r-t.top<t.top+t.height-r,c=U.point(e,o,{edge:s?`start`:`end`}),l=s?U.before(e,c):U.after(e,c);if(l)return U.range(e,l)}let s,{document:c}=this.getWindow(e);if(c.caretRangeFromPoint)s=c.caretRangeFromPoint(n,r);else{let e=c.caretPositionFromPoint(n,r);e&&(s=c.createRange(),s.setStart(e.offsetNode,e.offset),s.setEnd(e.offsetNode,e.offset))}if(!s)throw Error(`Cannot resolve a Slate range from a DOM event: ${t}`);return X.toSlateRange(e,s,{exactMatch:!1,suppressThrow:!1})},toSlateRange(e,t,n){let{exactMatch:r,suppressThrow:i}=n,a=ss(t)?t.anchorNode:t.startContainer,o,s,c,l,u;if(a&&(ss(t)?(o=t.anchorNode,s=t.anchorOffset,c=t.focusNode,l=t.focusOffset,u=dc&&ds()?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(o=t.startContainer,s=t.startOffset,c=t.endContainer,l=t.endOffset,u=t.collapsed)),o==null||c==null||s==null||l==null){if(i)return null;throw Error(`Cannot resolve a Slate range from DOM range: ${t}`)}let d=X.toSlatePoint(e,[o,s],{exactMatch:r,suppressThrow:i});if(!d)return null;let f=u?d:X.toSlatePoint(e,[c,l],{exactMatch:r,suppressThrow:i,searchDirection:pc(o,c)||o===c&&l<s?`forward`:`backward`});if(!f)return null;let p={anchor:d,focus:f};return R.isExpanded(p)&&R.isForward(p)&&os(c)&&U.void(e,{at:p.focus,mode:`highest`})&&(p=U.unhangRange(e,p,{voids:!0})),p},toSlatePoint(e,t,n){let{exactMatch:r,suppressThrow:i}=n,[a,o]=r?t:us(t),s=a.parentNode,c=n.searchDirection,l=null,u=0;if(s){var d;let t=X.toDOMNode(e,e),n=s.closest(`[data-slate-void="true"]`),r=n&&t.contains(n)?n:null,i=s.closest(`[contenteditable="false"]`),f=i&&t.contains(i)?i:null,p=s.closest(`[data-slate-leaf]`),m=null,h=X.getWindow(e);if(p&&h.document.createRange){l=p.closest(`[data-slate-node="text"]`);let e=h.document.createRange();e.setStart(l,0),e.setEnd(a,o);let t=e.cloneContents();[...(0,rc.default)(t.querySelectorAll(`[data-slate-zero-width]`)),...(0,rc.default)(t.querySelectorAll(`[contenteditable=false]`))].forEach(e=>{e.parentNode.removeChild(e)}),u=t.textContent.length,m=l}else if(r)p=Array.from(r.querySelectorAll(`[data-slate-leaf]`)).find(t=>X.hasDOMNode(e,t))||null,p?(l=p.closest(`[data-slate-node="text"]`),m=p,u=m.textContent.length,m.querySelectorAll(`[data-slate-zero-width]`).forEach(e=>{u-=e.textContent.length})):u=1;else if(f){let t=!!f.closest(`[data-w-e-reserve]`);!c&&t&&(c=`forward`);let n=c,r=t=>t?Array.from(t.querySelectorAll(`[data-slate-leaf]`)).filter(t=>X.hasDOMNode(e,t)):[],i=f.closest(`[data-slate-node="element"]`);if(c===`backward`||!c){let e=[...r(i==null?void 0:i.previousElementSibling),...r(i)];for(let t=e.length-1;t>=0;--t){let n=e[t];if(pc(f,n)){p=n,c=`backward`;break}}}if(!p&&(c===`forward`||!c||t)){let e=[...r(i),...r(i==null?void 0:i.nextElementSibling)];for(let r of e)if(mc(f,r)){p=r,n=c===`backward`&&t?`backward`:`forward`;break}}p&&(l=p.closest(`[data-slate-node="text"]`),m=p,n===`forward`?u=0:(u=m.textContent.length,m.querySelectorAll(`[data-slate-zero-width]`).forEach(e=>{u-=e.textContent.length})))}m&&u===m.textContent.length&&(s.hasAttribute(`data-slate-zero-width`)||sc&&(d=m.textContent)!=null&&d.endsWith(`
|
|
21
|
+
`))&&--u}if(!l){if(i)return null;throw Error(`Cannot resolve a Slate point from DOM point: ${t}`)}let f;try{let t=X.toSlateNode(e,l);f=X.findPath(e,t)}catch(e){if(i)return null;throw e}return{path:f,offset:u}},hasRange(e,t){let{anchor:n,focus:r}=t;return U.hasPath(e,n.path)&&U.hasPath(e,r.path)},getNodeType(e){return z.isElement(e)?e.type:``},checkNodeType(e,t){return this.getNodeType(e)===t},getNodesStr(e){return e.map(e=>B.string(e)).join(``)},getSelectedVoidNode(e){let{selection:t}=e;if(!t)return null;let n=U.void(e,{at:t});if(!n)return null;let[r]=n;return z.isElement(r)?r:null},getSelectedElems(e){let t=[],n=X.getSelectedVoidNode(e);n&&t.push(n);let r=U.nodes(e,{universal:!0});for(let e of r){let[r]=e;z.isElement(r)&&r!==n&&t.push(r)}return t},getSelectedNodeByType(e,t){let n=X.getSelectedVoidNode(e);if(n&&this.checkNodeType(n,t))return n;let[r]=U.nodes(e,{match:e=>this.checkNodeType(e,t),universal:!0});return r==null?null:r[0]},getSelectedTextNode(e){let[t]=U.nodes(e,{match:e=>Zn.isText(e),universal:!0});return t==null?null:t[0]},isNodeSelected(e,t){if(X.getSelectedVoidNode(e)===t)return!0;let[n]=U.nodes(e,{match:e=>e===t,universal:!0});if(n==null)return!1;let[r]=n;return r===t},isSelectionAtLineEnd(e,t){let{selection:n}=e;return n?U.isEnd(e,n.anchor,t)||U.isEnd(e,n.focus,t):!1},getTextarea(e){let t=Oa.get(e);if(t==null)throw Error(`Cannot find textarea instance by editor`);return t},getToolbar(e){return ja.get(e)||null},getHoverbar(e){return Na.get(e)||null},normalizeContent(e){e.children.forEach((t,n)=>{e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength(e){let{maxLength:t,onMaxLength:n}=e.getConfig();if(typeof t!=`number`||t<=0)return 1/0;let r=t-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,``).length;return r<=0&&n&&n(e),r},cleanExposedTexNodeInSelectionBlock(e){let{$textArea:t}=X.getTextarea(e),n=t==null?void 0:t[0].childNodes;if(n)for(let e of Array.from(n))if(cs(e))e.remove();else break;let r=U.nodes(e,{match:t=>!!(z.isElement(t)&&!e.isInline(t)),universal:!0});for(let t of r)if(t!=null){let n=t[0];if(!X.hasDOMNodeBySlateNode(e,n))continue;_s(X.toDOMNode(e,n),(e,t)=>{let n=Y(t);n.attr(`data-slate-string`)||n.attr(`data-slate-zero-width`)||n.attr(`data-w-e-reserve`)||t.removeChild(e)})}},isLastNode(e,t){let n=e.children||[];return n[n.length-1]===t},genEmptyParagraph(){return{type:`paragraph`,children:[{text:``}]}},isSelectedVoidNode(e){return X.getSelectedVoidNode(e)!=null},isSelectedEmptyParagraph(e){let{selection:t}=e;if(t==null||R.isExpanded(t))return!1;let n=[t.focus.path[0]];if(!U.hasPath(e,n))return!1;let[r]=U.node(e,n);if(!z.isElement(r)||r.type!==`paragraph`)return!1;let{children:i}=r;if(i.length!==1)return!1;let{text:a}=i[0];if(a===``)return!0},isEmptyPath(e,t){let n=U.node(e,t);if(n==null)return!1;let[r]=n,{children:i}=r;if(i.length===1){let{text:e}=i[0];if(e===``)return!0}return!1}};function hc(e,t,n){let r=n.isInline(e)?`span`:`div`;return`<${r}>${t}</${r}>`}function gc(e){return tc[e]||hc}const _c=/^[A-Za-z_:-][A-Za-z0-9_:.-]*$/;function vc(e){return!e||!_c.test(e)?`data-w-e-id`:e}function yc(e,t,n){if(!e)return e;let r=e.match(/^<([A-Za-z][A-Za-z0-9-]*)([^>]*)>/);if(!r)return e;let[i,a,o=``]=r;if(RegExp(`\\s${t}=`).test(o))return e;let s=/\/\s*$/.test(o),c=o.replace(/\s*\/\s*$/,``);return`<${a}${c.trim()?` ${c.trim()}`:``} ${t}="${n}"${s?` /`:``}>`+e.slice(i.length)}function bc(e,t,n,r){if(!r.includeId)return e;let i=vc(r.idKey),a=X.findKey(n,t);return yc(e,i,Js(X.getNodeType(t),a.id))}function xc(e,t,n={}){let{type:r=``,children:i=[]}=e,a=U.isVoid(t,e),o=``;a||(o=i.map(e=>Ec(e,t,n)).join(``));let s=gc(r)(e,o,t),c=``;if(c=typeof s==`string`?s:s.html||``,a||Xs.forEach(n=>c=n(e,c,t)),c=bc(c,e,t,n),typeof s==`string`)return c;let{prefix:l=``,suffix:u=``}=s;return l&&(c=l+c),u&&(c+=u),c}var Sc=xc;function Cc(e,t,n={}){let{text:r}=e;if(r==null)throw Error(`Current node is not slate Text ${JSON.stringify(e)}`);let i=r;i=It(i);let a=X.getParentsNodes(t,e).some(e=>X.getNodeType(e)===`pre`);if(a||(i=i.replace(/\n\r|\r\n|\r|\n/g,`<br>`)),a&&(i=i.replace(/ /g,` `)),i===``){let t=X.getParentNode(null,e);if(t&&t.children.length===0)i=`<br>`;else return i}return Xs.forEach(n=>i=n(e,i,t)),i}var wc=Cc;function Tc(e,t,n={}){return z.isElement(e)?Sc(e,t,n):wc(e,t,n)}var Ec=Tc;const Dc=(e,t)=>{let n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Oc=(e,t,n)=>{let r=X.toDOMRange(e,t).getBoundingClientRect(),i=X.toDOMRange(e,n).getBoundingClientRect();return Dc(r,i)&&Dc(i,r)},kc=(e,t)=>{let n=U.range(e,R.end(t)),r=Array.from(U.positions(e,{at:t})),i=0,a=r.length,o=Math.floor(a/2);if(Oc(e,U.range(e,r[i]),n))return U.range(e,r[i],n);if(r.length<2)return U.range(e,r[r.length-1],n);for(;o!==r.length&&o!==i;)Oc(e,U.range(e,r[o]),n)?a=o:i=o,o=Math.floor((i+a)/2);return U.range(e,r[a],n)};D();const Ac=(e,t)=>{let n=[];for(let[r,i]of U.levels(e,{at:t})){let t=X.findKey(e,r);n.push([i,t])}return n};function jc(e,t){if(Zn.isText(t)){e.insertNode(t);return}if(z.isElement(t))if(e.isInline(t))e.insertNode(t),t.type===`link`&&e.insertFragment([{text:``}]);else{let{selection:n}=e;if(!n)return;let r=[n.focus.path[0]];if(X.isSelectedEmptyParagraph(e)){K.removeNodes(e,{at:r}),K.insertNodes(e,t,{at:r}),K.select(e,U.end(e,r));return}let i=L.next(r);K.insertNodes(e,t,{at:i}),K.select(e,U.end(e,i))}}function Mc(e){let{selection:t}=e;if(t==null||R.isCollapsed(t))return!1;let[n,r]=R.edges(t),[i,a]=U.edges(e,[]);return G.equals(n,i)&&G.equals(r,a)}function Nc(e){let t=e.children[0];if(e.children.length!==1||!z.isElement(t)||t.type===`paragraph`&&B.string(t)===``||B.string(t)!==``)return;let n=[{type:`paragraph`,children:[{text:``}]}];U.withoutNormalizing(e,()=>{K.removeNodes(e,{at:[0]}),K.insertNodes(e,n,{at:[0]})})}function Pc(e){let t=[{type:`paragraph`,children:[{text:``}]}];U.withoutNormalizing(e,()=>{for(let t=e.children.length-1;t>=0;--t)K.removeNodes(e,{at:[t]});K.insertNodes(e,t,{at:[0]})})}const Fc=e=>{let t=e,{onChange:n,insertText:r,apply:i,deleteBackward:a,deleteFragment:o}=t;return t.insertText=e=>{let{readOnly:n}=t.getConfig();n||r(e)},t.apply=e=>{let n=[];switch(e.type){case`insert_text`:case`remove_text`:case`set_node`:case`split_node`:n.push(...Ac(t,e.path));break;case`insert_node`:case`remove_node`:n.push(...Ac(t,L.parent(e.path)));break;case`merge_node`:{let r=L.previous(e.path);n.push(...Ac(t,r));break}case`move_node`:{let r=L.common(L.parent(e.path),L.parent(e.newPath));n.push(...Ac(t,r));break}case`set_selection`:var r;if(!((r=e.newProperties)==null||(r=r.focus)==null)&&r.path){var a,o;n.push(...Ac(t,(a=e.newProperties)==null||(a=a.focus)==null?void 0:a.path)),n.push(...Ac(t,(o=e.properties)==null||(o=o.focus)==null?void 0:o.path))}break;default:}i(e);for(let[e,r]of n){let[n]=U.node(t,e);Ya.set(n,r),`type`in n&&(Va.has(n)&&Va.delete(n),Ha.has(n)&&Ha.delete(n))}},t.deleteBackward=n=>{if(n!==`line`)return a(n);if(e.selection&&R.isCollapsed(e.selection)){let n=U.above(e,{match:t=>z.isElement(t)&&U.isBlock(e,t),at:e.selection});if(n){let[,r]=n,i=kc(t,U.range(e,r,e.selection.anchor));R.isCollapsed(i)||K.delete(e,{at:i})}}},t.deleteFragment=e=>{let n=Mc(t);o(e),n&&(Pc(t),t.children.length>0&&K.select(t,U.start(t,[])))},t.onChange=()=>{let{selection:e}=t;e!=null&&Qa.set(t,e),t.emit(q.CHANGE),n()},t.handleTab=()=>{t.insertText(` `)},t.getHtml=()=>{let{children:e=[]}=t,{skipCacheTypes:n=[`list-item`]}=t.getConfig();return ec(e.map(e=>{let r=X.getNodeType(e);if(n.includes(r))return Ec(e,t);let i=Ha.get(e);if(i)return i.toString();let a=Ec(e,t);return Ha.set(e,a),a}),e,t).join(``)},t.getHtmlWithId=(e=`data-w-e-id`)=>{let{children:n=[]}=t;return ec(n.map(n=>Ec(n,t,{includeId:!0,idKey:e})),n,t,{includeId:!0,idKey:e}).join(``)},t.getText=()=>{let{children:e=[]}=t;return e.map(e=>B.string(e)).join(`
|
|
22
|
+
`)},t.getSelectionText=()=>{let{selection:n}=t;return n==null?``:U.string(e,n)},t.getElemsByType=(e,n=!1)=>{let r=[],i=U.nodes(t,{at:[],universal:!0});for(let a of i){let[i]=a;if(z.isElement(i)&&(n?i.type.indexOf(e)>=0:i.type===e)){let e=X.findKey(t,i),n=Js(i.type,e.id);r.push(E(E({},i),{},{id:n}))}}return r},t.getElemsByTypePrefix=e=>t.getElemsByType(e,!0),t.isEmpty=()=>{let{children:e=[]}=t;if(e.length>1)return!1;let n=e[0];if(n==null)return!0;if(!z.isElement(n)||n.type!==`paragraph`)return!1;let{children:r=[]}=n;if(r.length>1)return!1;let i=r[0];return i==null||Zn.isText(i)&&i.text===``},t.clear=()=>{let e=[{type:`paragraph`,children:[{text:``}]}];for(let e=t.children.length-1;e>=0;--e)K.removeNodes(t,{at:[e]});if(t.children.length===0){K.insertNodes(t,e);return}Nc(t)},t.getParentNode=e=>X.getParentNode(t,e),t.dangerouslyInsertHtml=(e=``,n=!1)=>{if(!e)return;let r=document.createElement(`div`);r.innerHTML=e;let i=Array.from(r.childNodes);if(i=i.filter(e=>{let{nodeName:t}=e;return cs(e)?!0:os(e)?!io.has(t.toLowerCase()):!1}),i.length===0)return;let{selection:a}=t;if(a==null)return;let o=null;if(X.isSelectedEmptyParagraph(t)&&!n){let{focus:e}=a;o=[e.path[0]]}r.setAttribute(`hidden`,`true`),document.body.appendChild(r);let s=0;i.forEach((e,n)=>{let{nodeName:r,textContent:a=``}=e;if(cs(e)){if(!a||!a.trim())return;t.insertNode({text:a});return}if(r===`BR`){t.insertText(`
|
|
23
|
+
`);return}let o=e,c=!1;if(xs.includes(r.toLowerCase()))c=!0;else for(let e in Es)if(o.matches(e)){c=!0;break}if(c){let e=Vs(Y(o),t),n=Array.isArray(e)?e:[e];if(n.forEach(e=>jc(t,e)),s+=n.length,X.isSelectedVoidNode(t)&&t.move(1),n.some(e=>z.isElement(e)?t.isInline(e)?!0:e.children.some(e=>z.isElement(e)&&t.isInline(e)):!1)&&t.selection){let e=U.nodes(t,{at:t.selection,match:e=>z.isElement(e)&&t.isInline(e),universal:!0}).next().value;if(e){let[,n]=e,r=L.next(n);U.hasPath(t,r)?K.select(t,{anchor:{path:r,offset:0},focus:{path:r,offset:0}}):t.move(1)}}return}let l=window.getComputedStyle(o).display;if(!X.isSelectedEmptyParagraph(t)&&l.indexOf(`inline`)<0){if(n>=1){let e=i[n-1];ts(e)&&t.insertBreak()}t.insertBreak()}t.dangerouslyInsertHtml(o.innerHTML,!0)}),s&&o&&X.isEmptyPath(t,o)&&K.removeNodes(t,{at:o}),r.remove()},t.setHtml=(e=``)=>{let n=t.isDisabled(),r=t.isFocused(),i=JSON.stringify(t.selection);t.enable(),Qa.delete(t),t.focus(),t.clear();let a=Ks(t,e==null?``:e);if(K.insertFragment(t,a),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{let e=JSON.parse(i);R.isRange(e)&&X.hasRange(t,e)?t.select(e):t.select(U.start(t,[]))}catch(e){t.select(U.start(t,[]))}},t};let Ic=1;const Lc=e=>{let t=e;return t.id=`wangEditor-${Ic}`,Ic+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=e=>{if(X.toDOMNode(t,t).focus({preventScroll:!0}),Za.set(t,!0),e){let e=U.end(t,[]);K.select(t,e)}else{let e=Qa.get(t);e?K.select(t,e):K.select(t,U.start(t,[]))}},t.isFocused=()=>!!Za.get(t),t.blur=()=>{X.toDOMNode(t,t).blur(),K.deselect(t),Za.set(t,!1)},t.updateView=()=>{X.getTextarea(t).changeViewState();let e=X.getToolbar(t);e&&e.changeToolbarState();let n=X.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=()=>{if(t.isDestroyed)return;let e=X.getTextarea(t);e.destroy(),Oa.delete(t),ka.delete(e);let n=X.getToolbar(t);n&&(n.destroy(),ja.delete(t),Aa.delete(n));let r=X.getHoverbar(t);r&&(r.destroy(),Na.delete(t),Ma.delete(r)),t.isDestroyed=!0,t.emit(q.DESTROYED)},t.scrollToElem=e=>{let{scroll:n}=t.getConfig();if(!n){let e=`编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能`;e+=`
|
|
24
|
+
You has disabled editor scroll, please do this yourself`,console.warn(e);return}let r=Y(`#${e}`);if(r.length===0)return;let i=r[0];if(!X.hasDOMNode(t,i)){let t=`Element (found by id is '${e}') is not in editor DOM`;t+=`\n 通过 id '${e}' 找到的 element 不在 editor DOM 之内`,console.error(t,i);return}let{$textAreaContainer:a,$scroll:o}=X.getTextarea(t),{top:s}=r.offset(),{top:c}=a.offset();o[0].scrollBy({top:s-c,behavior:`smooth`})},t.showProgressBar=e=>{e<1||X.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=()=>{let e=Fa.get(t);e!=null&&e.forEach(e=>e.hide())},t.enable=()=>{let e=t.getConfig();e.readOnly=!1,t.updateView()},t.disable=()=>{let e=t.getConfig();e.readOnly=!0,t.updateView()},t.isDisabled=()=>t.getConfig().readOnly,t.toDOMNode=e=>X.toDOMNode(t,e),t.fullScreen=()=>{if(t.isFullScreen)return;let e=null,n=X.getToolbar(t);n&&(e=n.$box);let r=X.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0]){let e=`Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent`;throw e+=`
|
|
25
|
+
不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致`,Error(e)}r.addClass(`w-e-full-screen-container`);let i=r.css(`z-index`);r.attr(`data-z-index`,i.toString()),t.isFullScreen=!0,t.emit(q.FULLSCREEN)},t.unFullScreen=()=>{if(!t.isFullScreen)return;let e=X.getTextarea(t).$box.parent();setTimeout(()=>{e.removeClass(`w-e-full-screen-container`),t.isFullScreen=!1,t.emit(q.UNFULLSCREEN)},200)},t.getEditableContainer=()=>X.getTextarea(t).$textAreaContainer[0],t};var Rc=s(((e,t)=>{var n=void 0;t.exports=function(e){return e!==n&&e!==null}})),zc=s(((e,t)=>{var n=Rc(),r={object:!0,function:!0,undefined:!0};t.exports=function(e){return n(e)?hasOwnProperty.call(r,typeof e):!1}})),Bc=s(((e,t)=>{var n=zc();t.exports=function(e){if(!n(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch(e){return!1}}})),Vc=s(((e,t)=>{var n=Bc();t.exports=function(e){if(typeof e!=`function`||!hasOwnProperty.call(e,`length`))return!1;try{if(typeof e.length!=`number`||typeof e.call!=`function`||typeof e.apply!=`function`)return!1}catch(e){return!1}return!n(e)}})),Hc=s(((e,t)=>{var n=Vc(),r=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!(!n(e)||r.test(i.call(e)))}})),Uc=s(((e,t)=>{t.exports=function(){var e=Object.assign,t;return typeof e==`function`?(t={foo:`raz`},e(t,{bar:`dwa`},{trzy:`trzy`}),t.foo+t.bar+t.trzy===`razdwatrzy`):!1}})),Wc=s(((e,t)=>{t.exports=function(){try{return!0}catch(e){return!1}}})),Gc=s(((e,t)=>{t.exports=function(){}})),Kc=s(((e,t)=>{var n=Gc()();t.exports=function(e){return e!==n&&e!==null}})),qc=s(((e,t)=>{var n=Kc(),r=Object.keys;t.exports=function(e){return r(n(e)?Object(e):e)}})),Jc=s(((e,t)=>{t.exports=Wc()()?Object.keys:qc()})),Yc=s(((e,t)=>{var n=Kc();t.exports=function(e){if(!n(e))throw TypeError(`Cannot use null or undefined`);return e}})),Xc=s(((e,t)=>{var n=Jc(),r=Yc(),i=Math.max;t.exports=function(e,t){var a,o,s=i(arguments.length,2),c;for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(e){a||(a=e)}},o=1;o<s;++o)t=arguments[o],n(t).forEach(c);if(a!==void 0)throw a;return e}})),Zc=s(((e,t)=>{t.exports=Uc()()?Object.assign:Xc()})),Qc=s(((e,t)=>{var n=Kc(),r=Array.prototype.forEach,i=Object.create,a=function(e,t){for(var n in e)t[n]=e[n]};t.exports=function(e){var t=i(null);return r.call(arguments,function(e){n(e)&&a(Object(e),t)}),t}})),$c=s(((e,t)=>{var n=`razdwatrzy`;t.exports=function(){return typeof n.contains==`function`?n.contains(`dwa`)===!0&&n.contains(`foo`)===!1:!1}})),el=s(((e,t)=>{var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}})),tl=s(((e,t)=>{t.exports=$c()()?String.prototype.contains:el()})),nl=s(((e,t)=>{var n=Rc(),r=Hc(),i=Zc(),a=Qc(),o=tl(),s=t.exports=function(e,t){var r,s,c,l,u;return arguments.length<2||typeof e!=`string`?(l=t,t=e,e=null):l=arguments[2],n(e)?(r=o.call(e,`c`),s=o.call(e,`e`),c=o.call(e,`w`)):(r=c=!0,s=!1),u={value:t,configurable:r,enumerable:s,writable:c},l?i(a(l),u):u};s.gs=function(e,t,s){var c,l,u,d;return typeof e==`string`?u=arguments[3]:(u=s,s=t,t=e,e=null),n(t)?r(t)?n(s)?r(s)||(u=s,s=void 0):s=void 0:(u=t,t=s=void 0):t=void 0,n(e)?(c=o.call(e,`c`),l=o.call(e,`e`)):(c=!0,l=!1),d={get:t,set:s,configurable:c,enumerable:l},u?i(a(u),d):d}})),rl=s(((e,t)=>{t.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function`);return e}})),il=u(s(((e,t)=>{var n=nl(),r=rl(),i=Function.prototype.apply,a=Function.prototype.call,o=Object.create,s=Object.defineProperty,c=Object.defineProperties,l=Object.prototype.hasOwnProperty,u={configurable:!0,enumerable:!1,writable:!0},d=function(e,t){var n;return r(t),l.call(this,`__ee__`)?n=this.__ee__:(n=u.value=o(null),s(this,`__ee__`,u),u.value=null),n[e]?typeof n[e]==`object`?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},f=function(e,t){var n,a;return r(t),a=this,d.call(this,e,n=function(){p.call(a,e,n),i.call(t,this,arguments)}),n.__eeOnceListener__=t,this},p=function(e,t){var n,i,a,o;if(r(t),!l.call(this,`__ee__`)||(n=this.__ee__,!n[e]))return this;if(i=n[e],typeof i==`object`)for(o=0;a=i[o];++o)(a===t||a.__eeOnceListener__===t)&&(i.length===2?n[e]=i[o?0:1]:i.splice(o,1));else (i===t||i.__eeOnceListener__===t)&&delete n[e];return this},m=function(e){var t,n,r,o,s;if(l.call(this,`__ee__`)&&(o=this.__ee__[e],o))if(typeof o==`object`){for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)i.call(r,this,s)}else switch(arguments.length){case 1:a.call(o,this);break;case 2:a.call(o,this,arguments[1]);break;case 3:a.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];i.call(o,this,s)}},h={on:d,once:f,off:p,emit:m},g={on:n(d),once:n(f),off:n(p),emit:n(m)},_=c({},g);t.exports=e=function(e){return e==null?o(_):c(Object(e),g)},e.methods=h}))(),1);function al(e){let t=$a.get(e);return t==null&&(t=(0,il.default)(),$a.set(e,t)),t}const ol=new WeakMap;function sl(e,t){let n=ol.get(e);n==null&&(n=new Set,ol.set(e,n)),n.add(t)}function cl(e){return ol.get(e)||new Set}function ll(e){ol.set(e,new Set)}const ul=e=>{let t=e;return t.on=(e,n)=>{let r=al(t);if(r.on(e,n),e===`destroyed`&&sl(t,n),e!==`destroyed`){let i=()=>r.off(e,n);r.on(`destroyed`,i),sl(t,i)}},t.once=(e,n)=>{al(t).once(e,n)},t.off=(e,n)=>{al(t).off(e,n)},t.emit=(e,...n)=>{let r=al(t);r.emit(e,...n),e===`destroyed`&&(cl(t).forEach(e=>r.off(`destroyed`,e)),ll(t))},t};function dl(e){return e.replace(/\n\r|\r\n|\r/g,`
|
|
26
|
+
`).split(`
|
|
27
|
+
`).map(e=>({type:`paragraph`,children:[{text:e}]}))}const fl=e=>{let t=e;return t.setFragmentData=e=>{let{selection:n}=t;if(!n)return;let[r,i]=R.edges(n),a=U.void(t,{at:r.path}),o=U.void(t,{at:i.path});if(R.isCollapsed(n)&&!a)return;let s=X.toDOMRange(t,n),c=s.cloneContents(),l=c.childNodes[0];if(c.childNodes.forEach(e=>{e.textContent&&e.textContent.trim()!==``&&(l=e)}),o){let[e]=o,n=s.cloneRange(),r=X.toDOMNode(t,e);n.setEndAfter(r),c=n.cloneContents()}if(a&&(l=c.querySelector(`[data-slate-spacer]`)),Array.from(c.querySelectorAll(`[data-slate-zero-width]`)).forEach(e=>{e.textContent=e.getAttribute(`data-slate-zero-width`)===`n`?`
|
|
28
|
+
`:``}),cs(l)){let e=l.ownerDocument.createElement(`span`);e.style.whiteSpace=`pre`,e.appendChild(l),c.appendChild(e),l=e}let u=t.getFragment(),d=JSON.stringify(u),f=window.btoa(encodeURIComponent(d));l.setAttribute(`data-slate-fragment`,f),e.setData(`application/x-slate-fragment`,f);let p=c.ownerDocument.createElement(`div`);return p.appendChild(c),p.setAttribute(`hidden`,`true`),c.ownerDocument.body.appendChild(p),e.setData(`text/html`,p.innerHTML),e.setData(`text/plain`,hs(p)),c.ownerDocument.body.removeChild(p),e},t.insertData=e=>{let n=e.getData(`application/x-slate-fragment`);if(n){let e=decodeURIComponent(window.atob(n)),r=JSON.parse(e);t.insertFragment(r);return}let r=e.getData(`text/plain`),i=e.getData(`text/html`);if(i){let{sanitizeHtml:e}=t.getConfig();t.dangerouslyInsertHtml(e?e(i):i);return}if(r){if(!/[\r\n]/.test(r)){t.insertText(r);return}let e=dl(r);t.insertFragment(e)}},t};var pl={isHistory(e){return fn(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||dn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||dn.isOperationList(e.undos[0].operations))}},ml=new WeakMap,hl=new WeakMap,gl=new WeakMap,_l={isHistoryEditor(e){return pl.isHistory(e.history)&&U.isEditor(e)},isMerging(e){return hl.get(e)},isSplittingOnce(e){return gl.get(e)},setSplittingOnce(e,t){gl.set(e,t)},isSaving(e){return ml.get(e)},redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=_l.isMerging(e);hl.set(e,!0),t(),hl.set(e,n)},withNewBatch(e,t){var n=_l.isMerging(e);hl.set(e,!0),gl.set(e,!0),t(),hl.set(e,n),gl.delete(e)},withoutMerging(e,t){var n=_l.isMerging(e);hl.set(e,!1),t(),hl.set(e,n)},withoutSaving(e,t){var n=_l.isSaving(e);ml.set(e,!1);try{t()}finally{ml.set(e,n)}}},vl=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&K.setSelection(t,r.selectionBefore),_l.withoutSaving(t,()=>{U.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory(`undos`,r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];_l.withoutSaving(t,()=>{U.withoutNormalizing(t,()=>{for(var e of r.operations.map(dn.inverse).reverse())t.apply(e);r.selectionBefore&&K.setSelection(t,r.selectionBefore)})}),t.writeHistory(`redos`,r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:i}=t,{undos:a}=i,o=a[a.length-1],s=o&&o.operations[o.operations.length-1],c=_l.isSaving(t),l=_l.isMerging(t);if(c==null&&(c=bl(e)),c){if(l==null&&(l=o==null?!1:r.includes(s)?!0:yl(e,s)),_l.isSplittingOnce(t)&&(l=!1,_l.setSplittingOnce(t,void 0)),o&&l)o.operations.push(e);else{var u={operations:[e],selectionBefore:t.selection};t.writeHistory(`undos`,u)}for(;a.length>100;)a.shift();i.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},yl=(e,t)=>!!(t&&e.type===`insert_text`&&t.type===`insert_text`&&e.offset===t.offset+t.text.length&&L.equals(e.path,t.path)||t&&e.type===`remove_text`&&t.type===`remove_text`&&e.offset+e.text.length===t.offset&&L.equals(e.path,t.path)),bl=(e,t)=>e.type!==`set_selection`;const xl=e=>{let t=vl(e);return t.clearHistory=()=>{t.history.undos=[],t.history.redos=[]},t};function Sl(e){return e.replace(/\n\r|\r\n|\r|\n/g,``).length}function Cl(e,t){if(t<=0)return``;let n=t,r=``;for(let t of e){if(/\r|\n/.test(t)){r+=t;continue}if(n<=0)break;r+=t,--n}return r}function wl(e,t){if(t<=0)return``;let n=document.createElement(`div`);n.innerHTML=e;let r=e=>{e.forEach(e=>e.remove())},i=e=>{let n=Array.from(e.childNodes);for(let e=0;e<n.length;e+=1){let a=n[e];if(cs(a)){let i=a.textContent||``,o=Sl(i);if(o<=t){t-=o;continue}return a.textContent=Cl(i,t),t=0,r(n.slice(e+1)),!1}if(os(a)){if(io.has(a.nodeName.toLowerCase())){a.remove();continue}if(!i(a))return r(n.slice(e+1)),!1;continue}a.remove()}return t>0};return i(n),n.innerHTML}const Tl=e=>{let t=e,{insertText:n,insertNode:r,insertFragment:i,dangerouslyInsertHtml:a}=t;return t.insertText=e=>{let{maxLength:r}=t.getConfig();if(!r){n(e);return}let i=X.getLeftLengthOfMaxLength(t);if(!(i<=0)){if(i<e.length){n(e.slice(0,i));return}n(e)}},t.insertNode=e=>{let{maxLength:n}=t.getConfig();if(!n){r(e);return}let i=X.getLeftLengthOfMaxLength(t);i<=0||i<B.string(e).length||r(e)},t.insertFragment=e=>{let{maxLength:n}=t.getConfig();if(!n){i(e);return}if(e.length>0){let n=e[0];if(X.getLeftLengthOfMaxLength(t)<B.string(n).length)return;i([n]);for(let n=1;n<e.length;n+=1)t.insertNode(e[n])}},t.dangerouslyInsertHtml=(e=``,n=!1)=>{if(!e)return;let{maxLength:r}=t.getConfig();if(!r){a(e,n);return}let i=X.getLeftLengthOfMaxLength(t);if(i<=0)return;let o=wl(e,i);o&&a(o,n)},t};function El(e){return e<0?0:e}function Dl(e){let t=X.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),{top:i,left:a}=t.offset();return{top:i,left:a,width:n,height:r}}function Ol(e){let t={top:`0`,left:`0`},{selection:n}=e;if(n==null)return t;let r=Dl(e);if(r==null)return t;let{top:i,left:a,width:o,height:s}=r,c=X.toDOMRange(e,n).getClientRects(),l=c?c[0]:null;if(l==null)return t;let{top:u,left:d}=l,f={},p=u-i,m=d-a;if(m>o/2?f.right=`${El(o-m)+5}px`:f.left=`${El(m)+5}px`,p>s/2)f.bottom=`${El(s-p)+5}px`;else{let e=c[c.length-1],t=e.top-i+e.height;t<0&&(t=0),f.top=`${t+5}px`}return f}function kl(e,t,n=`modal`){let r={top:`0`,left:`0`},{selection:i}=e;if(i==null)return r;let a=z.isElement(t)&&e.isVoid(t),o=z.isElement(t)&&e.isInline(t),s=Ja.get(t);if(s==null)return r;let{top:c,left:l,height:u,width:d}=s.getBoundingClientRect();if(a){let e=gs(s);if(e!=null){let{top:t,height:n}=e.getBoundingClientRect();c=t,u=n}}let f=Dl(e);if(f==null)return r;let{top:p,left:m,width:h,height:g}=f,_={},v=c-p,y=l-m;if(n===`bar`)return _.left=`${El(y)}px`,v>40?_.bottom=`${El(g-v)+5}px`:_.top=`${v+u+5}px`,_;if(n===`modal`){if(a?o?y>(h-d)/2?_.right=`${El(h-y)+5}px`:_.left=`${El(y+d)+5}px`:_.left=`20px`:_.left=`${El(y)}px`,a){let e=v;e<0&&(e=0),_.top=`${e}px`}else if(v>(g-u)/2)_.bottom=`${El(g-v)+5}px`;else{let e=v+u;e<0&&(e=0),_.top=`${e+5}px`}return _}throw Error(`type '${n}' is invalid`)}function Al(e,t){Ft(()=>{let n=Dl(e);if(n==null)return;let{top:r,left:i,width:a,height:o}=n,{top:s,left:c}=t.offset(),l=t.width(),u=t.height(),d=s-r,f=c-i,p=t.attr(`style`);if(p.indexOf(`top`)>=0){let e=d+u-o;if(e>0){let n=t.css(`top`),r=parseInt(n.toString(),10)-e;r<0&&(r=0),t.css(`top`,`${r}px`)}}if(p.indexOf(`bottom`)>=0&&s<0){let e=t.css(`bottom`),n=parseInt(e.toString(),10)-Math.abs(s);t.css(`bottom`,`${n}px`)}if(p.indexOf(`left`)>=0){let e=f+l-a;if(e>0){let n=t.css(`left`),r=parseInt(n.toString(),10)-e;r<0&&(r=0),t.css(`left`,`${r}px`)}}if(p.indexOf(`right`)>=0&&f<0){let e=t.css(`right`),n=parseInt(e.toString(),10)-Math.abs(f);t.css(`right`,`${n}px`)}})}const jl=e=>{let t=e,{select:n,deselect:r,move:i}=t;return t.select=e=>{n(e)},t.deselect=()=>{let{selection:e}=t,n=X.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&X.hasDOMNode(t,n.anchorNode)&&X.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=(e,t=!1)=>{if(typeof e!=`number`){i(e);return}e&&(e<0||i({distance:e,unit:`character`,reverse:t}))},t.moveReverse=e=>{t.move(e,!0)},t.restoreSelection=()=>{let e=Qa.get(t);e!=null&&(t.focus(),n(e))},t.getSelectionPosition=()=>Ol(t),t.getNodePosition=e=>kl(t,e),t.isSelectedAll=()=>{let{selection:e}=t;if(e==null)return!1;let[n,r]=R.edges(e),[i,a]=U.edges(t,[]);return!!(G.equals(n,i)&&G.equals(r,a))},t.selectAll=()=>{n({anchor:U.start(t,[]),focus:U.end(t,[])})},t};var Ml=u(s(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(x(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&p.call(e)==i}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=_}))(),1);D();const Z=e=>typeof e==`string`,Nl=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Pl=e=>e==null?``:``+e,Fl=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Il=/###/g,Ll=e=>e&&e.indexOf(`###`)>-1?e.replace(Il,`.`):e,Rl=e=>!e||Z(e),zl=(e,t,n)=>{let r=Z(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Rl(e))return{};let t=Ll(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Rl(e)?{}:{obj:e,k:Ll(r[i])}},Bl=(e,t,n)=>{let{obj:r,k:i}=zl(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=zl(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=zl(e,o,Object),s&&s.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Vl=(e,t,n,r)=>{let{obj:i,k:a}=zl(e,t,Object);i[a]=i[a]||[],i[a].push(n)},Hl=(e,t)=>{let{obj:n,k:r}=zl(e,t);if(n)return n[r]},Ul=(e,t,n)=>{let r=Hl(e,n);return r===void 0?Hl(t,n):r},Wl=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Z(e[r])||e[r]instanceof String||Z(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Wl(e[r],t[r],n):e[r]=t[r]);return e},Gl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`);var Kl={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`};const ql=e=>Z(e)?e.replace(/[&<>"'\/]/g,e=>Kl[e]):e;var Jl=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}};const Yl=[` `,`,`,`?`,`!`,`;`],Xl=new Jl(20),Zl=(e,t,n)=>{t=t||``,n=n||``;let r=Yl.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Xl.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Ql=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`.`;if(!e)return;if(e[t])return e[t];let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},$l=e=>e&&e.replace(`_`,`-`),eu={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};var tu=new class e{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||`i18next:`,this.logger=e||eu,this.options=t,this.debug=t.debug}log(){var e=[...arguments];return this.forward(e,`log`,``,!0)}warn(){var e=[...arguments];return this.forward(e,`warn`,``,!0)}error(){var e=[...arguments];return this.forward(e,`error`,``)}deprecate(){var e=[...arguments];return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(Z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,E(E({},{prefix:`${this.prefix}:${t}:`}),this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},nu=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){var t=[...arguments].slice(1);this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[n,r]=e;for(let e=0;e<r;e++)n(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(n=>{let[r,i]=n;for(let n=0;n<i;n++)r.apply(r,[e,...t])})}},ru=class extends nu{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:[`translation`],defaultNS:`translation`};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Z(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Hl(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Z(n)?s:Ql(this.data&&this.data[e]&&this.data[e][t],n,i)}addResource(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Bl(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let r in n)(Z(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Hl(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Wl(s,n,i):s=E(E({},s),n),Bl(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI===`v1`?E(E({},{}),this.getResource(e,t)):this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},iu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))}),t}};const au={};var ou=class e extends nu{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Fl([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=tu.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let n=this.resolve(e,t);return n&&n.res!==void 0}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Zl(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Z(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Z(i)?[i]:i}}translate(t,n,r){if(typeof n!=`object`&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n==`object`&&(n=E({},n)),n||(n={}),t==null)return``;Array.isArray(t)||(t=[String(t)]);let i=n.returnDetails===void 0?this.options.returnDetails:n.returnDetails,a=n.keySeparator===void 0?this.options.keySeparator:n.keySeparator,{key:o,namespaces:s}=this.extractFromKey(t[t.length-1],n),c=s[s.length-1],l=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&l.toLowerCase()===`cimode`){if(u){let e=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${e}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}let d=this.resolve(t,n),f=d&&d.res,p=d&&d.usedKey||o,m=d&&d.exactUsedKey||o,h=Object.prototype.toString.apply(f),g=[`[object Number]`,`[object Function]`,`[object RegExp]`],_=n.joinArrays===void 0?this.options.joinArrays:n.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!Z(f)&&typeof f!=`boolean`&&typeof f!=`number`;if(v&&f&&y&&g.indexOf(h)<0&&!(Z(_)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,E(E({},n),{},{ns:s})):`key '${o} (${this.language})' returned an object instead of string.`;return i?(d.res=e,d.usedParams=this.getUsedParamsDetails(n),d):e}if(a){let e=Array.isArray(f),t=e?[]:{},r=e?m:p;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${a}${e}`;t[e]=this.translate(i,E(E({},n),{joinArrays:!1,ns:s})),t[e]===i&&(t[e]=f[e])}f=t}}else if(v&&Z(_)&&Array.isArray(f))f=f.join(_),f&&(f=this.extendTranslation(f,t,n,r));else{let i=!1,s=!1,u=n.count!==void 0&&!Z(n.count),p=e.hasDefaultValue(n),m=u?this.pluralResolver.getSuffix(l,n.count,n):``,h=n.ordinal&&u?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):``,g=u&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),_=g&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${m}`]||n[`defaultValue${h}`]||n.defaultValue;!this.isValidLookup(f)&&p&&(i=!0,f=_),this.isValidLookup(f)||(s=!0,f=o);let v=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:f,y=p&&_!==f&&this.options.updateMissing;if(s||i||y){if(this.logger.log(y?`updateKey`:`missingKey`,l,c,o,y?_:f),a){let e=this.resolve(o,E(E({},n),{},{keySeparator:!1}));e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=p&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,i,y,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,c,t,i,y,n),this.emit(`missingKey`,e,c,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);g&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],o+t,n[`defaultValue${t}`]||_)})}):r(e,o,_))}f=this.extendTranslation(f,t,n,d,r),s&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(s||i)&&this.options.parseMissingKeyHandler&&(f=this.options.compatibilityAPI===`v1`?this.options.parseMissingKeyHandler(f):this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,i?f:void 0))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(e,t,n,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,E(E({},this.options.interpolation.defaultVariables),n),n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(E(E({},n),{interpolation:E(E({},this.options.interpolation),n.interpolation)}));let o=Z(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=n.replace&&!Z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=E(E({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),o){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;s<r&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!==`v1`&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){var e=[...arguments];return i&&i[0]===e[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):a.translate(...e,t)},n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,s=Z(o)?[o]:o;return e!=null&&s&&s.length&&n.applyPostProcessor!==!1&&(e=iu.handle(s,e,t,this.options&&this.options.postProcessPassResolved?E({i18nResolved:E(E({},r),{},{usedParams:this.getUsedParamsDetails(n)})},n):n,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,r,i,a,o;return Z(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Z(t.count),d=u&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),f=t.context!==void 0&&(Z(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!au[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(au[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(o.push(c+e),t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator}${t.context}`;o.push(r),u&&(o.push(r+e),t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Z(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r=E(E({},this.options.interpolation.defaultVariables),r)),!n){r=E({},r);for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}};const su=e=>e.charAt(0).toUpperCase()+e.slice(1);var cu=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=tu.create(`languageUtils`)}getScriptPartFromCode(e){if(e=$l(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=$l(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Z(e)&&e.indexOf(`-`)>-1){if(typeof Intl<`u`&&Intl.getCanonicalLocales!==void 0)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}let t=[`hans`,`hant`,`latn`,`cyrl`,`cans`,`mong`,`arab`],n=e.split(`-`);return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=su(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!==`sgn`&&n[2].length===2&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=su(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=su(n[2].toLowerCase()))),n.join(`-`)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(e.indexOf(`-`)<0&&n.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&n.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===n||e.indexOf(n)===0&&n.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Z(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Z(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Z(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}};let lu=[{lngs:[`ach`,`ak`,`am`,`arn`,`br`,`fil`,`gun`,`ln`,`mfe`,`mg`,`mi`,`oc`,`pt`,`pt-BR`,`tg`,`tl`,`ti`,`tr`,`uz`,`wa`],nr:[1,2],fc:1},{lngs:`af.an.ast.az.bg.bn.ca.da.de.dev.el.en.eo.es.et.eu.fi.fo.fur.fy.gl.gu.ha.hi.hu.hy.ia.it.kk.kn.ku.lb.mai.ml.mn.mr.nah.nap.nb.ne.nl.nn.no.nso.pa.pap.pms.ps.pt-PT.rm.sco.se.si.so.son.sq.sv.sw.ta.te.tk.ur.yo`.split(`.`),nr:[1,2],fc:2},{lngs:[`ay`,`bo`,`cgg`,`fa`,`ht`,`id`,`ja`,`jbo`,`ka`,`km`,`ko`,`ky`,`lo`,`ms`,`sah`,`su`,`th`,`tt`,`ug`,`vi`,`wo`,`zh`],nr:[1],fc:3},{lngs:[`be`,`bs`,`cnr`,`dz`,`hr`,`ru`,`sr`,`uk`],nr:[1,2,5],fc:4},{lngs:[`ar`],nr:[0,1,2,3,11,100],fc:5},{lngs:[`cs`,`sk`],nr:[1,2,5],fc:6},{lngs:[`csb`,`pl`],nr:[1,2,5],fc:7},{lngs:[`cy`],nr:[1,2,3,8],fc:8},{lngs:[`fr`],nr:[1,2],fc:9},{lngs:[`ga`],nr:[1,2,3,7,11],fc:10},{lngs:[`gd`],nr:[1,2,3,20],fc:11},{lngs:[`is`],nr:[1,2],fc:12},{lngs:[`jv`],nr:[0,1],fc:13},{lngs:[`kw`],nr:[1,2,3,4],fc:14},{lngs:[`lt`],nr:[1,2,10],fc:15},{lngs:[`lv`],nr:[1,2,0],fc:16},{lngs:[`mk`],nr:[1,2],fc:17},{lngs:[`mnk`],nr:[0,1,2],fc:18},{lngs:[`mt`],nr:[1,2,11,20],fc:19},{lngs:[`or`],nr:[2,1],fc:2},{lngs:[`ro`],nr:[1,2,20],fc:20},{lngs:[`sl`],nr:[5,1,2,3],fc:21},{lngs:[`he`,`iw`],nr:[1,2,20,21],fc:22}],uu={1:e=>Number(e>1),2:e=>Number(e!=1),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(e==1?0:e>=2&&e<=4?1:2),7:e=>Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(e==1?0:e==2?1:e!=8&&e!=11?2:3),9:e=>Number(e>=2),10:e=>Number(e==1?0:e==2?1:e<7?2:e<11?3:4),11:e=>Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(e!==0),14:e=>Number(e==1?0:e==2?1:e==3?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:e===0?2:1),17:e=>Number(e==1||e%10==1&&e%100!=11?0:1),18:e=>Number(e==0?0:e==1?1:2),19:e=>Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(e==1?0:e==0||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)};const du=[`v1`,`v2`,`v3`],fu=[`v4`],pu={zero:0,one:1,two:2,few:3,many:4,other:5},mu=()=>{let e={};return lu.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:uu[t.fc]}})}),e};var hu=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=tu.create(`pluralResolver`),(!this.options.compatibilityJSON||fu.includes(this.options.compatibilityJSON))&&(typeof Intl>`u`||!Intl.PluralRules)&&(this.options.compatibilityJSON=`v3`,this.logger.error(`Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.`)),this.rules=mu(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){let n=$l(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch(n){if(!e.match(/-|_/))return;let r=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(r,t)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>pu[e]-pu[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),``)}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r=`plural`:r===1&&(r=``));let i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON===`v1`?r===1?``:typeof r==`number`?`_plural_${r.toString()}`:i():this.options.compatibilityJSON===`v2`||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!du.includes(this.options.compatibilityJSON)}};const gu=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`.`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=Ul(e,t,n);return!a&&i&&Z(n)&&(a=Ql(e,n,r),a===void 0&&(a=Ql(t,n,r))),a},_u=e=>e.replace(/\$/g,`$$$$`);var vu=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=tu.create(`interpolator`),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?ql:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?Gl(i):a||`{{`,this.suffix=o?Gl(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?Gl(d):f||Gl(`$t(`),this.nestingSuffix=p?Gl(p):m||Gl(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=gu(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,E(E(E({},r),t),{},{interpolationkey:e})):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(gu(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,E(E(E({},r),t),{},{interpolationkey:a}))};this.resetRegExp();let l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>_u(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?_u(this.escape(e)):_u(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Z(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !Z(a)&&!this.useRawValueToEscape&&(a=Pl(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a=E(E({},t),a))}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a=E({},n),a=a.replace&&!Z(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){let e=r[1].split(this.formatSeparator).map(e=>e.trim());r[1]=e.shift(),s=e,c=!0}if(i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Z(i))return i;Z(i)||(i=Pl(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=``),c&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,E(E({},n),{},{interpolationkey:r[1].trim()})),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}};const yu=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||(n.currency=i.trim()):t===`relativetime`&&i.indexOf(`:`)<0?n.range||(n.range=i.trim()):i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},bu=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a=E(E({},a),{},{[i.interpolationkey]:void 0}));let o=r+JSON.stringify(a),s=t[o];return s||(s=e($l(r),i),t[o]=s),s(n)}};var xu=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=tu.create(`formatter`),this.options=e,this.formats={number:bu((e,t)=>{let n=new Intl.NumberFormat(e,E({},t));return e=>n.format(e)}),currency:bu((e,t)=>{let n=new Intl.NumberFormat(e,E(E({},t),{},{style:`currency`}));return e=>n.format(e)}),datetime:bu((e,t)=>{let n=new Intl.DateTimeFormat(e,E({},t));return e=>n.format(e)}),relativetime:bu((e,t)=>{let n=new Intl.RelativeTimeFormat(e,E({},t));return e=>n.format(e,t.range||`day`)}),list:bu((e,t)=>{let n=new Intl.ListFormat(e,E({},t));return e=>n.format(e)})},this.init(e)}init(e){this.formatSeparator=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation.formatSeparator||`,`}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=bu(t)}format(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=yu(t);if(this.formats[i]){let t=e;try{let o=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,E(E(E({},a),r),o))}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}};const Su=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};var Cu=class extends nu{constructor(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=tu.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Vl(n.loaded,[i],a),Su(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Z(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend&&this.backend.create){let s=E(E({},a),{},{isUpdate:i}),c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}};const wu=()=>({debug:!1,initImmediate:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Z(e[1])&&(t.defaultValue=e[1]),Z(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0}}),Tu=e=>(Z(e.ns)&&(e.ns=[e.ns]),Z(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Z(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Eu=()=>{},Du=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})};var Ou=class e extends nu{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Tu(e),this.services={},this.logger=tu,this.modules={external:[]},Du(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t==`function`&&(n=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(Z(t.ns)?t.defaultNS=t.ns:t.ns.indexOf(`translation`)<0&&(t.defaultNS=t.ns[0]));let r=wu();this.options=E(E(E({},r),this.options),Tu(t)),this.options.compatibilityAPI!==`v1`&&(this.options.interpolation=E(E({},r.interpolation),this.options.interpolation)),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);let i=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?tu.init(i(this.modules.logger),this.options):tu.init(null,this.options);let t;this.modules.formatter?t=this.modules.formatter:typeof Intl<`u`&&(t=xu);let n=new cu(this.options);this.store=new ru(this.options.resources,this.options);let a=this.services;a.logger=tu,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new hu(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=i(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new vu(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Cu(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new ou(this.services,this.options),this.translator.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Eu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=Nl(),o=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),a.resolve(t),n(e,t)};if(this.languages&&this.options.compatibilityAPI!==`v1`&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?o():setTimeout(o,0),a}loadResources(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Eu,n=Z(e)?e:this.language;if(typeof e==`function`&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return t();let e=[],r=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e)),this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){let r=Nl();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Eu),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&iu.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=Nl();this.emit(`languageChanging`,e);let i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},o=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Z(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{a(e,n)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,t,n){var r=this;let i=function(e,t){let a;if(typeof t!=`object`){var o=[...arguments].slice(2);a=r.options.overloadTranslationOptionHandler([e,t].concat(o))}else a=E({},t);a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||i.keyPrefix);let s=r.options.keySeparator||`.`,c;return c=a.keyPrefix&&Array.isArray(e)?e.map(e=>`${a.keyPrefix}${s}${e}`):a.keyPrefix?`${a.keyPrefix}${s}${e}`:e,r.t(c,a)};return Z(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Nl();return this.options.ns?(Z(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Nl();Z(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return`rtl`;let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services&&this.services.languageUtils||new cu(wu());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(){return new e(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Eu,r=t.forkResourceStore;r&&delete t.forkResourceStore;let i=E(E(E({},this.options),t),{isClone:!0}),a=new e(i);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services=E({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new ru(this.store.data,i),a.services.resourceStore=a.store),a.translator=new ou(a.services,i),a.translator.on(`*`,function(e){var t=[...arguments].slice(1);a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}};const ku=Ou.createInstance();ku.createInstance=Ou.createInstance,ku.createInstance,ku.dir,ku.init,ku.loadResources,ku.reloadResources,ku.use,ku.changeLanguage,ku.getFixedT,ku.t,ku.exists,ku.setDefaultNamespace,ku.hasLoadedNamespace,ku.loadNamespaces,ku.loadLanguages;const Au=`translation`;ku.init({lng:`zh-CN`,resources:{}});function ju(e,t){ku.addResourceBundle(e,Au,t,!0,!0)}function Mu(e){ku.changeLanguage(e)}function Nu(e){return ku.getResourceBundle(e,Au)}function Pu(e){return ku.on(`languageChanged`,e),()=>ku.off(`languageChanged`,e)}const Fu=ku.t.bind(ku);function Iu(e){if(!e.removeAttr)return;e.removeAttr(`width`),e.removeAttr(`height`),e.removeAttr(`fill`),e.removeAttr(`class`),e.removeAttr(`t`),e.removeAttr(`p-id`);let t=e.children();t.length&&Iu(t)}function Lu(){return Y(`<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>`)}function Ru(){return Y(`<div class="w-e-bar-divider"></div>`)}var zu=class{constructor(e){this.isShow=!1,this.showTime=0,this.record(e)}record(e){let t=Fa.get(e);t==null&&(t=new Set,Fa.set(e,t)),t.add(this),Ia.set(this,e)}renderContent(e){let{$elem:t}=this;t.empty(),t.append(e);let n=this.genSelfElem();n&&t.append(n)}appendTo(e){let{$elem:t}=this;e.append(t)}show(){if(this.isShow)return;this.showTime=Date.now();let{$elem:e}=this;e.show(),this.isShow=!0;let t=Ia.get(this);t&&t.emit(q.MODALORPANELSHOW,this)}hide(){if(!this.isShow||Date.now()-this.showTime<200)return;let{$elem:e}=this;e.hide(),this.isShow=!1;let t=Ia.get(this);t&&t.emit(q.MODALORPANELHIDE)}},Bu=class extends zu{constructor(...e){super(...e),this.type=`dropPanel`,this.$elem=Y(`<div class="w-e-drop-panel"></div>`)}genSelfElem(){return null}};function Vu(e,t,n,r=``,i=!1){if(t){if(r){let e=oc?`cmd`:`ctrl`;r=r.replace(`mod`,e)}if(i)r&&(e.attr(`data-tooltip`,r),e.addClass(`w-e-menu-tooltip-v5`),e.addClass(`tooltip-right`));else{let t=r?`${n}\n${r}`:n;e.attr(`data-tooltip`,t),e.addClass(`w-e-menu-tooltip-v5`)}}}var Hu=class{constructor(e,t,n=!1){this.$elem=Y(`<div class="w-e-bar-item"></div>`),this.$button=Y(`<button type="button"></button>`),this.disabled=!1,this.menu=t;let{tag:r,width:i}=t;if(r!==`button`)throw Error(`Invalid tag '${r}', expected 'button'`);let{title:a,hotkey:o=``,iconSvg:s=``}=t,{$button:c}=this;if(s){let e=Y(s);Iu(e),c.append(e)}else c.text(a);Vu(c,s,a,o,n),n&&s&&c.append(Y(`<span class="title">${a}</span>`)),i&&c.css(`width`,`${i}px`),c.attr(`data-menu-key`,e),this.$elem.append(c),Ft(()=>this.init())}init(){this.setActive(),this.setDisabled(),this.$button.on(`click`,e=>{e.preventDefault(),nd(this).hidePanelOrModal(),!this.disabled&&(this.exec(),this.onButtonClick())})}exec(){let e=nd(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()}setActive(){let e=nd(this),{$button:t}=this,n=this.menu.isActive(e),r=`active`;n?t.addClass(r):t.removeClass(r)}setDisabled(){let e=nd(this),{$button:t}=this,n=this.menu.isDisabled(e);(e.selection==null||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);let r=`disabled`;n?t.addClass(r):t.removeClass(r),this.disabled=n}setIcon(){let e=nd(this),{$button:t}=this;if(!this.menu.getIcon)return;let n=this.menu.getIcon(e);if(n){t.find(`svg`).remove();let e=Y(n);Iu(e),t.append(e)}}setTooltip(){let e=nd(this),{$button:t}=this;if(!this.menu.getTitle)return;let n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&Vu(t,r,n)}changeMenuState(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()}},Uu=class extends Hu{constructor(e,t,n=!1){if(super(e,t,n),this.dropPanel=null,this.menu=t,t.showDropPanel){let e=Lu();this.$button.append(e)}}onButtonClick(){this.menu.showDropPanel&&this.handleDropPanel()}handleDropPanel(){let e=this.menu;if(e.getPanelContentElem==null)return;let t=nd(this);if(this.dropPanel==null){let n=new Bu(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{let n=this.dropPanel;if(n.isShow)n.hide();else{let r=e.getPanelContentElem(t);n.renderContent(r),n.show()}}let n=this.dropPanel;if(n.isShow){let e=this.$elem,{left:t}=e.offset(),r=e.parents(`.w-e-bar`),{left:i}=r.offset(),a=r.width()/2;t-i>=a?n.$elem.css({left:`none`,right:`0`}):n.$elem.css({left:`0`,right:`none`})}}},Wu=class{constructor(e){this.$elem=Y(`<div class="w-e-bar-item w-e-bar-item-group"></div>`),this.$container=Y(`<div class="w-e-bar-item-menus-container"></div>`),this.$button=Y(`<button type="button"></button>`);let{key:t,iconSvg:n,title:r}=e,{$elem:i,$button:a}=this;if(n){let e=Y(n);Iu(e),a.append(e)}else a.text(r);a.attr(`data-menu-key`,t);let o=Lu();a.append(o),i.append(a);let{$container:s}=this;i.append(s);let c=this.createObserver();this.observe(c)}appendBarItem(e){let{$elem:t}=e;this.$container.append(t)}observe(e){let{$container:t}=this;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})}createObserver(){let{$container:e,$button:t}=this,n=new MutationObserver(()=>{let r=e.find(`button`),i=r.length;if(i===0)return;let a=0;r.each(e=>{Y(e).hasClass(`disabled`)&&(a+=1)}),n.disconnect(),a===i?t.addClass(`disabled`):t.removeClass(`disabled`),this.observe(n)});return n}},Gu=class extends zu{constructor(e,t=0){super(e),this.type=`modal`,this.$elem=Y(`<div class="w-e-modal"></div>`),this.width=0,t&&(this.width=t);let{$elem:n}=this;n.on(`click`,e=>e.stopPropagation()),n.on(`keyup`,t=>{t.code===`Escape`&&(this.hide(),e.restoreSelection())})}genSelfElem(){let e=Y(`<span class="btn-close"><svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg></span>`),t=Ia.get(this);return e.on(`click`,()=>{this.hide(),t==null||t.restoreSelection()}),e}setStyle(e){let{width:t,$elem:n}=this;n.attr(`style`,``),t&&n.css(`width`,`${t}px`),n.css(e)}};function Ku(e,t,n){let r=Y(`<label class="babel-container"></label>`);r.append(`<span>${e}</span>`);let i=Y(`<input type="text" id="${t}" placeholder="${n||``}">`);return r.append(i),[r[0],i[0]]}function qu(e,t,n){let r=Y(`<label class="babel-container"></label>`);r.append(`<span>${e}</span>`);let i=Y(`<textarea type="text" id="${t}" placeholder="${n||``}"></textarea>`);return r.append(i),[r[0],i[0]]}function Ju(e,t){let n=Y(`<div class="button-container"></div>`),r=Y(`<button type="button" id="${e}">${t}</button>`);return n.append(r),[n[0],r[0]]}var Yu=class extends Hu{constructor(e,t,n=!1){super(e,t,n),this.$body=Y(`body`),this.modal=null,this.menu=t}onButtonClick(){this.menu.showModal&&this.handleModal()}getPosition(){let e=nd(this),t=this.menu.getModalPositionNode(e);return z.isElement(t)?kl(e,t,`modal`):Ol(e)}handleModal(){let e=nd(this),t=this.menu;if(this.modal==null){let n=new Gu(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{let e=this.modal;e.isShow?e.hide():this.renderAndShowModal(e,!1)}}renderAndShowModal(e,t=!1){let n=nd(this),r=this.menu;if(r.getModalContentElem==null)return;let i=X.getTextarea(n),a=X.getToolbar(n),{modalAppendToBody:o}=(a==null?void 0:a.getConfig())||{},s=r.getModalContentElem(n);if(e.renderContent(s),o)e.setStyle({left:`0`,right:`0`});else{let t=this.getPosition();e.setStyle(t)}t&&(o?e.appendTo(this.$body):e.appendTo(i.$textAreaContainer)),e.show(),o||Al(n,e.$elem),setTimeout(()=>{n.blur()})}};function Xu(){return Y(`<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>`)}var Zu=class extends zu{constructor(e,t){super(e),this.type=`selectList`,this.$elem=Y(`<div class="w-e-select-list"></div>`),t&&this.$elem.css(`width`,`${t}px`),this.$elem.on(`click`,e=>{e.stopPropagation()})}renderList(e){let t=this.$elem;t.empty();let n=Y(`<ul></ul>`);e.forEach(e=>{let{value:t,text:r,selected:i,styleForRenderMenuList:a}=e,o=Y(`<li data-value="${t}"></li>`);if(a&&o.css(a),i){let e=Xu();o.append(e),o.addClass(`selected`)}o.append(Y(`<span data-value="${t}">${r}</span>`)),o.attr(`title`,r),n.append(o)}),t.append(n)}genSelfElem(){return null}};function Qu(e,t){let n=e.length,r=``;for(let i=0;i<n;i+=1){let n=e[i];if(n.value===t){r=n.text;break}}return r}var $u=class{constructor(e,t,n=!1){this.$elem=Y(`<div class="w-e-bar-item"></div>`),this.$button=Y(`<button type="button" class="select-button"></button>`),this.disabled=!1,this.selectList=null;let{tag:r,title:i,width:a,iconSvg:o=``,hotkey:s=``}=t;if(r!==`select`)throw Error(`Invalid tag '${r}', expected 'select'`);let c=this.$button;a&&c.css(`width`,`${a}px`),c.attr(`data-menu-key`,e),Vu(c,o,i,s,n),this.$elem.append(c),this.menu=t,Ft(()=>this.init())}init(){this.setSelectedValue(),this.$button.on(`click`,e=>{e.preventDefault(),nd(this).hidePanelOrModal(),this.trigger()})}trigger(){let e=nd(this);if(e.isDisabled()||this.disabled)return;let t=this.menu;if(this.selectList==null){this.selectList=new Zu(e,t.selectPanelWidth);let n=this.selectList,r=t.getOptions(e);n.renderList(r),n.appendTo(this.$elem),n.show(),n.$elem.on(`click`,`li`,e=>{let{target:t}=e;if(t==null)return;e.preventDefault();let n=Y(t).attr(`data-value`);this.onChange(n)})}else{let n=this.selectList;if(n.isShow)n.hide();else{let r=t.getOptions(e);n.renderList(r),n.show()}}}onChange(e){let t=nd(this),n=this.menu;n.exec!=null&&n.exec(t,e)}setSelectedValue(){let e=nd(this),t=this.menu,n=t.getValue(e),r=Qu(t.getOptions(e),n.toString()),i=this.$button,a=Lu();i.empty(),i.text(r),i.append(a)}setDisabled(){let e=nd(this),t=this.menu.isDisabled(e),n=this.$button;(e.selection==null||e.isDisabled())&&(t=!0);let r=`disabled`;t?n.addClass(r):n.removeClass(r),this.disabled=t}changeMenuState(){this.setSelectedValue(),this.setDisabled()}},ed=class extends Hu{constructor(e,t,n=!1){super(e,t,n)}onButtonClick(){}};const td=new WeakMap;function nd(e){let t=Pa.get(e);if(t==null)throw Error(`Can not get editor instance`);return t}function rd(e,t,n=!1){let r=td.get(t);if(r)return r;let{tag:i}=t;if(i===`button`){let{showDropPanel:i,showModal:a}=t;r=i?new Uu(e,t,n):a?new Yu(e,t,n):new ed(e,t,n)}if(i===`select`&&(r=new $u(e,t,n)),r==null)throw Error(`Invalid tag in menu ${JSON.stringify(t)}`);return td.set(t,r),r}function id(e){return new Wu(e)}function ad(e,t){let{selection:n}=e;return n==null||R.isCollapsed(n)||X.getSelectedElems(e).some(t=>{if(e.isVoid(t))return!0;let{type:n}=t;return!![`pre`,`code`,`table`].includes(n)})?!1:!!Zn.isText(t)}var od=class{constructor(){this.$elem=Y(`<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>`),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=()=>{},this.changeHoverbarState=(0,Ml.default)(()=>{let{isShow:e}=this,{node:t=null,menuKeys:n=[]}=this.getSelectedNodeAndMenuKeys()||{},r=this.getEditorInstance();if(t!=null&&this.changeItemsState(),t&&z.isElement(t)&&e){let e=this.isSamePath(t,this.prevSelectedNode);if(!U.isBlock(r,t)&&e)return}this.hideAndClean(),t!=null&&(this.registerItems(n),this.setPosition(t),this.show()),this.prevSelectedNode=t},200),Ft(()=>{let e=this.getEditorInstance(),t=this.$elem;t.on(`mousedown`,e=>e.preventDefault(),{passive:!1}),X.getTextarea(e).$textAreaContainer.append(t),e.on(q.CHANGE,this.changeHoverbarState);let n=this.hideAndClean.bind(this);e.on(q.SCROLL,n),e.on(q.FULLSCREEN,n),e.on(q.UNFULLSCREEN,n)}),this.lngListen=Pu(()=>{this.menus={},this.hideAndClean(),this.getEditorInstance().deselect()})}getMenus(){return this.menus}hideAndClean(){let e=this.$elem;e.removeClass(`w-e-bar-show`).addClass(`w-e-bar-hidden`),this.hoverbarItems=[],e.empty(),this.isShow=!1}checkPositionBottom(){let e=this.$elem,t=!1,n=typeof window<`u`?window.innerHeight:null;if(n&&n>=360){let{bottom:r}=e[0].getBoundingClientRect();n-r<360&&(t=!0)}t?e.addClass(`w-e-bar-bottom`):e.removeClass(`w-e-bar-bottom`)}show(){this.$elem.removeClass(`w-e-bar-hidden`).addClass(`w-e-bar-show`),this.isShow=!0,this.checkPositionBottom()}changeItemsState(){Ft(()=>{this.hoverbarItems.forEach(e=>{e.changeMenuState()})})}registerItems(e){let t=this.$elem;e.forEach(e=>{if(e===`|`){let e=Ru();t.append(e);return}this.registerSingleItem(e)})}registerSingleItem(e){let t=this.getEditorInstance(),{menus:n}=this,r=n[e];if(r==null){let t=Ea[e];if(t==null)throw Error(`Not found menu item factory by key '${e}'`);if(typeof t!=`function`)throw Error(`Menu item factory (key='${e}') is not a function`);r=t(),n[e]=r}let i=t.getMenuConfig(e);i&&i.iconSvg!==void 0&&(r.iconSvg=i.iconSvg);let a=rd(e,r);this.hoverbarItems.push(a),Pa.set(a,t),this.$elem.append(a.$elem)}setPosition(e){let t=this.getEditorInstance(),n=this.$elem;if(n.attr(`style`,``),z.isElement(e)){let r=kl(t,e,`bar`);n.css(r),Al(t,n);return}if(Zn.isText(e)){let e=Ol(t);n.css(e),Al(t,n);return}throw Error(`hoverbar.setPosition error, current selected node is not elem nor text`)}getSelectedNodeAndMenuKeys(){let e=this.getEditorInstance();if(e.selection==null)return null;let t=this.getHoverbarKeysConf(),n=null,r=[];for(let i in t){let{match:a,menuKeys:o=[]}=t[i],s=a||((e,t)=>X.checkNodeType(t,i)),c=a?null:X.getSelectedNodeByType(e,i),[l]=c?[[c]]:U.nodes(e,{match:t=>s(e,t),universal:!0});if(l!=null){n=l[0],r=o;break}}return n==null||r.length===0?null:{node:n,menuKeys:r}}getEditorInstance(){let e=Ma.get(this);if(e==null)throw Error(`Can not get editor instance`);return e}getHoverbarKeysConf(){let{hoverbarKeys:e={}}=this.getEditorInstance().getConfig(),t=e.text;return t&&t.match==null&&(t.match=ad),e}isSamePath(e,t){if(e==null||t==null)return!1;let n=X.findPath(null,e),r=X.findPath(null,t);return L.equals(n,r)}destroy(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),(e=this.lngListen)==null||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null}},sd=u(re(),1);function cd(e,t){return is(t)&&X.hasDOMNode(e,t,{editable:!0})}function ld(e,t){return is(t)&&X.hasDOMNode(e,t)}function ud(e,t){let{readOnly:n}=e.getConfig();if(n)return!1;let r=ld(e,t)&&X.toSlateNode(e,t);return!!r&&z.isElement(r)&&U.isVoid(e,r)}function dd(e,t){if(cd(e,t))return!0;if(!ld(e,t))return!1;let n=null;return os(t)?n=t:cs(t)&&(n=t.parentElement),n!=null&&n.closest(`[data-w-e-reserve]`)?!0:ud(e,t)}function fd(e,t,n){var r;let i=e,{readOnly:a}=n.getConfig();if(!fc||a||!cd(n,i.target))return;(r=t.flushDOMSelectionChange)==null||r.call(t);let{selection:o}=n,{inputType:s}=i,c=i.dataTransfer||i.data||void 0;if(!(s===`insertCompositionText`||s===`deleteCompositionText`)){if(i.preventDefault(),!s.startsWith(`delete`)||s.startsWith(`deleteBy`)){let[e]=i.getTargetRanges();if(e){let t=null;try{t=X.toSlateRange(n,e,{exactMatch:!1,suppressThrow:!0})}catch(e){t=null}t&&(!o||!R.equals(o,t))&&(K.select(n,t),o=t)}}if(o&&R.isExpanded(o)){let e=X.getSelectedElems(n),t=e[0].type===`table`,r=e[e.length-1].type!==`table-cell`;if(t&&r)return;if(s.startsWith(`delete`)){let e=s.endsWith(`Backward`)?`backward`:`forward`;U.deleteFragment(n,{direction:e});return}}if(o==null&&s.startsWith(`insert`)){let e=X.findDocumentOrShadowRoot(n).getSelection();if(e){let t=X.toSlateRange(n,e,{exactMatch:!1,suppressThrow:!0});t&&(K.select(n,t),o=t)}if(o==null){try{var l;(l=n.restoreSelection)==null||l.call(n)}catch(e){}o=n.selection}if(o==null){let e=U.end(n,[]),t={anchor:e,focus:e};K.select(n,t),o=t}}switch(s){case`deleteByComposition`:case`deleteByCut`:case`deleteByDrag`:U.deleteFragment(n);break;case`deleteContent`:case`deleteContentForward`:U.deleteForward(n);break;case`deleteContentBackward`:U.deleteBackward(n);break;case`deleteEntireSoftLine`:U.deleteBackward(n,{unit:`line`}),U.deleteForward(n,{unit:`line`});break;case`deleteHardLineBackward`:U.deleteBackward(n,{unit:`block`});break;case`deleteSoftLineBackward`:U.deleteBackward(n,{unit:`line`});break;case`deleteHardLineForward`:U.deleteForward(n,{unit:`block`});break;case`deleteSoftLineForward`:U.deleteForward(n,{unit:`line`});break;case`deleteWordBackward`:U.deleteBackward(n,{unit:`word`});break;case`deleteWordForward`:U.deleteForward(n,{unit:`word`});break;case`insertLineBreak`:U.insertText(n,`
|
|
29
|
+
`);break;case`insertParagraph`:U.insertBreak(n);break;case`insertFromDrop`:case`insertFromComposition`:case`insertFromPaste`:case`insertFromYank`:case`insertReplacementText`:case`insertText`:if(s===`insertFromComposition`&&(t.isComposing=!1,to.set(n,!0)),s===`insertFromPaste`&&!eo.get(n))break;$o(c)?n.insertData(c):typeof c==`string`&&U.insertText(n,c);break;default:}}}var pd=fd;function md(e,t,n){let r=e,{isUpdatingSelection:i,latestElement:a}=t,{readOnly:o}=n.getConfig();if(o||i||!cd(n,r.target))return;let s=X.findDocumentOrShadowRoot(n);if(a===s.activeElement)return;let{relatedTarget:c}=r;if(c!==X.toDOMNode(n,n)&&!(os(c)&&c.hasAttribute(`data-slate-spacer`))){if(c!=null&&is(c)&&X.hasDOMNode(n,c)){let e=X.toSlateNode(n,c);if(z.isElement(e)&&!n.isVoid(e))return}if(cc){let e=s.getSelection();e==null||e.removeAllRanges()}Za.delete(n)}}var hd=md;function gd(e,t,n){let{readOnly:r}=n.getConfig();if(r||!ld(n,e.target)||!is(e.target))return;let i=X.toSlateNode(n,e.target),a=X.findPath(n,i);if(U.hasPath(n,a)&&B.get(n,a)===i){let e=U.start(n,a),t=U.end(n,a),r=U.void(n,{at:e}),i=U.void(n,{at:t});if(r&&i&&L.equals(r[1],i[1])){let t=U.range(n,e);K.select(n,t)}}}var _d=gd;function vd(e,t){let{placeholder:n}=t.getConfig();if(!n)return;let r=t.isEmpty();if(r&&!e.showPlaceholder&&!e.isComposing){if(e.$placeholder==null){let t=Y(`<div class="w-e-text-placeholder">${n}</div>`);e.$textAreaContainer.append(t),e.$placeholder=t}e.$placeholder.show(),e.showPlaceholder=!0;return}if(!r&&e.showPlaceholder){var i;(i=e.$placeholder)==null||i.hide(),e.showPlaceholder=!1}}function yd(e,t){let{placeholder:n}=t.getConfig();if(n&&t.isEmpty()&&e.showPlaceholder){var r;(r=e.$placeholder)==null||r.hide(),e.showPlaceholder=!1}}const bd=e=>typeof e==`object`&&!!e&&e.nodeType===1,xd=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,Sd=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return xd(n.overflowY,t)||xd(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Cd=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,wd=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},Td=(e,t)=>{var n,r,i,a;if(typeof document>`u`)return[];let{scrollMode:o,block:s,inline:c,boundary:l,skipOverflowHiddenElements:u}=t,d=typeof l==`function`?l:e=>e!==l;if(!bd(e))throw TypeError(`Invalid target`);let f=document.scrollingElement||document.documentElement,p=[],m=e;for(;bd(m)&&d(m);){if(m=wd(m),m===f){p.push(m);break}m!=null&&m===document.body&&Sd(m)&&!Sd(document.documentElement)||m!=null&&Sd(m,u)&&p.push(m)}let h=(r=(n=window.visualViewport)==null?void 0:n.width)==null?innerWidth:r,g=(a=(i=window.visualViewport)==null?void 0:i.height)==null?innerHeight:a,{scrollX:_,scrollY:v}=window,{height:y,width:b,top:x,right:S,bottom:C,left:w}=e.getBoundingClientRect(),{top:T,right:E,bottom:D,left:O}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),k=s===`start`||s===`nearest`?x-T:s===`end`?C+D:x+y/2-T+D,A=c===`center`?w+b/2-O+E:c===`end`?S+E:w-O,j=[];for(let e=0;e<p.length;e++){let t=p[e],{height:n,width:r,top:i,right:a,bottom:l,left:u}=t.getBoundingClientRect();if(o===`if-needed`&&x>=0&&w>=0&&C<=g&&S<=h&&(t===f&&!Sd(t)||x>=i&&C<=l&&w>=u&&S<=a))return j;let d=getComputedStyle(t),m=parseInt(d.borderLeftWidth,10),T=parseInt(d.borderTopWidth,10),E=parseInt(d.borderRightWidth,10),D=parseInt(d.borderBottomWidth,10),O=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-m-E:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-T-D:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:r/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:n/t.offsetHeight:0;if(f===t)O=s===`start`?k:s===`end`?k-g:s===`nearest`?Cd(v,v+g,g,T,D,v+k,v+k+y,y):k-g/2,M=c===`start`?A:c===`center`?A-h/2:c===`end`?A-h:Cd(_,_+h,h,m,E,_+A,_+A+b,b),O=Math.max(0,O+v),M=Math.max(0,M+_);else{O=s===`start`?k-i-T:s===`end`?k-l+D+P:s===`nearest`?Cd(i,l,n,T,D+P,k,k+y,y):k-(i+n/2)+P/2,M=c===`start`?A-u-m:c===`center`?A-(u+r/2)+N/2:c===`end`?A-a+E+N:Cd(u,a,r,m,E+N,A,A+b,b);let{scrollLeft:e,scrollTop:o}=t;O=F===0?0:Math.max(0,Math.min(o+O/F,t.scrollHeight-n/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-r/ee+N)),k+=o-O,A+=e-M}j.push({el:t,top:O,left:M})}return j},Ed=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function Dd(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(Td(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of Td(e,Ed(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}function Od(e){e.selection!=null&&(e.selection=null,e.onChange())}function kd(e,t,n=!1){let{selection:r}=t,i=t.getConfig(),a=X.findDocumentOrShadowRoot(t).getSelection();if(!a||e.isComposing&&!n||!t.isFocused())return;let o=a.type!==`None`;if(!r&&!o)return;let s=Ga.get(t),c=!1;if(s.contains(a.anchorNode)&&s.contains(a.focusNode)&&(c=!0),o&&c&&r){let e=X.toSlateRange(t,a,{exactMatch:!0,suppressThrow:!0});if(e&&R.equals(e,r)){let e=!0;if(R.isCollapsed(r)){let{anchorNode:t,anchorOffset:n}=a;if(t===s){let t=s.childNodes,r;r=t[n],r&&r.matches(`table`)&&(e=!1),r=t[n-1],r&&r.matches(`table`)&&(e=!1)}}if(e)return}}if(r&&!X.hasRange(t,r)){t.selection=X.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!0});return}e.isUpdatingSelection=!0;let l=null;try{l=r&&X.toDOMRange(t,r)}catch(e){l=null}if(l){R.isBackward(r)?a.setBaseAndExtent(l.endContainer,l.endOffset,l.startContainer,l.startOffset):a.setBaseAndExtent(l.startContainer,l.startOffset,l.endContainer,l.endOffset);let e=l.startContainer.parentElement;if(!e.closest(`[data-slate-spacer]`)&&l.getBoundingClientRect){let t=l.getBoundingClientRect.bind(l)();t.top===0&&t.right===0&&t.bottom===0&&t.left===0&&t.height===0&&t.width===0||(e.getBoundingClientRect=l.getBoundingClientRect.bind(l));let n=document.body;if(Dd(e,{scrollMode:`if-needed`,boundary:i.scroll&&s.parentElement||n,block:`end`,behavior:`auto`}),i.scroll){let e=s.parentElement;if(e){let t=()=>{let t=l.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.bottom-n.bottom,i=n.top-t.top;r>0?e.scrollTop+=r+1:i>0&&(e.scrollTop-=i+1)};t(),requestAnimationFrame(t)}}delete e.getBoundingClientRect}}else a.removeAllRanges();setTimeout(()=>{l&&sc&&s.focus(),e.isUpdatingSelection=!1})}function Ad(e,t){let{isComposing:n,isUpdatingSelection:r,isDraggingInternally:i}=e,a=t.getConfig();if(r||i)return;let o=X.findDocumentOrShadowRoot(t),{activeElement:s}=o,c=X.toDOMNode(t,t),l=o.getSelection();if(s===c)e.latestElement=s,Za.set(t,!0);else{Za.delete(t),Od(t);return}if(!l)return Od(t);let{anchorNode:u,focusNode:d}=l,f=dd(t,u),p=ld(t,d);if(!n)if(f&&p){let e=X.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});e&&K.select(t,e)}else a.readOnly&&Od(t)}const jd=new WeakMap,Md=new WeakMap;function Nd(e){let t;try{t=X.findDocumentOrShadowRoot(e)}catch(e){return null}let n=t.getSelection();if(!n||n.rangeCount<=0)return null;try{return n.getRangeAt(0).startContainer}catch(e){return null}}function Pd(e,t){if(R.isCollapsed(t)){let{anchor:n,focus:r}=t;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(n.offset===0||r.offset===0)){let t=U.node(e,n.path),i=n.offset===0?n.path:r.path,a=[i[0],i[1]-1];if(i[1]===0)return!1;let o=U.node(e,a);if(Zn.isText(o[0])&&Zn.isText(t[0]))return!0}}}function Fd(e){let{selection:t}=e;if(t)return t;try{let n=X.findDocumentOrShadowRoot(e).getSelection();if(n){let r=X.toSlateRange(e,n,{exactMatch:!1,suppressThrow:!0});r&&(K.select(e,r),t=r)}}catch(e){}if(!t){try{var n;(n=e.restoreSelection)==null||n.call(e)}catch(e){}t=e.selection}if(!t){let n=U.end(e,[]),r={anchor:n,focus:n};K.select(e,r),t=r}return t}function Id(e,t,n){if(!cd(n,e.target))return;no.delete(n),t.isComposing=!0;let{selection:r}=n;if(r&&R.isCollapsed(r)){let e=Nd(n);if(e){let t=e.textContent||``;jd.set(n,t),Md.set(n,e)}}r&&R.isExpanded(r)&&(U.deleteFragment(n),t.changeViewState(),Promise.resolve().then(()=>{kd(t,n,!0)})),yd(t,n)}function Ld(e,t,n){cd(n,e.target)&&(t.isComposing=!0)}function Rd(e,t,n){let r=e;if(!cd(n,r.target))return;t.isComposing=!1;let i=to.get(n)===!0;i&&to.delete(n),no.delete(n);let a=Fd(n);if(a==null)return;(dc||sc)&&X.cleanExposedTexNodeInSelectionBlock(n);let o=R.isBackward(a)?a.focus:a.anchor,[s]=U.node(n,[o.path[0]]);for(let e=0;e<o.path.length;e+=1){let[t]=U.node(n,o.path.slice(0,e+1));if(z.isElement(t)&&((cc||sc)&&t.type===`link`||t.type===`code`)){X.setNewKey(s);break}}let{data:c}=r;if(!c||i)return;let{maxLength:l}=n.getConfig();if(l){let e=X.getLeftLengthOfMaxLength(n);if(e<c.length){let r=Nd(n);r&&r.nodeType===Node.TEXT_NODE&&(r.textContent=jd.get(n)||``),e>0&&U.insertText(n,c.slice(0,e)),t.changeViewState()}else U.insertText(n,c)}else{let e=X.findDocumentOrShadowRoot(n).getSelection();if(e&&Pd(n,a)){let t=X.toSlateRange(n,e,{exactMatch:!1,suppressThrow:!1});t&&(n.selection=t)}U.insertText(n,c)}cc||setTimeout(()=>{let{selection:e}=n;if(e==null)return;let t=Md.get(n);if(t==null||t.nodeType!==Node.TEXT_NODE)return;let r=Nd(n);r!=null&&r.nodeType===Node.TEXT_NODE&&r!==t&&(t.textContent=jd.get(n)||``)})}function zd(e,t,n){let r=e;if(!cd(n,r.target))return;let{readOnly:i}=n.getConfig();i||r.preventDefault();let a=r.clipboardData;if(a==null)return;n.setFragmentData(a);let{customCopy:o}=n.getConfig();o&&o(n,r)}var Bd=zd;function Vd(e,t,n){let r=e,{selection:i}=n,{readOnly:a}=n.getConfig();if(a||(r.preventDefault(),!cd(n,r.target)))return;let o=r.clipboardData;if(o!=null&&(n.setFragmentData(o),i))if(R.isExpanded(i))U.deleteFragment(n);else{let e=B.parent(n,i.anchor.path);z.isElement(e)&&U.isVoid(n,e)&&K.delete(n)}}var Hd=Vd;function Ud(e,t,n){let r=e;if(!ld(n,r.target))return;let{readOnly:i}=n.getConfig();if(i)return;let a=X.toSlateNode(n,r.target),o=X.findPath(n,a);if(z.isElement(a)&&U.isVoid(n,a)||U.void(n,{at:o,voids:!0})){let e=U.range(n,o);K.select(n,e)}let s=r.dataTransfer;s!=null&&(X.getSelectedNodeByType(n,`table`)||(t.isDraggingInternally=!0,n.setFragmentData(s)))}function Wd(e,t,n){if(!ld(n,e.target))return;let r=X.toSlateNode(n,e.target);z.isElement(r)&&U.isVoid(n,r)&&e.preventDefault()}function Gd(e,t,n){let r=e,{readOnly:i}=n.getConfig();i||t.isDraggingInternally&&ld(n,r.target)&&(t.isDraggingInternally=!1)}function Kd(e,t,n){let r=e,i=r.dataTransfer,{readOnly:a}=n.getConfig();if(a||!ld(n,r.target)||i==null||fc&&cc&&i.files.length>0)return;r.preventDefault();let o=n.selection,s=X.findEventRange(n,r);K.select(n,s),t.isDraggingInternally&&(o&&K.delete(n,{at:o}),t.isDraggingInternally=!1),n.insertData(i),n.isFocused()||n.focus()}var qd=Kd;function Jd(e,t,n){let r=X.toDOMNode(n,n);if(t.latestElement=X.findDocumentOrShadowRoot(n).activeElement,sc&&e.target!==r){r.focus();return}Za.set(n,!0)}var Yd=Jd,Xd=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0});for(var t=typeof window<`u`&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),n={alt:`altKey`,control:`ctrlKey`,meta:`metaKey`,shift:`shiftKey`},r={add:`+`,break:`pause`,cmd:`meta`,command:`meta`,ctl:`control`,ctrl:`control`,del:`delete`,down:`arrowdown`,esc:`escape`,ins:`insert`,left:`arrowleft`,mod:t?`meta`:`control`,opt:`alt`,option:`alt`,return:`enter`,right:`arrowright`,space:` `,spacebar:` `,up:`arrowup`,win:`meta`,windows:`meta`},i={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},a=1;a<20;a++)i[`f`+a]=111+a;function o(e,t,n){t&&!(`byKey`in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return c(e,t)}),i=function(e){return r.some(function(t){return l(t,e)})};return n==null?i:i(n)}function s(e,t){return o(e,{byKey:!0},t)}function c(e,t){var a=t&&t.byKey,o={};e=e.replace(`++`,`+add`);var s=e.split(`+`),c=s.length;for(var l in n)o[n[l]]=!1;var f=!0,p=!1,m=void 0;try{for(var h=s[Symbol.iterator](),g;!(f=(g=h.next()).done);f=!0){var _=g.value,v=_.endsWith(`?`)&&_.length>1;v&&(_=_.slice(0,-1));var y=d(_),b=n[y];if(_.length>1&&!b&&!r[_]&&!i[y])throw TypeError(`Unknown modifier: "`+_+`"`);(c===1||!b)&&(a?o.key=y:o.which=u(_)),b&&(o[b]=v?null:!0)}}catch(e){p=!0,m=e}finally{try{!f&&h.return&&h.return()}finally{if(p)throw m}}return o}function l(e,t){for(var n in e){var r=e[n],i=void 0;if(r!=null&&(i=n===`key`&&t.key!=null?t.key.toLowerCase():n===`which`?r===91&&t.which===93?91:t.which:t[n],!(i==null&&r===!1)&&i!==r))return!1}return!0}function u(e){return e=d(e),i[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=r[e]||e,e}e.isHotkey=o,e.isKeyHotkey=s}))();const Zd={bold:`mod+b`,compose:[`down`,`left`,`right`,`up`,`backspace`,`enter`],moveBackward:`left`,moveForward:`right`,moveWordBackward:`ctrl+left`,moveWordForward:`ctrl+right`,deleteBackward:`shift?+backspace`,deleteForward:`shift?+delete`,extendBackward:`shift+left`,extendForward:`shift+right`,italic:`mod+i`,splitBlock:`shift?+enter`,undo:`mod+z`,tab:`tab`,selectAll:`mod+a`},Qd={moveLineBackward:`opt+up`,moveLineForward:`opt+down`,moveWordBackward:`opt+left`,moveWordForward:`opt+right`,deleteBackward:[`ctrl+backspace`,`ctrl+h`],deleteForward:[`ctrl+delete`,`ctrl+d`],deleteLineBackward:`cmd+shift?+backspace`,deleteLineForward:[`cmd+shift?+delete`,`ctrl+k`],deleteWordBackward:`opt+shift?+backspace`,deleteWordForward:`opt+shift?+delete`,extendLineBackward:`opt+shift+up`,extendLineForward:`opt+shift+down`,redo:`cmd+shift+z`,transposeCharacter:`ctrl+t`},$d={deleteWordBackward:`ctrl+shift?+backspace`,deleteWordForward:`ctrl+shift?+delete`,redo:[`ctrl+y`,`ctrl+shift+z`]},Q=e=>{let t=Zd[e],n=Qd[e],r=$d[e],i=t&&(0,Xd.isKeyHotkey)(t),a=n&&(0,Xd.isKeyHotkey)(n),o=r&&(0,Xd.isKeyHotkey)(r);return e=>!!(i&&i(e)||oc&&a&&a(e)||!oc&&o&&o(e))};var $={isBold:Q(`bold`),isCompose:Q(`compose`),isMoveBackward:Q(`moveBackward`),isMoveForward:Q(`moveForward`),isDeleteBackward:Q(`deleteBackward`),isDeleteForward:Q(`deleteForward`),isDeleteLineBackward:Q(`deleteLineBackward`),isDeleteLineForward:Q(`deleteLineForward`),isDeleteWordBackward:Q(`deleteWordBackward`),isDeleteWordForward:Q(`deleteWordForward`),isExtendBackward:Q(`extendBackward`),isExtendForward:Q(`extendForward`),isExtendLineBackward:Q(`extendLineBackward`),isExtendLineForward:Q(`extendLineForward`),isItalic:Q(`italic`),isMoveLineBackward:Q(`moveLineBackward`),isMoveLineForward:Q(`moveLineForward`),isMoveWordBackward:Q(`moveWordBackward`),isMoveWordForward:Q(`moveWordForward`),isRedo:Q(`redo`),isSplitBlock:Q(`splitBlock`),isTransposeCharacter:Q(`transposeCharacter`),isUndo:Q(`undo`),isTab:Q(`tab`),isSelectAll:Q(`selectAll`)};D();function ef(e){e.preventDefault()}function tf(e,t){let n=ja.get(e),r=n&&n.getMenus(),i=Na.get(e),a=i&&i.getMenus(),o=E(E({},r),a);for(let n of Object.keys(o)){let r=o[n],{hotkey:i}=r;if(i&&(0,Xd.isHotkey)(i,t)&&!r.isDisabled(e)){let t=r.getValue(e);r.exec(e,t)}}}function nf(e,t,n){let r=e,{selection:i}=n,{readOnly:a}=n.getConfig();if(!a&&!t.isComposing&&cd(n,r.target)){if(tf(n,r),$.isTab(r)){ef(r),n.handleTab();return}if($.isRedo(r)){ef(r),typeof n.redo==`function`&&n.redo();return}if($.isUndo(r)){ef(r),typeof n.undo==`function`&&n.undo();return}if($.isMoveLineBackward(r)){ef(r),K.move(n,{unit:`line`,reverse:!0});return}if($.isMoveLineForward(r)){ef(r),K.move(n,{unit:`line`});return}if($.isExtendLineBackward(r)){ef(r),K.move(n,{unit:`line`,edge:`focus`,reverse:!0});return}if($.isExtendLineForward(r)){ef(r),K.move(n,{unit:`line`,edge:`focus`});return}if($.isMoveBackward(r)){ef(r),i&&R.isCollapsed(i)?K.move(n,{reverse:!0}):K.collapse(n,{edge:`start`});return}if($.isMoveForward(r)){ef(r),i&&R.isCollapsed(i)?K.move(n):K.collapse(n,{edge:`end`});return}if($.isMoveWordBackward(r)){ef(r),i&&R.isExpanded(i)&&K.collapse(n,{edge:`focus`}),K.move(n,{unit:`word`,reverse:!0});return}if($.isMoveWordForward(r)){ef(r),i&&R.isExpanded(i)&&K.collapse(n,{edge:`focus`}),K.move(n,{unit:`word`});return}if($.isSelectAll(r)){ef(r),n.selectAll();return}if(fc){if((dc||cc)&&i&&($.isDeleteBackward(r)||$.isDeleteForward(r))&&R.isCollapsed(i)){let e=B.parent(n,i.anchor.path);z.isElement(e)&&U.isVoid(n,e)&&U.isInline(n,e)&&(r.preventDefault(),K.delete(n,{unit:`block`}))}}else{if($.isBold(r)||$.isItalic(r)||$.isTransposeCharacter(r)){ef(r);return}if($.isSplitBlock(r)){ef(r),r.shiftKey?U.insertText(n,`
|
|
30
|
+
`):U.insertBreak(n);return}if($.isDeleteBackward(r)){ef(r),i&&R.isExpanded(i)?U.deleteFragment(n,{direction:`backward`}):U.deleteBackward(n);return}if($.isDeleteForward(r)){ef(r),i&&R.isExpanded(i)?U.deleteFragment(n,{direction:`forward`}):U.deleteForward(n);return}if($.isDeleteLineBackward(r)){ef(r),i&&R.isExpanded(i)?U.deleteFragment(n,{direction:`backward`}):U.deleteBackward(n,{unit:`line`});return}if($.isDeleteLineForward(r)){ef(r),i&&R.isExpanded(i)?U.deleteFragment(n,{direction:`forward`}):U.deleteForward(n,{unit:`line`});return}if($.isDeleteWordBackward(r)){ef(r),i&&R.isExpanded(i)?U.deleteFragment(n,{direction:`backward`}):U.deleteBackward(n,{unit:`word`});return}$.isDeleteWordForward(r)&&(ef(r),i&&R.isExpanded(i)?U.deleteFragment(n,{direction:`forward`}):U.deleteForward(n,{unit:`word`}))}}}var rf=nf;function af(e,t,n){if(fc)return;let{readOnly:r}=n.getConfig();if(r||!cd(n,e.target))return;e.preventDefault();let i=e.key;U.insertText(n,i)}var of=af;function sf(e,t,n){eo.set(n,!0);let r=e,{readOnly:i}=n.getConfig();if(i||!cd(n,r.target))return;let{customPaste:a}=n.getConfig();if(a&&a(n,r)===!1){eo.set(n,!1),r.preventDefault();return}if(!cc&&fc&&!ls(r))return;r.preventDefault();let o=r.clipboardData;o!=null&&n.insertData(o)}var cf={beforeinput:pd,blur:hd,focus:Yd,click:_d,compositionstart:Id,compositionend:Rd,compositionupdate:Ld,keydown:rf,keypress:of,copy:Bd,cut:Hd,paste:sf,dragover:Wd,dragstart:Ud,dragend:Gd,drop:qd};function lf(e,t){return document.createElement(e,t)}function uf(e,t,n){return document.createElementNS(e,t,n)}function df(){return Ef(document.createDocumentFragment())}function ff(e){return document.createTextNode(e)}function pf(e){return document.createComment(e)}function mf(e,t,n){if(Tf(e)){let t=e;for(;t&&Tf(t);)t=Ef(t).parent;e=t==null?e:t}Tf(t)&&(t=Ef(t,e)),n&&Tf(n)&&(n=Ef(n).firstChildNode),e.insertBefore(t,n)}function hf(e,t){e.removeChild(t)}function gf(e,t){Tf(t)&&(t=Ef(t,e)),e.appendChild(t)}function _f(e){if(Tf(e)){for(;e&&Tf(e);)e=Ef(e).parent;return e==null?null:e}return e.parentNode}function vf(e){var t;if(Tf(e)){let n=Ef(e),r=_f(n);if(r&&n.lastChildNode){let e=Array.from(r.childNodes);return(t=e[e.indexOf(n.lastChildNode)+1])==null?null:t}return null}return e.nextSibling}function yf(e){return e.tagName}function bf(e,t){e.textContent=t}function xf(e){return e.textContent}function Sf(e){return e.nodeType===1}function Cf(e){return e.nodeType===3}function wf(e){return e.nodeType===8}function Tf(e){return e.nodeType===11}function Ef(e,t){let n=e;return n.parent!=null||(n.parent=t==null?null:t),n.firstChildNode!=null||(n.firstChildNode=e.firstChild),n.lastChildNode!=null||(n.lastChildNode=e.lastChild),n}const Df={createElement:lf,createElementNS:uf,createTextNode:ff,createDocumentFragment:df,createComment:pf,insertBefore:mf,removeChild:hf,appendChild:gf,parentNode:_f,nextSibling:vf,tagName:yf,setTextContent:bf,getTextContent:xf,isElement:Sf,isText:Cf,isComment:wf,isDocumentFragment:Tf};function Of(e,t,n,r,i){return{sel:e,data:t,children:n,text:r,elm:i,key:t===void 0?void 0:t.key}}const kf=Array.isArray;function Af(e){return typeof e==`string`||typeof e==`number`||e instanceof String||e instanceof Number}const jf=Of(``,{},[],void 0,void 0);function Mf(e,t){var n,r;let i=e.key===t.key,a=((n=e.data)==null?void 0:n.is)===((r=t.data)==null?void 0:r.is),o=e.sel===t.sel,s=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&a&&s}function Nf(){throw Error(`The document fragment is not supported on this platform.`)}function Pf(e,t){return e.isElement(t)}function Ff(e,t){return e.isDocumentFragment(t)}function If(e,t,n){var r;let i={};for(let a=t;a<=n;++a){let t=(r=e[a])==null?void 0:r.key;t!==void 0&&(i[t]=a)}return i}const Lf=[`create`,`update`,`remove`,`destroy`,`pre`,`post`];function Rf(e,t,n){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t===void 0?Df:t;for(let t of Lf)for(let n of e){let e=n[t];e!==void 0&&r[t].push(e)}function a(e){let t=e.id?`#`+e.id:``,n=e.getAttribute(`class`),r=n?`.`+n.split(` `).join(`.`):``;return Of(i.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function o(e){return Of(void 0,{},[],void 0,e)}function s(e,t){return function(){if(--t===0){let t=i.parentNode(e);t!==null&&i.removeChild(t,e)}}}function c(e,t){var a,o,s,l;let u,d=e.data,f=d==null?void 0:d.hook;(a=f==null?void 0:f.init)==null||a.call(f,e);let p=e.children,m=e.sel;if(m===`!`)e.text!=null||(e.text=``),e.elm=i.createComment(e.text);else if(m===``)e.elm=i.createTextNode(e.text);else if(m!==void 0){let n=m.indexOf(`#`),a=m.indexOf(`.`,n),s=n>0?n:m.length,l=a>0?a:m.length,h=n!==-1||a!==-1?m.slice(0,Math.min(s,l)):m,g=d==null?void 0:d.ns,_=g===void 0?i.createElement(h,d):i.createElementNS(g,h,d);for(e.elm=_,s<l&&_.setAttribute(`id`,m.slice(s+1,l)),a>0&&_.setAttribute(`class`,m.slice(l+1).replace(/\./g,` `)),u=0;u<r.create.length;++u)r.create[u](jf,e);if(Af(e.text)&&(!kf(p)||p.length===0)&&i.appendChild(_,i.createTextNode(e.text)),kf(p))for(u=0;u<p.length;++u){let e=p[u];e!=null&&i.appendChild(_,c(e,t))}f!==void 0&&((o=f.create)==null||o.call(f,jf,e),f.insert!==void 0&&t.push(e))}else if((s=n==null?void 0:n.experimental)!=null&&s.fragments&&e.children){for(e.elm=((l=i.createDocumentFragment)==null?Nf:l)(),u=0;u<r.create.length;++u)r.create[u](jf,e);for(u=0;u<e.children.length;++u){let n=e.children[u];n!=null&&i.appendChild(e.elm,c(n,t))}}else e.elm=i.createTextNode(e.text);return e.elm}function l(e,t,n,r,a,o){for(;r<=a;++r){let a=n[r];a!=null&&i.insertBefore(e,c(a,o),t)}}function u(e){var t,n;let i=e.data;if(i!==void 0){(n=(t=i==null?void 0:i.hook)==null?void 0:t.destroy)==null||n.call(t,e);for(let t=0;t<r.destroy.length;++t)r.destroy[t](e);if(e.children!==void 0)for(let t=0;t<e.children.length;++t){let n=e.children[t];n!=null&&typeof n!=`string`&&u(n)}}}function d(e,t,n,a){for(var o,c;n<=a;++n){let a,l=t[n];if(l!=null)if(l.sel!==void 0){u(l),a=r.remove.length+1;let e=s(l.elm,a);for(let t=0;t<r.remove.length;++t)r.remove[t](l,e);let t=(c=(o=l==null?void 0:l.data)==null?void 0:o.hook)==null?void 0:c.remove;t===void 0?e():t(l,e)}else l.children?(u(l),d(e,l.children,0,l.children.length-1)):i.removeChild(e,l.elm)}}function f(e,t,n,r){let a=0,o=0,s=t.length-1,u=t[0],f=t[s],m=n.length-1,h=n[0],g=n[m],_,v,y,b;for(;a<=s&&o<=m;)u==null?u=t[++a]:f==null?f=t[--s]:h==null?h=n[++o]:g==null?g=n[--m]:Mf(u,h)?(p(u,h,r),u=t[++a],h=n[++o]):Mf(f,g)?(p(f,g,r),f=t[--s],g=n[--m]):Mf(u,g)?(p(u,g,r),i.insertBefore(e,u.elm,i.nextSibling(f.elm)),u=t[++a],g=n[--m]):Mf(f,h)?(p(f,h,r),i.insertBefore(e,f.elm,u.elm),f=t[--s],h=n[++o]):(_===void 0&&(_=If(t,a,s)),v=_[h.key],v===void 0?(i.insertBefore(e,c(h,r),u.elm),h=n[++o]):_[g.key]===void 0?(i.insertBefore(e,c(g,r),i.nextSibling(f.elm)),g=n[--m]):(y=t[v],y.sel===h.sel?(p(y,h,r),t[v]=void 0,i.insertBefore(e,y.elm,u.elm)):i.insertBefore(e,c(h,r),u.elm),h=n[++o]));o<=m&&(b=n[m+1]==null?null:n[m+1].elm,l(e,b,n,o,m,r)),a<=s&&d(e,t,a,s)}function p(e,t,n){var a,o,s,c,u,p;let m=(a=t.data)==null?void 0:a.hook;(o=m==null?void 0:m.prepatch)==null||o.call(m,e,t);let h=t.elm=e.elm;if(e===t)return;if(t.data!==void 0||t.text!==void 0&&t.text!==e.text){t.data!=null||(t.data={}),e.data!=null||(e.data={});for(let n=0;n<r.update.length;++n)r.update[n](e,t);(u=(c=(s=t.data)==null?void 0:s.hook)==null?void 0:c.update)==null||u.call(c,e,t)}let g=e.children,_=t.children;t.text===void 0?g!==void 0&&_!==void 0?g!==_&&f(h,g,_,n):_===void 0?g===void 0?e.text!==void 0&&i.setTextContent(h,``):d(h,g,0,g.length-1):(e.text!==void 0&&i.setTextContent(h,``),l(h,null,_,0,_.length-1,n)):e.text!==t.text&&(g!==void 0&&d(h,g,0,g.length-1),i.setTextContent(h,t.text)),(p=m==null?void 0:m.postpatch)==null||p.call(m,e,t)}return function(e,t){let n,s,l,u=[];for(n=0;n<r.pre.length;++n)r.pre[n]();for(Pf(i,e)?e=a(e):Ff(i,e)&&(e=o(e)),Mf(e,t)?p(e,t,u):(s=e.elm,l=i.parentNode(s),c(t,u),l!==null&&(i.insertBefore(l,t.elm,i.nextSibling(s)),d(l,[e],0,0))),n=0;n<u.length;++n)u[n].data.hook.insert(u[n]);for(n=0;n<r.post.length;++n)r.post[n]();return t}}function zf(e,t,n){if(e.ns=`http://www.w3.org/2000/svg`,n!==`foreignObject`&&t!==void 0)for(let e=0;e<t.length;++e){let n=t[e];if(typeof n==`string`)continue;let r=n.data;r!==void 0&&zf(r,n.children,n.sel)}}function Bf(e,t,n){let r={},i,a,o;if(n===void 0?t!=null&&(kf(t)?i=t:Af(t)?a=t.toString():t&&t.sel?i=[t]:r=t):(t!==null&&(r=t),kf(n)?i=n:Af(n)?a=n.toString():n&&n.sel&&(i=[n])),i!==void 0)for(o=0;o<i.length;++o)Af(i[o])&&(i[o]=Of(void 0,void 0,void 0,i[o],void 0));return e.startsWith(`svg`)&&(e.length===3||e[3]===`.`||e[3]===`#`)&&zf(r,i,e),Of(e,r,i,a,void 0)}function Vf(e,t){let n,r=t.elm,i=e.data.attrs,a=t.data.attrs;if(!(!i&&!a)&&i!==a){for(n in i=i||{},a=a||{},a){let e=a[n];i[n]!==e&&(e===!0?r.setAttribute(n,``):e===!1?r.removeAttribute(n):n.charCodeAt(0)===120?n.charCodeAt(3)===58?r.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,n,e):n.charCodeAt(5)===58?n.charCodeAt(1)===109?r.setAttributeNS(`http://www.w3.org/2000/xmlns/`,n,e):r.setAttributeNS(`http://www.w3.org/1999/xlink`,n,e):r.setAttribute(n,e):r.setAttribute(n,e))}for(n in i)n in a||r.removeAttribute(n)}}const Hf={create:Vf,update:Vf};function Uf(e,t){let n,r,i=t.elm,a=e.data.class,o=t.data.class;if(!(!a&&!o)&&a!==o){for(r in a=a||{},o=o||{},a)a[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)n=o[r],n!==a[r]&&i.classList[n?`add`:`remove`](r)}}const Wf={create:Uf,update:Uf},Gf=/[A-Z]/g;function Kf(e,t){let n=t.elm,r=e.data.dataset,i=t.data.dataset,a;if(!r&&!i||r===i)return;r=r||{},i=i||{};let o=n.dataset;for(a in r)a in i||(o?a in o&&delete o[a]:n.removeAttribute(`data-`+a.replace(Gf,`-$&`).toLowerCase()));for(a in i)r[a]!==i[a]&&(o?o[a]=i[a]:n.setAttribute(`data-`+a.replace(Gf,`-$&`).toLowerCase(),i[a]))}const qf={create:Kf,update:Kf};function Jf(e,t,n){if(typeof e==`function`)e.call(t,n,t);else if(typeof e==`object`)for(let r=0;r<e.length;r++)Jf(e[r],t,n)}function Yf(e,t){let n=e.type,r=t.data.on;r&&r[n]&&Jf(r[n],t,e)}function Xf(){return function e(t){Yf(t,e.vnode)}}function Zf(e,t){let n=e.data.on,r=e.listener,i=e.elm,a=t&&t.data.on,o=t&&t.elm,s;if(n!==a){if(n&&r)if(a)for(s in n)a[s]||i.removeEventListener(s,r,!1);else for(s in n)i.removeEventListener(s,r,!1);if(a){let r=t.listener=e.listener||Xf();if(r.vnode=t,n)for(s in a)n[s]||o.addEventListener(s,r,!1);else for(s in a)o.addEventListener(s,r,!1)}}}const Qf={create:Zf,update:Zf,destroy:Zf};function $f(e,t){let n,r,i,a=t.elm,o=e.data.props,s=t.data.props;if(!(!o&&!s)&&o!==s)for(n in o=o||{},s=s||{},s)r=s[n],i=o[n],i!==r&&(n!==`value`||a[n]!==r)&&(a[n]=r)}const ep={create:$f,update:$f},tp=typeof(window==null?void 0:window.requestAnimationFrame)==`function`?window.requestAnimationFrame.bind(window):setTimeout,np=e=>{tp(()=>{tp(e)})};let rp=!1;function ip(e,t,n){np(()=>{e[t]=n})}function ap(e,t){let n,r,i=t.elm,a=e.data.style,o=t.data.style;if(!a&&!o||a===o)return;a=a||{},o=o||{};let s=`delayed`in a;for(r in a)r in o||(r[0]===`-`&&r[1]===`-`?i.style.removeProperty(r):i.style[r]=``);for(r in o)if(n=o[r],r===`delayed`&&o.delayed)for(let e in o.delayed)n=o.delayed[e],(!s||n!==a.delayed[e])&&ip(i.style,e,n);else r!==`remove`&&n!==a[r]&&(r[0]===`-`&&r[1]===`-`?i.style.setProperty(r,n):i.style[r]=n)}function op(e){let t,n,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(n in t)r.style[n]=t[n]}function sp(e,t){let n=e.data.style;if(!n||!n.remove){t();return}rp||(e.elm.offsetLeft,rp=!0);let r,i=e.elm,a=0,o=n.remove,s=0,c=[];for(r in o)c.push(r),i.style[r]=o[r];let l=getComputedStyle(i)[`transition-property`].split(`, `);for(;a<l.length;++a)c.indexOf(l[a])!==-1&&s++;i.addEventListener(`transitionend`,e=>{e.target===i&&--s,s===0&&t()})}function cp(){rp=!1}const lp={pre:cp,create:ap,update:ap,destroy:op,remove:sp};function up(e,t){for(let n of e)n!=null&&n!==!1&&n!==``&&(Array.isArray(n)?up(n,t):typeof n==`string`||typeof n==`number`||typeof n==`boolean`?t.push(Of(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function dp(e,t,...n){let r=up(n,[]);return typeof e==`function`?e(t,r):r.length===1&&!r[0].sel&&r[0].text?Bf(e,t,r[0].text):Bf(e,t,r)}const fp=[];function pp(e){fp.push(e)}const mp={};function hp(e){let{type:t,renderElem:n}=e,r=t||``;mp[r]=n}function gp(e,t,n){return dp(n.isInline(e)?`span`:`div`,null,t)}function _p(e){return mp[e]||gp}var vp=_p;function yp(e,t,n){let r=t;return fp.forEach(t=>{r=t(e,r,n)}),r}var bp=yp;function xp(e,t){let n=X.findKey(t,e),r=t.isInline(e),i=U.isVoid(t,e),a=Js(e.type,n.id),o={id:a,key:n.id,"data-slate-node":`element`,"data-slate-inline":r},{type:s,children:c=[]}=e,l=vp(s),u;u=i?null:c.map((n,r)=>jp(n,r,e,t));let d=l(e,u,t);if(i){o[`data-slate-void`]=!0;let n=r?`span`:`div`,[[i]]=B.texts(e),a=jp(i,0,e,t);d=dp(n,{style:{position:`relative`}},d,dp(n,{"data-slate-spacer":!0,style:{height:`0`,color:`transparent`,outline:`none`,position:`absolute`}},a)),Ua.set(i,0),Wa.set(i,e)}return d.data==null&&(d.data={}),Object.assign(d.data,o),!i&&!r&&(d=bp(e,d,t)),Ft(()=>{let r=Ga.get(t),i=r==null?void 0:r.querySelector(`#${a}`);i!=null&&(qa.set(n,i),Ja.set(e,i),Ka.set(i,e))}),d}var Sp=xp;function Cp(e,t=!1){return dp(`span`,{"data-slate-string":!0},t?`${e}\n`:e)}function wp(e=0,t=!1){return dp(`span`,{"data-slate-zero-width":t?`n`:`z`,"data-slate-length":e},``,t?dp(`br`,null):null)}function Tp(e,t,n,r,i=!1){let{text:a}=e,o=X.findPath(r,t),s=L.parent(o);if(U.isEditor(n))throw Error(`Text node ${JSON.stringify(t)} parent is Editor`);return r.isVoid(n)?wp(B.string(n).length):a===``&&n.children[n.children.length-1]===t&&!r.isInline(n)&&U.string(r,s)===``?wp(0,!0):a===``?wp():i&&a.slice(-1)===`
|
|
31
|
+
`?Cp(a,!0):Cp(a)}var Ep=Tp;function Dp(e,t,n){let r=t;return fp.forEach(t=>{r=t(e,r,n)}),r}var Op=Dp;function kp(e,t,n){if(e.text==null)throw Error(`Current node is not slate Text ${JSON.stringify(e)}`);let r=X.findKey(n,e),{decorate:i}=n.getConfig();if(i==null)throw Error(`Can not get config.decorate`);let a=i([e,X.findPath(n,e)]),o=Zn.decorations(e,a),s=o.map(({leaf:r,position:i})=>{var a;let s=Ep(r,e,t,n,(a=i==null?void 0:i.isLast)==null?o.length===1:a);return s=Op(r,s,n),dp(`span`,{"data-slate-leaf":!0},s)}),c=Ys(r.id),l=dp(`span`,{"data-slate-node":`text`,id:c,key:r.id},s);return Ft(()=>{let t=Ga.get(n),i=t==null?void 0:t.querySelector(`#${c}`);i!=null&&(qa.set(r,i),Ja.set(e,i),Ka.set(i,e))}),l}var Ap=kp;function jp(e,t,n,r){Ua.set(e,t),Wa.set(e,n);let i;return i=z.isElement(e)?Sp(e,r):Ap(e,n,r),i}var Mp=u(s(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=`\\ud800-\\udfff`,s=`\\u0300-\\u036f\\ufe20-\\ufe23`,c=`\\u20d0-\\u20f0`,l=`\\u2700-\\u27bf`,u=`a-z\\xdf-\\xf6\\xf8-\\xff`,d=`\\xac\\xb1\\xd7\\xf7`,f=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,p=`\\u2000-\\u206f`,m=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,h=`A-Z\\xc0-\\xd6\\xd8-\\xde`,g=`\\ufe0e\\ufe0f`,_=d+f+p+m,v=`['’]`,y=`[`+o+`]`,b=`[`+_+`]`,x=`[`+s+c+`]`,S=`\\d+`,C=`[`+l+`]`,w=`[`+u+`]`,T=`[^`+o+_+S+l+u+h+`]`,E=`\\ud83c[\\udffb-\\udfff]`,D=`(?:`+x+`|`+E+`)`,O=`[^`+o+`]`,k=`(?:\\ud83c[\\udde6-\\uddff]){2}`,A=`[\\ud800-\\udbff][\\udc00-\\udfff]`,j=`[`+h+`]`,M=`\\u200d`,N=`(?:`+w+`|`+T+`)`,P=`(?:`+j+`|`+T+`)`,ee=`(?:`+v+`(?:d|ll|m|re|s|t|ve))?`,F=`(?:`+v+`(?:D|LL|M|RE|S|T|VE))?`,te=D+`?`,ne=`[`+g+`]?`,re=`(?:`+M+`(?:`+[O,k,A].join(`|`)+`)`+ne+te+`)*`,ie=ne+te+re,ae=`(?:`+[C,k,A].join(`|`)+`)`+ie,oe=`(?:`+[O+x+`?`,x,k,A,y].join(`|`)+`)`,se=RegExp(v,`g`),ce=RegExp(x,`g`),le=RegExp(E+`(?=`+E+`)|`+oe+ie,`g`),ue=RegExp([j+`?`+w+`+`+ee+`(?=`+[b,j,`$`].join(`|`)+`)`,P+`+`+F+`(?=`+[b,j+N,`$`].join(`|`)+`)`,j+`?`+N+`+`+ee,j+`+`+F,S,ae].join(`|`),`g`),de=RegExp(`[`+M+o+s+c+g+`]`),fe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pe={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},me=typeof global==`object`&&global&&global.Object===Object&&global,he=typeof self==`object`&&self&&self.Object===Object&&self,ge=me||he||Function(`return this`)();function _e(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ve(e){return e.split(``)}function ye(e){return e.match(i)||[]}function be(e){return function(t){return e==null?void 0:e[t]}}var xe=be(pe);function Se(e){return de.test(e)}function Ce(e){return fe.test(e)}function we(e){return Se(e)?Te(e):ve(e)}function Te(e){return e.match(le)||[]}function Ee(e){return e.match(ue)||[]}var De=Object.prototype.toString,Oe=ge.Symbol,ke=Oe?Oe.prototype:void 0,Ae=ke?ke.toString:void 0;function je(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function Me(e){if(typeof e==`string`)return e;if(Le(e))return Ae?Ae.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function Ne(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:je(e,t,n)}function Pe(e){return function(t){t=Re(t);var n=Se(t)?we(t):void 0,r=n?n[0]:t.charAt(0),i=n?Ne(n,1).join(``):t.slice(1);return r[e]()+i}}function Fe(e){return function(t){return _e(Ue(Ve(t).replace(se,``)),e,``)}}function Ie(e){return!!e&&typeof e==`object`}function Le(e){return typeof e==`symbol`||Ie(e)&&De.call(e)==r}function Re(e){return e==null?``:Me(e)}var ze=Fe(function(e,t,n){return t=t.toLowerCase(),e+(n?Be(t):t)});function Be(e){return He(Re(e).toLowerCase())}function Ve(e){return e=Re(e),e&&e.replace(a,xe).replace(ce,``)}var He=Pe(`toUpperCase`);function Ue(e,t,n){return e=Re(e),t=n?void 0:t,t===void 0?Ce(e)?Ee(e):ye(e):e.match(t)||[]}t.exports=ze}))(),1);function Np(){return Rf([Wf,ep,lp,qf,Qf,Hf])}const Pp=[`props`,`attrs`,`style`,`dataset`,`on`,`hook`,`ns`];function Fp(e,t){e.data==null&&(e.data={});let n=e.data;n.props==null&&(n.props={}),Object.assign(n.props,t)}function Ip(e,t){e.data==null&&(e.data={});let n=e.data;n.dataset==null&&(n.dataset={}),Object.assign(n.dataset,t)}function Lp(e){let{data:t={},children:n=[]}=e;Object.keys(t).forEach(n=>{let r=t[n];if(n===`key`){e.key=r;return}if(!Pp.includes(n)){if(n.startsWith(`data-`)){let i=n.slice(5);i=(0,Mp.default)(i),Ip(e,{[i]:r}),delete t[n];return}Fp(e,{[n]:r}),delete t[n]}}),n.length>0&&n.forEach(e=>{typeof e!=`string`&&Lp(e)})}function Rp(e){return`w-e-textarea-${e}`}function zp(e,t=!1){return Bf(`div#${e}`,{props:{contentEditable:!t}})}function Bp(e,t=!1){return Y(`<div
|
|
32
|
+
id="${e}"
|
|
33
|
+
data-slate-editor
|
|
34
|
+
data-slate-node="value"
|
|
35
|
+
suppressContentEditableWarning
|
|
36
|
+
role="textarea"
|
|
37
|
+
spellCheck="true"
|
|
38
|
+
autoCorrect="true"
|
|
39
|
+
autoCapitalize="true"
|
|
40
|
+
></div>`)}function Vp(e,t){let n=e.$scroll,r=Rp(e.id),{readOnly:i,autoFocus:a}=t.getConfig(),o=zp(r,i);o.children=(t.children||[]).map((e,n)=>{if(Va.has(e)){let t=Va.get(e);if(t){let[r,i]=t;if(i)return r!==n&&(Ua.set(e,n),Va.set(e,[n,i])),i}}let r=jp(e,n,t,t);Lp(r);let{skipCacheTypes:i=[`list-item`]}=t.getConfig();return z.isElement(e)&&i.includes(e.type)||Va.set(e,[n,r]),r});let s,c=Ra.get(e);if(c==null&&(c=!0),c){let a=Bp(r,i);n.append(a),e.$textArea=a,s=a[0],Ga.set(t,s),Ja.set(t,s),Ka.set(s,t);let c=Np();c(s,o),Ra.set(e,!1),za.set(e,c)}else{let t=Ba.get(e),n=za.get(e);if(t==null||n==null)return;s=t.elm,n(t,o)}if(s==null){let e=n[0];if(s=(e==null?void 0:e.querySelector(`#${r}`))||fs(r),s==null)return}let l;if(l=c?a:t.isFocused(),l&&s.focus({preventScroll:!0}),c){let e=rs(s);e&&Xa.set(t,e)}Ga.set(t,s),Ja.set(t,s),Ka.set(s,t),Ba.set(e,o)}var Hp=Vp;let Up=1;var Wp=class{constructor(e){this.selectionChangeRoot=null,this.destroyed=!1,this.id=Up++,this.$textArea=null,this.$progressBar=Y(`<div class="w-e-progress-bar"></div>`),this.$maxLengthInfo=Y(`<div class="w-e-max-length-info"></div>`),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=(0,sd.default)(e=>{let t=os(e==null?void 0:e.target)?e.target:null,n=t==null?void 0:t.tagName;if(n===`INPUT`||n===`TEXTAREA`)return;let r=this.getActiveEditor();r!=null&&Ad(this,r)},100);let t=Y(e);if(t.length===0)throw Error(`Cannot find textarea DOM by selector '${e}'`);this.$box=t;let n=Y(`<div class="w-e-text-container"></div>`);n.append(this.$progressBar),n.append(this.$maxLengthInfo),t.append(n);let r=Y(`<div class="w-e-scroll"></div>`);n.append(r),this.$scroll=r,this.$textAreaContainer=n,Ft(()=>{let e=this.getActiveEditor();if(e==null)return;this.bindSelectionChange(e),n.on(`click`,()=>e.hidePanelOrModal()),e.on(q.CHANGE,this.changeViewState.bind(this));let{onChange:r,scroll:i}=e.getConfig();r&&e.on(q.CHANGE,()=>r(e)),i||(t.css(`position`,`relative`),n.addClass(`no-scroll`)),this.onFocusAndOnBlur(),e.on(q.CHANGE,this.changeMaxLengthInfo.bind(this)),this.bindEvent()})}get editorInstance(){let e=ka.get(this);if(e==null)throw Error(`Can not get editor instance`);return e}getActiveEditor(){if(this.destroyed)return null;let e=ka.get(this);return e==null||e.isDestroyed?null:e}bindSelectionChange(e,t=5){if(!(this.selectionChangeRoot!=null||e.isDestroyed)){try{let t=X.findDocumentOrShadowRoot(e);t.addEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=t}catch(n){if(t>0){setTimeout(()=>this.bindSelectionChange(e,t-1),0);return}window.document.addEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(q.DESTROYED,()=>{var e;(e=this.selectionChangeRoot)==null||e.removeEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=null})}}flushDOMSelectionChange(){this.onDOMSelectionChange.flush()}bindEvent(){let{$textArea:e,$scroll:t}=this,n=this.editorInstance;if(e==null)return;(0,Pt.default)(cf,(t,r)=>{e.on(r,e=>{t(e,this,n)})});let{scroll:r}=n.getConfig();r&&(t.css(`overflow-y`,`auto`),t.on(`scroll`,(0,sd.default)(()=>{n.emit(q.SCROLL)},100)))}onFocusAndOnBlur(){let e=this.getActiveEditor();if(e==null)return;let{onBlur:t,onFocus:n}=e.getConfig();this.latestEditorSelection=e.selection,e.on(q.CHANGE,()=>{this.latestEditorSelection==null&&e.selection!=null?setTimeout(()=>{this.destroyed||e.isDestroyed||n&&n(e)}):this.latestEditorSelection!=null&&e.selection==null&&setTimeout(()=>{this.destroyed||e.isDestroyed||t&&t(e)}),this.latestEditorSelection=e.selection})}changeMaxLengthInfo(){let e=this.getActiveEditor();if(e==null)return;let{maxLength:t}=e.getConfig();if(t){let n=t-X.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML=`${n}/${t}`}}changeProgress(e){let t=this.$progressBar;t.css(`width`,`${e}%`),e>=100&&setTimeout(()=>{t.hide(),t.css(`width`,`0`),t.show()},1e3)}changeViewState(){let e=this.getActiveEditor();e!=null&&(Hp(this,e),vd(this,e),Ft(()=>{this.destroyed||e.isDestroyed||kd(this,e)}))}destroy(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),(e=this.selectionChangeRoot)==null||e.removeEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()}};function Gp(e,t,n,r){if(Ua.set(e,t),Wa.set(e,n),z.isElement(e)){let{children:t=[]}=e;if(t.forEach((t,n)=>Gp(t,n,e,r)),U.isVoid(r,e)){let[[t]]=B.texts(e);Ua.set(t,0),Wa.set(t,e)}}}var Kp=Gp;function qp(e){let{selector:t=``,config:n={},content:r,html:i,plugins:a=[]}=e,o=(e=>[fl,Lc,ro,Fc,jl,ul,Tl,xl].reduce((e,t)=>t(e),e))(ma());if(t&&Us(o,t))throw Error(`Repeated create editor by selector '${t}'`);let s=wa(n);La.set(o,s);let{hoverbarKeys:c={}}=s;if(a.forEach(e=>{o=e(o)}),qs(o,{html:i,content:r}),t){let e=new Wp(t);Oa.set(o,e),ka.set(e,o),e.changeViewState();let n;Object.keys(c).length>0&&(n=new od,Ma.set(n,o),Na.set(o,n)),o.on(q.CHANGE,()=>{o.hidePanelOrModal()}),o.on(q.SCROLL,()=>{o.hidePanelOrModal()})}else o.children.forEach((e,t)=>Kp(e,t,o,o));let{onCreated:l,onDestroyed:u}=s;return l&&o.on(q.CREATED,()=>l(o)),u&&o.on(q.DESTROYED,()=>u(o)),Ft(()=>o.emit(q.CREATED)),o}var Jp=class{constructor(e,t){this.$toolbar=Y(`<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>`),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=()=>{},this.syncToolbarState=()=>{this.toolbarItems.forEach(e=>{e.changeMenuState()})},this.changeToolbarState=(0,Ml.default)(()=>{this.syncToolbarState()},200),this.config=t;let n=Y(e);if(n.length===0)throw Error(`Cannot find toolbar DOM by selector '${e}'`);this.$box=n;let r=this.$toolbar;r.on(`mousedown`,e=>e.preventDefault(),{passive:!1}),n.append(r),Ft(()=>{this.initToolbar(),this.lngListen=Pu(()=>this.initToolbar());let e=this.getEditorInstance();e.on(q.CHANGE,this.changeToolbarState),e.on(q.FULLSCREEN,this.syncToolbarState),e.on(q.UNFULLSCREEN,this.syncToolbarState)})}getMenus(){return this.menus}getConfig(){return this.config}initToolbar(){this.menus={};let e=this.$toolbar;e==null||e.empty(),this.registerItems(),this.changeToolbarState()}registerItems(){let e=``,t=this.$toolbar,{toolbarKeys:n=[],insertKeys:r={index:0,keys:[]},excludeKeys:i=[]}=this.config,a=(0,ha.default)(n),o=[];o=Array.isArray(r)?r:[r];let s=0;o.forEach(e=>{let t=e.index+s;if(e.replaceFn&&a[t]){let n=e.replaceFn(a[t]);if(!n)throw Error(`This function needs to return the menu configuration: IToolbarMenuKey`);a[t]=n}e.keys.length>0&&(typeof e.keys==`string`&&(e.keys=[e.keys]),e.keys.forEach((e,n)=>{a.splice(t+n,0,e)}),s+=e.keys.length)});let c=a.filter(e=>{let t=typeof e==`string`?e:e.key;return!i.includes(t)}),l=c.length;c.forEach((n,r)=>{if(n===`|`){if(r===0||r+1===l||e===`|`)return;let i=Ru();t.append(i),e=n;return}if(typeof n==`string`){this.registerSingleItem(n,this),e=n;return}if(this.isMenuGroup(n)){this.registerGroup(n),e=`group`;return}this.registerSingleMenuByConf(n),e=n.key})}isMenuGroup(e){return typeof e!=`string`&&Array.isArray(e.menuKeys)}registerSingleMenuByConf(e){let{key:t,title:n,iconSvg:r}=e;this.registerSingleItem(t,this,{title:n,iconSvg:r})}registerGroup(e){let t=this.$toolbar,n=id(e),{menuKeys:r=[]}=e,{excludeKeys:i=[]}=this.config;r.forEach(e=>{i.includes(e)||this.registerSingleItem(e,n)}),t.append(n.$elem)}registerSingleItem(e,t,n={}){let r=this.getEditorInstance(),i=t instanceof Wu,{menus:a}=this,o=a[e];if(o==null){let t=Ea[e];if(t==null)throw Error(`Not found menu item factory by key '${e}'`);if(typeof t!=`function`)throw Error(`Menu item factory (key='${e}') is not a function`);o=t(),a[e]=o}else console.warn(`Duplicated toolbar menu key '${e}'\n重复注册了菜单栏 menu '${e}'`);let s=r.getMenuConfig(e);s&&s.iconSvg!==void 0&&(o.iconSvg=s.iconSvg),n.iconSvg!==void 0&&(o.iconSvg=n.iconSvg),n.title!==void 0&&(o.title=n.title);let c=rd(e,o,i);this.toolbarItems.push(c),Pa.set(c,r),i?t.appendBarItem(c):t.$toolbar.append(c.$elem)}getEditorInstance(){let e=Aa.get(this);if(e==null)throw Error(`Can not get editor instance`);return e}destroy(){var e;this.$toolbar.remove(),(e=this.lngListen)==null||e.call(this),this.menus={},this.toolbarItems=[]}};function Yp(e,t){if(e==null)throw Error(`Cannot create toolbar, because editor is null`);let{selector:n,config:r={}}=t;if(Ws(e,n))throw Error(`Repeated create toolbar by selector '${n}'`);let i=new Jp(n,Ta(r));return Aa.set(i,e),ja.set(e,i),i}function Xp(e){return e&&e.getConfig().textStyleMode===`class`?`class`:`inline`}function Zp(e){if(!e)return`preserve-data`;let t=e.getConfig().classStylePolicy;return t===`fallback-inline`?`fallback-inline`:t===`strict`?`strict`:`preserve-data`}function Qp(e,t){let n=e==null?void 0:e.getConfig().onClassStyleUnsupported;if(n){n(t);return}console.warn(t.message)}ju(`en`,{editor:{more:`More`,justify:`Justify`,indent:`Indent`,image:`Image`,video:`Video`}}),ju(`zh-CN`,{editor:{more:`更多`,justify:`对齐`,indent:`缩进`,image:`图片`,video:`视频`}});function $p(e){let{menus:t,renderElems:n,renderStyle:r,elemsToHtml:i,styleToHtml:a,htmlTransform:o,preParseHtml:s,parseElemsHtml:c,parseStyleHtml:l,editorPlugin:u}=e;t&&t.forEach(e=>nm.registerMenu(e)),n&&n.forEach(e=>nm.registerRenderElem(e)),r&&nm.registerRenderStyle(r),i&&i.forEach(e=>nm.registerElemToHtml(e)),a&&nm.registerStyleToHtml(a),o&&nm.registerHtmlTransform(o),s&&s.forEach(e=>nm.registerPreParseHtml(e)),c&&c.forEach(e=>nm.registerParseElemHtml(e)),l&&nm.registerParseStyleHtml(l),u&&nm.registerPlugin(u)}var em=$p;D();var tm=class{constructor(){throw Error(`不能实例化
|
|
41
|
+
Can not construct a instance`)}static setEditorConfig(e={}){this.editorConfig=E(E({},this.editorConfig),e)}static setSimpleEditorConfig(e={}){this.simpleEditorConfig=E(E({},this.simpleEditorConfig),e)}static setToolbarConfig(e={}){this.toolbarConfig=E(E({},this.toolbarConfig),e)}static setSimpleToolbarConfig(e={}){this.simpleToolbarConfig=E(E({},this.simpleToolbarConfig),e)}static registerPlugin(e){this.plugins.push(e)}static registerMenu(e,t){Da(e,t)}static registerRenderElem(e){hp(e)}static registerRenderStyle(e){pp(e)}static registerElemToHtml(e){nc(e)}static registerStyleToHtml(e){Zs(e)}static registerHtmlTransform(e){$s(e)}static registerPreParseHtml(e){Cs(e)}static registerParseElemHtml(e){Ds(e)}static registerParseStyleHtml(e){Ts(e)}static registerModule(e){em(e)}};tm.editorConfig={},tm.simpleEditorConfig={},tm.toolbarConfig={},tm.simpleToolbarConfig={},tm.plugins=[];var nm=tm;D();function rm(e={}){let{selector:t=``,content:n=[],html:r,config:i={},mode:a=`default`}=e,o=a===`simple`?nm.simpleEditorConfig:nm.editorConfig,s=E(E({},o.hoverbarKeys||{}),i.hoverbarKeys||{});return qp({selector:t,config:E(E(E({},o),i),{},{hoverbarKeys:s}),content:n,html:r,plugins:nm.plugins})}function im(e){let{selector:t,editor:n,config:r={},mode:i=`default`}=e;if(!t)throw Error(`Cannot find 'selector' when create toolbar`);return Yp(n,{selector:t,config:E(E({},i===`simple`?nm.simpleToolbarConfig:nm.toolbarConfig),r)})}D();const am=new Set,om=new WeakSet;function sm(e){return typeof e==`object`&&!!e&&`module`in e}function cm(e){return sm(e)?e:{module:e}}function lm(e,t={}){return E(E(E({},e),t),{},{hoverbarKeys:E(E({},e.hoverbarKeys||{}),t.hoverbarKeys||{})})}function um(e){let{key:t,module:n}=cm(e);if(!(t&&am.has(t))){if(typeof n!=`object`||!n)throw Error(`Invalid extension module. Expect an object that follows IModuleConf.`);om.has(n)||(nm.registerModule(n),t&&am.add(t),om.add(n))}}function dm(e=[]){e.forEach(e=>um(e))}function fm(e={}){let{extensions:t=[],editorConfig:n={},toolbarConfig:r={}}=e;dm(t);let i=(e={})=>{let t=lm(n,e.config||{});return rm(E(E({},e),{},{config:t}))},a=e=>im(E(E({},e),{},{config:E(E({},r),e.config||{})}));return{create:(e={})=>{let{editor:t={},toolbar:n}=e,r=i(t);return{editor:r,toolbar:n?a(E(E({},n),{},{editor:r})):null}},createEditor:i,createToolbar:a,registerExtensions:dm}}var pm={};export{nm as Boot,X as DomEditor,U as SlateEditor,z as SlateElement,B as SlateNode,L as SlatePath,G as SlatePoint,R as SlateRange,Zn as SlateText,K as SlateTransforms,Jp as Toolbar,rm as createEditor,fm as createEditorFactory,im as createToolbar,pm as default,Ju as genModalButtonElems,Ku as genModalInputElems,qu as genModalTextareaElems,Zp as getClassStylePolicy,Xp as getTextStyleMode,ju as i18nAddResources,Mu as i18nChangeLanguage,Nu as i18nGetResources,dm as registerExtensions,Qp as reportUnsupportedClassStyle,Fu as t};
|
|
42
|
+
//# sourceMappingURL=core.mjs.map
|