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AAM,MACL,uGAEF,EAAM,IAAM,EACZ,EAAa,KAAK,EACnB,CACD,CAEA,OAAO,IAAI,OAAO,EAAc,EACjC","file":"/npm/suneditor@3.3.3/src/suneditor.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/suneditor@3.3.3/src/suneditor.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * @warning `suneditor.js`, `cdn-builder.js`, `format-index.cjs` must be modified together.\n */\n\nimport Editor from './core/editor';\n\nimport plugins from './plugins';\nimport * as moduleContract from './modules/contract';\nimport * as moduleManager from './modules/manager';\nimport * as moduleUI from './modules/ui';\nimport helper from './helper';\nimport * as interfaces from './interfaces';\n\nimport langs from './langs';\n\nconst modules = {\n\tcontract: moduleContract,\n\tmanager: moduleManager,\n\tui: moduleUI,\n};\n\n/**\n * @module SunEditorExports\n */\nexport { plugins, modules, helper, langs, interfaces };\n\n/**\n * SunEditor Factory Object\n * @namespace SunEditor\n */\nexport default {\n\t/**\n\t * Returns the create function with preset options.\n\t * If the options overlap, the options of the `create` function take precedence.\n\t * @example\n\t * // Preset common options, then create multiple editors\n\t * const preset = SUNEDITOR.init({\n\t *   plugins: [image, link],\n\t *   buttonList: [['bold', 'italic'], ['image', 'link']],\n\t * });\n\t * const editor1 = preset.create('#editor1', { height: '300px' });\n\t * const editor2 = preset.create('#editor2', { height: '500px' });\n\t * @param {SunEditor.InitOptions} init_options - Initialization options\n\t * @returns {{create: (targets: Element|Object<string, {target: Element, options: SunEditor.InitFrameOptions}>, options: SunEditor.InitOptions) => SunEditor.Instance}}}\n\t */\n\tinit(init_options) {\n\t\treturn {\n\t\t\tcreate: (targets, options) => this.create(targets, options, init_options),\n\t\t};\n\t},\n\n\t/**\n\t * Creates a new instance of the SunEditor\n\t * @example\n\t * // Create with a DOM element\n\t * const editor = SUNEDITOR.create(document.getElementById('editor'), {\n\t *   buttonList: [['bold', 'italic', 'underline']],\n\t * });\n\t *\n\t * // Create with a CSS selector\n\t * const editor = SUNEDITOR.create('#editor', { height: '400px' });\n\t *\n\t * // Create multi-root editor\n\t * const editor = SUNEDITOR.create({\n\t *   header: { target: document.getElementById('header') },\n\t *   body: { target: document.getElementById('body'), options: { height: '500px' } },\n\t * });\n\t * @param {Element|string|Object<string, {target: Element, options: SunEditor.InitFrameOptions}>} target\n\t * - `Element`: The direct DOM element to initialize the editor on.\n\t * - `string`: A CSS selector string. The corresponding element is selected using `document.querySelector`.\n\t * - `Object`: For multi-root setup. Each key maps to a config with `{target, options}`.\n\t * @param {SunEditor.InitOptions} options - Initialization options\n\t * @param {SunEditor.InitOptions} [_init_options] - Optional preset initialization options\n\t * @returns {SunEditor.Instance} - Instance of the SunEditor\n\t * @throws {Error} If the target element is not provided or is invalid\n\t */\n\tcreate(target, options, _init_options) {\n\t\tif (typeof options !== 'object') options = /** @type {SunEditor.InitOptions} */ ({});\n\t\tif (_init_options) {\n\t\t\toptions = /** @type {SunEditor.InitOptions} */ (\n\t\t\t\t(() => {\n\t\t\t\t\treturn [_init_options, options].reduce((init, option) => {\n\t\t\t\t\t\tObject.entries(option).forEach(([key, value]) => {\n\t\t\t\t\t\t\tif (key === 'plugins' && value && init[key]) {\n\t\t\t\t\t\t\t\tconst i = Array.isArray(init[key]) ? init[key] : Object.values(init[key]);\n\t\t\t\t\t\t\t\tconst o = Array.isArray(value) ? value : Object.values(value);\n\t\t\t\t\t\t\t\tinit[key] = [...o.filter((val) => !i.includes(val)), ...i];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinit[key] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn init;\n\t\t\t\t\t}, {});\n\t\t\t\t})()\n\t\t\t);\n\t\t}\n\n\t\tif (!target) throw Error('[SUNEDITOR.create.fail] The first parameter \"target\" is missing.');\n\n\t\tconst multiTargets = [];\n\t\tif (typeof target === 'string') {\n\t\t\tconst t = document.querySelector(target);\n\t\t\tif (!t)\n\t\t\t\tthrow Error(\n\t\t\t\t\t`[SUNEDITOR.create.fail]-[document.querySelector(${target})] Cannot find target element. Make sure \"${target}\" is a valid selector and exists in the document.`,\n\t\t\t\t);\n\t\t\tmultiTargets.push({ key: null, target: t });\n\t\t} else if (target.nodeType === 1) {\n\t\t\tmultiTargets.push({ key: null, target: target });\n\t\t} else {\n\t\t\tlet props;\n\t\t\tfor (const key in target) {\n\t\t\t\tprops = target[key];\n\t\t\t\tif (!props.target || props.target.nodeType !== 1)\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'[SUNEDITOR.create.fail] suneditor multi root requires textarea\\'s element at the \"target\" property.',\n\t\t\t\t\t);\n\t\t\t\tprops.key = key;\n\t\t\t\tmultiTargets.push(props);\n\t\t\t}\n\t\t}\n\n\t\treturn new Editor(multiTargets, options);\n\t},\n};\n"]}