@ncino/web-components 3.4.0-preview.2 → 3.4.0-preview.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/dist/_virtual/index.js +1 -1
- package/dist/_virtual/index2.js +1 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@45.0.0/node_modules/ckeditor5/dist/ckeditor5.css +4 -0
- package/dist/components/input-rich-text/ckeditor-config.js +1 -1
- package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-alignment@45.0.0/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@44.3.0 → @ckeditor_ckeditor5-autoformat@45.0.0}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@44.3.0 → @ckeditor_ckeditor5-autosave@45.0.0}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@45.0.0/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@44.3.0 → @ckeditor_ckeditor5-block-quote@45.0.0}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@45.0.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +20 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@44.3.0 → @ckeditor_ckeditor5-cloud-services@45.0.0}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@44.3.0 → @ckeditor_ckeditor5-code-block@45.0.0}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +5 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@45.0.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@45.0.0/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-engine@44.3.0 → @ckeditor_ckeditor5-engine@45.0.0}/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@44.3.0 → @ckeditor_ckeditor5-enter@45.0.0}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@44.3.0 → @ckeditor_ckeditor5-essentials@45.0.0}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@45.0.0/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +5 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@45.0.0/node_modules/@ckeditor/ckeditor5-font/dist/index.js +7 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@44.3.0 → @ckeditor_ckeditor5-heading@45.0.0}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-highlight@45.0.0/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-horizontal-line@45.0.0/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@45.0.0/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@45.0.0/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +12 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-icons@45.0.0/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +6 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@45.0.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +10 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@45.0.0/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +10 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@44.3.0 → @ckeditor_ckeditor5-language@45.0.0}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@45.0.0/node_modules/@ckeditor/ckeditor5-link/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@45.0.0/node_modules/@ckeditor/ckeditor5-list/dist/index.js +13 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@44.3.0 → @ckeditor_ckeditor5-markdown-gfm@45.0.0}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@45.0.0/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +7 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@44.3.0 → @ckeditor_ckeditor5-mention@45.0.0}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@45.0.0/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@44.3.0 → @ckeditor_ckeditor5-paragraph@45.0.0}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paste-from-office@44.3.0 → @ckeditor_ckeditor5-paste-from-office@45.0.0}/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-remove-format@45.0.0/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-select-all@45.0.0/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-show-blocks@45.0.0/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@45.0.0/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +12 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@45.0.0/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@44.3.0 → @ckeditor_ckeditor5-style@45.0.0}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@45.0.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +16 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-typing@44.3.0 → @ckeditor_ckeditor5-typing@45.0.0}/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@45.0.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +28 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@44.3.0 → @ckeditor_ckeditor5-undo@45.0.0}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@44.3.0 → @ckeditor_ckeditor5-upload@45.0.0}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-utils@44.3.0 → @ckeditor_ckeditor5-utils@45.0.0}/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +9 -9
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@44.3.0 → @ckeditor_ckeditor5-watchdog@45.0.0}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@45.0.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@storybook_instrumenter@8.6.12_storybook@8.6.12_prettier@3.4.2_ → @storybook_instrumenter@8.6.12_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/instrumenter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@storybook_test@8.6.12_storybook@8.6.12_prettier@3.4.2_ → @storybook_test@8.6.12_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/test/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/color-parse@1.4.2/node_modules/color-parse/index.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/getTag.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/isIndex.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/tags.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/toKey.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/debounce.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/throttle.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/assignIn.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/get.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/keysIn.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/mapValues.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/merge.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/mergeWith.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/property.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/set.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/unset.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isElement.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObject.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isString.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/string/escapeRegExp.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/string/startCase.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/string/upperFirst.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/eq.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/times.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/toFinite.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/toInteger.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/toNumber.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/toPath.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/util/toString.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/after.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/debounce.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/identity.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/noop.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/clone.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/cloneDeepWith.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/mapValues.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isBuffer.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isEqual.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isEqualWith.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isFunction.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isLength.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isPlainObject.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isPrimitive.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isTypedArray.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/string/escapeRegExp.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/string/upperFirst.js +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/string/words.js +1 -0
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@44.3.0/node_modules/ckeditor5/dist/ckeditor5.css +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-alignment@44.3.0/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@44.3.0/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@44.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +0 -20
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@44.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +0 -6
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@44.3.0/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@44.3.0/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +0 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@44.3.0/node_modules/@ckeditor/ckeditor5-font/dist/index.js +0 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-highlight@44.3.0/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-horizontal-line@44.3.0/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@44.3.0/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@44.3.0/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +0 -12
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@44.3.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +0 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@44.3.0/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +0 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@44.3.0/node_modules/@ckeditor/ckeditor5-link/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@44.3.0/node_modules/@ckeditor/ckeditor5-list/dist/index.js +0 -13
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@44.3.0/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +0 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@44.3.0/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-remove-format@44.3.0/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-select-all@44.3.0/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-show-blocks@44.3.0/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@44.3.0/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +0 -12
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@44.3.0/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@44.3.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +0 -19
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@44.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +0 -29
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@44.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiToArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiWords.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMap.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyOf.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnset.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castSlice.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createCaseFirst.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createCompounder.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_deburrLetter.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicodeWord.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_parent.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeToArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeWords.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assignIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/clone.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeepWith.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/deburr.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/escapeRegExp.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isElement.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEqual.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEqualWith.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mergeWith.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/set.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/startCase.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/throttle.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/unset.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/upperFirst.js +0 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/words.js +0 -1
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.12_prettier@3.4.2_storybook@8.6.12_prettier@3.4.2_ → @storybook_core@8.6.12_prettier@3.5.3_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/core/dist/channels/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.12_prettier@3.4.2_storybook@8.6.12_prettier@3.4.2_ → @storybook_core@8.6.12_prettier@3.5.3_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/core/dist/client-logger/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.12_prettier@3.4.2_storybook@8.6.12_prettier@3.4.2_ → @storybook_core@8.6.12_prettier@3.5.3_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/core/dist/core-events/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.12_prettier@3.4.2_storybook@8.6.12_prettier@3.4.2_ → @storybook_core@8.6.12_prettier@3.5.3_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/core/dist/csf/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.12_prettier@3.4.2_storybook@8.6.12_prettier@3.4.2_ → @storybook_core@8.6.12_prettier@3.5.3_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/core/dist/preview-api/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.12_prettier@3.4.2_storybook@8.6.12_prettier@3.4.2_ → @storybook_core@8.6.12_prettier@3.5.3_storybook@8.6.12_prettier@3.5.3_}/node_modules/@storybook/core/dist/preview-errors.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_browser@3.1.2_msw@2.7.3_@types_node@22.13.10_typescript@5.8.3__playwright@1.52._d9f437d9be40af4c1087950720317100 → @vitest_browser@3.1.2_msw@2.7.3_@types_node@22.14.1_typescript@5.8.3__playwright@1.52.0_92e0976dd8f8178c7dbbaa4988dfa8c8}/node_modules/@vitest/browser/context.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.1.2_@types_debug@4.1.12_@types_node@22.13.10_@vitest_browser@3.1.2_@vitest_ui@_b3e273fb96cdae5dad1113241e94b66d → vitest@3.1.2_@types_debug@4.1.12_@types_node@22.14.1_@vitest_browser@3.1.2_@vitest_ui@3_941980ac824345de547571ef69676a52}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.1.2_@types_debug@4.1.12_@types_node@22.13.10_@vitest_browser@3.1.2_@vitest_ui@_b3e273fb96cdae5dad1113241e94b66d → vitest@3.1.2_@types_debug@4.1.12_@types_node@22.14.1_@vitest_browser@3.1.2_@vitest_ui@3_941980ac824345de547571ef69676a52}/node_modules/vitest/dist/chunks/date.CDOsz-HY.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.1.2_@types_debug@4.1.12_@types_node@22.13.10_@vitest_browser@3.1.2_@vitest_ui@_b3e273fb96cdae5dad1113241e94b66d → vitest@3.1.2_@types_debug@4.1.12_@types_node@22.14.1_@vitest_browser@3.1.2_@vitest_ui@3_941980ac824345de547571ef69676a52}/node_modules/vitest/dist/chunks/utils.CgTj3MsC.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.1.2_@types_debug@4.1.12_@types_node@22.13.10_@vitest_browser@3.1.2_@vitest_ui@_b3e273fb96cdae5dad1113241e94b66d → vitest@3.1.2_@types_debug@4.1.12_@types_node@22.14.1_@vitest_browser@3.1.2_@vitest_ui@3_941980ac824345de547571ef69676a52}/node_modules/vitest/dist/chunks/vi.ClIskdbk.js +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var G=Object.defineProperty;var K=(s,r,e)=>r in s?G(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var A=(s,r,e)=>K(s,typeof r!="symbol"?r+"":r,e);import{Plugin as f}from"../../../../../@ckeditor_ckeditor5-core@44.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{uid as H,priorities as S,CKEditorError as X,toArray as F,isValidAttributeName as Q}from"../../../../../@ckeditor_ckeditor5-utils@44.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{UpcastWriter as V,HtmlDataProcessor as Y,Matcher as M,StylesMap as J}from"../../../../../@ckeditor_ckeditor5-engine@44.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Widget as Z,toWidget as z}from"../../../../../@ckeditor_ckeditor5-widget@44.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{Enter as ee}from"../../../../../@ckeditor_ckeditor5-enter@44.3.0/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import N from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/isEqual.js";import te from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/mergeWith.js";import re from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/startCase.js";import ie from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js";import oe from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/function v(s,r,e,t){r&&le(s,r,t),e&&p(s,e,t)}function p(s,r,e){if(r.attributes)for(const[t,i]of Object.entries(r.attributes))s.setAttribute(t,i,e);r.styles&&s.setStyle(r.styles,e),r.classes&&s.addClass(r.classes,e)}function le(s,r,e){if(r.attributes)for(const[t]of Object.entries(r.attributes))s.removeAttribute(t,e);if(r.styles)for(const t of Object.keys(r.styles))s.removeStyle(t,e);r.classes&&s.removeClass(r.classes,e)}function ne(s,r){const e=oe(s);let t="attributes";for(t in r)t=="classes"?e[t]=Array.from(new Set([...s[t]||[],...r[t]])):e[t]={...s[t],...r[t]};return e}function E(s,r,e,t,i){const o=r.getAttribute(e),l={};for(const n of["attributes","styles","classes"]){if(n!=t){o&&o[n]&&(l[n]=o[n]);continue}if(t=="classes"){const a=new Set(o&&o.classes||[]);i(a),a.size&&(l[n]=Array.from(a));continue}const m=new Map(Object.entries(o&&o[n]||{}));i(m),m.size&&(l[n]=Object.fromEntries(m))}Object.keys(l).length?r.is("documentSelection")?s.setSelectionAttribute(e,l):s.setAttribute(e,l,r):o&&(r.is("documentSelection")?s.removeSelectionAttribute(e):s.removeAttribute(e,r))}function se(s){return re(s).replace(/ /g,"")}function b(s){return`html${se(s)}Attributes`}function x({model:s}){return(r,e)=>e.writer.createElement(s,{htmlContent:r.getCustomProperty("$rawContent")})}function me(s,{view:r,isInline:e}){const t=s.t;return(i,{writer:o})=>{const l=t("HTML object"),n=T(r,i,o),m=i.getAttribute(b(r));o.addClass("html-object-embed__content",n),m&&p(o,m,n);const a=o.createContainerElement(e?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},n);return z(a,o,{label:l})}}function T(s,r,e){return e.createRawElement(s,null,(t,i)=>{i.setContentOf(t,r.getAttribute("htmlContent"))})}function ae({view:s,model:r,allowEmpty:e},t){return o=>{o.on(`element:${s}`,(l,n,m)=>{let a=t.processViewAttributes(n.viewItem,m);if(!(!a&&!m.consumable.test(n.viewItem,{name:!0}))){if(a=a||{},m.consumable.consume(n.viewItem,{name:!0}),n.modelRange||(n=Object.assign(n,m.convertChildren(n.viewItem,n.modelCursor))),e&&n.modelRange.isCollapsed&&Object.keys(a).length){const u=m.writer.createElement("htmlEmptyElement");if(!m.safeInsert(u,n.modelCursor))return;const c=m.getSplitParts(u);n.modelRange=m.writer.createRange(n.modelRange.start,m.writer.createPositionAfter(c[c.length-1])),m.updateConversionResult(u,n),i(u,a,m);return}for(const u of n.modelRange.getItems())i(u,a,m)}},{priority:"low"})};function i(o,l,n){if(n.schema.checkAttribute(o,r)){const m=o.getAttribute(r),a=ne(l,m||{});n.writer.setAttribute(r,a,o)}}}function L({model:s,view:r},e){return(t,{writer:i,consumable:o})=>{if(!t.hasAttribute(s))return null;const l=i.createContainerElement(r),n=t.getAttribute(s);return o.consume(t,`attribute:${s}`),p(i,n,l),l.getFillerOffset=()=>null,e?z(l,i):l}}function ue({priority:s,view:r}){return(e,t)=>{if(!e)return;const{writer:i}=t,o=i.createAttributeElement(r,null,{priority:s});return p(i,e,o),o}}function C({view:s},r){return e=>{e.on(`element:${s}`,(t,i,o)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const l=r.processViewAttributes(i.viewItem,o);l&&o.writer.setAttribute(b(i.viewItem.name),l,i.modelRange)},{priority:"low"})}}function O({view:s,model:r}){return e=>{e.on(`attribute:${b(s)}:${r}`,(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const{attributeOldValue:l,attributeNewValue:n}=i,m=o.writer,a=o.mapper.toViewElement(i.item);v(m,l,n,a)})}}/**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/var j={block:[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],inline:[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref"},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}]};class k extends f{constructor(){super(...arguments);A(this,"_definitions",[])}static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of j.block)this.registerBlockElement(e);for(const e of j.inline)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const o of this._getMatchingViewDefinitions(e)){if(t)for(const l of this._getReferences(o.model))i.add(l);i.add(o)}return i}getDefinitionsForModel(e){return this._definitions.filter(t=>t.model==e)}_getMatchingViewDefinitions(e){return this._definitions.filter(t=>t.view&&ce(e,t.view))}*_getReferences(e){const t=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter(o=>o.model==e);for(const{modelSchema:o}of i)if(o)for(const l of t)for(const n of F(o[l]||[])){const m=this._definitions.filter(a=>a.model==n);for(const a of m)n!==e&&(yield*this._getReferences(a.model),yield a)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter(([,i])=>i.model==e.model);if(t.length==0){this._definitions.push(e);return}for(const[i,o]of t)this._definitions[i]=te({},o,e,(l,n)=>Array.isArray(l)?l.concat(n):void 0)}}function ce(s,r){return typeof s=="string"?s===r:s instanceof RegExp?s.test(r):!1}class d extends f{constructor(e){super(e);A(this,"_dataSchema");A(this,"_allowedAttributes");A(this,"_disallowedAttributes");A(this,"_allowedElements");A(this,"_disallowedElements");A(this,"_dataInitialized");A(this,"_coupledAttributes");this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new M,this._disallowedAttributes=new M,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[k,Z]}loadAllowedConfig(e){for(const t of e){const i=t.name||/[\s\S]+/,o=q(t);this.allowElement(i),o.forEach(l=>this.allowAttributes(l))}}loadDisallowedConfig(e){for(const t of e){const i=t.name||/[\s\S]+/,o=q(t);o.length==0?this.disallowElement(i):o.forEach(l=>this.disallowAttributes(l))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return W(e,this._disallowedAttributes,i),de(e,W(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&typeof e.appliesToBlock=="string")for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(e)},{priority:S.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)},{priority:S.highest+1})}_registerElementHandlers(){this.on("register",(e,t)=>{const i=this.editor.model.schema;if(t.isObject&&!i.isRegistered(t.model))this._registerObjectElement(t);else if(t.isBlock)this._registerBlockElement(t);else if(t.isInline)this._registerInlineElement(t);else throw new X("data-filter-invalid-definition",null,t);e.stop()},{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer(i=>{const o=e.document.differ.getChanges();let l=!1;const n=this._getCoupledAttributesMap();for(const m of o){if(m.type!="attribute"||m.attributeNewValue!==null)continue;const a=n.get(m.attributeKey);if(a)for(const{item:u}of m.range.getWalker())for(const c of a)u.hasAttribute(c)&&(i.removeAttribute(c,u),l=!0)}return l}),this.listenTo(t,"change:attribute",(i,{attributeKeys:o})=>{const l=new Set,n=this._getCoupledAttributesMap();for(const m of o){if(t.hasAttribute(m))continue;const a=n.get(m);if(a)for(const u of a)t.hasAttribute(u)&&l.add(u)}l.size!=0&&e.change(m=>{for(const a of l)m.removeSelectionAttribute(a)})})}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer(t=>{const i=e.document.differ.getChanges();let o=!1;for(const l of i)if(!(l.type!=="insert"||l.name==="$text"))for(const n of l.attributes.keys())!n.startsWith("html")||!n.endsWith("Attributes")||e.schema.checkAttribute(l.name,n)||(t.removeAttribute(n,l.position.nodeAfter),o=!0);return o})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const t=this.editor,i=t.model.schema,o=t.conversion,{view:l,model:n}=e;i.register(n,e.modelSchema);/* istanbul ignore next: paranoid check -- @preserve */l&&(i.extend(e.model,{allowAttributes:[b(l),"htmlContent"]}),t.data.registerRawContentMatcher({name:l}),o.for("upcast").elementToElement({view:l,model:x(e),converterPriority:S.low+2}),o.for("upcast").add(C(e,this)),o.for("editingDowncast").elementToStructure({model:{name:n,attributes:[b(l)]},view:me(t,e)}),o.for("dataDowncast").elementToElement({model:n,view:(m,{writer:a})=>T(l,m,a)}),o.for("dataDowncast").add(O(e)))}_registerBlockElement(e){const t=this.editor,i=t.model.schema,o=t.conversion,{view:l,model:n}=e;if(!i.isRegistered(e.model)){if(!e.modelSchema||(i.register(e.model,e.modelSchema),!l))return;o.for("upcast").elementToElement({model:n,view:l,converterPriority:S.low+2}),o.for("downcast").elementToElement({model:n,view:(m,{writer:a})=>e.isEmpty?a.createEmptyElement(l):a.createContainerElement(l)})}l&&(i.extend(e.model,{allowAttributes:b(l)}),o.for("upcast").add(C(e,this)),o.for("downcast").add(O(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,o=t.conversion,l=e.model;e.appliesToBlock||(i.extend("$text",{allowAttributes:l}),e.attributeProperties&&i.setAttributeProperties(l,e.attributeProperties),o.for("upcast").add(ae(e,this)),o.for("downcast").attributeToElement({model:l,view:ue(e)}),e.allowEmpty&&(i.setAttributeProperties(l,{copyFromObject:!1}),i.isRegistered("htmlEmptyElement")||i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"}),t.data.htmlProcessor.domConverter.registerInlineObjectMatcher(n=>n.name==e.view&&n.isEmpty&&Array.from(n.getAttributeKeys()).length?{name:!0}:null),o.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:L(e,!0)}),o.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:L(e)})))}}function W(s,r,e){const t=r.matchAll(s)||[],i=s.document.stylesProcessor;return t.reduce((o,{match:l})=>{for(const[n,m]of l.attributes||[])if(n=="style"){const a=m,u=i.getRelatedStyles(a).filter(c=>c.split("-").length>a.split("-").length).sort((c,h)=>h.split("-").length-c.split("-").length);for(const c of u)e.consume(s,{styles:[c]})&&o.styles.push(c);e.consume(s,{styles:[a]})&&o.styles.push(a)}else if(n=="class"){const a=m;e.consume(s,{classes:[a]})&&o.classes.push(a)}else e.consume(s,{attributes:[n]})&&o.attributes.push(n);return o},{attributes:[],classes:[],styles:[]})}function de(s,{attributes:r,classes:e,styles:t}){return!r.length&&!e.length&&!t.length?null:{...r.length&&{attributes:he(s,r)},...t.length&&{styles:fe(s,t)},...e.length&&{classes:e}}}function he(s,r){const e={};for(const t of r){const i=s.getAttribute(t);i!==void 0&&Q(t)&&(e[t]=i)}return e}function fe(s,r){const e=new J(s.document.stylesProcessor);for(const t of r){const i=s.getStyle(t);i!==void 0&&e.set(t,i)}return Object.fromEntries(e.getStylesEntries())}function _(s,r){const{name:e}=s,t=s[r];return ie(t)?Object.entries(t).map(([i,o])=>({name:e,[r]:{[i]:o}})):Array.isArray(t)?t.map(i=>({name:e,[r]:[i]})):[s]}function q(s){const{name:r,attributes:e,classes:t,styles:i}=s,o=[];return e&&o.push(..._({name:r,attributes:e},"attributes")),t&&o.push(..._({name:r,classes:t},"classes")),i&&o.push(..._({name:r,styles:i},"styles")),o}class ge extends f{static get requires(){return[d]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const r=this.editor.plugins.get(d);r.on("register:pre",(e,t)=>{if(t.model!=="codeBlock")return;const i=this.editor,o=i.model.schema,l=i.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),l.for("upcast").add(be(r)),l.for("downcast").add(pe()),e.stop()})}}function be(s){return r=>{r.on("element:code",(e,t,i)=>{const o=t.viewItem,l=o.parent;if(!l||!l.is("element","pre"))return;n(l,"htmlPreAttributes"),n(o,"htmlContentAttributes");function n(m,a){const u=s.processViewAttributes(m,i);u&&i.writer.setAttribute(a,u,t.modelRange)}},{priority:"low"})}}function pe(){return s=>{s.on("attribute:htmlPreAttributes:codeBlock",(r,e,t)=>{if(!t.consumable.consume(e.item,r.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=t.mapper.toViewElement(e.item).parent;v(t.writer,i,o,n)}),s.on("attribute:htmlContentAttributes:codeBlock",(r,e,t)=>{if(!t.consumable.consume(e.item,r.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,l=t.mapper.toViewElement(e.item);v(t.writer,i,o,l)})}}class we extends f{static get requires(){return[d]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(d).on("register",(e,t)=>{const i=t,o=this.editor,l=o.model.schema,n=o.conversion;if(!i.paragraphLikeModel||l.isRegistered(i.model)||l.isRegistered(i.paragraphLikeModel))return;const m={model:i.paragraphLikeModel,view:i.view};l.register(i.model,i.modelSchema),l.register(m.model,{inheritAllFrom:"$block"}),n.for("upcast").elementToElement({view:i.view,model:(a,{writer:u})=>this._hasBlockContent(a)?u.createElement(i.model):u.createElement(m.model),converterPriority:S.low+.5}),n.for("downcast").elementToElement({view:i.view,model:i.model}),this._addAttributeConversion(i),n.for("downcast").elementToElement({view:m.view,model:m.model}),this._addAttributeConversion(m),e.stop()})}_hasBlockContent(r){const e=this.editor.editing.view,t=e.domConverter.blockElements;for(const i of e.createRangeIn(r).getItems())if(i.is("element")&&t.includes(i.name))return!0;return!1}_addAttributeConversion(r){const e=this.editor,t=e.conversion,i=e.plugins.get(d);e.model.schema.extend(r.model,{allowAttributes:b(r.view)}),t.for("upcast").add(C(r,i)),t.for("downcast").add(O(r))}}class Ae extends f{static get requires(){return[k,ee]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor;if(!r.plugins.has("HeadingEditing"))return;const e=r.config.get("heading.options");this.registerHeadingElements(r,e)}registerHeadingElements(r,e){const t=r.plugins.get(k),i=[];for(const o of e)"model"in o&&"view"in o&&(t.registerBlockElement({view:o.view,model:o.model}),i.push(o.model));t.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}}),t.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:i}})}}/**
|
|
8
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
9
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
10
|
-
*/function P(s,r,e){const t=s.createRangeOn(r);for(const{item:i}of t.getWalker())if(i.is("element",e))return i}class ve extends f{static get requires(){return[d]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor;if(!r.plugins.has("ImageInlineEditing")&&!r.plugins.has("ImageBlockEditing"))return;const e=r.model.schema,t=r.conversion,i=r.plugins.get(d);i.on("register:figure",()=>{t.for("upcast").add(Ce(i))}),i.on("register:img",(o,l)=>{l.model!=="imageBlock"&&l.model!=="imageInline"||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),t.for("upcast").add(Ee(i)),t.for("downcast").add(ke()),r.plugins.has("LinkImage")&&t.for("upcast").add(ye(i,r)),o.stop())})}}function Ee(s){return r=>{r.on("element:img",(e,t,i)=>{if(!t.modelRange)return;const o=t.viewItem,l=s.processViewAttributes(o,i);l&&i.writer.setAttribute("htmlImgAttributes",l,t.modelRange)},{priority:"low"})}}function ye(s,r){const e=r.plugins.get("ImageUtils");return t=>{t.on("element:a",(i,o,l)=>{const n=o.viewItem;if(!e.findViewImgElement(n))return;const a=o.modelCursor.parent;if(!a.is("element","imageBlock"))return;const u=s.processViewAttributes(n,l);u&&l.writer.setAttribute("htmlLinkAttributes",u,a)},{priority:"low"})}}function Ce(s){return r=>{r.on("element:figure",(e,t,i)=>{const o=t.viewItem;if(!t.modelRange||!o.hasClass("image"))return;const l=s.processViewAttributes(o,i);l&&i.writer.setAttribute("htmlFigureAttributes",l,t.modelRange)},{priority:"low"})}}function ke(){return s=>{r("htmlImgAttributes"),e("img","htmlImgAttributes"),e("figure","htmlFigureAttributes"),e("a","htmlLinkAttributes");function r(t){s.on(`attribute:${t}:imageInline`,(i,o,l)=>{if(!l.consumable.consume(o.item,i.name))return;const{attributeOldValue:n,attributeNewValue:m}=o,a=l.mapper.toViewElement(o.item);v(l.writer,n,m,a)},{priority:"low"})}function e(t,i){s.on(`attribute:${i}:imageBlock`,(o,l,n)=>{if(!n.consumable.test(l.item,o.name))return;const{attributeOldValue:m,attributeNewValue:a}=l,u=n.mapper.toViewElement(l.item),c=P(n.writer,u,t);c&&(v(n.writer,m,a,c),n.consumable.consume(l.item,o.name))},{priority:"low"}),t==="a"&&s.on("attribute:linkHref:imageBlock",(o,l,n)=>{if(!n.consumable.consume(l.item,"attribute:htmlLinkAttributes:imageBlock"))return;const m=n.mapper.toViewElement(l.item),a=P(n.writer,m,"a");p(n.writer,l.item.getAttribute("htmlLinkAttributes"),a)},{priority:"low"})}}}class Se extends f{static get requires(){return[d]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor;if(!r.plugins.has("MediaEmbed")||r.config.get("mediaEmbed.previewsInData"))return;const e=r.model.schema,t=r.conversion,i=this.editor.plugins.get(d),o=this.editor.plugins.get(k),l=r.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:l}),i.on("register:figure",()=>{t.for("upcast").add(Oe(i))}),i.on(`register:${l}`,(n,m)=>{m.model==="media"&&(e.extend("media",{allowAttributes:[b(l),"htmlFigureAttributes"]}),t.for("upcast").add(Fe(i,l)),t.for("dataDowncast").add(Pe(l)),n.stop())})}}function Fe(s,r){const e=(t,i,o)=>{const l=i.viewItem;n(l,b(r));function n(m,a){const u=s.processViewAttributes(m,o);u&&o.writer.setAttribute(a,u,i.modelRange)}};return t=>{t.on(`element:${r}`,e,{priority:"low"})}}function Oe(s){return r=>{r.on("element:figure",(e,t,i)=>{const o=t.viewItem;if(!t.modelRange||!o.hasClass("media"))return;const l=s.processViewAttributes(o,i);l&&i.writer.setAttribute("htmlFigureAttributes",l,t.modelRange)},{priority:"low"})}}function Pe(s){return r=>{e(s,b(s)),e("figure","htmlFigureAttributes");function e(t,i){r.on(`attribute:${i}:media`,(o,l,n)=>{if(!n.consumable.consume(l.item,o.name))return;const{attributeOldValue:m,attributeNewValue:a}=l,u=n.mapper.toViewElement(l.item),c=P(n.writer,u,t);v(n.writer,m,a,c)})}}}class $e extends f{static get requires(){return[d]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor.plugins.get(d);r.on("register:script",(e,t)=>{const i=this.editor,o=i.model.schema,l=i.conversion;o.register("htmlScript",t.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"script"}),l.for("upcast").elementToElement({view:"script",model:x(t)}),l.for("upcast").add(C(t,r)),l.for("downcast").elementToElement({model:"htmlScript",view:(n,{writer:m})=>T("script",n,m)}),l.for("downcast").add(O(t)),e.stop()})}}class Te extends f{static get requires(){return[d]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor;if(!r.plugins.has("TableEditing"))return;const e=r.model.schema,t=r.conversion,i=r.plugins.get(d),o=r.plugins.get("TableUtils");i.on("register:figure",()=>{t.for("upcast").add(Be(i))}),i.on("register:table",(l,n)=>{n.model==="table"&&(e.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),t.for("upcast").add(De(i)),t.for("downcast").add(_e()),r.model.document.registerPostFixer(Ie(r.model,o)),l.stop())})}}function Ie(s,r){return e=>{const t=s.document.differ.getChanges();let i=!1;for(const o of t){if(o.type!="attribute"||o.attributeKey!="headingRows")continue;const l=o.range.start.nodeAfter,n=l.getAttribute("htmlTheadAttributes"),m=l.getAttribute("htmlTbodyAttributes");n&&!o.attributeNewValue?(e.removeAttribute("htmlTheadAttributes",l),i=!0):m&&o.attributeNewValue==r.getRows(l)&&(e.removeAttribute("htmlTbodyAttributes",l),i=!0)}return i}}function De(s){return r=>{r.on("element:table",(e,t,i)=>{if(!t.modelRange)return;const o=t.viewItem;l(o,"htmlTableAttributes");for(const n of o.getChildren())n.is("element","thead")&&l(n,"htmlTheadAttributes"),n.is("element","tbody")&&l(n,"htmlTbodyAttributes");function l(n,m){const a=s.processViewAttributes(n,i);a&&i.writer.setAttribute(m,a,t.modelRange)}},{priority:"low"})}}function Be(s){return r=>{r.on("element:figure",(e,t,i)=>{const o=t.viewItem;if(!t.modelRange||!o.hasClass("table"))return;const l=s.processViewAttributes(o,i);l&&i.writer.setAttribute("htmlFigureAttributes",l,t.modelRange)},{priority:"low"})}}function _e(){return s=>{r("table","htmlTableAttributes"),r("figure","htmlFigureAttributes"),r("thead","htmlTheadAttributes"),r("tbody","htmlTbodyAttributes");function r(e,t){s.on(`attribute:${t}:table`,(i,o,l)=>{if(!l.consumable.test(o.item,i.name))return;const n=l.mapper.toViewElement(o.item),m=P(l.writer,n,e);m&&(l.consumable.consume(o.item,i.name),v(l.writer,o.attributeOldValue,o.attributeNewValue,m))})}}}class Re extends f{static get requires(){return[d]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor.plugins.get(d);r.on("register:style",(e,t)=>{const i=this.editor,o=i.model.schema,l=i.conversion;o.register("htmlStyle",t.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"style"}),l.for("upcast").elementToElement({view:"style",model:x(t)}),l.for("upcast").add(C(t,r)),l.for("downcast").elementToElement({model:"htmlStyle",view:(n,{writer:m})=>T("style",n,m)}),l.for("downcast").add(O(t)),e.stop()})}}class Ve extends f{static get requires(){return[d]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor;if(!r.plugins.has("ListEditing"))return;const e=r.model.schema,t=r.conversion,i=r.plugins.get(d),o=r.plugins.get("ListEditing"),l=r.plugins.get("ListUtils"),n=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:p}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:p}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:p}),i.on("register",(m,a)=>{if(!n.includes(a.view)||(m.stop(),e.checkAttribute("$block","htmlLiAttributes")))return;const u=n.map(c=>b(c));e.extend("$listItem",{allowAttributes:u}),t.for("upcast").add(c=>{c.on("element:ul",R("htmlUlAttributes",i),{priority:"low"}),c.on("element:ol",R("htmlOlAttributes",i),{priority:"low"}),c.on("element:li",R("htmlLiAttributes",i),{priority:"low"})})}),o.on("postFixer",(m,{listNodes:a,writer:u})=>{for(const{node:c,previousNodeInList:h}of a)if(h){if(h.getAttribute("listType")==c.getAttribute("listType")){const g=U(h.getAttribute("listType")),w=h.getAttribute(g);!N(c.getAttribute(g),w)&&u.model.schema.checkAttribute(c,g)&&(u.setAttribute(g,w,c),m.return=!0)}if(h.getAttribute("listItemId")==c.getAttribute("listItemId")){const g=h.getAttribute("htmlLiAttributes");!N(c.getAttribute("htmlLiAttributes"),g)&&u.model.schema.checkAttribute(c,"htmlLiAttributes")&&(u.setAttribute("htmlLiAttributes",g,c),m.return=!0)}}}),o.on("postFixer",(m,{listNodes:a,writer:u})=>{for(const{node:c}of a){const h=c.getAttribute("listType");!l.isNumberedListType(h)&&c.getAttribute("htmlOlAttributes")&&(u.removeAttribute("htmlOlAttributes",c),m.return=!0),l.isNumberedListType(h)&&c.getAttribute("htmlUlAttributes")&&(u.removeAttribute("htmlUlAttributes",c),m.return=!0)}})}afterInit(){const r=this.editor;if(!r.commands.get("indentList"))return;const e=r.commands.get("indentList");this.listenTo(e,"afterExecute",(t,i)=>{r.model.change(o=>{for(const l of i){const n=U(l.getAttribute("listType"));r.model.schema.checkAttribute(l,n)&&o.setAttribute(n,{},l)}})})}}function R(s,r){return(e,t,i)=>{const o=t.viewItem;t.modelRange||Object.assign(t,i.convertChildren(t.viewItem,t.modelCursor));const l=r.processViewAttributes(o,i);for(const n of t.modelRange.getItems({shallow:!0}))n.hasAttribute("listItemId")&&(n.hasAttribute("htmlUlAttributes")||n.hasAttribute("htmlOlAttributes")||i.writer.model.schema.checkAttribute(n,s)&&i.writer.setAttribute(s,l||{},n))}}function U(s){return s==="numbered"||s=="customNumbered"?"htmlOlAttributes":"htmlUlAttributes"}class xe extends f{static get requires(){return[d]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor;if(!r.plugins.has("HorizontalLineEditing"))return;const e=r.model.schema,t=r.conversion,i=r.plugins.get(d);i.on("register:hr",(o,l)=>{l.model==="horizontalLine"&&(e.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),t.for("upcast").add(C(l,i)),t.for("downcast").add(He()),o.stop())})}}function He(){return s=>{s.on("attribute:htmlHrAttributes:horizontalLine",(r,e,t)=>{if(!t.consumable.test(e.item,r.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,l=t.mapper.toViewElement(e.item),n=P(t.writer,l,"hr");n&&(v(t.writer,i,o,n),t.consumable.consume(e.item,r.name))},{priority:"low"})}}class Me extends f{static get requires(){return[d,k]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const r=this.editor.plugins.get(d),e=this.editor.plugins.get(k);r.on("register:$customElement",(t,i)=>{t.stop();const o=this.editor,l=o.model.schema,n=o.conversion,m=o.editing.view.domConverter.unsafeElements,a=o.data.htmlProcessor.domConverter.preElements;l.register(i.model,i.modelSchema),l.extend(i.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),o.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),n.for("upcast").elementToElement({view:/.*/,model:(u,c)=>{if(u.name=="$comment"||!Ne(u.name)||e.getDefinitionsForView(u.name).size)return null;m.includes(u.name)||m.push(u.name),a.includes(u.name)||a.push(u.name);const h=c.writer.createElement(i.model,{htmlElementName:u.name}),g=r.processViewAttributes(u,c);g&&c.writer.setAttribute("htmlCustomElementAttributes",g,h);let w;if(u.is("element","template")&&u.getCustomProperty("$rawContent"))w=u.getCustomProperty("$rawContent");else{const I=new V(u.document).createDocumentFragment(u),D=o.data.htmlProcessor.domConverter.viewToDom(I),B=D.firstChild;for(;B.firstChild;)D.appendChild(B.firstChild);B.remove(),w=o.data.htmlProcessor.htmlWriter.getHtml(D)}c.writer.setAttribute("htmlContent",w,h);for(const{item:$}of o.editing.view.createRangeIn(u))c.consumable.consume($,{name:!0});return h},converterPriority:"low"}),n.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(u,{writer:c})=>{const h=u.getAttribute("htmlElementName"),g=c.createRawElement(h);return u.hasAttribute("htmlCustomElementAttributes")&&p(c,u.getAttribute("htmlCustomElementAttributes"),g),g}}),n.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(u,{writer:c})=>{const h=u.getAttribute("htmlElementName"),g=u.getAttribute("htmlContent"),w=c.createRawElement(h,null,($,I)=>{I.setContentOf($,g)});return u.hasAttribute("htmlCustomElementAttributes")&&p(c,u.getAttribute("htmlCustomElementAttributes"),w),w}})})}}function Ne(s){try{document.createElement(s)}catch{return!1}return!0}class et extends f{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[d,ge,we,Ae,ve,Se,$e,Te,Re,Ve,xe,Me]}init(){const r=this.editor,e=r.plugins.get(d);e.loadAllowedEmptyElementsConfig(r.config.get("htmlSupport.allowEmpty")||[]),e.loadAllowedConfig(r.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(r.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(r){const e=this.editor.plugins.get("DataSchema"),t=Array.from(e.getDefinitionsForView(r,!1)),i=t.find(o=>o.isInline&&!t[0].isObject);return i?i.model:b(r)}addModelHtmlClass(r,e,t){const i=this.editor.model,o=this.getGhsAttributeNameForElement(r);i.change(l=>{for(const n of y(i,t,o))E(l,n,o,"classes",m=>{for(const a of F(e))m.add(a)})})}removeModelHtmlClass(r,e,t){const i=this.editor.model,o=this.getGhsAttributeNameForElement(r);i.change(l=>{for(const n of y(i,t,o))E(l,n,o,"classes",m=>{for(const a of F(e))m.delete(a)})})}setModelHtmlAttributes(r,e,t){const i=this.editor.model,o=this.getGhsAttributeNameForElement(r);i.change(l=>{for(const n of y(i,t,o))E(l,n,o,"attributes",m=>{for(const[a,u]of Object.entries(e))m.set(a,u)})})}removeModelHtmlAttributes(r,e,t){const i=this.editor.model,o=this.getGhsAttributeNameForElement(r);i.change(l=>{for(const n of y(i,t,o))E(l,n,o,"attributes",m=>{for(const a of F(e))m.delete(a)})})}setModelHtmlStyles(r,e,t){const i=this.editor.model,o=this.getGhsAttributeNameForElement(r);i.change(l=>{for(const n of y(i,t,o))E(l,n,o,"styles",m=>{for(const[a,u]of Object.entries(e))m.set(a,u)})})}removeModelHtmlStyles(r,e,t){const i=this.editor.model,o=this.getGhsAttributeNameForElement(r);i.change(l=>{for(const n of y(i,t,o))E(l,n,o,"styles",m=>{for(const a of F(e))m.delete(a)})})}}function*y(s,r,e){if(r)if(!(Symbol.iterator in r)&&r.is("documentSelection")&&r.isCollapsed)s.schema.checkAttributeInSelection(r,e)&&(yield r);else for(const t of Le(s,r,e))yield*t.getItems({shallow:!0})}function Le(s,r,e){return!(Symbol.iterator in r)&&(r.is("node")||r.is("$text")||r.is("$textProxy"))?s.schema.checkAttribute(r,e)?[s.createRangeOn(r)]:[]:s.schema.getValidRanges(s.createSelection(r).getRanges(),e)}class tt extends f{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const r=this.editor,e=new Map;r.data.processor.skipComments=!1,r.model.schema.addAttributeCheck((t,i)=>{if(t.endsWith("$root")&&i.startsWith("$comment"))return!0}),r.conversion.for("upcast").elementToMarker({view:"$comment",model:t=>{const o=`$comment:${H()}`,l=t.getCustomProperty("$rawContent");return e.set(o,l),o}}),r.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:i})=>{let o;for(const a of this.editor.model.document.getRootNames())if(o=this.editor.model.document.getRoot(a),o.hasAttribute(t.markerName))break;const l=t.markerName,n=o.getAttribute(l),m=i.createUIElement("$comment");return i.setCustomProperty("$rawContent",n,m),m}}),r.model.document.registerPostFixer(t=>{let i=!1;const o=r.model.document.differ.getChangedMarkers().filter(l=>l.name.startsWith("$comment:"));for(const l of o){const{oldRange:n,newRange:m}=l.data;if(!(n&&m&&n.root==m.root)){if(n){const a=n.root;a.hasAttribute(l.name)&&(t.removeAttribute(l.name,a),i=!0)}if(m){const a=m.root;a.rootName=="$graveyard"?(t.removeMarker(l.name),i=!0):a.hasAttribute(l.name)||(t.setAttribute(l.name,e.get(l.name)||"",a),i=!0)}}}return i}),r.data.on("set",()=>{for(const t of r.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(t.name)},{priority:"high"}),r.model.on("deleteContent",(t,[i])=>{for(const o of i.getRanges()){const l=r.model.schema.getLimitElement(o),n=r.model.createPositionAt(l,0),m=r.model.createPositionAt(l,"end");let a;n.isTouching(o.start)&&m.isTouching(o.end)?a=this.getHtmlCommentsInRange(r.model.createRange(n,m)):a=this.getHtmlCommentsInRange(o,{skipBoundaries:!0});for(const u of a)this.removeHtmlComment(u)}},{priority:"high"})}createHtmlComment(r,e){const t=H(),o=this.editor.model,l=o.document.getRoot(r.root.rootName),n=`$comment:${t}`;return o.change(m=>{const a=m.createRange(r);return m.addMarker(n,{usingOperation:!0,affectsData:!0,range:a}),m.setAttribute(n,e,l),n})}removeHtmlComment(r){const e=this.editor,t=e.model.markers.get(r);return t?(e.model.change(i=>{i.removeMarker(t)}),!0):!1}getHtmlCommentData(r){const t=this.editor.model.markers.get(r);if(!t)return null;let i="";for(const o of this.editor.model.document.getRoots())if(o.hasAttribute(r)){i=o.getAttribute(r);break}return{content:i,position:t.getStart()}}getHtmlCommentsInRange(r,{skipBoundaries:e=!1}={}){const t=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter(o=>i(o,r)).map(o=>o.name);function i(o,l){const n=o.getRange().start;return(n.isAfter(l.start)||t&&n.isEqual(l.start))&&(n.isBefore(l.end)||t&&n.isEqual(l.end))}}}class je extends Y{toView(r){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(r.trim().slice(0,1e4)))return super.toView(r);let e="",t="";r=r.trim().replace(/<\?xml\s[^?]*\?>/i,n=>(t=n,"")),r=r.trim().replace(/^<!DOCTYPE\s[^>]*?>/i,n=>(e=n,""));const i=this._toDom(r),o=this.domConverter.domToView(i,{skipComments:this.skipComments}),l=new V(o.document);return l.setCustomProperty("$fullPageDocument",i.ownerDocument.documentElement.outerHTML,o),e&&l.setCustomProperty("$fullPageDocType",e,o),t&&l.setCustomProperty("$fullPageXmlDeclaration",t,o),o}toData(r){let e=super.toData(r);const t=r.getCustomProperty("$fullPageDocument"),i=r.getCustomProperty("$fullPageDocType"),o=r.getCustomProperty("$fullPageXmlDeclaration");return t&&(e=t.replace(/<\/body\s*>/,e+"$&"),i&&(e=i+`
|
|
11
|
-
`+e),o&&(e=o+`
|
|
12
|
-
`+e)),e}}class rt extends f{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}init(){const r=this.editor,e=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration"];r.data.processor=new je(r.data.viewDocument),r.model.schema.extend("$root",{allowAttributes:e}),r.data.on("toModel",(t,[i])=>{const o=r.model.document.getRoot();r.model.change(l=>{for(const n of e){const m=i.getCustomProperty(n);m&&l.setAttribute(n,m,o)}})},{priority:"low"}),r.data.on("toView",(t,[i])=>{if(!i.is("rootElement"))return;const o=i,l=t.return;if(!o.hasAttribute("$fullPageDocument"))return;const n=new V(l.document);for(const m of e){const a=o.getAttribute(m);a&&n.setCustomProperty(m,a,l)}},{priority:"low"}),r.data.on("set",()=>{const t=r.model.document.getRoot();r.model.change(i=>{for(const o of e)t.hasAttribute(o)&&i.removeAttribute(o,t)})},{priority:"high"}),r.data.on("get",(t,i)=>{i[0]||(i[0]={}),i[0].trim=!1},{priority:"high"})}}export{d as DataFilter,k as DataSchema,rt as FullPage,et as GeneralHtmlSupport,tt as HtmlComment,je as HtmlPageDataProcessor};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var He=Object.defineProperty;var Ge=(a,i,e)=>i in a?He(a,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[i]=e;var f=(a,i,e)=>Ge(a,typeof i!="symbol"?i+"":i,e);import{Plugin as p,icons as I,Command as C}from"../../../../../@ckeditor_ckeditor5-core@44.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Clipboard as Ke,ClipboardPipeline as j}from"../../../../../@ckeditor_ckeditor5-clipboard@44.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{LivePosition as L,LiveRange as Je,UpcastWriter as H,enablePlaceholder as Ze,Element as Xe,Observer as Ye}from"../../../../../@ckeditor_ckeditor5-engine@44.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Undo as Qe}from"../../../../../@ckeditor_ckeditor5-undo@44.3.0/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";import{Delete as et}from"../../../../../@ckeditor_ckeditor5-typing@44.3.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{global as x,DomEmitterMixin as tt,logWarning as y,CKEditorError as it,Collection as nt,env as st,first as G,FocusTracker as K,KeystrokeHandler as O,Rect as ot,toArray as he}from"../../../../../@ckeditor_ckeditor5-utils@44.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Widget as fe,WidgetToolbarRepository as ie,toWidget as at,isWidget as rt,toWidgetEditable as lt,WidgetResize as D,calculateResizeHostAncestorWidth as pe,findOptimalInsertionRange as ct}from"../../../../../@ckeditor_ckeditor5-widget@44.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{SplitButtonView as Ie,createDropdown as J,MenuBarMenuView as mt,MenuBarMenuListView as ut,MenuBarMenuListItemView as gt,ButtonView as v,Dialog as dt,MenuBarMenuListItemButtonView as ht,ContextualBalloon as be,CssTransitionDisablerMixin as we,clickOutsideHandler as _e,ViewModel as ne,addToolbarToDropdown as ft,Notification as se,FileDialogButtonView as oe,MenuBarMenuListItemFileDialogButtonView as pt,View as N,ViewCollection as Z,FocusCycler as X,CollapsibleView as It,submitHandler as F,LabeledFieldView as Y,createLabeledInputText as ye,BalloonPanelView as bt,DropdownButtonView as wt,addListToDropdown as _t,createLabeledInputNumber as yt}from"../../../../../@ckeditor_ckeditor5-ui@44.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{FileRepository as k}from"../../../../../@ckeditor_ckeditor5-upload@44.3.0/node_modules/@ckeditor/ckeditor5-upload/dist/index.js";import vt from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/map.js";import ve from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/isObject.js";import U from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/identity.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/function Ct(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}function ae(a){return a.createContainerElement("figure",{class:"image"},[a.createEmptyElement("img"),a.createSlot("children")])}function Ce(a,i){const e=a.plugins.get("ImageUtils"),t=a.plugins.has("ImageInlineEditing")&&a.plugins.has("ImageBlockEditing");return s=>e.isInlineImageView(s)?t&&(s.getStyle("display")=="block"||s.findAncestor(e.isBlockImageView)?"imageBlock":"imageInline")!==i?null:n(s):null;function n(s){const o={name:!0};return s.hasAttribute("src")&&(o.attributes=["src"]),o}}function Q(a,i){const e=G(i.getSelectedBlocks());return!e||a.isObject(e)||e.isEmpty&&e.name!="listItem"?"imageBlock":"imageInline"}function R(a){return a&&a.endsWith("px")?parseInt(a):null}function z(a){const i=R(a.getStyle("width")),e=R(a.getStyle("height"));return!!(i&&e)}const Et=/^(image|image-inline)$/;class _ extends p{constructor(){super(...arguments);f(this,"_domEmitter",new(tt()))}static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null,s={}){const o=this.editor,r=o.model,l=r.document.selection,c=Ee(o,t||l,n);e={...Object.fromEntries(l.getAttributes()),...e};for(const m in e)r.schema.checkAttribute(c,m)||delete e[m];return r.change(m=>{const{setImageSizes:g=!0}=s,u=m.createElement(c,e);return r.insertObject(u,t,null,{setSelection:"on",findOptimalPosition:!t&&c!="imageInline"?"auto":void 0}),u.parent?(g&&this.setImageNaturalSizeAttributes(u),u):null})}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(n=>{const s=new x.window.Image;this._domEmitter.listenTo(s,"load",()=>{!e.getAttribute("width")&&!e.getAttribute("height")&&this.editor.model.enqueueChange(n.batch,o=>{o.setAttribute("width",s.naturalWidth,e),o.setAttribute("height",s.naturalHeight,e)}),this._domEmitter.stopListening(s,"load")}),s.src=t}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const n=e.getSelectedElement();if(n&&this.isImageWidget(n))return n;let s=t.parent;for(;s;){if(s.is("element")&&this.isImageWidget(s))return s;s=s.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:Et})}isImageAllowed(){const t=this.editor.model.document.selection;return kt(this.editor,t)&&St(t)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),at(e,t,{label:()=>{const r=this.findViewImgElement(e).getAttribute("alt");return r?`${r} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&rt(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function kt(a,i){if(Ee(a,i,null)=="imageBlock"){const t=Ut(i,a.model);if(a.model.schema.checkChild(t,"imageBlock"))return!0}else if(a.model.schema.checkChild(i.focus,"imageInline"))return!0;return!1}function St(a){return[...a.focus.getAncestors()].every(i=>!i.is("element","imageBlock"))}function Ut(a,i){const t=ct(a,i).start.parent;return t.isEmpty&&!t.is("element","$root")?t.parent:t}function Ee(a,i,e){const t=a.model.schema,n=a.config.get("image.insert.type");return a.plugins.has("ImageBlockEditing")?a.plugins.has("ImageInlineEditing")?e||(n==="inline"?"imageInline":n!=="auto"?"imageBlock":i.is("selection")?Q(t,i):t.checkChild(i,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const Bt=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class qi extends p{constructor(e){super(e);f(this,"_timeoutId");f(this,"_positionToInsert");this._timeoutId=null,this._positionToInsert=null}static get requires(){return[Ke,_,Qe,et]}static get pluginName(){return"AutoImage"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.document,n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const s=t.selection.getFirstRange(),o=L.fromPosition(s.start);o.stickiness="toPrevious";const r=L.fromPosition(s.end);r.stickiness="toNext",t.once("change:data",()=>{this._embedImageBetweenPositions(o,r),o.detach(),r.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(x.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedImageBetweenPositions(e,t){const n=this.editor,s=new Je(e,t),o=s.getWalker({ignoreElementEnd:!0}),r=Object.fromEntries(n.model.document.selection.getAttributes()),l=this.editor.plugins.get("ImageUtils");let c="";for(const m of o)m.item.is("$textProxy")&&(c+=m.item.data);if(c=c.trim(),!c.match(Bt)){s.detach();return}this._positionToInsert=L.fromPosition(e),this._timeoutId=setTimeout(()=>{if(!n.commands.get("insertImage").isEnabled){s.detach();return}n.model.change(u=>{this._timeoutId=null,u.remove(s),s.detach();let d;this._positionToInsert.root.rootName!=="$graveyard"&&(d=this._positionToInsert.toPosition()),l.insertImage({...r,src:c},d),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get("Delete").requestUndoOnBackspace()},100)}}class Vt extends C{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(i){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model,s=t.getClosestSelectedImageElement(n.document.selection);n.change(o=>{o.setAttribute("alt",i.newValue,s)})}}class Tt extends p{static get requires(){return[_]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new Vt(this.editor))}}class At extends N{constructor(e){super(e);f(this,"focusTracker");f(this,"keystrokes");f(this,"labeledInput");f(this,"saveButtonView");f(this,"cancelButtonView");f(this,"_focusables");f(this,"_focusCycler");const t=this.locale.t;this.focusTracker=new K,this.keystrokes=new O,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),I.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),I.cancel,"ck-button-cancel","cancel"),this._focusables=new Z,this._focusCycler=new X({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),F({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,s){const o=new v(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),s&&o.delegate("execute").to(this,s),o}_createLabeledInputView(){const e=this.locale.t,t=new Y(this.locale,ye);return t.label=e("Text alternative"),t}}function xt(a){const i=a.plugins.get("ContextualBalloon");if(a.plugins.get("ImageUtils").getClosestSelectedImageWidget(a.editing.view.document.selection)){const t=ee(a);i.updatePosition(t)}}function ee(a){const i=a.editing.view,e=bt.defaultPositions,t=a.plugins.get("ImageUtils");return{target:i.domConverter.mapViewToDom(t.getClosestSelectedImageWidget(i.document.selection)),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.viewportStickyNorth]}}class Rt extends p{constructor(){super(...arguments);f(this,"_balloon");f(this,"_form")}static get requires(){return[be]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const s=e.commands.get("imageTextAlternative"),o=new v(n);return o.set({label:t("Change image text alternative"),icon:I.textAlternative,tooltip:!0}),o.bind("isEnabled").to(s,"isEnabled"),o.bind("isOn").to(s,"value",r=>!!r),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,n=e.editing.view.document,s=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(we(At))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(o,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{s.getClosestSelectedImageWidget(n.selection)?this._isVisible&&xt(e):this._hideForm(!0)}),_e({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:ee(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class ke extends p{static get requires(){return[Tt,Rt]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function zt(a){const i=(e,t,n)=>{if(!n.consumable.test(t.viewItem,{name:!0,classes:"image"}))return;const s=a.findViewImgElement(t.viewItem);if(!s||!n.consumable.test(s,{name:!0}))return;n.consumable.consume(t.viewItem,{name:!0,classes:"image"});const o=n.convertItem(s,t.modelCursor),r=G(o.modelRange.getItems());if(!r){n.consumable.revert(t.viewItem,{name:!0,classes:"image"});return}n.convertChildren(t.viewItem,r),n.updateConversionResult(r,t)};return e=>{e.on("element:figure",i)}}function Se(a,i){const e=(t,n,s)=>{if(!s.consumable.consume(n.item,t.name))return;const o=s.writer,r=s.mapper.toViewElement(n.item),l=a.findViewImgElement(r);n.attributeNewValue===null?(o.removeAttribute("srcset",l),o.removeAttribute("sizes",l)):n.attributeNewValue&&(o.setAttribute("srcset",n.attributeNewValue,l),o.setAttribute("sizes","100vw",l))};return t=>{t.on(`attribute:srcset:${i}`,e)}}function P(a,i,e){const t=(n,s,o)=>{if(!o.consumable.consume(s.item,n.name))return;const r=o.writer,l=o.mapper.toViewElement(s.item),c=a.findViewImgElement(l);r.setAttribute(s.attributeKey,s.attributeNewValue||"",c)};return n=>{n.on(`attribute:${e}:${i}`,t)}}class te extends Ye{observe(i){this.listenTo(i,"load",(e,t)=>{const n=t.target;this.checkShouldIgnoreEventFromTarget(n)||n.tagName=="IMG"&&this._fireEvents(t)},{useCapture:!0})}stopObserving(i){this.stopListening(i)}_fireEvents(i){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",i))}}class Pt extends C{constructor(i){super(i);const e=i.config.get("image.insert.type");i.plugins.has("ImageBlockEditing")||e==="block"&&y("image-block-plugin-required"),i.plugins.has("ImageInlineEditing")||e==="inline"&&y("image-inline-plugin-required")}refresh(){const i=this.editor.plugins.get("ImageUtils");this.isEnabled=i.isImageAllowed()}execute(i){const e=he(i.source),t=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(t.getAttributes());e.forEach((o,r)=>{const l=t.getSelectedElement();if(typeof o=="string"&&(o={src:o}),r&&l&&n.isImage(l)){const c=this.editor.model.createPositionAfter(l);n.insertImage({...o,...s},c,i.imageType)}else i.breakBlock?n.insertImage({...o,...s},t.getFirstPosition(),i.imageType):n.insertImage({...o,...s},null,i.imageType)})}}class Ot extends C{constructor(i){super(i),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(i){const e=this.editor.model.document.selection.getSelectedElement(),t=this.editor.plugins.get("ImageUtils");this.editor.model.change(n=>{n.setAttribute("src",i.source,e),this.cleanupImage(n,e),t.setImageNaturalSizeAttributes(e)})}cleanupImage(i,e){i.removeAttribute("srcset",e),i.removeAttribute("sizes",e),i.removeAttribute("sources",e),i.removeAttribute("width",e),i.removeAttribute("height",e),i.removeAttribute("alt",e)}}class Ue extends p{static get requires(){return[_]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,e=i.conversion;i.editing.view.addObserver(te),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const t=new Pt(i),n=new Ot(i);i.commands.add("insertImage",t),i.commands.add("replaceImageSource",n),i.commands.add("imageInsert",t)}}class Be extends p{static get requires(){return[_]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(i){const e=this.editor,t=e.plugins.get("ImageUtils"),n=i==="imageBlock"?"figure":"img";e.conversion.for("upcast").attributeToAttribute({view:{name:n,styles:{width:/.+/}},model:{key:"width",value:o=>z(o)?R(o.getStyle("width")):null}}).attributeToAttribute({view:{name:n,key:"width"},model:"width"}).attributeToAttribute({view:{name:n,styles:{height:/.+/}},model:{key:"height",value:o=>z(o)?R(o.getStyle("height")):null}}).attributeToAttribute({view:{name:n,key:"height"},model:"height"}),e.conversion.for("editingDowncast").add(o=>{s(o,"width","width",!0,!0),s(o,"height","height",!0,!0)}),e.conversion.for("dataDowncast").add(o=>{s(o,"width","width",!1),s(o,"height","height",!1)});function s(o,r,l,c,m=!1){o.on(`attribute:${r}:${i}`,(g,u,d)=>{if(!d.consumable.consume(u.item,g.name))return;const h=d.writer,b=d.mapper.toViewElement(u.item),w=t.findViewImgElement(b);u.attributeNewValue!==null?h.setAttribute(l,u.attributeNewValue,w):h.removeAttribute(l,w);const E=u.item.getAttribute("width"),S=u.item.getAttribute("height"),T=E&&S;if(T&&m&&h.setAttribute("loading","lazy",w),u.item.hasAttribute("sources"))return;const je=u.item.hasAttribute("resizedWidth");i==="imageInline"&&!je&&!c||T&&h.setStyle("aspect-ratio",`${E}/${S}`,w)})}}}class Ve extends C{constructor(e,t){super(e);f(this,"_modelElementName");this._modelElementName=t}refresh(){const t=this.editor.plugins.get("ImageUtils"),n=t.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=t.isInlineImage(n):this.isEnabled=t.isBlockImage(n)}execute(e={}){const t=this.editor,n=this.editor.model,s=t.plugins.get("ImageUtils"),o=s.getClosestSelectedImageElement(n.document.selection),r=Object.fromEntries(o.getAttributes());return!r.src&&!r.uploadId?null:n.change(l=>{const{setImageSizes:c=!0}=e,m=Array.from(n.markers).filter(d=>d.getRange().containsItem(o)),g=s.insertImage(r,n.createSelection(o,"on"),this._modelElementName,{setImageSizes:c});if(!g)return null;const u=l.createRangeOn(g);for(const d of m){const h=d.getRange(),b=h.root.rootName!="$graveyard"?h.getJoined(u,!0):u;l.updateMarker(d,{range:b})}return{oldElement:o,newElement:g}})}}class Te extends p{static get requires(){return[_]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const i=this.editor.model.schema;i.isRegistered("imageBlock")&&i.extend("imageBlock",{allowAttributes:["placeholder"]}),i.isRegistered("imageInline")&&i.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const i=this.editor,e=i.conversion,t=i.plugins.get("ImageUtils");e.for("editingDowncast").add(n=>{n.on("attribute:placeholder",(s,o,r)=>{if(!r.consumable.test(o.item,s.name)||!o.item.is("element","imageBlock")&&!o.item.is("element","imageInline"))return;r.consumable.consume(o.item,s.name);const l=r.writer,c=r.mapper.toViewElement(o.item),m=t.findViewImgElement(c);o.attributeNewValue?(l.addClass("image_placeholder",m),l.setStyle("background-image",`url(${o.attributeNewValue})`,m),l.setCustomProperty("editingPipeline:doNotReuseOnce",!0,m)):(l.removeClass("image_placeholder",m),l.removeStyle("background-image",m))})})}_setupLoadListener(){const i=this.editor,e=i.model,t=i.editing,n=t.view,s=i.plugins.get("ImageUtils");n.addObserver(te),this.listenTo(n.document,"imageLoaded",(o,r)=>{const l=n.domConverter.mapDomToView(r.target);if(!l)return;const c=s.getImageWidgetFromImageView(l);if(!c)return;const m=t.mapper.toModelElement(c);!m||!m.hasAttribute("placeholder")||e.enqueueChange({isUndoable:!1},g=>{g.removeAttribute("placeholder",m)})})}}class Ae extends p{static get requires(){return[Ue,Be,_,Te,j]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const i=this.editor;i.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),i.plugins.has("ImageInlineEditing")&&(i.commands.add("imageTypeBlock",new Ve(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const i=this.editor,e=i.t,t=i.conversion,n=i.plugins.get("ImageUtils");t.for("dataDowncast").elementToStructure({model:"imageBlock",view:(s,{writer:o})=>ae(o)}),t.for("editingDowncast").elementToStructure({model:"imageBlock",view:(s,{writer:o})=>n.toImageWidget(ae(o),o,e("image widget"))}),t.for("downcast").add(P(n,"imageBlock","src")).add(P(n,"imageBlock","alt")).add(Se(n,"imageBlock")),t.for("upcast").elementToElement({view:Ce(i,"imageBlock"),model:(s,{writer:o})=>o.createElement("imageBlock",s.hasAttribute("src")?{src:s.getAttribute("src")}:void 0)}).add(zt(n))}_setupClipboardIntegration(){const i=this.editor,e=i.model,t=i.editing.view,n=i.plugins.get("ImageUtils"),s=i.plugins.get("ClipboardPipeline");this.listenTo(s,"inputTransformation",(o,r)=>{const l=Array.from(r.content.getChildren());let c;if(!l.every(n.isInlineImageView))return;r.targetRanges?c=i.editing.mapper.toModelRange(r.targetRanges[0]):c=e.document.selection.getFirstRange();const m=e.createSelection(c);if(Q(e.schema,m)==="imageBlock"){const g=new H(t.document),u=l.map(d=>g.createElement("figure",{class:"image"},d));r.content=g.createDocumentFragment(u)}}),this.listenTo(s,"contentInsertion",(o,r)=>{r.method==="paste"&&e.change(l=>{const c=l.createRangeIn(r.content);for(const m of c.getItems())m.is("element","imageBlock")&&n.setImageNaturalSizeAttributes(m)})})}}class Nt extends N{constructor(e,t=[]){super(e);f(this,"focusTracker");f(this,"keystrokes");f(this,"_focusables");f(this,"_focusCycler");f(this,"children");this.focusTracker=new K,this.keystrokes=new O,this._focusables=new Z,this.children=this.createCollection(),this._focusCycler=new X({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of t)this.children.add(n),this._focusables.add(n),n instanceof It&&this._focusables.addMany(n.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),F({view:this});for(const t of this._focusables)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class V extends p{constructor(e){super(e);f(this,"dropdownView");f(this,"_integrations",new Map);e.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[_]}init(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=n.isImage(t.getSelectedElement())});const s=r=>this._createToolbarComponent(r),o=r=>this._createMenuBarComponent(r);e.ui.componentFactory.add("insertImage",s),e.ui.componentFactory.add("imageInsert",s),e.ui.componentFactory.add("menuBar:insertImage",o)}registerIntegration({name:e,observable:t,buttonViewCreator:n,formViewCreator:s,menuBarButtonViewCreator:o,requiresForm:r=!1,override:l=!1}){this._integrations.has(e)&&!l&&y("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:n,menuBarButtonViewCreator:o,formViewCreator:s,requiresForm:r})}_createToolbarComponent(e){const t=this.editor,n=e.t,s=this._prepareIntegrations();if(!s.length)return null;let o;const r=s[0];if(s.length==1){if(!r.requiresForm)return r.buttonViewCreator(!0);o=r.buttonViewCreator(!0)}else{const m=r.buttonViewCreator(!1);o=new Ie(e,m),o.tooltip=!0,o.bind("label").to(this,"isImageSelected",g=>n(g?"Replace image":"Insert image"))}const l=this.dropdownView=J(e,o),c=s.map(({observable:m})=>typeof m=="function"?m():m);return l.bind("isEnabled").toMany(c,"isEnabled",(...m)=>m.some(g=>g)),l.once("change:isOpen",()=>{const m=s.flatMap(({formViewCreator:u})=>u(s.length==1)),g=new Nt(t.locale,m);l.panelView.children.add(g)}),l}_createMenuBarComponent(e){const t=e.t,n=this._prepareIntegrations();if(!n.length)return null;const s=n.flatMap(({menuBarButtonViewCreator:l})=>l(n.length==1)),o=new mt(e),r=new ut(e);o.panelView.children.add(r),o.buttonView.set({icon:I.image,label:t("Image")});for(const l of s){const c=new gt(e,o);c.children.add(l),r.items.add(c),l.delegate("execute").to(o)}return o}_prepareIntegrations(){const t=this.editor.config.get("image.insert.integrations"),n=[];if(!t.length)return y("image-insert-integrations-not-specified"),n;for(const s of t){if(!this._integrations.has(s)){["upload","assetManager","url"].includes(s)||y("image-insert-unknown-integration",{item:s});continue}n.push(this._integrations.get(s))}return n.length||y("image-insert-integrations-not-registered"),n}}class $i extends p{static get requires(){return[Ae,fe,ke,V]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class Ft extends p{static get requires(){return[Ue,Be,_,Te,j]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const i=this.editor;i.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),i.plugins.has("ImageBlockEditing")&&(i.commands.add("imageTypeInline",new Ve(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const i=this.editor,e=i.t,t=i.conversion,n=i.plugins.get("ImageUtils");t.for("dataDowncast").elementToElement({model:"imageInline",view:(s,{writer:o})=>o.createEmptyElement("img")}),t.for("editingDowncast").elementToStructure({model:"imageInline",view:(s,{writer:o})=>n.toImageWidget(Ct(o),o,e("image widget"))}),t.for("downcast").add(P(n,"imageInline","src")).add(P(n,"imageInline","alt")).add(Se(n,"imageInline")),t.for("upcast").elementToElement({view:Ce(i,"imageInline"),model:(s,{writer:o})=>o.createElement("imageInline",s.hasAttribute("src")?{src:s.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const i=this.editor,e=i.model,t=i.editing.view,n=i.plugins.get("ImageUtils"),s=i.plugins.get("ClipboardPipeline");this.listenTo(s,"inputTransformation",(o,r)=>{const l=Array.from(r.content.getChildren());let c;if(!l.every(n.isBlockImageView))return;r.targetRanges?c=i.editing.mapper.toModelRange(r.targetRanges[0]):c=e.document.selection.getFirstRange();const m=e.createSelection(c);if(Q(e.schema,m)==="imageInline"){const g=new H(t.document),u=l.map(d=>d.childCount===1?(Array.from(d.getAttributes()).forEach(h=>g.setAttribute(...h,n.findViewImgElement(d))),d.getChild(0)):d);r.content=g.createDocumentFragment(u)}}),this.listenTo(s,"contentInsertion",(o,r)=>{r.method==="paste"&&e.change(l=>{const c=l.createRangeIn(r.content);for(const m of c.getItems())m.is("element","imageInline")&&n.setImageNaturalSizeAttributes(m)})})}}class ji extends p{static get requires(){return[Ft,fe,ke,V]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class xe extends p{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[_]}getCaptionFromImageModelElement(i){for(const e of i.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(i){const e=this.editor.plugins.get("ImageUtils"),t=i.getFirstPosition().findAncestor("caption");return t&&e.isBlockImage(t.parent)?t:null}matchImageCaptionViewElement(i){const e=this.editor.plugins.get("ImageUtils");return i.name=="figcaption"&&e.isBlockImageView(i.parent)?{name:!0}:null}}class Lt extends C{refresh(){const i=this.editor,e=i.plugins.get("ImageCaptionUtils"),t=i.plugins.get("ImageUtils");if(!i.plugins.has(Ae)){this.isEnabled=!1,this.value=!1;return}const n=i.model.document.selection,s=n.getSelectedElement();if(!s){const o=e.getCaptionFromModelSelection(n);this.isEnabled=!!o,this.value=!!o;return}this.isEnabled=t.isImage(s),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(s):this.value=!1}execute(i={}){const{focusCaptionOnShow:e}=i;this.editor.model.change(t=>{this.value?this._hideImageCaption(t):this._showImageCaption(t,e)})}_showImageCaption(i,e){const n=this.editor.model.document.selection,s=this.editor.plugins.get("ImageCaptionEditing"),o=this.editor.plugins.get("ImageUtils");let r=n.getSelectedElement();const l=s._getSavedCaption(r);o.isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=n.getSelectedElement());const c=l||i.createElement("caption");i.append(c,r),e&&i.setSelection(c,"in")}_hideImageCaption(i){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("ImageCaptionEditing"),s=e.plugins.get("ImageCaptionUtils");let o=t.getSelectedElement(),r;o?r=s.getCaptionFromImageModelElement(o):(r=s.getCaptionFromModelSelection(t),o=r.parent),n._saveCaption(o,r),i.setSelection(o,"on"),i.remove(r)}}class Dt extends p{constructor(e){super(e);f(this,"_savedCaptionsMap");this._savedCaptionsMap=new WeakMap}static get requires(){return[_,xe]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new Lt(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),s=e.plugins.get("ImageCaptionUtils"),o=e.t;e.conversion.for("upcast").elementToElement({view:r=>s.matchImageCaptionViewElement(r),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(r,{writer:l})=>n.isBlockImage(r.parent)?l.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(r,{writer:l})=>{if(!n.isBlockImage(r.parent))return null;const c=l.createEditableElement("figcaption");l.setCustomProperty("imageCaption",!0,c),c.placeholder=o("Enter image caption"),Ze({view:t,element:c,keepOnFocus:!0});const m=r.parent.getAttribute("alt"),g=m?o("Caption for image: %0",[m]):o("Caption for the image");return lt(c,l,{label:g})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),s=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),r=l=>{if(!l.return)return;const{oldElement:c,newElement:m}=l.return;/* istanbul ignore if: paranoid check -- @preserve */if(!c)return;if(t.isBlockImage(c)){const u=n.getCaptionFromImageModelElement(c);if(u){this._saveCaption(m,u);return}}const g=this._getSavedCaption(c);g&&this._saveCaption(m,g)};s&&this.listenTo(s,"execute",r,{priority:"low"}),o&&this.listenTo(o,"execute",r,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Xe.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,n=e.plugins.get("ImageUtils"),s=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{const o=t.document.differ.getChanges();for(const r of o){if(r.attributeKey!=="alt")continue;const l=r.range.start.nodeAfter;if(n.isBlockImage(l)){const c=s.getCaptionFromImageModelElement(l);if(!c)return;e.editing.reconvertItem(c)}}})}}class Mt extends p{static get requires(){return[xe]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const i=this.editor,e=i.editing.view,t=i.plugins.get("ImageCaptionUtils"),n=i.t;i.ui.componentFactory.add("toggleImageCaption",s=>{const o=i.commands.get("toggleImageCaption"),r=new v(s);return r.set({icon:I.caption,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),r.bind("label").to(o,"value",l=>n(l?"Toggle caption off":"Toggle caption on")),this.listenTo(r,"execute",()=>{i.execute("toggleImageCaption",{focusCaptionOnShow:!0});const l=t.getCaptionFromModelSelection(i.model.document.selection);if(l){const c=i.editing.mapper.toViewElement(l);e.scrollToTheSelection(),e.change(m=>{m.addClass("image__caption_highlighted",c)})}i.editing.view.focus()}),r})}}class Hi extends p{static get requires(){return[Dt,Mt]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}}function Re(a){const i=a.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${i.join("|")})$`)}function Wt(a){return new Promise((i,e)=>{const t=a.getAttribute("src");fetch(t).then(n=>n.blob()).then(n=>{const s=ze(n,t),r=`image.${s.replace("image/","")}`,l=new File([n],r,{type:s});i(l)}).catch(n=>n&&n.name==="TypeError"?$t(t).then(i).catch(e):e(n))})}function qt(a,i){return!a.isInlineImageView(i)||!i.getAttribute("src")?!1:!!i.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!i.getAttribute("src").match(/^blob:/g)}function ze(a,i){return a.type?a.type:i.match(/data:(image\/\w+);base64/)?i.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}function $t(a){return jt(a).then(i=>{const e=ze(i,a),n=`image.${e.replace("image/","")}`;return new File([i],n,{type:e})})}function jt(a){return new Promise((i,e)=>{const t=x.document.createElement("img");t.addEventListener("load",()=>{const n=x.document.createElement("canvas");n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n.toBlob(o=>o?i(o):e())}),t.addEventListener("error",()=>e()),t.src=a})}class Ht extends p{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const i=this.editor;i.ui.componentFactory.add("uploadImage",()=>this._createToolbarButton()),i.ui.componentFactory.add("imageUpload",()=>this._createToolbarButton()),i.ui.componentFactory.add("menuBar:uploadImage",()=>this._createMenuBarButton("standalone")),i.plugins.has("ImageInsertUI")&&i.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>i.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(i){const e=this.editor,t=e.locale,n=e.commands.get("uploadImage"),s=e.config.get("image.upload.types"),o=Re(s),r=new i(e.locale),l=t.t;return r.set({acceptedType:s.map(c=>`image/${c}`).join(","),allowMultipleFiles:!0,label:l("Upload from computer"),icon:I.imageUpload}),r.bind("isEnabled").to(n),r.on("done",(c,m)=>{const g=Array.from(m).filter(u=>o.test(u.type));g.length&&(e.execute("uploadImage",{file:g}),e.editing.view.focus())}),r}_createToolbarButton(){const i=this.editor.locale.t,e=this.editor.plugins.get("ImageInsertUI"),t=this.editor.commands.get("uploadImage"),n=this._createButton(oe);return n.tooltip=!0,n.bind("label").to(e,"isImageSelected",t,"isAccessAllowed",(s,o)=>i(o?s?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),n}_createDropdownButton(){const i=this.editor.locale.t,e=this.editor.plugins.get("ImageInsertUI"),t=this._createButton(oe);return t.withText=!0,t.bind("label").to(e,"isImageSelected",n=>i(n?"Replace from computer":"Upload from computer")),t.on("execute",()=>{e.dropdownView.isOpen=!1}),t}_createMenuBarButton(i){const e=this.editor.locale.t,t=this._createButton(pt);switch(t.withText=!0,i){case"standalone":t.label=e("Image from computer");break;case"insertOnly":t.label=e("Image");break;case"insertNested":t.label=e("From computer");break}return t}}class Gt extends p{constructor(e){super(e);f(this,"placeholder");f(this,"uploadStatusChange",(e,t,n)=>{const s=this.editor,o=t.item,r=o.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const l=s.plugins.get("ImageUtils"),c=s.plugins.get(k),m=r?t.attributeNewValue:null,g=this.placeholder,u=s.editing.mapper.toViewElement(o),d=n.writer;if(m=="reading"){re(u,d),le(l,g,u,d);return}if(m=="uploading"){const h=c.loaders.get(r);re(u,d),h?(ce(u,d),Jt(u,d,h,s.editing.view),ei(l,u,d,h)):le(l,g,u,d);return}m=="complete"&&c.loaders.get(r)&&Xt(u,d,s.editing.view),Zt(u,d),ce(u,d),Kt(u,d)});this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function re(a,i){a.hasClass("ck-appear")||i.addClass("ck-appear",a)}function Kt(a,i){i.removeClass("ck-appear",a)}function le(a,i,e,t){e.hasClass("ck-image-upload-placeholder")||t.addClass("ck-image-upload-placeholder",e);const n=a.findViewImgElement(e);n.getAttribute("src")!==i&&t.setAttribute("src",i,n),Pe(e,"placeholder")||t.insert(t.createPositionAfter(n),Qt(t))}function ce(a,i){a.hasClass("ck-image-upload-placeholder")&&i.removeClass("ck-image-upload-placeholder",a),Oe(a,i,"placeholder")}function Jt(a,i,e,t){const n=Yt(i);i.insert(i.createPositionAt(a,"end"),n),e.on("change:uploadedPercent",(s,o,r)=>{t.change(l=>{l.setStyle("width",r+"%",n)})})}function Zt(a,i){Oe(a,i,"progressBar")}function Xt(a,i,e){const t=i.createUIElement("div",{class:"ck-image-upload-complete-icon"});i.insert(i.createPositionAt(a,"end"),t),setTimeout(()=>{e.change(n=>n.remove(n.createRangeOn(t)))},3e3)}function Yt(a){const i=a.createUIElement("div",{class:"ck-progress-bar"});return a.setCustomProperty("progressBar",!0,i),i}function Qt(a){const i=a.createUIElement("div",{class:"ck-upload-placeholder-loader"});return a.setCustomProperty("placeholder",!0,i),i}function Pe(a,i){for(const e of a.getChildren())if(e.getCustomProperty(i))return e}function Oe(a,i,e){const t=Pe(a,e);t&&i.remove(i.createRangeOn(t))}function ei(a,i,e,t){if(t.data){const n=a.findViewImgElement(i);e.setAttribute("src",t.data,n)}}class ti extends C{constructor(i){super(i),this.set("isAccessAllowed",!0)}refresh(){const i=this.editor,e=i.plugins.get("ImageUtils"),t=i.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(t)}execute(i){const e=he(i.file),t=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(t.getAttributes());e.forEach((o,r)=>{const l=t.getSelectedElement();if(r&&l&&n.isImage(l)){const c=this.editor.model.createPositionAfter(l);this._uploadImage(o,s,c)}else this._uploadImage(o,s)})}_uploadImage(i,e,t){const n=this.editor,o=n.plugins.get(k).createLoader(i),r=n.plugins.get("ImageUtils");o&&r.insertImage({...e,uploadId:o.id},t)}}class ii extends p{constructor(e){super(e);f(this,"_uploadImageElements");f(this,"_uploadedImages",new Map);e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[k,se,j,_]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.document,n=e.conversion,s=e.plugins.get(k),o=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline"),l=Re(e.config.get("image.upload.types")),c=new ti(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(m=>m.on("element:img",(g,u,d)=>{if(!d.consumable.test(u.viewItem,{attributes:["data-ck-upload-id"]}))return;const h=u.viewItem.getAttribute("data-ck-upload-id");if(!h)return;const[b]=Array.from(u.modelRange.getItems({shallow:!0})),w=s.loaders.get(h);b&&(d.writer.setAttribute("uploadId",h,b),d.consumable.consume(u.viewItem,{attributes:["data-ck-upload-id"]}),w&&w.data&&d.writer.setAttribute("uploadStatus",w.status,b))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(m,g)=>{if(ni(g.dataTransfer))return;const u=Array.from(g.dataTransfer.files).filter(h=>h?l.test(h.type):!1);if(!u.length)return;if(m.stop(),e.model.change(h=>{g.targetRanges&&h.setSelection(g.targetRanges.map(b=>e.editing.mapper.toModelRange(b))),e.execute("uploadImage",{file:u})}),!e.commands.get("uploadImage").isAccessAllowed){const h=e.plugins.get("Notification"),b=e.locale.t;h.showWarning(b("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(r,"inputTransformation",(m,g)=>{const u=Array.from(e.editing.view.createRangeIn(g.content)).map(h=>h.item).filter(h=>qt(o,h)&&!h.getAttribute("uploadProcessed")).map(h=>({promise:Wt(h),imageElement:h}));if(!u.length)return;const d=new H(e.editing.view.document);for(const h of u){d.setAttribute("uploadProcessed",!0,h.imageElement);const b=s.createLoader(h.promise);b&&(d.setAttribute("src","",h.imageElement),d.setAttribute("uploadId",b.id,h.imageElement))}}),e.editing.view.document.on("dragover",(m,g)=>{g.preventDefault()}),t.on("change",()=>{const m=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),g=new Set;for(const u of m)if(u.type=="insert"&&u.name!="$text"){const d=u.position.nodeAfter,h=u.position.root.rootName=="$graveyard";for(const b of si(e,d)){const w=b.getAttribute("uploadId");if(!w)continue;const E=s.loaders.get(w);if(!E){!h&&this._uploadedImages.has(w)&&e.model.enqueueChange({isUndoable:!1},S=>{S.setAttribute("uploadStatus","complete",b),this.fire("uploadComplete",{data:this._uploadedImages.get(w),imageElement:b})});continue}h?g.has(w)||Array.from(this._uploadImageElements.get(w)).every(T=>T.root.rootName=="$graveyard")&&E.abort():(g.add(w),this._uploadImageElements.has(w)?this._uploadImageElements.get(w).add(b):this._uploadImageElements.set(w,new Set([b])),E.status=="idle"&&this._readAndUpload(E))}}}),this.on("uploadComplete",(m,{imageElement:g,data:u})=>{const d=u.urls?u.urls:u;this.editor.model.change(h=>{h.setAttribute("src",d.default,g),this._parseAndSetSrcsetAttributeOnImage(d,g,h),o.setImageNaturalSizeAttributes(g)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const t=this.editor,n=t.model,s=t.locale.t,o=t.plugins.get(k),r=t.plugins.get(se),l=t.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},g=>{const u=c.get(e.id);for(const d of u)g.setAttribute("uploadStatus","reading",d)}),e.read().then(()=>{const g=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(s("Uploading image"));for(const u of c.get(e.id)){/* istanbul ignore next -- @preserve */if(st.isSafari){const d=t.editing.mapper.toViewElement(u),h=l.findViewImgElement(d);t.editing.view.once("render",()=>{if(!h.parent)return;const b=t.editing.view.domConverter.mapViewToDom(h.parent);if(!b)return;const w=b.style.display;b.style.display="none",b._ckHack=b.offsetHeight,b.style.display=w})}n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","uploading",u)})}return g}).then(g=>{n.enqueueChange({isUndoable:!1},u=>{for(const d of c.get(e.id))u.setAttribute("uploadStatus","complete",d),this.fire("uploadComplete",{data:g,imageElement:d});t.ui&&t.ui.ariaLiveAnnouncer.announce(s("Image upload complete")),this._uploadedImages.set(e.id,g)}),m()}).catch(g=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(s("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw g;e.status=="error"&&g&&r.showWarning(g,{title:s("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},u=>{for(const d of c.get(e.id))d.root.rootName!=="$graveyard"&&u.remove(d)}),m()});function m(){n.enqueueChange({isUndoable:!1},g=>{for(const u of c.get(e.id))g.removeAttribute("uploadId",u),g.removeAttribute("uploadStatus",u);c.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let s=0;const o=Object.keys(e).filter(r=>{const l=parseInt(r,10);if(!isNaN(l))return s=Math.max(s,l),!0}).map(r=>`${e[r]} ${r}w`).join(", ");if(o!=""){const r={srcset:o};!t.hasAttribute("width")&&!t.hasAttribute("height")&&(r.width=s),n.setAttributes(r,t)}}_registerConverters(e){const{conversion:t,plugins:n}=this.editor,s=n.get(k),o=n.get(_);t.for("dataDowncast").add(r=>{r.on(`attribute:uploadId:${e}`,(l,c,m)=>{if(!m.consumable.test(c.item,l.name))return;const g=s.loaders.get(c.attributeNewValue);if(!g||!g.data)return null;const u=m.mapper.toViewElement(c.item),d=o.findViewImgElement(u);d&&(m.consumable.consume(c.item,l.name),m.writer.setAttribute("data-ck-upload-id",g.id,d))})})}}function ni(a){return Array.from(a.types).includes("text/html")&&a.getData("text/html")!==""}function si(a,i){const e=a.plugins.get("ImageUtils");return Array.from(a.model.createRangeOn(i)).filter(t=>e.isImage(t.item)).map(t=>t.item)}class oi extends p{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[ii,Ht,Gt]}}class ai extends N{constructor(e){super(e);f(this,"urlInputView");f(this,"keystrokes");this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.keystrokes=new O,this.urlInputView=this._createUrlInputView(),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-url"],tabindex:"-1"},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]}}]})}render(){super.render(),F({view:this}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,n=new Y(e,ye);return n.bind("label").to(this,"isImageSelected",s=>t(s?"Update image URL":"Insert image via URL")),n.bind("isEnabled").to(this),n.fieldView.inputMode="url",n.fieldView.placeholder="https://example.com/image.png",n.fieldView.bind("value").to(this,"imageURLInputValue",s=>s||""),n.fieldView.on("input",()=>{this.imageURLInputValue=n.fieldView.element.value.trim()}),n}focus(){this.urlInputView.focus()}}class ri extends p{constructor(){super(...arguments);f(this,"_imageInsertUI");f(this,"_formView")}static get pluginName(){return"ImageInsertViaUrlUI"}static get isOfficialPlugin(){return!0}static get requires(){return[V,dt]}init(){this.editor.ui.componentFactory.add("insertImageViaUrl",()=>this._createToolbarButton()),this.editor.ui.componentFactory.add("menuBar:insertImageViaUrl",()=>this._createMenuBarButton("standalone"))}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createInsertUrlButton(e){const t=new e(this.editor.locale);return t.icon=I.imageUrl,t.on("execute",()=>{this._showModal()}),t}_createToolbarButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(v);return t.tooltip=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",n=>e(n?"Update image URL":"Insert image via URL")),t}_createDropdownButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(v);return t.withText=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",n=>e(n?"Update image URL":"Insert via URL")),t}_createMenuBarButton(e){const t=this.editor.locale.t,n=this._createInsertUrlButton(ht);switch(n.withText=!0,e){case"standalone":n.label=t("Image via URL");break;case"insertOnly":n.label=t("Image");break;case"insertNested":n.label=t("Via URL");break}return n}_createInsertUrlView(){const e=this.editor,t=e.locale,n=e.commands.get("replaceImageSource"),s=e.commands.get("insertImage"),o=new ai(t);return o.bind("isImageSelected").to(this._imageInsertUI),o.bind("isEnabled").toMany([s,n],"isEnabled",(...r)=>r.some(l=>l)),o}_showModal(){const e=this.editor,n=e.locale.t,s=e.plugins.get("Dialog");this._formView||(this._formView=this._createInsertUrlView(),this._formView.on("submit",()=>this._handleSave()));const o=e.commands.get("replaceImageSource");this._formView.imageURLInputValue=o.value||"",s.show({id:"insertImageViaUrl",title:this._imageInsertUI.isImageSelected?n("Update image URL"):n("Insert image via URL"),isModal:!0,content:this._formView,actionButtons:[{label:n("Cancel"),withText:!0,onExecute:()=>s.hide()},{label:n("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSave()}]})}_handleSave(){this.editor.commands.get("replaceImageSource").isEnabled?this.editor.execute("replaceImageSource",{source:this._formView.imageURLInputValue}):this.editor.execute("insertImage",{source:this._formView.imageURLInputValue}),this.editor.plugins.get("Dialog").hide()}}class li extends p{static get pluginName(){return"ImageInsertViaUrl"}static get isOfficialPlugin(){return!0}static get requires(){return[ri,V]}}class Gi extends p{static get pluginName(){return"ImageInsert"}static get isOfficialPlugin(){return!0}static get requires(){return[oi,li,V]}}class ci extends C{refresh(){const i=this.editor,t=i.plugins.get("ImageUtils").getClosestSelectedImageElement(i.model.document.selection);this.isEnabled=!!t,!t||!t.hasAttribute("resizedWidth")?this.value=null:this.value={width:t.getAttribute("resizedWidth"),height:null}}execute(i){const e=this.editor,t=e.model,n=e.plugins.get("ImageUtils"),s=n.getClosestSelectedImageElement(t.document.selection);this.value={width:i.width,height:null},s&&t.change(o=>{o.setAttribute("resizedWidth",i.width,s),o.removeAttribute("resizedHeight",s),n.setImageNaturalSizeAttributes(s)})}}class Ne extends p{static get requires(){return[_]}static get pluginName(){return"ImageResizeEditing"}static get isOfficialPlugin(){return!0}constructor(i){super(i),i.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const i=this.editor,e=new ci(i);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),i.commands.add("resizeImage",e),i.commands.add("imageResize",e)}afterInit(){this._registerSchema()}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]})}_registerConverters(i){const e=this.editor,t=e.plugins.get("ImageUtils");e.conversion.for("downcast").add(n=>n.on(`attribute:resizedWidth:${i}`,(s,o,r)=>{if(!r.consumable.consume(o.item,s.name))return;const l=r.writer,c=r.mapper.toViewElement(o.item);o.attributeNewValue!==null?(l.setStyle("width",o.attributeNewValue,c),l.addClass("image_resized",c)):(l.removeStyle("width",c),l.removeClass("image_resized",c))})),e.conversion.for("dataDowncast").attributeToAttribute({model:{name:i,key:"resizedHeight"},view:n=>({key:"style",value:{height:n}})}),e.conversion.for("editingDowncast").add(n=>n.on(`attribute:resizedHeight:${i}`,(s,o,r)=>{if(!r.consumable.consume(o.item,s.name))return;const l=r.writer,c=r.mapper.toViewElement(o.item),m=i==="imageInline"?t.findViewImgElement(c):c;o.attributeNewValue!==null?l.setStyle("height",o.attributeNewValue,m):l.removeStyle("height",m)})),e.conversion.for("upcast").attributeToAttribute({view:{name:i==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:n=>z(n)?null:n.getStyle("width")}}),e.conversion.for("upcast").attributeToAttribute({view:{name:i==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:n=>z(n)?null:n.getStyle("height")}})}}const M={small:I.objectSizeSmall,medium:I.objectSizeMedium,large:I.objectSizeLarge,custom:I.objectSizeCustom,original:I.objectSizeFull};class mi extends p{constructor(e){super(e);f(this,"_resizeUnit");this._resizeUnit=e.config.get("image.resizeUnit")}static get requires(){return[Ne]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),n=e.commands.get("resizeImage");this.bind("isEnabled").to(n);for(const s of t)this._registerImageResizeButton(s);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:n,value:s,icon:o}=e;t.ui.componentFactory.add(n,r=>{const l=new v(r),c=t.commands.get("resizeImage"),m=this._getOptionLabelValue(e,!0);if(!M[o])throw new it("imageresizebuttons-missing-icon",t,e);if(l.set({label:m,icon:M[o],tooltip:m,isToggleable:!0}),l.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&B(e)){const g=t.plugins.get("ImageCustomResizeUI");this.listenTo(l,"execute",()=>{g._showForm(this._resizeUnit)})}else{const g=s?s+this._resizeUnit:null;l.bind("isOn").to(c,"value",q(g)),this.listenTo(l,"execute",()=>{t.execute("resizeImage",{width:g})})}return l})}_registerImageResizeDropdown(e){const t=this.editor,n=t.t,s=e.find(r=>!r.value),o=r=>{const l=t.commands.get("resizeImage"),c=J(r,wt),m=c.buttonView,g=n("Resize image");return m.set({tooltip:g,commandValue:s.value,icon:M.medium,isToggleable:!0,label:this._getOptionLabelValue(s),withText:!0,class:"ck-resize-image-button",ariaLabel:g,ariaLabelledBy:void 0}),m.bind("label").to(l,"value",u=>u&&u.width?u.width:this._getOptionLabelValue(s)),c.bind("isEnabled").to(this),_t(c,()=>this._getResizeDropdownListItemDefinitions(e,l),{ariaLabel:n("Image resize list"),role:"menu"}),this.listenTo(c,"execute",u=>{"onClick"in u.source?u.source.onClick():(t.execute(u.source.commandName,{width:u.source.commandValue}),t.editing.view.focus())}),c};t.ui.componentFactory.add("resizeImage",o),t.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,t=!1){const n=this.editor.t;return e.label?e.label:t?B(e)?n("Custom image size"):e.value?n("Resize image to %0",e.value+this._resizeUnit):n("Resize image to the original size"):B(e)?n("Custom"):e.value?e.value+this._resizeUnit:n("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:n}=this,s=new nt,o=e.map(r=>B(r)?{...r,valueWithUnits:"custom"}:r.value?{...r,valueWithUnits:`${r.value}${this._resizeUnit}`}:{...r,valueWithUnits:null});for(const r of o){let l=null;if(n.plugins.has("ImageCustomResizeUI")&&B(r)){const c=n.plugins.get("ImageCustomResizeUI");l={type:"button",model:new ne({label:this._getOptionLabelValue(r),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{c._showForm(this._resizeUnit)}})};const m=vt(o,"valueWithUnits");l.model.bind("isOn").to(t,"value",ui(m))}else l={type:"button",model:new ne({commandName:"resizeImage",commandValue:r.valueWithUnits,label:this._getOptionLabelValue(r),role:"menuitemradio",withText:!0,icon:null})},l.model.bind("isOn").to(t,"value",q(r.valueWithUnits));l.model.bind("isEnabled").to(t,"isEnabled"),s.add(l)}return s}}function B(a){return a.value==="custom"}function q(a){return i=>{const e=i;return a===null&&e===a?!0:e!==null&&e.width===a}}function ui(a){return i=>!a.some(e=>q(e)(i))}const gi="figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img",W="image_resized";class di extends p{static get requires(){return[D,_]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const i=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(i),this._setupResizerCreator()}_setupResizerCreator(){const i=this.editor,e=i.editing.view,t=i.plugins.get("ImageUtils");e.addObserver(te),this.listenTo(e.document,"imageLoaded",(n,s)=>{if(!s.target.matches(gi))return;const o=i.editing.view.domConverter,r=o.domToView(s.target),l=t.getImageWidgetFromImageView(r);let c=this.editor.plugins.get(D).getResizerByViewElement(l);if(c){c.redraw();return}const m=i.editing.mapper,g=m.toModelElement(l);c=i.plugins.get(D).attachTo({unit:i.config.get("image.resizeUnit"),modelElement:g,viewElement:l,editor:i,getHandleHost(u){return u.querySelector("img")},getResizeHost(){return o.mapViewToDom(m.toViewElement(g))},isCentered(){return g.getAttribute("imageStyle")=="alignCenter"},onCommit(u){e.change(d=>{d.removeClass(W,l)}),i.execute("resizeImage",{width:u})}}),c.on("updateSize",()=>{l.hasClass(W)||e.change(d=>{d.addClass(W,l)});const u=g.name==="imageInline"?r:l;u.getStyle("height")&&e.change(d=>{d.removeStyle("height",u)})}),c.bind("isEnabled").to(this)})}}/**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/function Fe(a){if(!a)return null;const[,i,e]=a.trim().match(/([.,\d]+)(%|px)$/)||[],t=Number.parseFloat(i);return Number.isNaN(t)?null:{value:t,unit:e}}function Le(a,i,e){return e==="px"?{value:i.value,unit:"px"}:{value:i.value/a*100,unit:"%"}}/**
|
|
8
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
9
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
10
|
-
*/function De(a){const{editing:i}=a,t=a.plugins.get("ImageUtils").getClosestSelectedImageElement(a.model.document.selection);if(!t)return null;const n=i.mapper.toViewElement(t),s=i.view.domConverter.mapViewToDom(n);return{model:t,view:n,dom:s}}function hi(a,i){const e=De(a);if(!e)return null;const t=Fe(e.model.getAttribute("resizedWidth")||null);if(!t)return null;if(t.unit===i)return t;const n=pe(e.dom),s={value:new ot(e.dom).width};return Le(n,s,i)}class fi extends N{constructor(e,t,n){super(e);f(this,"focusTracker");f(this,"keystrokes");f(this,"unit");f(this,"labeledInput");f(this,"saveButtonView");f(this,"cancelButtonView");f(this,"_focusables");f(this,"_focusCycler");f(this,"_validators");const s=this.locale.t;this.focusTracker=new K,this.keystrokes=new O,this.unit=t,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(s("Save"),I.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(s("Cancel"),I.cancel,"ck-button-cancel","cancel"),this._focusables=new Z,this._validators=n,this._focusCycler=new X({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),F({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,s){const o=new v(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),s&&o.delegate("execute").to(this,s),o}_createLabeledInputView(){const e=this.locale.t,t=new Y(this.locale,yt);return t.label=e("Resize image (in %0)",this.unit),t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(e===null)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return e===null?null:`${e}${t}`}}function pi(a,i){const e=De(a);if(!e)return null;const t=pe(e.dom),n=Fe(window.getComputedStyle(e.dom).minWidth)||{value:1},s=Math.max(.1,Le(t,n,i).value);return{unit:i,lower:s,upper:i==="px"?t:100}}class Ii extends p{constructor(){super(...arguments);f(this,"_balloon");f(this,"_form")}static get requires(){return[be]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(we(fi))(t.locale,e,bi(t)),this._form.render(),this.listenTo(this._form,"submit",()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))}),this.listenTo(this._form.labeledInput,"change:errorText",()=>{t.ui.update()}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(n,s)=>{this._hideForm(!0),s()}),_e({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,n=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:ee(t)});const s=hi(t,e),o=s?s.value.toFixed(1):"",r=pi(t,e);n.fieldView.value=n.fieldView.element.value=o,r&&Object.assign(n.fieldView,{min:r.lower.toFixed(1),max:Math.ceil(r.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}function bi(a){const i=a.t;return[e=>{if(e.rawSize.trim()==="")return i("The value must not be empty.");if(e.parsedSize===null)return i("The value should be a plain number.")}]}class Ki extends p{static get requires(){return[Ne,di,Ii,mi]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}}class wi extends C{constructor(e,t){super(e);f(this,"_defaultStyles");f(this,"_styles");this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const s of n.modelElements)this._defaultStyles[s]=n.name;return[n.name,n]}))}refresh(){const n=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!n,this.isEnabled?n.hasAttribute("imageStyle")?this.value=n.getAttribute("imageStyle"):this.value=this._defaultStyles[n.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,s=t.plugins.get("ImageUtils");n.change(o=>{const r=e.value,{setImageSizes:l=!0}=e;let c=s.getClosestSelectedImageElement(n.document.selection);r&&this.shouldConvertImageType(r,c)&&(this.editor.execute(s.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:l}),c=s.getClosestSelectedImageElement(n.document.selection)),!r||this._styles.get(r).isDefault?o.removeAttribute("imageStyle",c):o.setAttribute("imageStyle",r,c),l&&s.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const A={get inline(){return{name:"inline",title:"In line",icon:I.objectInline,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:I.objectLeft,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:I.objectBlockLeft,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:I.objectCenter,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:I.objectRight,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:I.objectBlockRight,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:I.objectCenter,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:I.objectRight,modelElements:["imageBlock"],className:"image-style-side"}}},Me={full:I.objectFullWidth,left:I.objectBlockLeft,right:I.objectBlockRight,center:I.objectCenter,inlineLeft:I.objectLeft,inlineRight:I.objectRight,inline:I.objectInline},We=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function _i(a){return(a.configuredStyles.options||[]).map(t=>Ci(t)).filter(t=>Ei(t,a))}function yi(a,i){return a&&i?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:a?{options:["block","side"]}:i?{options:["inline","alignLeft","alignRight"]}:{}}function vi(a){return a.has("ImageBlockEditing")&&a.has("ImageInlineEditing")?[...We]:[]}function Ci(a){return typeof a=="string"?A[a]?a={...A[a]}:a={name:a}:a=ki(A[a.name],a),typeof a.icon=="string"&&(a.icon=Me[a.icon]||a.icon),a}function Ei(a,{isBlockPluginLoaded:i,isInlinePluginLoaded:e}){const{modelElements:t,name:n}=a;if(!t||!t.length||!n)return qe({style:a}),!1;{const s=[i?"imageBlock":null,e?"imageInline":null];if(!t.some(o=>s.includes(o)))return y("image-style-missing-dependency",{style:a,missingPlugins:t.map(o=>o==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}function ki(a,i){const e={...i};for(const t in a)Object.prototype.hasOwnProperty.call(i,t)||(e[t]=a[t]);return e}function qe(a){y("image-style-configuration-definition-invalid",a)}var $={normalizeStyles:_i,getDefaultStylesConfiguration:yi,getDefaultDropdownDefinitions:vi,warnInvalidStyle:qe,DEFAULT_OPTIONS:A,DEFAULT_ICONS:Me,DEFAULT_DROPDOWN_DEFINITIONS:We};function Si(a){return(i,e,t)=>{if(!t.consumable.consume(e.item,i.name))return;const n=me(e.attributeNewValue,a),s=me(e.attributeOldValue,a),o=t.mapper.toViewElement(e.item),r=t.writer;s&&r.removeClass(s.className,o),n&&r.addClass(n.className,o)}}function Ui(a){const i={imageInline:a.filter(e=>!e.isDefault&&e.modelElements.includes("imageInline")),imageBlock:a.filter(e=>!e.isDefault&&e.modelElements.includes("imageBlock"))};return(e,t,n)=>{if(!t.modelRange)return;const s=t.viewItem,o=G(t.modelRange.getItems());if(o&&n.schema.checkAttribute(o,"imageStyle"))for(const r of i[o.name])n.consumable.consume(s,{classes:r.className})&&n.writer.setAttribute("imageStyle",r.name,o)}}function me(a,i){for(const e of i)if(e.name===a)return e}class $e extends p{constructor(){super(...arguments);f(this,"normalizedStyles")}static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[_]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=$,n=this.editor,s=n.plugins.has("ImageBlockEditing"),o=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(s,o)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:s,isInlinePluginLoaded:o}),this._setupConversion(s,o),this._setupPostFixer(),n.commands.add("imageStyle",new wi(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,s=n.model.schema,o=Si(this.normalizedStyles),r=Ui(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",o),n.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(s.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",r,{priority:"low"})),t&&(s.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",r,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(_),s=new Map(this.normalizedStyles.map(o=>[o.name,o]));t.registerPostFixer(o=>{let r=!1;for(const l of t.differ.getChanges())if(l.type=="insert"||l.type=="attribute"&&l.attributeKey=="imageStyle"){let c=l.type=="insert"?l.position.nodeAfter:l.range.start.nodeAfter;if(c&&c.is("element","paragraph")&&c.childCount>0&&(c=c.getChild(0)),!n.isImage(c))continue;const m=c.getAttribute("imageStyle");if(!m)continue;const g=s.get(m);(!g||!g.modelElements.includes(c.name))&&(o.removeAttribute("imageStyle",c),r=!0)}return r})}}class Bi extends p{static get requires(){return[$e]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const i=this.editor.t;return{"Wrap text":i("Wrap text"),"Break text":i("Break text"),"In line":i("In line"),"Full size image":i("Full size image"),"Side image":i("Side image"),"Left aligned image":i("Left aligned image"),"Centered image":i("Centered image"),"Right aligned image":i("Right aligned image")}}init(){const i=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],t=i.get("ImageStyleEditing"),n=ue(t.normalizedStyles,this.localizedDefaultStylesTitles);for(const o of n)this._createButton(o);const s=ue([...e.filter(ve),...$.getDefaultDropdownDefinitions(i)],this.localizedDefaultStylesTitles);for(const o of s)this._createDropdown(o,n)}_createDropdown(i,e){const t=this.editor.ui.componentFactory;t.add(i.name,n=>{let s;const{defaultItem:o,items:r,title:l}=i,c=r.filter(d=>e.find(({name:h})=>ge(h)===d)).map(d=>{const h=t.create(d);return d===o&&(s=h),h});r.length!==c.length&&$.warnInvalidStyle({dropdown:i});const m=J(n,Ie),g=m.buttonView,u=g.arrowView;return ft(m,c,{enableActiveItemFocusOnDropdownOpen:!0}),g.set({label:de(l,s.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:l}),g.bind("icon").toMany(c,"isOn",(...d)=>{const h=d.findIndex(U);return h<0?s.icon:c[h].icon}),g.bind("label").toMany(c,"isOn",(...d)=>{const h=d.findIndex(U);return de(l,h<0?s.label:c[h].label)}),g.bind("isOn").toMany(c,"isOn",(...d)=>d.some(U)),g.bind("class").toMany(c,"isOn",(...d)=>d.some(U)?"ck-splitbutton_flatten":void 0),g.on("execute",()=>{c.some(({isOn:d})=>d)?m.isOpen=!m.isOpen:s.fire("execute")}),m.bind("isEnabled").toMany(c,"isEnabled",(...d)=>d.some(U)),this.listenTo(m,"execute",()=>{this.editor.editing.view.focus()}),m})}_createButton(i){const e=i.name;this.editor.ui.componentFactory.add(ge(e),t=>{const n=this.editor.commands.get("imageStyle"),s=new v(t);return s.set({label:i.title,icon:i.icon,tooltip:!0,isToggleable:!0}),s.bind("isEnabled").to(n,"isEnabled"),s.bind("isOn").to(n,"value",o=>o===e),s.on("execute",this._executeCommand.bind(this,e)),s})}_executeCommand(i){this.editor.execute("imageStyle",{value:i}),this.editor.editing.view.focus()}}function ue(a,i){for(const e of a)i[e.title]&&(e.title=i[e.title]);return a}function ge(a){return`imageStyle:${a}`}function de(a,i){return(a?a+": ":"")+i}class Ji extends p{static get requires(){return[$e,Bi]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}}class Zi extends p{static get requires(){return[ie,_]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const i=this.editor,e=i.t,t=i.plugins.get(ie),n=i.plugins.get("ImageUtils");t.register("image",{ariaLabel:e("Image toolbar"),items:Vi(i.config.get("image.toolbar")||[]),getRelatedElement:s=>n.getClosestSelectedImageWidget(s)})}}function Vi(a){return a.map(i=>ve(i)?i.name:i)}export{qi as AutoImage,$i as ImageBlock,Ae as ImageBlockEditing,Hi as ImageCaption,Dt as ImageCaptionEditing,Mt as ImageCaptionUI,xe as ImageCaptionUtils,Ii as ImageCustomResizeUI,Ue as ImageEditing,ji as ImageInline,Gi as ImageInsert,V as ImageInsertUI,li as ImageInsertViaUrl,Ki as ImageResize,mi as ImageResizeButtons,Ne as ImageResizeEditing,di as ImageResizeHandles,Be as ImageSizeAttributes,Ji as ImageStyle,$e as ImageStyleEditing,Bi as ImageStyleUI,ke as ImageTextAlternative,Tt as ImageTextAlternativeEditing,Rt as ImageTextAlternativeUI,Zi as ImageToolbar,oi as ImageUpload,ii as ImageUploadEditing,Gt as ImageUploadProgress,Ht as ImageUploadUI,_ as ImageUtils,Re as createImageTypeRegExp};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var k=Object.defineProperty;var I=(o,t,e)=>t in o?k(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var d=(o,t,e)=>I(o,typeof t!="symbol"?t+"":t,e);import{Plugin as f,MultiCommand as h,icons as l,Command as w}from"../../../../../@ckeditor_ckeditor5-core@44.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ButtonView as b,MenuBarMenuListItemButtonView as p}from"../../../../../@ckeditor_ckeditor5-ui@44.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{addMarginRules as B}from"../../../../../@ckeditor_ckeditor5-engine@44.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{first as v}from"../../../../../@ckeditor_ckeditor5-utils@44.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class C extends f{static get pluginName(){return"IndentEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.commands.add("indent",new h(t)),t.commands.add("outdent",new h(t))}}class x extends f{static get pluginName(){return"IndentUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale,n=t.t,s=e.uiLanguageDirection=="ltr"?l.indent:l.outdent,i=e.uiLanguageDirection=="ltr"?l.outdent:l.indent;this._defineButton("indent",n("Increase indent"),s),this._defineButton("outdent",n("Decrease indent"),i)}_defineButton(t,e,n){const s=this.editor;s.ui.componentFactory.add(t,()=>{const i=this._createButton(b,t,e,n);return i.set({tooltip:!0}),i}),s.ui.componentFactory.add("menuBar:"+t,()=>this._createButton(p,t,e,n))}_createButton(t,e,n,s){const i=this.editor,c=i.commands.get(e),r=new t(i.locale);return r.set({label:n,icon:s}),r.bind("isEnabled").to(c,"isEnabled"),this.listenTo(r,"execute",()=>{i.execute(e),i.editing.view.focus()}),r}}class y extends f{static get pluginName(){return"Indent"}static get isOfficialPlugin(){return!0}static get requires(){return[C,x]}}class u extends w{constructor(e,n){super(e);d(this,"_indentBehavior");this._indentBehavior=n}refresh(){const n=this.editor.model,s=v(n.document.selection.getSelectedBlocks());if(!s||!this._isIndentationChangeAllowed(s)){this.isEnabled=!1;return}this.isEnabled=this._indentBehavior.checkEnabled(s.getAttribute("blockIndent"))}execute(){const e=this.editor.model,n=this._getBlocksToChange();e.change(s=>{for(const i of n){const c=i.getAttribute("blockIndent"),r=this._indentBehavior.getNextIndent(c);r?s.setAttribute("blockIndent",r,i):s.removeAttribute("blockIndent",i)}})}_getBlocksToChange(){const n=this.editor.model.document.selection;return Array.from(n.getSelectedBlocks()).filter(i=>this._isIndentationChangeAllowed(i))}_isIndentationChangeAllowed(e){const n=this.editor;return n.model.schema.checkAttribute(e,"blockIndent")?!n.plugins.has("ListUtils")||!this._indentBehavior.isForward?!0:!n.plugins.get("ListUtils").isListItemBlock(e):!1}}/**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/class g{constructor(t){d(this,"isForward");d(this,"offset");d(this,"unit");this.isForward=t.direction==="forward",this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||"0");return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||"0");if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const s=this.isForward?this.offset:-this.offset,i=e+s;return i>0?i+this.unit:void 0}}/**
|
|
8
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
9
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
10
|
-
*/class m{constructor(t){d(this,"isForward");d(this,"classes");this.isForward=t.direction==="forward",this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e<this.classes.length-1:e>=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const _=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class S extends f{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.config.get("indentBlock");e.classes&&e.classes.length?(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new u(t,new m({direction:"forward",classes:e.classes}))),t.commands.add("outdentBlock",new u(t,new m({direction:"backward",classes:e.classes})))):(t.data.addStyleProcessorRules(B),this._setupConversionUsingOffset(),t.commands.add("indentBlock",new u(t,new g({direction:"forward",offset:e.offset,unit:e.unit}))),t.commands.add("outdentBlock",new u(t,new g({direction:"backward",offset:e.offset,unit:e.unit}))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),s=t.commands.get("outdent"),i=t.config.get("heading.options");(i&&i.map(a=>a.model)||_).forEach(a=>{e.isRegistered(a)&&e.extend(a,{allowAttributes:"blockIndent"})}),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),s.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,n=this.editor.locale.contentLanguageDirection==="rtl"?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[n]:/[\s\S]+/}},model:{key:"blockIndent",value:s=>{if(!s.is("element","li"))return s.getStyle(n)}}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:s=>({key:"style",value:{[n]:s}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}}export{y as Indent,S as IndentBlock,C as IndentEditing,x as IndentUI};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var G=Object.defineProperty;var W=(a,s,e)=>s in a?G(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e;var m=(a,s,e)=>W(a,typeof s!="symbol"?s+"":s,e);import{Plugin as b,Command as D,icons as V}from"../../../../../@ckeditor_ckeditor5-core@44.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Delete as X,findAttributeRange as A,TextWatcher as j,getLastTextLine as J,TwoStepCaretMovement as L,Input as Y,inlineHighlight as Q}from"../../../../../@ckeditor_ckeditor5-typing@44.3.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{ClipboardPipeline as Z}from"../../../../../@ckeditor_ckeditor5-clipboard@44.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{env as ee,keyCodes as te,Collection as ie,first as ne,toMap as T,ObservableMixin as se,FocusTracker as R,KeystrokeHandler as H}from"../../../../../@ckeditor_ckeditor5-utils@44.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ClickObserver as oe,Matcher as re}from"../../../../../@ckeditor_ckeditor5-engine@44.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ContextualBalloon as S,CssTransitionDisablerMixin as ae,ButtonView as p,MenuBarMenuListItemButtonView as le,clickOutsideHandler as ce,View as E,ViewCollection as F,FocusCycler as U,submitHandler as ue,LabeledFieldView as de,createLabeledInputText as me,SwitchButtonView as he}from"../../../../../@ckeditor_ckeditor5-ui@44.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{isWidget as fe}from"../../../../../@ckeditor_ckeditor5-widget@44.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import ge from"../../../../../lodash-es@4.17.21/node_modules/lodash-es/upperFirst.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class ke{constructor(){m(this,"_definitions",new Set)}get length(){return this._definitions.size}add(s){Array.isArray(s)?s.forEach(e=>this._definitions.add(e)):this._definitions.add(s)}getDispatcher(){return s=>{s.on("attribute:linkHref",(e,t,n)=>{if(!n.consumable.test(t.item,"attribute:linkHref")||!(t.item.is("selection")||n.schema.isInline(t.item)))return;const i=n.writer,o=i.document.selection;for(const r of this._definitions){const l=i.createAttributeElement("a",r.attributes,{priority:5});r.classes&&i.addClass(r.classes,l);for(const c in r.styles)i.setStyle(c,r.styles[c],l);i.setCustomProperty("link",!0,l),r.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(o.getFirstRange(),l):i.wrap(n.mapper.toViewRange(t.range),l):i.unwrap(n.mapper.toViewRange(t.range),l)}},{priority:"high"})}}getDispatcherForLinkedImage(){return s=>{s.on("attribute:linkHref:imageBlock",(e,t,{writer:n,mapper:i})=>{const o=i.toViewElement(t.item),r=Array.from(o.getChildren()).find(l=>l.is("element","a"));if(r)for(const l of this._definitions){const c=T(l.attributes);if(l.callback(t.attributeNewValue)){for(const[u,d]of c)u==="class"?n.addClass(d,r):n.setAttribute(u,d,r);l.classes&&n.addClass(l.classes,r);for(const u in l.styles)n.setStyle(u,l.styles[u],r)}else{for(const[u,d]of c)u==="class"?n.removeClass(d,r):n.removeAttribute(u,r);l.classes&&n.removeClass(l.classes,r);for(const u in l.styles)n.removeStyle(u,r)}}})}}}const be=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,we="^(?:(?:<protocols>):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))",pe=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,_e=/^((\w+:(\/{2,})?)|(\W))/i,ve=["https?","ftps?","mailto"],w="Ctrl+K";function Ve(a){return a.is("attributeElement")&&!!a.getCustomProperty("link")}function C(a,{writer:s}){const e=s.createAttributeElement("a",{href:a},{priority:5});return s.setCustomProperty("link",!0,e),e}function O(a,s=ve){const e=String(a),t=s.join("|"),n=new RegExp(`${we.replace("<protocols>",t)}`,"i");return Ee(e,n)?e:"#"}function Ee(a,s){return!!a.replace(be,"").match(s)}function Ie(a,s){const e={"Open in a new tab":a("Open in a new tab"),Downloadable:a("Downloadable")};return s.forEach(t=>("label"in t&&e[t.label]&&(t.label=e[t.label]),t)),s}function Ae(a){const s=[];if(a)for(const[e,t]of Object.entries(a)){const n=Object.assign({},t,{id:`link${ge(e)}`});s.push(n)}return s}function I(a,s){return a?s.checkAttribute(a.name,"linkHref"):!1}function Te(a){return pe.test(a)}function y(a,s){const e=Te(a)?"mailto:":s,t=!!e&&!M(a);return a&&t?e+a:a}function M(a){return _e.test(a)}function N(a){window.open(a,"_blank","noopener")}function z(a){const s=a.plugins.has("BookmarkEditing")?a.plugins.get("BookmarkEditing"):null;function e(n){return!!n&&n.startsWith("#")&&!!s&&!!s.getElementForBookmarkId(n.slice(1))}function t(n){const i=n.slice(1),o=s.getElementForBookmarkId(i);a.model.change(r=>{r.setSelection(o,"on")}),a.editing.view.scrollToTheSelection({alignToTop:!0,forceScroll:!0})}return{isScrollableToTarget:e,scrollToTarget:t}}class ye extends D{constructor(){super(...arguments);m(this,"manualDecorators",new ie);m(this,"automaticDecorators",new ke)}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||ne(t.getSelectedBlocks());I(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,o=[],r=[];for(const l in t)t[l]?o.push(l):r.push(l);n.change(l=>{if(i.isCollapsed){const c=i.getFirstPosition();if(i.hasAttribute("linkHref")){const u=P(i);let d=A(c,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===u&&(d=this._updateLinkContent(n,l,d,e)),l.setAttribute("linkHref",e,d),o.forEach(h=>{l.setAttribute(h,!0,d)}),r.forEach(h=>{l.removeAttribute(h,d)}),l.setSelection(l.createPositionAfter(d.end.nodeBefore))}else if(e!==""){const u=T(i.getAttributes());u.set("linkHref",e),o.forEach(h=>{u.set(h,!0)});const{end:d}=n.insertContent(l.createText(e,u),c);l.setSelection(d)}["linkHref",...o,...r].forEach(u=>{l.removeSelectionAttribute(u)})}else{const c=n.schema.getValidRanges(i.getRanges(),"linkHref"),u=[];for(const h of i.getSelectedBlocks())n.schema.checkAttribute(h,"linkHref")&&u.push(l.createRangeOn(h));const d=u.slice();for(const h of c)this._isRangeToUpdate(h,u)&&d.push(h);for(const h of d){let f=h;if(d.length===1){const k=P(i);i.getAttribute("linkHref")===k&&(f=this._updateLinkContent(n,l,h,e),l.setSelection(l.createSelection(f)))}l.setAttribute("linkHref",e,f),o.forEach(k=>{l.setAttribute(k,!0,f)}),r.forEach(k=>{l.removeAttribute(k,f)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return I(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}_updateLinkContent(e,t,n,i){const o=t.createText(i,{linkHref:i});return e.insertContent(o,n)}}function P(a){if(a.isCollapsed){const s=a.getFirstPosition();return s.textNode&&s.textNode.data}else{const s=Array.from(a.getFirstRange().getItems());if(s.length>1)return null;const e=s[0];return e.is("$text")||e.is("$textProxy")?e.data:null}}class Le extends D{refresh(){const s=this.editor.model,e=s.document.selection,t=e.getSelectedElement();I(t,s.schema)?this.isEnabled=s.schema.checkAttribute(t,"linkHref"):this.isEnabled=s.schema.checkAttributeInSelection(e,"linkHref")}execute(){const s=this.editor,e=this.editor.model,t=e.document.selection,n=s.commands.get("link");e.change(i=>{const o=t.isCollapsed?[A(t.getFirstPosition(),"linkHref",t.getAttribute("linkHref"),e)]:e.schema.getValidRanges(t.getRanges(),"linkHref");for(const r of o)if(i.removeAttribute("linkHref",r),n)for(const l of n.manualDecorators)i.removeAttribute(l.id,r)})}}class Se extends se(){constructor({id:e,label:t,attributes:n,classes:i,styles:o,defaultValue:r}){super();m(this,"id");m(this,"defaultValue");m(this,"label");m(this,"attributes");m(this,"classes");m(this,"styles");this.id=e,this.set("value",void 0),this.defaultValue=r,this.label=t,this.attributes=n,this.classes=i,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const Ce="ck-link_selected",B="automatic",Pe="manual",Be=/^(https?:)?\/\//;class _ extends b{static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[L,Y,Z]}constructor(s){super(s),s.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const s=this.editor,e=this.editor.config.get("link.allowedProtocols");s.model.schema.extend("$text",{allowAttributes:"linkHref"}),s.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:C}),s.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(i,o)=>C(O(i,e),o)}),s.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:i=>i.getAttribute("href")}}),s.commands.add("link",new ye(s)),s.commands.add("unlink",new Le(s));const t=Ie(s.t,Ae(s.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(i=>i.mode===B)),this._enableManualDecorators(t.filter(i=>i.mode===Pe)),s.plugins.get(L).registerAttribute("linkHref"),Q(s,"linkHref","a",Ce),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(s){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:B,callback:i=>!!i&&Be.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(s),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(s){if(!s.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;s.forEach(i=>{e.model.schema.extend("$text",{allowAttributes:i.id});const o=new Se(i);n.add(o),e.conversion.for("downcast").attributeToElement({model:o.id,view:(r,{writer:l,schema:c},{item:u})=>{if((u.is("selection")||c.isInline(u))&&r){const d=l.createAttributeElement("a",o.attributes,{priority:5});o.classes&&l.addClass(o.classes,d);for(const h in o.styles)l.setStyle(h,o.styles[h],d);return l.setCustomProperty("link",!0,d),d}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})})}_enableLinkOpen(){const s=this.editor,t=s.editing.view.document,n=z(s);function i(o){n.isScrollableToTarget(o)?n.scrollToTarget(o):N(o)}this.listenTo(t,"click",(o,r)=>{if(!(ee.isMac?r.domEvent.metaKey:r.domEvent.ctrlKey))return;let c=r.domTarget;if(c.tagName.toLowerCase()!="a"&&(c=c.closest("a")),!c)return;const u=c.getAttribute("href");u&&(o.stop(),r.preventDefault(),i(u))},{context:"$capture"}),this.listenTo(t,"keydown",(o,r)=>{const c=s.commands.get("link").value;c&&r.keyCode===te.enter&&r.altKey&&(o.stop(),i(c))})}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",(n,{attributeKeys:i})=>{!i.includes("linkHref")||t.hasAttribute("linkHref")||e.change(o=>{xe(o,De(e.schema))})})}_enableClipboardIntegration(){const s=this.editor,e=s.model,t=this.editor.config.get("link.defaultProtocol");t&&this.listenTo(s.plugins.get("ClipboardPipeline"),"contentInsertion",(n,i)=>{e.change(o=>{const r=o.createRangeIn(i.content);for(const l of r.getItems())if(l.hasAttribute("linkHref")){const c=y(l.getAttribute("linkHref"),t);o.setAttribute("linkHref",c,l)}})})}}function xe(a,s){a.removeSelectionAttribute("linkHref");for(const e of s)a.removeSelectionAttribute(e)}function De(a){return a.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}class Re extends E{constructor(e,t,n){super(e);m(this,"focusTracker",new R);m(this,"keystrokes",new H);m(this,"urlInputView");m(this,"saveButtonView");m(this,"cancelButtonView");m(this,"_manualDecoratorSwitches");m(this,"children");m(this,"_validators");m(this,"_focusables",new F);m(this,"_focusCycler");const i=e.t;this._validators=n,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),V.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),V.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new U({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),ue({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new de(this.locale,me);return t.fieldView.inputMode="url",t.label=e("Link URL"),t}_createButton(e,t,n,i){const o=new p(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new he(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(o,r)=>r===void 0&&o===void 0?!!n.defaultValue:!!o),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new E;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}var He='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>';class Fe extends E{constructor(e,t={},n){super(e);m(this,"focusTracker",new R);m(this,"keystrokes",new H);m(this,"previewButtonView");m(this,"unlinkButtonView");m(this,"editButtonView");m(this,"_focusables",new F);m(this,"_focusCycler");m(this,"_linkConfig");m(this,"_options");const i=e.t;this._options=n,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(i("Unlink"),He,"unlink"),this.editButtonView=this._createButton(i("Edit link"),V.pencil,"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new U({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new p(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new p(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",i=>i&&O(i,this._linkConfig.allowedProtocols)),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to(i=>{this._options&&this._options.isScrollableToTarget(this.href)?(i.preventDefault(),this._options.scrollToTarget(this.href)):N(this.href)})}}),e.bind("tooltip").to(this,"href",i=>this._options&&this._options.isScrollableToTarget(i)?n("Scroll to target"):n("Open link in new tab")),e.bind("label").to(this,"href",i=>i||n("This link has no URL")),e.bind("isEnabled").to(this,"href",i=>!!i),e.template.tag="a",e}}var K='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>';const g="link-ui";class $ extends b{constructor(){super(...arguments);m(this,"actionsView",null);m(this,"formView",null);m(this,"_balloon")}static get requires(){return[S]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(oe),this._balloon=e.plugins.get(S),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:g,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:g,view:(n,{writer:i})=>{if(!n.markerRange.isCollapsed)return null;const o=i.createUIElement("span");return i.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],o),o}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:w},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new Fe(e.locale,e.config.get("link"),z(e)),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(o,r)=>{this._hideUI(),r()}),t.keystrokes.set(w,(o,r)=>{this._addFormView(),r()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new(ae(Re))(e.locale,t,Ue(e));return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isEnabled").to(t,"isEnabled"),i.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(i,"submit",()=>{if(i.isValid()){const{value:o}=i.urlInputView.fieldView.element,r=y(o,n);e.execute("link",r,i.getDecoratorSwitchesState()),this._closeFormView()}}),this.listenTo(i.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(o,r)=>{this._closeFormView(),r()}),i}_createToolbarLinkButton(){const e=this.editor;e.ui.componentFactory.add("link",()=>{const t=this._createButton(p);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:link",()=>{const t=this._createButton(le);return t.set({role:"menuitemcheckbox"}),t})}_createButton(e){const t=this.editor,n=t.locale,i=t.commands.get("link"),o=new e(t.locale),r=n.t;return o.set({label:r("Link"),icon:K,keystroke:w,isToggleable:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",l=>!!l),this.listenTo(o,"execute",()=>this._showUI(!0)),o}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(w,(n,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),ce({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),!this._areActionsInPanel&&this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=t.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=r();const o=()=>{const l=this._getSelectedLinkElement(),c=r();n&&!l||!n&&c!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=l,i=c};function r(){return t.selection.focus.getAncestors().reverse().find(l=>l.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i;if(t.markers.has(g)){const o=Array.from(this.editor.editing.mapper.markerNameToElements(g)),r=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));i=e.domConverter.viewRangeToDom(r)}else i=()=>{const o=this._getSelectedLinkElement();return o?e.domConverter.mapViewToDom(o):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&fe(n))return v(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),o=v(i.start),r=v(i.end);return!o||o!=r?null:e.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(g))t.updateMarker(g,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:o})=>!e.schema.isContent(o),{boundaries:n});t.addMarker(g,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(g,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(g)&&e.change(t=>{t.removeMarker(g)})}}function v(a){return a.getAncestors().find(s=>Ve(s))||null}function Ue(a){const s=a.t,e=a.config.get("link.allowCreatingEmptyLinks");return[t=>{if(!e&&!t.url.length)return s("Link URL must not be empty.")}]}const Oe=4,q=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i"),Me=2;class Ne extends b{static get requires(){return[X,_]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(s,e){return e.textNode&&e.textNode.hasAttribute("linkHref")?A(e,"linkHref",e.textNode.getAttribute("linkHref"),s):null}_selectEntireLinks(s,e){const n=this.editor.model,i=n.document.selection,o=i.getFirstPosition(),r=i.getLastPosition();let l=e.getJoined(this._expandLinkRange(n,o)||e);l&&(l=l.getJoined(this._expandLinkRange(n,r)||e)),l&&(l.start.isBefore(o)||l.end.isAfter(r))&&s.setSelection(l)}_enablePasteLinking(){const s=this.editor,e=s.model,t=e.document.selection,n=s.plugins.get("ClipboardPipeline"),i=s.commands.get("link");n.on("inputTransformation",(o,r)=>{if(!this.isEnabled||!i.isEnabled||t.isCollapsed||r.method!=="paste"||t.rangeCount>1)return;const l=t.getFirstRange(),c=r.dataTransfer.getData("text/plain");if(!c)return;const u=c.match(q);u&&u[2]===c&&(e.change(d=>{this._selectEntireLinks(d,l),i.execute(c)}),o.stop())},{priority:"high"})}_enableTypingHandling(){const s=this.editor,e=new j(s.model,t=>{let n=t;if(!ze(n))return;n=n.slice(0,-1),"!.:,;?".includes(n[n.length-1])&&(n=n.slice(0,-1));const i=x(n);if(i)return{url:i,removedTrailingCharacters:t.length-n.length}});e.on("matched:data",(t,n)=>{const{batch:i,range:o,url:r,removedTrailingCharacters:l}=n;if(!i.isTyping)return;const c=o.end.getShiftedBy(-l),u=c.getShiftedBy(-r.length),d=s.model.createRange(u,c);this._applyAutoLink(r,d)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const s=this.editor,e=s.model,t=s.commands.get("enter");t&&t.on("execute",()=>{const n=e.document.selection.getFirstPosition();if(!n.parent.previousSibling)return;const i=e.createRangeIn(n.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const s=this.editor,e=s.model,t=s.commands.get("shiftEnter");t&&t.on("execute",()=>{const n=e.document.selection.getFirstPosition(),i=e.createRange(e.createPositionAt(n.parent,0),n.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(s){const e=this.editor.model,{text:t,range:n}=J(s,e),i=x(t);if(i){const o=e.createRange(n.end.getShiftedBy(-i.length),n.end);this._applyAutoLink(i,o)}}_applyAutoLink(s,e){const t=this.editor.model,n=this.editor.config.get("link.defaultProtocol"),i=y(s,n);!this.isEnabled||!Ke(e,t)||!M(i)||$e(e)||this._persistAutoLink(i,e)}_persistAutoLink(s,e){const t=this.editor.model,n=this.editor.plugins.get("Delete");t.enqueueChange(i=>{i.setAttribute("linkHref",s,e),t.enqueueChange(()=>{n.requestUndoOnBackspace()})})}}function ze(a){return a.length>Oe&&a[a.length-1]===" "&&a[a.length-2]!==" "}function x(a){const s=q.exec(a);return s?s[Me]:null}function Ke(a,s){return s.schema.checkAttributeInSelection(s.createSelection(a),"linkHref")}function $e(a){const s=a.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}class rt extends b{static get requires(){return[_,$,Ne]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}}class qe extends b{static get requires(){return["ImageEditing","ImageUtils",_]}static get pluginName(){return"LinkImageEditing"}static get isOfficialPlugin(){return!0}afterInit(){const s=this.editor,e=s.model.schema;s.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["linkHref"]}),s.conversion.for("upcast").add(Ge(s)),s.conversion.for("downcast").add(We(s)),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const s=this.editor,t=s.commands.get("link").automaticDecorators;t.length&&s.conversion.for("downcast").add(t.getDispatcherForLinkedImage())}_enableManualDecorators(){const s=this.editor,e=s.commands.get("link");for(const t of e.manualDecorators)s.plugins.has("ImageBlockEditing")&&s.model.schema.extend("imageBlock",{allowAttributes:t.id}),s.plugins.has("ImageInlineEditing")&&s.model.schema.extend("imageInline",{allowAttributes:t.id}),s.conversion.for("downcast").add(Xe(t)),s.conversion.for("upcast").add(je(s,t))}}function Ge(a){const s=a.plugins.has("ImageInlineEditing"),e=a.plugins.get("ImageUtils");return t=>{t.on("element:a",(n,i,o)=>{const r=i.viewItem,l=e.findViewImgElement(r);if(!l)return;const c=l.findAncestor(f=>e.isBlockImageView(f));if(s&&!c)return;const u={attributes:["href"]};if(!o.consumable.consume(r,u))return;const d=r.getAttribute("href");if(!d)return;let h=i.modelCursor.parent;if(!h.is("element","imageBlock")){const f=o.convertItem(l,i.modelCursor);i.modelRange=f.modelRange,i.modelCursor=f.modelCursor,h=i.modelCursor.nodeBefore}h&&h.is("element","imageBlock")&&o.writer.setAttribute("linkHref",d,h)},{priority:"high"})}}function We(a){const s=a.plugins.get("ImageUtils");return e=>{e.on("attribute:linkHref:imageBlock",(t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const o=i.mapper.toViewElement(n.item),r=i.writer,l=Array.from(o.getChildren()).find(d=>d.is("element","a")),c=s.findViewImgElement(o),u=c.parent.is("element","picture")?c.parent:c;if(l)n.attributeNewValue?r.setAttribute("href",n.attributeNewValue,l):(r.move(r.createRangeOn(u),r.createPositionAt(o,0)),r.remove(l));else{const d=r.createContainerElement("a",{href:n.attributeNewValue});r.insert(r.createPositionAt(o,0),d),r.move(r.createRangeOn(u),r.createPositionAt(d,0))}},{priority:"high"})}}function Xe(a){return s=>{s.on(`attribute:${a.id}:imageBlock`,(e,t,n)=>{const i=n.mapper.toViewElement(t.item),o=Array.from(i.getChildren()).find(r=>r.is("element","a"));if(o){for(const[r,l]of T(a.attributes))n.writer.setAttribute(r,l,o);a.classes&&n.writer.addClass(a.classes,o);for(const r in a.styles)n.writer.setStyle(r,a.styles[r],o)}})}}function je(a,s){const e=a.plugins.has("ImageInlineEditing"),t=a.plugins.get("ImageUtils");return n=>{n.on("element:a",(i,o,r)=>{const l=o.viewItem,c=t.findViewImgElement(l);if(!c)return;const u=c.findAncestor(k=>t.isBlockImageView(k));if(e&&!u)return;const h=new re(s._createPattern()).match(l);if(!h||!r.consumable.consume(l,h.match))return;const f=o.modelCursor.nodeBefore||o.modelCursor.parent;r.writer.setAttribute(s.id,!0,f)},{priority:"high"})}}class Je extends b{static get requires(){return[_,$,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}static get isOfficialPlugin(){return!0}init(){const s=this.editor,e=s.editing.view.document;this.listenTo(e,"click",(t,n)=>{this._isSelectedLinkedImage(s.model.document.selection)&&(n.preventDefault(),t.stop())},{priority:"high"}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const s=this.editor,e=s.t;s.ui.componentFactory.add("linkImage",t=>{const n=new p(t),i=s.plugins.get("LinkUI"),o=s.commands.get("link");return n.set({isEnabled:!0,label:e("Link image"),icon:K,keystroke:w,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",r=>!!r),this.listenTo(n,"execute",()=>{this._isSelectedLinkedImage(s.model.document.selection)?i._addActionsView():i._showUI(!0)}),n})}_isSelectedLinkedImage(s){const e=s.getSelectedElement();return this.editor.plugins.get("ImageUtils").isImage(e)&&e.hasAttribute("linkHref")}}class at extends b{static get requires(){return[qe,Je]}static get pluginName(){return"LinkImage"}static get isOfficialPlugin(){return!0}}export{Ne as AutoLink,rt as Link,Fe as LinkActionsView,ye as LinkCommand,_ as LinkEditing,Re as LinkFormView,at as LinkImage,qe as LinkImageEditing,Je as LinkImageUI,$ as LinkUI,Le as UnlinkCommand,y as addLinkProtocolIfApplicable,O as ensureSafeUrl,I as isLinkableElement};
|