From 46afc744d311e0b9077b1faeedf07677f6f29f91 Mon Sep 17 00:00:00 2001 From: xdan Date: Mon, 8 Mar 2021 02:36:46 +0300 Subject: [PATCH] New version 3.6.3. Read more https://github.com/xdan/jodit/blob/master/CHANGELOG.MD --- build/jodit.css | 4 +- build/jodit.es2018.css | 2 +- build/jodit.es2018.en.css | 2 +- build/jodit.es2018.en.js | 195 +++++++--- build/jodit.es2018.en.min.js | 4 +- build/jodit.es2018.js | 195 +++++++--- build/jodit.es2018.min.js | 4 +- build/jodit.js | 680 +++++++++++++++++++++-------------- build/jodit.min.css | 2 +- build/jodit.min.js | 4 +- package-lock.json | 4 +- package.json | 2 +- 12 files changed, 727 insertions(+), 371 deletions(-) diff --git a/build/jodit.css b/build/jodit.css index c72fdd93f..395d28b6e 100644 --- a/build/jodit.css +++ b/build/jodit.css @@ -1,14 +1,14 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ diff --git a/build/jodit.es2018.css b/build/jodit.es2018.css index 73f0952ca..7f6472917 100644 --- a/build/jodit.es2018.css +++ b/build/jodit.es2018.css @@ -1,7 +1,7 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ diff --git a/build/jodit.es2018.en.css b/build/jodit.es2018.en.css index 73f0952ca..7f6472917 100644 --- a/build/jodit.es2018.en.css +++ b/build/jodit.es2018.en.css @@ -1,7 +1,7 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ diff --git a/build/jodit.es2018.en.js b/build/jodit.es2018.en.js index 3198a8de2..cd5b42898 100644 --- a/build/jodit.es2018.en.js +++ b/build/jodit.es2018.en.js @@ -1,7 +1,7 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ @@ -35,6 +35,7 @@ return /******/ (() => { // webpackBootstrap class Config { constructor() { + this.namespace = ''; this.iframe = false; this.license = ''; this.preset = 'custom'; @@ -5461,7 +5462,7 @@ function persistent(target, propertyKey) { target.hookStatus(core_component/* STATUSES.ready */.n$.ready, (component) => { const jodit = (0,helpers.isViewObject)(component) ? component - : component.jodit, storageKey = `${component.componentName}_prop_${propertyKey}`, initialValue = component[propertyKey]; + : component.jodit, storageKey = `${jodit.options.namespace}${component.componentName}_prop_${propertyKey}`, initialValue = component[propertyKey]; Object.defineProperty(component, propertyKey, { get() { var _a; @@ -5551,6 +5552,11 @@ function watch(observeFields, context) { view.events .on(context || component, eventName, callback) .on(eventName, callback); + view.hookStatus('beforeDestruct', () => { + view.events + .off(context || component, eventName, callback) + .off(eventName, callback); + }); return; } const parts = field.split('.'), [key] = parts; @@ -6254,8 +6260,9 @@ var decorators = __webpack_require__(33); class Popup extends ui_element/* UIElement */.u { - constructor(jodit) { + constructor(jodit, smart = true) { super(jodit); + this.smart = smart; this.isOpened = false; this.strategy = 'leftBottom'; this.viewBound = () => ({ @@ -6429,26 +6436,32 @@ class Popup extends ui_element/* UIElement */.u { addGlobalListeners() { const up = this.updatePosition, ow = this.ow; global/* eventEmitter.on */.TB.on('closeAllPopups', this.close); + if (this.smart) { + this.j.e + .on('escape', this.close) + .on('mousedown touchstart', this.closeOnOutsideClick) + .on(ow, 'mousedown touchstart', this.closeOnOutsideClick); + } this.j.e .on('closeAllPopups', this.close) - .on('escape', this.close) .on('resize', up) .on(this.container, 'scroll mousewheel', up) - .on('mousedown touchstart', this.closeOnOutsideClick) - .on(ow, 'mousedown touchstart', this.closeOnOutsideClick) .on(ow, 'scroll', up) .on(ow, 'resize', up); } removeGlobalListeners() { const up = this.updatePosition, ow = this.ow; global/* eventEmitter.off */.TB.off('closeAllPopups', this.close); + if (this.smart) { + this.j.e + .off('escape', this.close) + .off('mousedown touchstart', this.closeOnOutsideClick) + .off(ow, 'mousedown touchstart', this.closeOnOutsideClick); + } this.j.e .off('closeAllPopups', this.close) - .off('escape', this.close) .off('resize', up) .off(this.container, 'scroll mousewheel', up) - .off('mousedown touchstart', this.closeOnOutsideClick) - .off(ow, 'mousedown touchstart', this.closeOnOutsideClick) .off(ow, 'scroll', up) .off(ow, 'resize', up); } @@ -8302,6 +8315,7 @@ __webpack_require__.d(plugins_namespaceObject, { "resizeHandler": () => (resizeHandler), "resizer": () => (resizer), "search": () => (search), + "select": () => (select_select), "selectCells": () => (selectCells), "size": () => (size), "source": () => (source), @@ -8988,7 +9002,7 @@ class View extends component/* Component */.wA { this.isView = true; this.mods = {}; this.components = new Set(); - this.version = "3.6.2"; + this.version = "3.6.3"; this.async = new Async(); this.buffer = Storage.makeStorage(); this.storage = Storage.makeStorage(true, this.componentName); @@ -9086,7 +9100,10 @@ class View extends component/* Component */.wA { return this.__isFullSize; } getVersion() { - return this.version; + return "3.6.3"; + } + static getVersion() { + return "3.6.3"; } initOptions(options) { this.options = (0,helpers.ConfigProto)(options || {}, (0,helpers.ConfigProto)(this.options || {}, View.defaultOptions)); @@ -9145,6 +9162,7 @@ class View extends component/* Component */.wA { View.defaultOptions = { extraButtons: [], textIcons: false, + namespace: '', removeButtons: [], zIndex: 100002, defaultTimeout: 100, @@ -9829,6 +9847,7 @@ class ViewWithToolbar extends View { config/* Config.prototype.dialog */.D.prototype.dialog = { + namespace: '', extraButtons: [], resizable: true, draggable: true, @@ -10553,6 +10572,7 @@ const ICON_LOADER = ''; config/* Config.prototype.filebrowser */.D.prototype.filebrowser = { + namespace: '', extraButtons: [], filter(item, search) { search = search.toLowerCase(); @@ -16023,6 +16043,7 @@ class Jodit extends ViewWithToolbar { super.destruct(); } } +Jodit.fatMode = false; Jodit.plugins = global/* pluginSystem */.pw; Jodit.modules = global/* modules */.qz; Jodit.ns = global/* modules */.qz; @@ -18561,6 +18582,7 @@ class DragAndDropElement extends Plugin { pointerEvents: 'none', pointer: 'drag', position: 'fixed', + opacity: 0.7, display: 'inline-block', left: event.clientX, top: event.clientY, @@ -20468,17 +20490,20 @@ config/* Config.prototype.popup */.D.prototype.popup = { class inlinePopup extends Plugin { constructor() { super(...arguments); + this.requires = ['select']; this.type = null; - this.popup = new ui_popup/* Popup */.G(this.jodit); + this.popup = new ui_popup/* Popup */.G(this.jodit, false); this.toolbar = makeCollection(this.jodit, this.popup); this.snapRange = null; + this.elmsList = (0,helpers.keys)(this.j.o.popup, false).filter(s => !this.isExcludedTarget(s)); } - onClick(e) { - const node = e.target, elements = (0,helpers.keys)(this.j.o.popup, false), target = dom/* Dom.isTag */.i.isTag(node, 'img') + onClick(node) { + const elements = this.elmsList, target = dom/* Dom.isTag */.i.isTag(node, 'img') ? node : dom/* Dom.closest */.i.closest(node, elements, this.j.editor); if (target && this.canShowPopupForType(target.nodeName.toLowerCase())) { this.showPopup(() => (0,helpers.position)(target, this.j), target.nodeName.toLowerCase(), target); + return false; } } showPopup(rect, type, target) { @@ -20508,10 +20533,13 @@ class inlinePopup extends Plugin { return true; } hidePopup(type) { - if (!type || type === this.type) { + if (!(0,helpers.isString)(type) || type === this.type) { this.popup.close(); } } + onOutsideClick(e) { + this.popup.close(); + } canShowPopupForType(type) { const data = this.j.o.popup[type.toLowerCase()]; if (this.j.o.readonly || !this.j.o.toolbarInline || !data) { @@ -20544,9 +20572,9 @@ class inlinePopup extends Plugin { .on('showPopup', (elm, rect, type) => { this.showPopup(rect, type || ((0,helpers.isString)(elm) ? elm : elm.nodeName), (0,helpers.isString)(elm) ? undefined : elm); }) - .on('click', this.onClick) .on('mousedown keydown', this.onSelectionStart) .on([this.j.ew, this.j.ow], 'mouseup keyup', this.onSelectionEnd); + this.addListenersForElements(); } onSelectionStart() { this.snapRange = this.j.s.range.cloneRange(); @@ -20599,8 +20627,14 @@ class inlinePopup extends Plugin { beforeDestruct(jodit) { jodit.e .off('showPopup') - .off('click', this.onClick) .off([this.j.ew, this.j.ow], 'mouseup keyup', this.onSelectionEnd); + this.removeListenersForElements(); + } + addListenersForElements() { + this.j.e.on(this.elmsList.map(e => (0,helpers.camelCase)(`click_${e}`)).join(' '), this.onClick); + } + removeListenersForElements() { + this.j.e.off(this.elmsList.map(e => (0,helpers.camelCase)(`click_${e}`)).join(' '), this.onClick); } } (0,tslib_es6.__decorate)([ @@ -20610,8 +20644,12 @@ class inlinePopup extends Plugin { (0,decorators.wait)((ctx) => !ctx.j.isLocked) ], inlinePopup.prototype, "showPopup", null); (0,tslib_es6.__decorate)([ + (0,decorators.watch)(':clickEditor'), decorators.autobind ], inlinePopup.prototype, "hidePopup", null); +(0,tslib_es6.__decorate)([ + (0,decorators.watch)(':outsideClick') +], inlinePopup.prototype, "onOutsideClick", null); (0,tslib_es6.__decorate)([ decorators.autobind ], inlinePopup.prototype, "onSelectionStart", null); @@ -21138,7 +21176,13 @@ class link_link extends Plugin { const textWasChanged = getSelectionText() !== content_input.value.trim(); if (!link) { if (!jodit.s.isCollapsed()) { - links = jodit.s.wrapInTag('a'); + const node = jodit.s.current(); + if (dom/* Dom.isTag */.i.isTag(node, ['img'])) { + links = [dom/* Dom.wrap */.i.wrap(node, 'a', jodit)]; + } + else { + links = jodit.s.wrapInTag('a'); + } } else { const a = jodit.createInside.element('a'); @@ -21935,7 +21979,7 @@ class resizer extends Plugin { } } }; - this.onClickElement = (element) => { + this.onClickElement = (element, e) => { if (this.element !== element || !this.isShown) { this.element = element; this.show(); @@ -21994,7 +22038,7 @@ class resizer extends Plugin { } }) .on('hideResizer', this.hide) - .on('change afterInit afterSetMode', editor.async.debounce(this.onChangeEditor.bind(this), editor.defaultTimeout)); + .on('change afterInit afterSetMode', this.onChangeEditor); this.addEventListeners(); this.onChangeEditor(); } @@ -22123,7 +22167,7 @@ class resizer extends Plugin { event.preventDefault(); } }) - .on(element, 'click', () => this.onClickElement(element)); + .on(element, 'click', (e) => this.onClickElement(element, e)); } showSizeViewer(w, h) { if (!this.j.o.resizer.showSize) { @@ -22167,6 +22211,9 @@ class resizer extends Plugin { jodit.e.off(this.j.ow, '.resizer').off('.resizer'); } } +(0,tslib_es6.__decorate)([ + (0,decorators.debounce)() +], resizer.prototype, "onChangeEditor", null); (0,tslib_es6.__decorate)([ decorators.autobind ], resizer.prototype, "hide", null); @@ -22640,6 +22687,62 @@ class search extends Plugin { decorators.autobind ], search.prototype, "calcSticky", null); +;// CONCATENATED MODULE: ./src/plugins/select.ts +/*! + * Jodit Editor (https://xdsoft.net/jodit/) + * Released under MIT see LICENSE.txt in the project root for license information. + * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net + */ + + + + + + +class select_select extends Plugin { + constructor() { + super(...arguments); + this.proxyEventsList = ['click', 'mousedown', 'touchstart', 'mouseup', 'touchend']; + } + afterInit(jodit) { + this.proxyEventsList.forEach((eventName) => { + jodit.e.on(eventName + '.inline-popup', this.onStartSelection); + }); + } + beforeDestruct(jodit) { + this.proxyEventsList.forEach((eventName) => { + jodit.e.on(eventName + '.inline-popup', this.onStartSelection); + }); + } + onStartSelection(e) { + const { j } = this; + let result, target = e.target; + while (result === undefined && target && target !== j.editor) { + result = j.e.fire((0,helpers.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e); + target = target.parentElement; + } + if (e.type === 'click' && result === undefined && target === j.editor) { + j.e.fire(e.type + 'Editor', target, e); + } + } + onOutsideClick(e) { + const node = e.target; + if (dom/* Dom.up */.i.up(node, (elm) => elm === this.j.editor)) { + return; + } + const box = ui/* UIElement.closestElement */.u1.closestElement(node, ui/* Popup */.GI); + if (!box) { + this.j.e.fire('outsideClick', e); + } + } +} +(0,tslib_es6.__decorate)([ + decorators.autobind +], select_select.prototype, "onStartSelection", null); +(0,tslib_es6.__decorate)([ + (0,decorators.watch)('ow:click') +], select_select.prototype, "onOutsideClick", null); + ;// CONCATENATED MODULE: ./src/plugins/size/config.ts config/* Config.prototype.width */.D.prototype.width = 'auto'; @@ -24493,6 +24596,7 @@ const select_cells_key = 'table_processor_observer'; class selectCells extends Plugin { constructor() { super(...arguments); + this.requires = ['select']; this.selectedCell = null; } get module() { @@ -24503,7 +24607,6 @@ class selectCells extends Plugin { return; } jodit.e - .on(this.j.ow, 'click.select-cells', this.onRemoveSelection) .on('keydown.select-cells', (event) => { if (event.key === constants.KEY_TAB) { this.unselectCells(); @@ -24511,28 +24614,31 @@ class selectCells extends Plugin { }) .on('beforeCommand.select-cells', this.onExecCommand) .on('afterCommand.select-cells', this.onAfterCommand) - .on('change afterCommand afterSetMode click afterInit' - .split(' ') + .on([ + 'clickEditor', + 'mousedownTd', + 'mousedownTh', + 'touchstartTd', + 'touchstartTh' + ] .map(e => e + '.select-cells') - .join(' '), () => { - (0,helpers.$$)('table', jodit.editor).forEach(this.observe); + .join(' '), this.onStartSelection) + .on('clickTr', () => { + if (this.module.getAllSelectedCells().length) { + return false; + } }); } - observe(table) { - if ((0,helpers.dataBind)(table, select_cells_key)) { - return; - } - this.onRemoveSelection(); - (0,helpers.dataBind)(table, select_cells_key, true); - this.j.e.on(table, 'mousedown.select-cells touchstart.select-cells', this.onStartSelection.bind(this, table)); - } - onStartSelection(table, e) { + onStartSelection(cell) { if (this.j.o.readonly) { return; } this.unselectCells(); - const cell = dom/* Dom.closest */.i.closest(e.target, ['td', 'th'], table); - if (!cell) { + if (cell === this.j.editor) { + return; + } + const table = dom/* Dom.closest */.i.closest(cell, 'table', this.j.editor); + if (!cell || !table) { return; } if (!cell.firstChild) { @@ -24543,7 +24649,10 @@ class selectCells extends Plugin { this.j.e .on(table, 'mousemove.select-cells touchmove.select-cells', this.onMove.bind(this, table)) .on(table, 'mouseup.select-cells touchend.select-cells', this.onStopSelection.bind(this, table)); - this.j.e.fire('showPopup', table, () => (0,helpers.position)(cell, this.j), 'cells'); + return false; + } + onOutsideClick(e) { + this.unselectCells(); } onMove(table, e) { if (this.j.o.readonly) { @@ -24641,7 +24750,7 @@ class selectCells extends Plugin { command = command.replace('table', ''); const cells = this.module.getAllSelectedCells(); if (cells.length) { - const cell = cells.shift(); + const [cell] = cells; if (!cell) { return; } @@ -24660,7 +24769,7 @@ class selectCells extends Plugin { Table.mergeSelected(table, this.j); break; case 'empty': - cells.forEach(td => (td.innerHTML = '')); + cells.forEach(td => dom/* Dom.detach */.i.detach(td)); break; case 'bin': dom/* Dom.safeRemove */.i.safeRemove(table); @@ -24698,7 +24807,10 @@ class selectCells extends Plugin { } (0,tslib_es6.__decorate)([ decorators.autobind -], selectCells.prototype, "observe", null); +], selectCells.prototype, "onStartSelection", null); +(0,tslib_es6.__decorate)([ + (0,decorators.watch)(':outsideClick') +], selectCells.prototype, "onOutsideClick", null); (0,tslib_es6.__decorate)([ decorators.autobind ], selectCells.prototype, "onRemoveSelection", null); @@ -25248,6 +25360,7 @@ class xpath extends Plugin { + // EXTERNAL MODULE: ./src/styles/icons/about.svg diff --git a/build/jodit.es2018.en.min.js b/build/jodit.es2018.en.min.js index eb43f8a21..4009d2711 100644 --- a/build/jodit.es2018.en.min.js +++ b/build/jodit.es2018.en.min.js @@ -1,10 +1,10 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ -((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}})(self,(function(){return(()=>{var t=[,(t,e,s)=>{"use strict";s.d(e,{D:()=>o});var i=s(2);class o{constructor(){this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window:null,this.shadowRoot=null,this.zIndex=0,this.readonly=!1,this.disabled=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots","selectall"],this.toolbarButtonSize="middle",this.allowTabNavigation=!1,this.inline=!1,this.theme="default",this.saveModeInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n=!1,this.tabIndex=-1,this.toolbar=!0,this.statusbar=!0,this.showTooltip=!0,this.showTooltipDelay=1e3,this.useNativeTooltip=!1,this.enter=i.PARAGRAPH,this.enterBlock="br"!==this.enter?this.enter:i.PARAGRAPH,this.defaultMode=i.MODE_WYSIWYG,this.useSplitMode=!1,this.colors={greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]},this.colorPickerDefaultTab="background",this.imageDefaultWidth=300,this.removeButtons=[],this.disablePlugins=[],this.extraPlugins=[],this.extraButtons=[],this.extraIcons={},this.createAttributes={},this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=[{group:"source",buttons:[]},{group:"font-style",buttons:[]},{group:"script",buttons:[]},{group:"list",buttons:["ul","ol"]},{group:"indent",buttons:[]},{group:"font",buttons:[]},{group:"color",buttons:[]},{group:"media",buttons:[]},"\n",{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}],this.buttonsMD=["source","|","bold","italic","|","ul","ol","eraser","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","\n","undo","redo","|","hr","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","eraser","|","fontsize","brush","paragraph","|","image","table","\n","link","|","align","|","undo","redo","|","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","eraser","\n","align","|","undo","redo","|","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!0}static get defaultOptions(){return o.__defaultOptions||(o.__defaultOptions=new o),o.__defaultOptions}}o.prototype.controls={}},(t,e,s)=>{"use strict";s.r(e),s.d(e,{INVISIBLE_SPACE:()=>i,NBSP_SPACE:()=>o,INVISIBLE_SPACE_REG_EXP:()=>r,INVISIBLE_SPACE_REG_EXP_END:()=>n,INVISIBLE_SPACE_REG_EXP_START:()=>a,SPACE_REG_EXP:()=>l,SPACE_REG_EXP_START:()=>c,SPACE_REG_EXP_END:()=>h,IS_BLOCK:()=>d,IS_INLINE:()=>u,INSEPARABLE_TAGS:()=>p,MAY_BE_REMOVED_WITH_KEY:()=>f,KEY_BACKSPACE:()=>m,KEY_TAB:()=>g,KEY_ENTER:()=>v,KEY_ESC:()=>b,KEY_LEFT:()=>w,KEY_UP:()=>y,KEY_RIGHT:()=>_,KEY_DOWN:()=>C,KEY_SPACE:()=>j,KEY_DELETE:()=>x,KEY_F3:()=>E,NEARBY:()=>S,ACCURACY:()=>k,COMMAND_KEYS:()=>T,BR:()=>I,PARAGRAPH:()=>q,MODE_WYSIWYG:()=>L,MODE_SOURCE:()=>z,MODE_SPLIT:()=>M,IS_IE:()=>P,TEXT_PLAIN:()=>D,TEXT_HTML:()=>N,MARKER_CLASS:()=>R,EMULATE_DBLCLICK_TIMEOUT:()=>A,INSERT_AS_HTML:()=>B,INSERT_CLEAR_HTML:()=>O,INSERT_AS_TEXT:()=>H,INSERT_ONLY_TEXT:()=>F,SAFE_COUNT_CHANGE_CALL:()=>W,IS_MAC:()=>$,KEY_ALIASES:()=>V,BASE_PATH:()=>Y});const i="\ufeff",o=" ",r=()=>/[\uFEFF]/g,n=()=>/[\uFEFF]+$/g,a=()=>/^[\uFEFF]+/g,l=()=>/[\s\n\t\r\uFEFF\u200b]+/g,c=()=>/^[\s\n\t\r\uFEFF\u200b]+/g,h=()=>/[\s\n\t\r\uFEFF\u200b]+$/g,d=/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i,u=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i,p=["img","br","video","iframe","script","input","textarea","hr","link","jodit","jodit-media"],f=RegExp(`^${p.join("|")}$`,"i"),m="Backspace",g="Tab",v="Enter",b="Escape",w="ArrowLeft",y="ArrowUp",_="ArrowRight",C="ArrowDown",j="Space",x="Delete",E="F3",S=5,k=10,T=[m,x,y,C,_,w,v,b,E,g],I="br",q="p",L=1,z=2,M=3,P="undefined"!=typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),D=P?"text":"text/plain",N=P?"html":"text/html",R="jodit-selection_marker",A=300,B="insert_as_html",O="insert_clear_html",H="insert_as_text",F="insert_only_text",W=10,$="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),V={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:$?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Y=(()=>{if("undefined"==typeof document)return"";const t=document.currentScript,e=t=>t.replace(/\/[^/]+.js$/,"/");if(t)return e(t.src);const s=document.querySelectorAll("script[src]");return s&&s.length?e(s[s.length-1].src):window.location.href})()},(t,e,s)=>{"use strict";s.d(e,{DG:()=>o,ng:()=>c,P5:()=>p,rO:()=>i});const i="JoditEventDefaultNamespace";class o{constructor(){this.__store={}}get(t,e){if(void 0!==this.__store[e])return this.__store[e][t]}indexOf(t,e,s){const i=this.get(t,e);if(i)for(let t=0;i.length>t;t+=1)if(i[t].originalCallback===s)return t;return!1}namespaces(t=!1){const e=Object.keys(this.__store);return t?e.filter((t=>t!==i)):e}events(t){return this.__store[t]?Object.keys(this.__store[t]):[]}set(t,e,s,i=!1){void 0===this.__store[e]&&(this.__store[e]={}),void 0===this.__store[e][t]&&(this.__store[e][t]=[]),i?this.__store[e][t].unshift(s):this.__store[e][t].push(s)}clear(){this.__store={}}}var r=s(5),n=s(6),a=s(7),l=s(4);class c{constructor(t){this.__key="__JoditEventsNativeNamespaces",this.doc=document,this.prepareEvent=t=>{t.cancelBubble||(t.type.match(/^touch/)&&t.changedTouches&&t.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach((e=>{Object.defineProperty(t,e,{value:t.changedTouches[0][e],configurable:!0,enumerable:!0})})),t.originalEvent||(t.originalEvent=t),"paste"===t.type&&void 0===t.clipboardData&&this.doc.defaultView.clipboardData&&Object.defineProperty(t,"clipboardData",{get:()=>this.doc.defaultView.clipboardData,configurable:!0,enumerable:!0}))},this.currents=[],this.__stopped=[],this.isDestructed=!1,t&&(this.doc=t),this.__key+=(new Date).getTime()}eachEvent(t,e){t.split(/[\s,]+/).forEach((t=>{const s=t.split(".");e.call(this,s[0],s[1]||i)}))}getStore(t){if(!t)throw(0,l.vU)("Need subject");if(void 0===t[this.__key]){const e=new o;Object.defineProperty(t,this.__key,{enumerable:!1,configurable:!0,value:e})}return t[this.__key]}clearStore(t){void 0!==t[this.__key]&&delete t[this.__key]}triggerNativeEvent(t,e){const s=this.doc.createEvent("HTMLEvents");"string"==typeof e?s.initEvent(e,!0,!0):(s.initEvent(e.type,e.bubbles,e.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach((t=>{Object.defineProperty(s,t,{value:e[t],enumerable:!0})})),Object.defineProperty(s,"originalEvent",{value:e,enumerable:!0})),t.dispatchEvent(s)}get current(){return this.currents[this.currents.length-1]}on(t,e,s,i=!1){const o=(0,r.H)(t)?this:t,c=(0,r.H)(e)?e:t;let h=s;void 0===h&&(0,n.m)(e)&&(h=e);const d=this.getStore(o);if(!(0,r.H)(c)||""===c)throw(0,l.vU)("Need events names");if(!(0,n.m)(h))throw(0,l.vU)("Need event handler");if((0,a.k)(o))return o.forEach((t=>{this.on(t,c,h,i)})),this;const u=(0,n.m)(o.addEventListener),p=this;let f=function(t,...e){return h&&h.call(this,t,...e)};return u&&(f=function(t){if(p.prepareEvent(t),h&&!1===h.call(this,t))return t.preventDefault(),t.stopImmediatePropagation(),!1}),this.eachEvent(c,((t,e)=>{if(""===t)throw(0,l.vU)("Need event name");if(!1===d.indexOf(t,e,h)&&(d.set(t,e,{event:t,originalCallback:h,syntheticCallback:f},i),u)){const e=!!["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"].includes(t)&&{passive:!0};o.addEventListener(t,f,e)}})),this}one(t,e,s,i=!1){const o=(0,r.H)(t)?this:t,a=(0,r.H)(e)?e:t;let l=s;void 0===l&&(0,n.m)(e)&&(l=e);const c=(...t)=>{this.off(o,a,c),l(...t)};return this.on(o,a,c,i),this}off(t,e,s){const o=(0,r.H)(t)?this:t,a=(0,r.H)(e)?e:t,l=this.getStore(o);let c=s;if(!(0,r.H)(a)||!a)return l.namespaces().forEach((t=>{this.off(o,"."+t)})),this.clearStore(o),this;void 0===c&&(0,n.m)(e)&&(c=e);const h=(0,n.m)(o.removeEventListener),d=t=>{h&&o.removeEventListener(t.event,t.syntheticCallback,!1)},u=(t,e)=>{if(""!==t){const s=l.get(t,e);if(s&&s.length)if((0,n.m)(c)){const i=l.indexOf(t,e,c);!1!==i&&(d(s[i]),s.splice(i,1))}else s.forEach(d),s.length=0}else l.events(e).forEach((t=>{""!==t&&u(t,e)}))};return this.eachEvent(a,((t,e)=>{e===i?l.namespaces().forEach((e=>{u(t,e)})):u(t,e)})),this}stopPropagation(t,e){const s=(0,r.H)(t)?this:t,o=(0,r.H)(t)?t:e;if("string"!=typeof o)throw(0,l.vU)("Need event names");const n=this.getStore(s);this.eachEvent(o,((t,e)=>{const o=n.get(t,e);o&&this.__stopped.push(o),e===i&&n.namespaces(!0).forEach((e=>this.stopPropagation(s,t+"."+e)))}))}removeStop(t){if(t){const e=this.__stopped.indexOf(t);-1!==e&&this.__stopped.splice(0,e+1)}}isStopped(t){return void 0!==t&&-1!==this.__stopped.indexOf(t)}fire(t,e,...s){let o,a;const c=(0,r.H)(t)?this:t,h=(0,r.H)(t)?t:e,d=(0,r.H)(t)?[e,...s]:s,u=(0,n.m)(c.dispatchEvent);if(!u&&!(0,r.H)(h))throw(0,l.vU)("Need events names");const p=this.getStore(c);return!(0,r.H)(h)&&u?this.triggerNativeEvent(c,e):this.eachEvent(h,((t,e)=>{if(u)this.triggerNativeEvent(c,t);else{const s=p.get(t,e);if(s)try{[...s].every((e=>!this.isStopped(s)&&(this.currents.push(t),a=e.syntheticCallback.apply(c,d),this.currents.pop(),void 0!==a&&(o=a),!0)))}finally{this.removeStop(s)}e!==i||u||p.namespaces().filter((t=>t!==e)).forEach((e=>{const s=this.fire.call(this,c,t+"."+e,...d);void 0!==s&&(o=s)}))}})),o}destruct(){this.isDestructed&&(this.isDestructed=!0,this.off(this),this.getStore(this).clear(),delete this[this.__key])}}var h=s(36),d=s(8),u=s(33);class p{constructor(t,e=[],s={}){this.__lockEvent={},this.__data=t,this.__prefix=e,this.__onEvents=s,Object.keys(t).forEach((e=>{const s=this.__prefix.concat(e).filter((t=>t.length));Object.defineProperty(this,e,{set:i=>{var o;const r=t[e];if(!(0,d.isFastEqual)(r,i)){this.fire(["beforeChange","beforeChange."+s.join(".")],e,i),(0,d.isPlainObject)(i)&&(i=new p(i,s,this.__onEvents)),t[e]=i;const n=[];this.fire(["change",...s.reduce(((t,e)=>(n.push(e),t.push("change."+n.join(".")),t)),[])],s.join("."),r,(null===(o=i)||void 0===o?void 0:o.valueOf)?i.valueOf():i)}},get:()=>t[e],enumerable:!0,configurable:!0}),(0,d.isPlainObject)(t[e])&&(t[e]=new p(t[e],s,this.__onEvents))}))}valueOf(){return this.__data}toString(){return JSON.stringify(this.valueOf())}on(t,e){return(0,d.isArray)(t)?(t.map((t=>this.on(t,e))),this):(this.__onEvents[t]||(this.__onEvents[t]=[]),this.__onEvents[t].push(e),this)}fire(t,...e){if((0,d.isArray)(t))t.map((t=>this.fire(t,...e)));else try{!this.__lockEvent[t]&&this.__onEvents[t]&&(this.__lockEvent[t]=!0,this.__onEvents[t].forEach((t=>t.call(this,...e))))}finally{this.__lockEvent[t]=!1}}static create(t,e=[]){return t instanceof p?t:new p(t,e)}}(0,h.__decorate)([u.nonenumerable],p.prototype,"__data",void 0),(0,h.__decorate)([u.nonenumerable],p.prototype,"__prefix",void 0),(0,h.__decorate)([u.nonenumerable],p.prototype,"__onEvents",void 0),(0,h.__decorate)([u.nonenumerable],p.prototype,"__lockEvent",void 0)},(t,e,s)=>{"use strict";s.d(e,{RI:()=>r,dt:()=>n,vU:()=>a});const i={},o=i.toString,r=i.hasOwnProperty;["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment","DOMStringList","HTMLCollection"].forEach((t=>{i["[object "+t+"]"]=t.toLowerCase()}));const n=t=>null===t?"null":"object"==typeof t||"function"==typeof t?i[o.call(t)]||"object":typeof t;function a(t){return new TypeError(t)}},(t,e,s)=>{"use strict";function i(t){return"string"==typeof t}s.d(e,{H:()=>i})},(t,e,s)=>{"use strict";function i(t){return"function"==typeof t}s.d(e,{m:()=>i})},(t,e,s)=>{"use strict";function i(t){return Array.isArray(t)}s.d(e,{k:()=>i})},(t,e,s)=>{"use strict";s.r(e),s.d(e,{$$:()=>k,ConfigFlatten:()=>y,ConfigProto:()=>w,LimitedStack:()=>i.lI,appendScript:()=>Y,appendScriptAsync:()=>U,appendStyleAsync:()=>G,applyStyles:()=>M,asArray:()=>r,attr:()=>i.Lj,browser:()=>X,buildQuery:()=>rt,call:()=>i.RE,callPromise:()=>i.C6,camelCase:()=>x.eV,cleanFromWord:()=>P,clearCenterAlign:()=>Q.b,clearTimeout:()=>d,cns:()=>i.H5,colorToHex:()=>v.h,completeUrl:()=>W,convertMediaUrlToVideoEmbed:()=>Z,css:()=>Q.i,cssPath:()=>q,ctrlKey:()=>tt,dataBind:()=>et.q,defaultLanguage:()=>st.X,each:()=>it,error:()=>j.vU,fastClone:()=>m,get:()=>i.U2,getClassName:()=>i.gj,getContentWidth:()=>B,getXPathByElement:()=>T,hasBrowserColorPicker:()=>g.EO,hasContainer:()=>g.Zt,hasOwn:()=>j.RI,htmlspecialchars:()=>D,humanSizeToBytes:()=>ot,i18n:()=>x.ag,inView:()=>nt,innerWidth:()=>O,isArray:()=>g.kJ,isAtom:()=>p,isBoolean:()=>g.jn,isDestructable:()=>g.Z$,isEqual:()=>g.Xy,isFastEqual:()=>g.LP,isFunction:()=>g.mf,isHTML:()=>g.FP,isHtmlFromWord:()=>g.I4,isInitable:()=>g.Gu,isInt:()=>g.GN,isJoditObject:()=>g.Zu,isLicense:()=>g.A1,isNativeFunction:()=>g.QC,isNumber:()=>g.hj,isNumeric:()=>g.kE,isPlainObject:()=>g.PO,isPromise:()=>g.tI,isString:()=>g.HD,isURL:()=>g.PX,isValidName:()=>g.r1,isViewObject:()=>g.f2,isVoid:()=>g.nj,isWindow:()=>g.FJ,kebabCase:()=>x.GL,keepNames:()=>i.kc,keys:()=>i.XP,loadImage:()=>i.po,loadNext:()=>K,markAsAtomic:()=>f,markDeprecated:()=>i.Q8,markOwner:()=>i.MN,memorizeExec:()=>i.u3,nl2br:()=>R,normalizeColor:()=>A.ut,normalizeCssValue:()=>A.Zh,normalizeKeyAliases:()=>A.T2,normalizeLicense:()=>A.Pd,normalizeNode:()=>A.Tz,normalizePath:()=>A.AH,normalizeRelativePath:()=>A.Jf,normalizeSize:()=>A.aC,normalizeUrl:()=>A.D5,offset:()=>H,parseQuery:()=>J,position:()=>F,refs:()=>I,reset:()=>i.mc,resolveElement:()=>L,scrollIntoViewIfNeeded:()=>at,set:()=>i.t8,setTimeout:()=>h,splitArray:()=>a,sprintf:()=>x.gB,stringify:()=>x.Pz,stripTags:()=>N,toArray:()=>c,trim:()=>x.fy,trimInv:()=>x.as,type:()=>j.dt,ucfirst:()=>x.Ps,val:()=>lt});var i=s(9),o=s(7);const r=t=>(0,o.k)(t)?t:[t];var n=s(5);function a(t){return(0,n.H)(t)?t.split(/[,\s]+/):t}var l=s(19);const c=(...t)=>{var e;return((0,l.Q)(Array.from)?Array.from:null!==(e=(0,i.mc)("Array.from"))&&void 0!==e?e:Array.from).apply(Array,t)};function h(t,e,...s){return e?window.setTimeout(t,e,...s):(t.call(null,...s),0)}function d(t){window.clearTimeout(t)}var u=s(16);function p(t){return t&&t.isAtom}function f(t){return Object.defineProperty(t,"isAtom",{enumerable:!1,value:!0,configurable:!1}),t}function m(t){return JSON.parse((0,u.P)(t))}var g=s(15),v=s(21),b=s(1);function w(t,e,s=0){if(Object.getPrototypeOf(t)!==Object.prototype)return t;const i=b.D.defaultOptions;if((0,g.HD)(t.preset)){if(void 0!==i.presets[t.preset]){const e=i.presets[t.preset];Object.keys(e).forEach((s=>{(0,g.nj)(t[s])&&(t[s]=e[s])}))}delete t.preset}const o={};return Object.keys(t).forEach((i=>{const r=t[i],n=e?e[i]:null;o[i]=(0,g.PO)(r)&&(0,g.PO)(n)&&!p(r)?w(r,n,s+1):0!==s&&(0,g.kJ)(r)&&!p(r)&&(0,g.kJ)(n)?[...r,...n.slice(r.length)]:r})),Object.setPrototypeOf(o,e),o}function y(t){return(0,i.XP)(t,!1).reduce(((e,s)=>(e[s]=t[s],e)),{})}var _=s(14),C=s(2),j=s(4),x=s(22),E=s(24);let S=1;function k(t,e){let s;if(!/:scope/.test(t)||!C.IS_IE||e&&e.nodeType===Node.DOCUMENT_NODE)s=e.querySelectorAll(t);else{const i=e.id,o=i||"_selector_id_"+(Math.random()+"").slice(2)+(S++,S);t=t.replace(/:scope/g,"#"+o),!i&&e.setAttribute("id",o),s=e.parentNode.querySelectorAll(t),i||e.removeAttribute("id")}return[].slice.call(s)}const T=(t,e)=>{if(!t||t.nodeType!==Node.ELEMENT_NODE)return"";if(!t.parentNode||e===t)return"";if(t.id)return"//*[@id='"+t.id+"']";const s=[].filter.call(t.parentNode.childNodes,(e=>e.nodeName===t.nodeName));return T(t.parentNode,e)+"/"+t.nodeName.toLowerCase()+(s.length>1?"["+(c(s).indexOf(t)+1)+"]":"")},I=t=>(t instanceof E.u1&&(t=t.container),k("[ref],[data-ref]",t).reduce(((t,e)=>{const s=(0,i.Lj)(e,"-ref");return s&&(0,g.HD)(s)&&(t[(0,x.eV)(s)]=e,t[s]=e),t}),{})),q=t=>{if(!_.i.isElement(t))return null;const e=[];let s=t;for(;s&&s.nodeType===Node.ELEMENT_NODE;){let t=s.nodeName.toLowerCase();if(s.id){t+="#"+s.id,e.unshift(t);break}{let e=s,i=1;do{e=e.previousElementSibling,e&&e.nodeName.toLowerCase()===t&&i++}while(e);t+=":nth-of-type("+i+")"}e.unshift(t),s=s.parentNode}return e.join(" > ")};function L(t,e){let s=t;if((0,g.HD)(t))try{s=e.querySelector(t)}catch(e){throw(0,j.vU)('String "'+t+'" should be valid HTML selector')}if(!s||"object"!=typeof s||!_.i.isElement(s)||!s.cloneNode)throw(0,j.vU)('Element "'+t+'" should be string or HTMLElement instance');return s}function z(t){return t.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";]+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,((t,e,s)=>{switch(s.toLowerCase()){case"pt":return(1.328*parseFloat(e)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(e)).toFixed(0)+"px"}return t}))}function M(t){if(-1===t.indexOf("")+7);const e=document.createElement("iframe");e.style.display="none",document.body.appendChild(e);let s="",i=[],o=[];try{const r=e.contentDocument||(e.contentWindow?e.contentWindow.document:null);if(r){r.open(),r.write(t),r.close(),r.styleSheets.length&&(o=r.styleSheets[r.styleSheets.length-1].cssRules);for(let t=0;o.length>t;t+=1)""!==o[t].selectorText&&(i=k(o[t].selectorText,r.body),i.forEach((e=>{e.style.cssText=z(o[t].style.cssText+";"+e.style.cssText)})));_.i.each(r.body,(t=>{if(_.i.isElement(t)){const e=t,s=e.style.cssText;s&&(e.style.cssText=z(s)),e.hasAttribute("lang")&&e.removeAttribute("lang")}})),s=r.firstChild?(0,x.fy)(r.body.innerHTML):""}}catch(t){}finally{_.i.safeRemove(e)}return s&&(t=s),(0,x.fy)(t.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(//i);-1!==e&&(t=t.substr(e+20));const s=t.search(//i);return-1!==s&&(t=t.substr(0,s)),t})(s)),e.s.insertHTML(s)}const Gt="clipboard";class Kt{constructor(){this.buttons=[{name:"cut",group:"clipboard"},{name:"copy",group:"clipboard"},{name:"paste",group:"clipboard"},{name:"selectall",group:"clipboard"}]}init(t){var e;null===(e=this.buttons)||void 0===e||e.forEach((e=>t.registerButton(e))),t.e.off("copy.clipboard cut.clipboard").on("copy.clipboard cut.clipboard",(e=>{var s;const i=t.s.html,o=Yt(e)||Yt(t.ew)||Yt(e.originalEvent);o&&(o.setData(a.TEXT_PLAIN,(0,c.stripTags)(i)),o.setData(a.TEXT_HTML,i)),t.buffer.set(Gt,i),t.e.fire("pasteStack",{html:i,action:t.o.defaultActionOnPaste}),"cut"===e.type&&(t.s.remove(),t.s.focus()),e.preventDefault(),null===(s=null==t?void 0:t.events)||void 0===s||s.fire("afterCopy",i)}))}destruct(t){var e,s;null===(e=null==t?void 0:t.buffer)||void 0===e||e.set(Gt,""),null===(s=null==t?void 0:t.events)||void 0===s||s.off(".clipboard")}}n.D.prototype.askBeforePasteHTML=!0,n.D.prototype.processPasteHTML=!0,n.D.prototype.askBeforePasteFromWord=!0,n.D.prototype.processPasteFromWord=!0,n.D.prototype.nl2brInPlainText=!0,n.D.prototype.defaultActionOnPaste=a.INSERT_AS_HTML,n.D.prototype.defaultActionOnPasteFromWord=null,n.D.prototype.draggableTags=["img","a","jodit-media","jodit"],n.D.prototype.controls.cut={command:"cut",isDisabled:t=>t.s.isCollapsed(),tooltip:"Cut selection"},n.D.prototype.controls.copy={command:"copy",isDisabled:t=>t.s.isCollapsed(),tooltip:"Copy selection"};const Xt="pasteStorage";n.D.prototype.controls.paste={tooltip:"Paste from clipboard",async exec(t,e,{control:s}){if(s.name===Xt)return void t.execCommand("showPasteStorage");t.s.focus();let i="",o=!0;if(navigator.clipboard){try{const t=await navigator.clipboard.read();if(t&&t.length){const e=await t[0].getType(a.TEXT_PLAIN);i=await new Response(e).text()}o=!1}catch(t){}if(o)try{i=await navigator.clipboard.readText(),o=!1}catch(t){}}o&&(i=t.buffer.get(Gt)||"",o=0===i.length);const r=t.value;o?(t.ed.execCommand("paste"),o=r===t.value,!o&&t.e.fire("afterPaste")):i.length?(Ut(null,t,i),t.e.fire("afterPaste")):o&&A(t.i18n("Your browser doesn't support direct access to the clipboard."),(()=>{t.s.focus()})).bindDestruct(t)},list:{[Xt]:"Paste Storage"},isChildDisabled(t){return 2>t.e.fire("pasteStorageList")}},n.D.prototype.controls.selectall={icon:"select-all",command:"selectall",tooltip:"Select all"};class Jt extends H{constructor(){super(...arguments),this.pasteStack=new c.LimitedStack(20)}afterInit(t){t.e.on("paste.paste",this.onPaste).on("pasteStack.paste",(t=>this.pasteStack.push(t))),t.o.nl2brInPlainText&&this.j.e.on("processPaste.paste",this.onProcessPasteReplaceNl2Br)}onPaste(t){try{if(!1===this.j.e.fire("beforePaste",t)||!1===this.customPasteProcess(t))return t.preventDefault(),!1;this.defaultPasteProcess(t)}finally{this.j.e.fire("afterPaste",t)}}customPasteProcess(t){if(!this.j.o.processPasteHTML)return;const e=Yt(t),s=[null==e?void 0:e.getData(a.TEXT_HTML),null==e?void 0:e.getData(a.TEXT_PLAIN)];for(const e of s)if((0,c.isHTML)(e)&&(this.processWordHTML(t,e)||this.processHTML(t,e)))return!1}defaultPasteProcess(t){const e=Yt(t);let s=(null==e?void 0:e.getData(a.TEXT_HTML))||(null==e?void 0:e.getData(a.TEXT_PLAIN));if(e&&s&&""!==(0,c.trim)(s)){const i=this.j.e.fire("processPaste",t,s,(t=>{const e=t.types;let s="";if((0,c.isArray)(e)||"domstringlist"===(0,c.type)(e))for(let t=0;e.length>t;t+=1)s+=e[t]+";";else s=(e||a.TEXT_PLAIN)+";";return s})(e));void 0!==i&&(s=i),((0,c.isString)(s)||S.i.isNode(s,this.j.ew))&&this.insertByType(t,s,this.j.o.defaultActionOnPaste),t.preventDefault(),t.stopPropagation()}}processWordHTML(t,e){return!(!this.j.o.processPasteFromWord||!(0,c.isHtmlFromWord)(e)||(this.j.o.askBeforePasteFromWord?this.askInsertTypeDialog("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","Word Paste Detected",(s=>{this.insertFromWordByType(t,e,s)})):this.insertFromWordByType(t,e,this.j.o.defaultActionOnPasteFromWord||this.j.o.defaultActionOnPaste),0))}processHTML(t,e){if(this.j.o.askBeforePasteHTML){const s=this.pasteStack.find((t=>t.html===e));return s?(this.insertByType(t,e,s.action||this.j.o.defaultActionOnPaste),!0):(this.askInsertTypeDialog("Your code is similar to HTML. Keep as HTML?","Paste as HTML",(s=>{this.insertByType(t,e,s)}),"Insert as Text"),!0)}return!1}insertFromWordByType(t,e,s){var i;switch(s){case a.INSERT_AS_HTML:if(e=(0,c.applyStyles)(e),this.j.o.beautifyHTML){const t=null===(i=this.j.events)||void 0===i?void 0:i.fire("beautifyHTML",e);(0,c.isString)(t)&&(e=t)}break;case a.INSERT_AS_TEXT:e=(0,c.cleanFromWord)(e);break;case a.INSERT_ONLY_TEXT:e=(0,c.stripTags)((0,c.cleanFromWord)(e))}Ut(t,this.j,e)}insertByType(t,e,s){if(this.pasteStack.push({html:e,action:s}),(0,c.isString)(e))switch(this.j.buffer.set(Gt,e),s){case a.INSERT_CLEAR_HTML:e=(0,c.cleanFromWord)(e);break;case a.INSERT_ONLY_TEXT:e=(0,c.stripTags)(e);break;case a.INSERT_AS_TEXT:e=(0,c.htmlspecialchars)(e)}Ut(t,this.j,e)}askInsertTypeDialog(t,e,s,i="Clean",o="Insert only Text"){var r,n,l,h;if(!1===(null===(n=null===(r=this.j)||void 0===r?void 0:r.e)||void 0===n?void 0:n.fire("beforeOpenPasteDialog",t,e,s,i,o)))return;const d=O(`
${this.j.i18n(t)}
`,this.j.i18n(e));d.bindDestruct(this.j),(0,c.markOwner)(this.j,d.container);const u=(0,f.zx)(this.j,{text:"Keep",name:"keep",status:"primary",tabIndex:0}),p=(0,f.zx)(this.j,{text:i,tabIndex:0}),m=(0,f.zx)(this.j,{text:o,tabIndex:0}),g=(0,f.zx)(this.j,{text:"Cancel",tabIndex:0});return u.onAction((()=>{d.close(),s&&s(a.INSERT_AS_HTML)})),p.onAction((()=>{d.close(),s&&s(a.INSERT_AS_TEXT)})),m.onAction((()=>{d.close(),s&&s(a.INSERT_ONLY_TEXT)})),g.onAction((()=>{d.close()})),d.setFooter([u,p,o?m:"",g]),u.focus(),null===(h=null===(l=this.j)||void 0===l?void 0:l.e)||void 0===h||h.fire("afterOpenPasteDialog",d,t,e,s,i,o),d}onProcessPasteReplaceNl2Br(t,e,s){if(s===a.TEXT_PLAIN+";"&&!(0,c.isHTML)(e))return(0,c.nl2br)(e)}useFakeDivBox(t){const e=this.j.c.div("",{tabindex:-1,contenteditable:!0,style:{left:-9999,top:0,width:0,height:"100%",lineHeight:"140%",overflow:"hidden",position:"fixed",zIndex:2147483647,wordBreak:"break-all"}});this.j.container.appendChild(e);const s=this.j.s.save();e.focus();let i=0;const o=()=>{S.i.safeRemove(e),this.j.selection&&this.j.s.restore(s)},r=()=>{if(i+=1,e.childNodes&&e.childNodes.length>0){const s=e.innerHTML;return o(),void this.processHTML(t,s)}5>i?this.j.async.setTimeout(r,20):o()};r()}beforeDestruct(t){t.e.off("paste.paste",this.onPaste)}}(0,r.__decorate)([j.autobind],Jt.prototype,"onPaste",null),(0,r.__decorate)([j.autobind],Jt.prototype,"onProcessPasteReplaceNl2Br",null);class Zt extends H{constructor(){super(...arguments),this.currentIndex=0,this.list=[],this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.paste=()=>{if(this.j.s.focus(),this.j.s.insertHTML(this.list[this.currentIndex]),0!==this.currentIndex){const t=this.list[0];this.list[0]=this.list[this.currentIndex],this.list[this.currentIndex]=t}this.dialog&&this.dialog.close(),this.j.setEditorValue(),this.j.e.fire("afterPaste")},this.onKeyDown=t=>{let e=this.currentIndex;-1!==[a.KEY_UP,a.KEY_DOWN,a.KEY_ENTER].indexOf(t.key)&&(t.key===a.KEY_UP&&(0===e?e=this.list.length-1:e-=1),t.key===a.KEY_DOWN&&(e===this.list.length-1?e=0:e+=1),t.key!==a.KEY_ENTER?(e!==this.currentIndex&&this.selectIndex(e),t.stopImmediatePropagation(),t.preventDefault()):this.paste())},this.selectIndex=t=>{this.listBox&&(0,c.toArray)(this.listBox.childNodes).forEach(((e,s)=>{e.classList.remove("jodit_active"),t===s&&this.previewBox&&(e.classList.add("jodit_active"),this.previewBox.innerHTML=this.list[t],e.focus())})),this.currentIndex=t},this.showDialog=()=>{2>this.list.length||(this.dialog||this.createDialog(),this.listBox&&(this.listBox.innerHTML=""),this.previewBox&&(this.previewBox.innerHTML=""),this.list.forEach(((t,e)=>{const s=this.j.c.element("a");s.textContent=e+1+". "+t.replace((0,a.SPACE_REG_EXP)(),""),this.j.e.on(s,"keydown",this.onKeyDown),(0,c.attr)(s,"href","javascript:void(0)"),(0,c.attr)(s,"data-index",""+e),(0,c.attr)(s,"tab-index","-1"),this.listBox&&this.listBox.appendChild(s)})),this.dialog&&this.dialog.open(),this.j.async.setTimeout((()=>{this.selectIndex(0)}),100))}}createDialog(){this.dialog=new R({language:this.j.o.language});const t=this.j.c.fromHTML(''+this.j.i18n("Paste")+"");this.j.e.on(t,"click",this.paste);const e=this.j.c.fromHTML(''+this.j.i18n("Cancel")+"");this.j.e.on(e,"click",this.dialog.close),this.container=this.j.c.div(),this.container.classList.add("jodit-paste-storage"),this.listBox=this.j.c.div(),this.previewBox=this.j.c.div(),this.container.appendChild(this.listBox),this.container.appendChild(this.previewBox),this.dialog.setHeader(this.j.i18n("Choose Content to Paste")),this.dialog.setContent(this.container),this.dialog.setFooter([t,e]),this.j.e.on(this.listBox,"click dblclick",(t=>{const e=t.target;return S.i.isTag(e,"a")&&e.hasAttribute("data-index")&&this.selectIndex(parseInt((0,c.attr)(e,"-index")||"0",10)),"dblclick"===t.type&&this.paste(),!1}))}afterInit(){this.j.e.off("afterCopy.paste-storage").on("pasteStorageList.paste-storage",(()=>this.list.length)).on("afterCopy.paste-storage",(t=>{-1!==this.list.indexOf(t)&&this.list.splice(this.list.indexOf(t),1),this.list.unshift(t),this.list.length>5&&(this.list.length=5)})),this.j.registerCommand("showPasteStorage",{exec:this.showDialog,hotkeys:["ctrl+shift+v","cmd+shift+v"]})}beforeDestruct(){this.dialog&&this.dialog.destruct(),this.j.e.off(".paste-storage"),S.i.safeRemove(this.previewBox),S.i.safeRemove(this.listBox),S.i.safeRemove(this.container),this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.list=[]}}const Qt="copyformat",te=["fontWeight","fontStyle","fontSize","color","margin","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textDecorationLine","fontFamily"],ee=(t,e,s,i)=>{let o=(0,c.css)(s,e);return o===i[e]&&(o=s.parentNode&&s!==t.editor&&s.parentNode!==t.editor?ee(t,e,s.parentNode,i):void 0),o};function se(t){t.registerButton({name:"copyformat",group:"clipboard"})}n.D.prototype.controls.copyformat={exec(t,e,{button:s}){if(e){if(t.buffer.exists(Qt))t.buffer.delete(Qt),t.e.off(t.editor,"mouseup.copyformat");else{const s={},i=S.i.up(e,(t=>t&&!S.i.isText(t)),t.editor)||t.editor,o=t.createInside.span();t.editor.appendChild(o),te.forEach((t=>{s[t]=(0,c.css)(o,t)})),o!==t.editor&&S.i.safeRemove(o);const r=((t,e,s)=>{const i={};return e&&te.forEach((o=>{i[o]=ee(t,o,e,s),o.match(/border(Style|Color)/)&&!i.borderWidth&&(i[o]=void 0)})),i})(t,i,s),n=()=>{t.buffer.delete(Qt);const e=t.s.current();e&&(S.i.isTag(e,"img")?(0,c.css)(e,r):t.s.applyStyle(r)),t.e.off(t.editor,"mouseup.copyformat")};t.e.on(t.editor,"mouseup.copyformat",n),t.buffer.set(Qt,!0)}s.update()}},isActive:t=>t.buffer.exists(Qt),tooltip:"Paint format"};var ie=s(43);function oe(t){t.registerButton({name:"brush",group:"color"});const e=(e,s,i)=>{const o=(0,c.normalizeColor)(i);switch(e){case"background":t.s.applyStyle({backgroundColor:o||""});break;case"forecolor":t.s.applyStyle({color:o||""})}return t.setEditorValue(),!1};t.registerCommand("forecolor",e).registerCommand("background",e)}n.D.prototype.controls.brush={update(t){const e=(0,c.dataBind)(t,"color"),s=t.j,i=(e,i)=>{i&&i!==""+(0,c.css)(s.editor,e)&&(t.state.icon.fill=i)};if(e){const s=(0,c.dataBind)(t,"color");return void i("color"===s?s:"background-color",e)}const o=s.s.current();if(o&&!t.state.disabled){const t=S.i.closest(o,(t=>S.i.isBlock(t,s.ew)||t&&S.i.isElement(t)),s.editor)||s.editor;i("color",""+(0,c.css)(t,"color")),i("background-color",""+(0,c.css)(t,"background-color"))}t.state.icon.fill="",t.state.activated=!1},popup(t,e,s,i,o){let r="",n="",a=[],l=null;return e&&e!==t.editor&&S.i.isNode(e,t.ew)&&(S.i.isElement(e)&&t.s.isCollapsed()&&!S.i.isTag(e,["br","hr"])&&(l=e),S.i.up(e,(e=>{if(S.i.isHTMLElement(e,t.ew)){const t=(0,c.css)(e,"color",void 0,!0),s=(0,c.css)(e,"background-color",void 0,!0);if(t)return r=""+t,!0;if(s)return n=""+s,!0}}),t.editor)),a=[{name:"Background",content:(0,ie.YW)(t,(e=>{l?l.style.backgroundColor=e:t.execCommand("background",!1,e),(0,c.dataBind)(o,"color",e),(0,c.dataBind)(o,"color-mode","background"),i()}),n)},{name:"Text",content:(0,ie.YW)(t,(e=>{l?l.style.color=e:t.execCommand("forecolor",!1,e),(0,c.dataBind)(o,"color",e),(0,c.dataBind)(o,"color-mode","color"),i()}),r)}],"background"!==t.o.colorPickerDefaultTab&&(a=a.reverse()),(0,ie.IL)(t,a,l)},exec(t,e,{button:s}){const i=(0,c.dataBind)(s,"color-mode"),o=(0,c.dataBind)(s,"color");if(!i)return!1;if(e&&e!==t.editor&&S.i.isNode(e,t.ew)&&S.i.isElement(e))switch(i){case"color":e.style.color=o;break;case"background":e.style.backgroundColor=o}else t.execCommand("background"===i?i:"forecolor",!1,o)},tooltip:"Fill color or set the text color"};class re extends H{constructor(){super(...arguments),this.isFragmentFromEditor=!1,this.isCopyMode=!1,this.startDragPoint={x:0,y:0},this.draggable=null,this.bufferRange=null,this.getText=t=>{const e=Yt(t);return e?e.getData(a.TEXT_HTML)||e.getData(a.TEXT_PLAIN):null}}afterInit(){this.j.e.on([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}onDragStart(t){let e=t.target;if(this.onDragEnd(),this.isFragmentFromEditor=S.i.isOrContains(this.j.editor,e,!0),this.isCopyMode=!this.isFragmentFromEditor||(0,c.ctrlKey)(t),this.isFragmentFromEditor){const t=this.j.s.sel,e=t&&t.rangeCount?t.getRangeAt(0):null;e&&(this.bufferRange=e.cloneRange())}else this.bufferRange=null;this.startDragPoint.x=t.clientX,this.startDragPoint.y=t.clientY,S.i.isElement(e)&&e.classList.contains("jodit-filebrowser__files-item")&&(e=e.querySelector("img")),S.i.isTag(e,"img")&&(this.draggable=e.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",e)),this.addDragListeners()}addDragListeners(){this.j.e.on("dragover",this.onDrag).on("drop.DragAndDrop",this.onDrop).on(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}removeDragListeners(){this.j.e.off("dragover",this.onDrag).off("drop.DragAndDrop",this.onDrop).off(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}onDrag(t){this.draggable&&(this.j.e.fire("hidePopup"),this.j.s.insertCursorAtPoint(t.clientX,t.clientY),t.preventDefault(),t.stopPropagation())}onDragEnd(){this.draggable&&(S.i.safeRemove(this.draggable),this.draggable=null),this.isCopyMode=!1,this.removeDragListeners()}onDrop(t){if(!t.dataTransfer||!t.dataTransfer.files||!t.dataTransfer.files.length){if(!this.isFragmentFromEditor&&!this.draggable)return this.j.e.fire("paste",t),t.preventDefault(),t.stopPropagation(),!1;const e=this.j.s.sel,s=this.bufferRange||(e&&e.rangeCount?e.getRangeAt(0):null);let i=null;if(!this.draggable&&s)i=this.isCopyMode?s.cloneContents():s.extractContents();else if(this.draggable)if(this.isCopyMode){const[t,e]="1"===(0,c.attr)(this.draggable,"-is-file")?["a","href"]:["img","src"];i=this.j.createInside.element(t),i.setAttribute(e,(0,c.attr)(this.draggable,"data-src")||(0,c.attr)(this.draggable,"src")||""),"a"===t&&(i.textContent=(0,c.attr)(i,e)||"")}else i=(0,c.dataBind)(this.draggable,"target");else this.getText(t)&&(i=this.j.createInside.fromHTML(this.getText(t)));e&&e.removeAllRanges(),this.j.s.insertCursorAtPoint(t.clientX,t.clientY),i&&(this.j.s.insertNode(i,!1,!1),s&&i.firstChild&&i.lastChild&&(s.setStartBefore(i.firstChild),s.setEndAfter(i.lastChild),this.j.s.selectRange(s),this.j.e.fire("synchro")),S.i.isTag(i,"img")&&this.j.events&&this.j.e.fire("afterInsertImage",i)),t.preventDefault(),t.stopPropagation()}this.isFragmentFromEditor=!1,this.removeDragListeners()}beforeDestruct(){this.onDragEnd(),this.j.e.off(window,".DragAndDrop").off(".DragAndDrop").off([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}}(0,r.__decorate)([j.autobind],re.prototype,"onDragStart",null),(0,r.__decorate)([(0,j.throttle)((t=>t.j.defaultTimeout/10))],re.prototype,"onDrag",null),(0,r.__decorate)([j.autobind],re.prototype,"onDragEnd",null),(0,r.__decorate)([j.autobind],re.prototype,"onDrop",null);class ne extends H{constructor(){super(...arguments),this.dragList=[],this.draggable=null,this.wasMoved=!1,this.isCopyMode=!1,this.diffStep=10,this.startX=0,this.startY=0}afterInit(){this.dragList=this.j.o.draggableTags?(0,c.splitArray)(this.j.o.draggableTags).filter(Boolean).map((t=>t.toLowerCase())):[],this.dragList.length&&this.j.e.on("mousedown touchstart dragstart",this.onDragStart)}onDragStart(t){if("dragstart"===t.type&&this.draggable)return!1;const e=t.target;if(!this.dragList.length||!e)return;const s=t=>t&&this.dragList.includes(t.nodeName.toLowerCase()),i=S.i.furthest(e,s,this.j.editor)||(s(e)?e:null);i&&(this.startX=t.clientX,this.startY=t.clientY,this.isCopyMode=(0,c.ctrlKey)(t),this.onDragEnd(),this.draggable=i.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",i),this.addDragListeners())}onDrag(t){var e,s;if(!this.draggable)return;const i=t.clientY;if(Math.sqrt(Math.pow(t.clientX-this.startX,2)+Math.pow(i-this.startY,2))>=this.diffStep){if(this.wasMoved=!0,this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){const i=(0,c.dataBind)(this.draggable,"target");(0,c.css)(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",display:"inline-block",left:t.clientX,top:t.clientY,width:null!==(e=null==i?void 0:i.offsetWidth)&&void 0!==e?e:100,height:null!==(s=null==i?void 0:i.offsetHeight)&&void 0!==s?s:100}),(0,C.ZO)(this.j,ne).appendChild(this.draggable)}(0,c.css)(this.draggable,{left:t.clientX,top:t.clientY}),this.j.s.insertCursorAtPoint(t.clientX,t.clientY)}}onDragEnd(){this.isInDestruct||this.draggable&&(S.i.safeRemove(this.draggable),this.draggable=null,this.wasMoved=!1,this.removeDragListeners())}onDrop(){if(!this.draggable||!this.wasMoved)return void this.onDragEnd();let t=(0,c.dataBind)(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(t=t.cloneNode(!0));const{parentElement:e}=t;this.j.s.insertNode(t,!0,!1),e&&S.i.isEmpty(e)&&S.i.safeRemove(e),S.i.isTag(t,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",t),this.j.e.fire("synchro")}addDragListeners(){this.j.e.on(this.j.editor,"mousemove touchmove",this.onDrag).on("mouseup touchend",this.onDrop).on([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}removeDragListeners(){this.j.e.off(this.j.editor,"mousemove touchmove",this.onDrag).off("mouseup touchend",this.onDrop).off([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}beforeDestruct(){this.onDragEnd(),this.j.e.off("mousedown touchstart dragstart",this.onDragStart),this.removeDragListeners()}}(0,r.__decorate)([j.autobind],ne.prototype,"onDragStart",null),(0,r.__decorate)([(0,j.throttle)((t=>t.j.defaultTimeout/10))],ne.prototype,"onDrag",null),(0,r.__decorate)([j.autobind],ne.prototype,"onDragEnd",null),(0,r.__decorate)([j.autobind],ne.prototype,"onDrop",null);const ae=(t,e,s,i)=>{var o;const r=t.createInside.element(s),n=t.createInside.element("br");r.appendChild(n),i&&i.cssText&&r.setAttribute("style",i.cssText),t.s.insertNode(r,!1,!1),t.s.setCursorBefore(n);const a=t.s.createRange();return a.setStartBefore("br"!==s.toLowerCase()?n:r),a.collapse(!0),t.s.selectRange(a),S.i.safeRemove(e),(0,c.scrollIntoViewIfNeeded)(r,t.editor,t.ed),null===(o=t.events)||void 0===o||o.fire("synchro"),r};class le extends H{constructor(){super(...arguments),this.brMode=!1,this.defaultTag=a.PARAGRAPH}afterInit(t){this.defaultTag=t.o.enter.toLowerCase(),this.brMode=this.defaultTag===a.BR.toLowerCase(),t.o.enterBlock||(t.o.enterBlock=this.brMode?a.PARAGRAPH:this.defaultTag),t.e.off(".enter").on("keydown.enter",(e=>{if(e.key===a.KEY_ENTER){const s=t.e.fire("beforeEnter",e);return void 0!==s?s:(t.s.isCollapsed()||t.execCommand("Delete"),t.s.focus(),this.onEnter(e),!1)}}))}onEnter(t){const e=this.j,s=e.selection,i=this.defaultTag;let o=s.current(!1);o&&o!==e.editor||(o=e.createInside.text(a.INVISIBLE_SPACE),s.insertNode(o),s.select(o));let r=this.getBlockWrapper(o);const n=S.i.isTag(r,"li");if((!n||t.shiftKey)&&!this.checkBR(o,t.shiftKey))return!1;if(r||this.hasPreviousBlock(o)||(r=this.wrapText(o)),!r||r===o)return ae(e,null,n?"li":i),!1;if(!this.checkUnsplittableBox(r))return!1;if(n&&S.i.isEmpty(r))return this.enterInsideEmptyLIelement(r),!1;const l=r.tagName.toLowerCase()===this.defaultTag||n,c=s.cursorOnTheRight(r),h=s.cursorOnTheLeft(r);if(!l&&(c||h)){let t=null;return t=c?s.setCursorAfter(r):s.setCursorBefore(r),ae(e,t,this.defaultTag),void(h&&!c&&s.setCursorIn(r,!0))}s.splitSelection(r)}getBlockWrapper(t,e=a.IS_BLOCK){let s=t;const i=this.j.editor;do{if(!s||s===i)break;if(e.test(s.nodeName))return S.i.isTag(s,"li")?s:this.getBlockWrapper(s.parentNode,/^li$/i)||s;s=s.parentNode}while(s&&s!==i);return null}checkBR(t,e){const s=S.i.closest(t,["pre","blockquote"],this.j.editor);if(this.brMode||e&&!s||!e&&s){const t=this.j.createInside.element("br");return this.j.s.insertNode(t,!0),(0,c.scrollIntoViewIfNeeded)(t,this.j.editor,this.j.ed),!1}return!0}wrapText(t){let e=t;S.i.up(e,(t=>{t&&t.hasChildNodes()&&t!==this.j.editor&&(e=t)}),this.j.editor);const s=S.i.wrapInline(e,this.j.o.enter,this.j);if(S.i.isEmpty(s)){const t=this.j.createInside.element("br");s.appendChild(t),this.j.s.setCursorBefore(t)}return s}hasPreviousBlock(t){const e=this.j;return!!S.i.prev(t,(t=>S.i.isBlock(t,e.ew)||S.i.isImage(t,e.ew)),e.editor)}checkUnsplittableBox(t){const e=this.j,s=e.selection;if(!S.i.canSplitBlock(t,e.ew)){const t=e.createInside.element("br");return s.insertNode(t,!1),s.setCursorAfter(t),!1}return!0}enterInsideEmptyLIelement(t){let e=null;const s=S.i.closest(t,["ol","ul"],this.j.editor);if(s){if(S.i.prev(t,(t=>S.i.isTag(t,"li")),s))if(S.i.next(t,(t=>S.i.isTag(t,"li")),s)){const i=this.j.s.createRange();i.setStartBefore(s),i.setEndAfter(t);const o=i.extractContents();s.parentNode&&s.parentNode.insertBefore(o,s),e=this.j.s.setCursorBefore(s)}else e=this.j.s.setCursorAfter(s);else e=this.j.s.setCursorBefore(s);S.i.safeRemove(t),ae(this.j,e,this.defaultTag),(0,c.$$)("li",s).length||S.i.safeRemove(s)}}beforeDestruct(t){t.e.off("keydown.enter")}}function ce(t){if(t.o.showMessageErrors){let e;const s=t.c.div("jodit_error_box_for_messages"),i=()=>{e=5,(0,c.toArray)(s.childNodes).forEach((i=>{(0,c.css)(s,"bottom",e+"px"),e+=i.offsetWidth+t.o.showMessageErrorOffsetPx}))};t.e.on("beforeDestruct",(()=>{S.i.safeRemove(s)})).on("errorMessage",((e,o,r)=>{t.workplace.appendChild(s);const n=t.c.div("active "+(o||""),e);s.appendChild(n),i(),t.async.setTimeout((()=>{n.classList.remove("active"),t.async.setTimeout((()=>{S.i.safeRemove(n),i()}),300)}),r||t.o.showMessageErrorTime)}))}}function he(t){t.registerButton({name:"font",group:"font"}).registerButton({name:"fontsize",group:"font"});const e=(e,s,i)=>{switch(e){case"fontsize":t.s.applyStyle({fontSize:(0,c.normalizeSize)(i)});break;case"fontname":t.s.applyStyle({fontFamily:i})}return t.e.fire("synchro"),!1};t.registerCommand("fontsize",e).registerCommand("fontname",e)}function de(t){t.registerButton({name:"paragraph",group:"font"}),t.registerCommand("formatblock",((e,s,i)=>(t.s.applyStyle(void 0,{element:i}),t.setEditorValue(),!1)))}function ue(t){t.registerButton({name:"fullsize"});let e=!1,s=0,i=0,o=!1;const r=()=>{t.events&&(e?(s=(0,c.css)(t.container,"height",void 0,!0),i=(0,c.css)(t.container,"width",void 0,!0),(0,c.css)(t.container,{height:t.ow.innerHeight,width:t.ow.innerWidth}),o=!0):o&&(0,c.css)(t.container,{height:s||"auto",width:i||"auto"}))},n=s=>{var i;if(t.container){if(void 0===s&&(s=!t.container.classList.contains("jodit_fullsize")),t.setMod("fullsize",s),t.o.fullsize=s,e=s,t.container.classList.toggle("jodit_fullsize",s),t.toolbar&&((0,c.isJoditObject)(t)&&t.toolbarContainer.appendChild(t.toolbar.container),(0,c.css)(t.toolbar.container,"width","auto")),t.o.globalFullSize){let e=t.container.parentNode;for(;e&&e.nodeType!==Node.DOCUMENT_NODE;)e.classList.toggle("jodit_fullsize-box_true",s),e=e.parentNode;r()}null===(i=t.events)||void 0===i||i.fire("afterResize")}};t.o.globalFullSize&&t.e.on(t.ow,"resize",r),t.e.on("afterInit afterOpen",(()=>{var e;t.toggleFullSize(null===(e=null==t?void 0:t.options)||void 0===e?void 0:e.fullsize)})).on("toggleFullSize",n).on("beforeDestruct",(()=>{e&&n(!1)})).on("beforeDestruct",(()=>{t.events&&t.e.off(t.ow,"resize",r)}))}n.D.prototype.showMessageErrors=!0,n.D.prototype.showMessageErrorTime=3e3,n.D.prototype.showMessageErrorOffsetPx=3,n.D.prototype.defaultFontSizePoints="px",n.D.prototype.controls.fontsize={command:"fontSize",data:{cssRule:"font-size"},list:["8","9","10","11","12","14","16","18","24","30","36","48","60","72","96"],exec:(t,e,{control:s})=>(0,c.memorizeExec)(t,e,{control:s},(e=>{var i;return"fontsize"===(null===(i=s.command)||void 0===i?void 0:i.toLowerCase())?`${e}${t.o.defaultFontSizePoints}`:e})),childTemplate:(t,e,s)=>`${s}${t.o.defaultFontSizePoints}`,tooltip:"Font size",isChildActive(t,e){var s,i;const o=t.s.current(),r=(null===(s=e.data)||void 0===s?void 0:s.cssRule)||"font-size",n=(null===(i=e.data)||void 0===i?void 0:i.normalize)||(e=>/pt$/i.test(e)&&"pt"===t.o.defaultFontSizePoints?e.replace(/pt$/i,""):e);if(o){const s=S.i.closest(o,(e=>S.i.isBlock(e,t.ew)||e&&S.i.isElement(e)),t.editor)||t.editor,i=(0,c.css)(s,r);return!(!i||!e.args||n(""+e.args[0])!==n(""+i))}return!1}},n.D.prototype.controls.font={...n.D.prototype.controls.fontsize,command:"fontname",list:{"":"Default","Helvetica,sans-serif":"Helvetica","Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","'Times New Roman',Times,serif":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},childTemplate:(t,e,s)=>`${s}`,data:{cssRule:"font-family",normalize:t=>t.toLowerCase().replace(/['"]+/g,"").replace(/[^a-z0-9]+/g,",")},tooltip:"Font family"},n.D.prototype.controls.paragraph={command:"formatBlock",update(t){const e=t.j,s=t.control,i=e.s.current();if(i&&e.o.textIcons){const o=(S.i.closest(i,(t=>S.i.isBlock(t,e.ew)),e.editor)||e.editor).nodeName.toLowerCase(),r=s.list;t&&s.data&&s.data.currentValue!==o&&r&&r[o]&&(e.o.textIcons?t.state.text=o:t.state.icon.name=o,s.data.currentValue=o)}return!1},exec:c.memorizeExec,data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote"},isChildActive(t,e){const s=t.s.current();if(s){const i=S.i.closest(s,(e=>S.i.isBlock(e,t.ew)),t.editor);return!(!i||i===t.editor||void 0===e.args||i.nodeName.toLowerCase()!==e.args[0])}return!1},isActive(t,e){const s=t.s.current();if(s){const i=S.i.closest(s,(e=>S.i.isBlock(e,t.ew)),t.editor);return!(!i||i===t.editor||void 0===e.list||S.i.isTag(i,"p")||void 0===e.list[i.nodeName.toLowerCase()])}return!1},childTemplate:(t,e,s)=>`<${e} style="margin:0;padding:0">${t.i18n(s)}`,tooltip:"Insert format block"},n.D.prototype.fullsize=!1,n.D.prototype.globalFullSize=!0,n.D.prototype.controls.fullsize={exec(t){t.toggleFullSize()},update(t){const e=t.j,s=e.isFullSize?"shrink":"fullsize";t.state.activated=e.isFullSize,e.o.textIcons?t.state.text=s:t.state.icon.name=s},tooltip:"Open editor in fullsize",mode:a.MODE_SOURCE+a.MODE_WYSIWYG},n.D.prototype.commandToHotkeys={removeFormat:["ctrl+shift+m","cmd+shift+m"],insertOrderedList:["ctrl+shift+7","cmd+shift+7"],insertUnorderedList:["ctrl+shift+8, cmd+shift+8"],selectall:["ctrl+a","cmd+a"]};class pe extends H{constructor(){super(...arguments),this.onKeyPress=t=>{const e=this.specialKeys[t.which],s=(t.key||String.fromCharCode(t.which)).toLowerCase(),i=[e||s];return["alt","ctrl","shift","meta"].forEach((s=>{t[s+"Key"]&&e!==s&&i.push(s)})),(0,c.normalizeKeyAliases)(i.join("+"))},this.specialKeys={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",91:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}}afterInit(t){(0,c.keys)(t.o.commandToHotkeys,!1).forEach((e=>{const s=t.o.commandToHotkeys[e];s&&((0,c.isArray)(s)||(0,c.isString)(s))&&t.registerHotkeyToCommand(s,e)}));let e=!1;t.e.off(".hotkeys").on([t.ow,t.ew],"keydown.hotkeys",(t=>{if(t.key===a.KEY_ESC)return this.j.e.fire("escape",t)})).on("keydown.hotkeys",(s=>{const i=this.onKeyPress(s),o={shouldStop:!0};if(!1===this.j.e.fire(i+".hotkey",s.type,o)){if(o.shouldStop)return e=!0,t.e.stopPropagation("keydown"),!1;s.preventDefault()}}),void 0,!0).on("keyup.hotkeys",(()=>{if(e)return e=!1,t.e.stopPropagation("keyup"),!1}),void 0,!0)}beforeDestruct(t){t.events&&t.e.off(".hotkeys")}}function fe(t){const e=t.options;t.e.on("afterSetMode",(()=>{t.isEditorMode()&&t.s.focus()})).on("generateDocumentStructure.iframe",((t,s)=>{const i=t||s.iframe.contentWindow.document;if(i.open(),i.write(e.iframeDoctype+``+`${e.iframeTitle}`+(e.iframeBaseUrl?``:"")+''),i.close(),e.iframeCSSLinks&&e.iframeCSSLinks.forEach((t=>{const e=i.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",t),i.head&&i.head.appendChild(e)})),e.iframeStyle){const t=i.createElement("style");t.innerHTML=e.iframeStyle,i.head&&i.head.appendChild(t)}})).on("createEditor",(()=>{if(!e.iframe)return;const s=t.c.element("iframe");s.style.display="block",s.src="about:blank",s.className="jodit-wysiwyg_iframe",s.setAttribute("allowtransparency","true"),s.setAttribute("tabindex",""+e.tabIndex),s.setAttribute("frameborder","0"),t.workplace.appendChild(s),t.iframe=s;const i=t.e.fire("generateDocumentStructure.iframe",null,t);return(0,c.callPromise)(i,(()=>{if(!t.iframe)return;const s=t.iframe.contentWindow.document;t.editorWindow=t.iframe.contentWindow;const i=()=>{(0,c.attr)(s.body,"contenteditable",t.getMode()!==a.MODE_SOURCE&&!t.getReadOnly()||null)},o=t=>{const e=//im,s="{%%BODY%%}",i=e.exec(t);return i&&(t=t.replace(e,s).replace(/]*?)>(.*?)<\/span>/gim,"").replace(/<span([^&]*?)>(.*?)<\/span>/gim,"").replace(s,i[0].replace(/(]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im,"$1").replace(/(]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5").replace(/(<[^<]+?)\sclass="[\s]*"/gim,"$1").replace(/(<[^<]+?)\sstyle="[\s;]*"/gim,"$1").replace(/(<[^<]+?)\sdir="[\s]*"/gim,"$1")),t};if(e.editHTMLDocumentMode){const e=t.element.tagName;if("TEXTAREA"!==e&&"INPUT"!==e)throw(0,c.error)("If enable `editHTMLDocumentMode` - source element should be INPUT or TEXTAREA");t.e.on("beforeGetNativeEditorValue",(()=>o(t.o.iframeDoctype+s.documentElement.outerHTML))).on("beforeSetNativeEditorValue",(e=>!t.isLocked&&(/<(html|body)/i.test(e)?o(s.documentElement.outerHTML)!==o(e)&&(s.open(),s.write(t.o.iframeDoctype+o(e)),s.close(),t.editor=s.body,i(),t.e.fire("prepareWYSIWYGEditor")):s.body.innerHTML=e,!0)))}if(t.editor=s.body,t.e.on("afterSetMode afterInit afterAddPlace",i),"auto"===e.height){s.documentElement&&(s.documentElement.style.overflowY="hidden");const i=t.async.throttle((()=>{t.editor&&t.iframe&&"auto"===e.height&&(0,c.css)(t.iframe,"height",t.editor.offsetHeight)}),t.defaultTimeout/2);t.e.on("change afterInit afterSetMode resize",i).on([t.iframe,t.ew,s.documentElement],"load",i).on(s,"readystatechange DOMContentLoaded",i)}return s.documentElement&&t.e.on(s.documentElement,"mousedown touchend",(()=>{t.s.isFocused()||(t.s.focus(),t.editor===s.body&&t.s.setCursorIn(s.body))})).on(t.ew,"mousedown touchstart keydown keyup touchend click mouseup mousemove scroll",(e=>{var s;null===(s=t.events)||void 0===s||s.fire(t.ow,e)})),!1}))}))}function me(t){const e=t.o,s=t.i18n.bind(t),i=k.JO.get.bind(k.JO),o=e.filebrowser.ajax.url||e.uploader.url,r=e.image.useImageEditor;return t.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t${i("image")}\n\t\t\t\t\t\t${i("crop")}\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
`)}function ge(t){const e=t.o,s=t.i18n.bind(t),i=k.JO.get.bind(k.JO);return t.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t${i("lock")}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t`)}n.D.prototype.iframeBaseUrl="",n.D.prototype.iframeTitle="Jodit Editor",n.D.prototype.iframeDoctype="",n.D.prototype.iframeDefaultSrc="about:blank",n.D.prototype.iframeStyle='html{margin:0;padding:0;min-height: 100%;}body{box-sizing:border-box;font-size:13px;line-height:1.6;padding:10px;margin:0;background:transparent;color:#000;position:relative;z-index:2;user-select:auto;margin:0px;overflow:auto;outline:none;}table{width:100%;border:none;border-collapse:collapse;empty-cells: show;max-width: 100%;}th,td{padding: 2px 5px;border:1px solid #ccc;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}p{margin-top:0;}.jodit_editor .jodit_iframe_wrapper{display: block;clear: both;user-select: none;position: relative;}.jodit_editor .jodit_iframe_wrapper:after {position:absolute;content:"";z-index:1;top:0;left:0;right: 0;bottom: 0;cursor: pointer;display: block;background: rgba(0, 0, 0, 0);} .jodit_disabled{user-select: none;-o-user-select: none;-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none}',n.D.prototype.iframeCSSLinks=[],n.D.prototype.editHTMLDocumentMode=!1,n.D.prototype.image={dialogWidth:600,openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editBorderRadius:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0};const ve=t=>(t=(0,c.trim)(t),/^[0-9]+$/.test(t)?t+"px":t),be=t=>/^[-+]?[0-9.]+px$/.test(""+t)?parseFloat(""+t):t;class we extends H{constructor(){super(...arguments),this.state={image:new Image,get ratio(){return this.image.naturalWidth/this.image.naturalHeight||1},sizeIsLocked:!0,marginIsLocked:!0}}onChangeMarginIsLocked(){if(!this.form)return;const{marginRight:t,marginBottom:e,marginLeft:s,lockMargin:i}=(0,c.refs)(this.form);[t,e,s].forEach((t=>{(0,c.attr)(t,"disabled",this.state.marginIsLocked||null)})),i.innerHTML=k.JO.get(this.state.marginIsLocked?"lock":"unlock")}onChangeSizeIsLocked(){if(!this.form)return;const{lockSize:t,imageWidth:e}=(0,c.refs)(this.form);t.innerHTML=k.JO.get(this.state.sizeIsLocked?"lock":"unlock"),t.classList.remove("jodit-properties__lock"),t.classList.remove("jodit-properties__unlock"),t.classList.add(this.state.sizeIsLocked?"jodit-properties__lock":"jodit-properties__unlock"),this.j.e.fire(e,"change")}open(){return this.makeForm(),this.j.e.fire("hidePopup"),(0,c.markOwner)(this.j,this.dialog.container),this.state.marginIsLocked=!0,this.state.sizeIsLocked=!0,this.updateValues(),this.dialog.open().setModal(!0).setPosition(),!1}makeForm(){if(this.dialog)return;this.dialog=new R({fullsize:this.j.o.fullsize,globalFullSize:this.j.o.globalFullSize,theme:this.j.o.theme,language:this.j.o.language,minWidth:Math.min(400,screen.width),minHeight:400,buttons:["fullsize","dialog.close"]});const t=this.j,e=t.o,s=t.i18n.bind(t),i={check:(0,f.zx)(t,"ok","Apply"),remove:(0,f.zx)(t,"bin","Delete")};t.e.on(this.dialog,"afterClose",(()=>{this.state.image.parentNode&&e.image.selectImageAfterClose&&t.s.select(this.state.image)})),i.remove.onAction((()=>{t.s.removeNode(this.state.image),this.dialog.close()}));const{dialog:o}=this;o.setHeader(s("Image properties"));const r=(t=>{const{showPreview:e,editSize:s}=t.o.image,i=k.JO.get.bind(k.JO);return t.c.fromHTML(`
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t${i("lock")}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t
`)})(t);this.form=r,o.setContent(r);const{tabsBox:n}=(0,c.refs)(this.form);n&&n.appendChild((0,ie.IL)(t,[{name:"Image",content:me(t)},{name:"Advanced",content:ge(t)}])),i.check.onAction(this.onApply);const{changeImage:a,editImage:l}=(0,c.refs)(this.form);t.e.on(a,"click",this.openImagePopup),e.image.useImageEditor&&t.e.on(l,"click",this.openImageEditor);const{lockSize:h,lockMargin:d,imageWidth:u,imageHeight:p}=(0,c.refs)(r);h&&t.e.on(h,"click",(()=>{this.state.sizeIsLocked=!this.state.sizeIsLocked})),t.e.on(d,"click",(t=>{this.state.marginIsLocked=!this.state.marginIsLocked,t.preventDefault()}));const m=t=>{if(!(0,c.isNumeric)(u.value)||!(0,c.isNumeric)(p.value))return;const e=parseFloat(u.value),s=parseFloat(p.value);t.target===u?p.value=""+Math.round(e/this.state.ratio):u.value=""+Math.round(s*this.state.ratio)};t.e.on([u,p],"change keydown mousedown paste",(e=>{this.state.sizeIsLocked&&t.async.setTimeout(m.bind(this,e),{timeout:t.defaultTimeout,label:"image-properties-changeSize"})})),o.setFooter([i.remove,i.check]),o.setSize(this.j.o.image.dialogWidth)}updateValues(){const t=this.j.o,{image:e}=this.state,{marginTop:s,marginRight:i,marginBottom:o,marginLeft:r,lockMargin:n,imageSrc:a,id:l,classes:h,align:d,style:u,imageTitle:p,imageAlt:f,borderRadius:m,imageLink:g,imageWidth:v,imageHeight:b,imageLinkOpenInNewTab:w,imageViewSrc:y,lockSize:_}=(0,c.refs)(this.form);(()=>{n.checked=this.state.marginIsLocked,_.checked=this.state.sizeIsLocked})(),a.value=(0,c.attr)(e,"src")||"",y&&(0,c.attr)(y,"src",(0,c.attr)(e,"src")||""),(()=>{p.value=(0,c.attr)(e,"title")||"",f.value=(0,c.attr)(e,"alt")||"";const t=S.i.closest(e,"a",this.j.editor);t?(g.value=(0,c.attr)(t,"href")||"",w.checked="_blank"===(0,c.attr)(t,"target")):(g.value="",w.checked=!1)})(),(()=>{const t=(0,c.attr)(e,"width")||(0,c.css)(e,"width",void 0,!0)||!1,s=(0,c.attr)(e,"height")||(0,c.css)(e,"height",void 0,!0)||!1;v.value=!1!==t?""+be(t):""+e.offsetWidth,b.value=!1!==s?""+be(s):""+e.offsetHeight,this.state.sizeIsLocked=(()=>!(!(0,c.isNumeric)(v.value)||!(0,c.isNumeric)(b.value))&&1>Math.abs(parseFloat(v.value)-parseFloat(b.value)*this.state.ratio))()})(),(()=>{if(!t.image.editMargins)return;let n=!0,a=!1;[s,i,o,r].forEach((t=>{const i=(0,c.attr)(t,"data-ref")||"";let o=e.style.getPropertyValue((0,c.kebabCase)(i));if(!o)return a=!0,void(t.value="");/^[0-9]+(px)?$/.test(o)&&(o=parseInt(o,10)),t.value=""+o||"",(a&&t.value||n&&"marginTop"!==i&&t.value!==s.value)&&(n=!1)})),this.state.marginIsLocked=n})(),h.value=((0,c.attr)(e,"class")||"").replace(/jodit_focused_image[\s]*/,""),l.value=(0,c.attr)(e,"id")||"",m.value=""+(parseInt(e.style.borderRadius||"0",10)||"0"),e.style.cssFloat&&-1!==["left","right"].indexOf(e.style.cssFloat.toLowerCase())?d.value=(0,c.css)(e,"float"):"block"===(0,c.css)(e,"display")&&"auto"===e.style.marginLeft&&"auto"===e.style.marginRight&&(d.value="center"),u.value=(0,c.attr)(e,"style")||""}onApply(){const{style:t,imageSrc:e,borderRadius:s,imageTitle:i,imageAlt:o,imageLink:r,imageWidth:n,imageHeight:a,marginTop:l,marginRight:h,marginBottom:d,marginLeft:u,imageLinkOpenInNewTab:p,align:f,classes:m,id:g}=(0,c.refs)(this.form),v=this.j.o,{image:b}=this.state;if(v.image.editStyle&&(0,c.attr)(b,"style",t.value||null),!e.value)return S.i.safeRemove(b),void this.dialog.close();(0,c.attr)(b,"src",e.value),b.style.borderRadius="0"!==s.value&&/^[0-9]+$/.test(s.value)?s.value+"px":"",(0,c.attr)(b,"title",i.value||null),(0,c.attr)(b,"alt",o.value||null);let w=S.i.closest(b,"a",this.j.editor);r.value?(w||(w=S.i.wrap(b,"a",this.j)),(0,c.attr)(w,"href",r.value),(0,c.attr)(w,"target",p.checked?"_blank":null)):w&&w.parentNode&&w.parentNode.replaceChild(b,w),n.value===""+b.offsetWidth&&a.value===""+b.offsetHeight||((0,c.css)(b,{width:(0,c.trim)(n.value)?ve(n.value):null,height:(0,c.trim)(a.value)?ve(a.value):null}),(0,c.attr)(b,"width",null),(0,c.attr)(b,"height",null));const y=[l,h,d,u];v.image.editMargins&&(this.state.marginIsLocked?(0,c.css)(b,"margin",ve(l.value)):y.forEach((t=>{const e=(0,c.attr)(t,"data-ref")||"";(0,c.css)(b,e,ve(t.value))}))),v.image.editClass&&(0,c.attr)(b,"class",m.value||null),v.image.editId&&(0,c.attr)(b,"id",g.value||null),v.image.editAlign&&(f.value?["right","left"].includes(f.value.toLowerCase())?((0,c.css)(b,"float",f.value),(0,c.clearCenterAlign)(b)):(0,c.css)(b,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):((0,c.css)(b,"float")&&-1!==["right","left"].indexOf((""+(0,c.css)(b,"float")).toLowerCase())&&(0,c.css)(b,"float",""),(0,c.clearCenterAlign)(b))),this.j.setEditorValue(),this.dialog.close()}openImageEditor(){const t=(0,c.attr)(this.state.image,"src")||"",e=this.j.c.element("a"),s=()=>{e.host===location.host||O(this.j.i18n("You can only edit your own images. Download this image on the host?"),(t=>{t&&this.j.uploader&&this.j.uploader.uploadRemoteImage(""+e.href,(t=>{A(this.j.i18n("The image has been successfully uploaded to the host!"),(()=>{(0,c.isString)(t.newfilename)&&((0,c.attr)(this.state.image,"src",t.baseurl+t.newfilename),this.updateValues())})).bindDestruct(this.j)}),(t=>{A(this.j.i18n("There was an error loading %s",t.message)).bindDestruct(this.j)}))})).bindDestruct(this.j)};e.href=t,this.j.filebrowser.dataProvider.getPathByUrl(""+e.href).then((s=>{rt.call(this.j.filebrowser,e.href,s.name,s.path,s.source,(()=>{const e=(new Date).getTime();(0,c.attr)(this.state.image,"src",t+(-1!==t.indexOf("?")?"":"?")+"&_tmp="+e),this.updateValues()}),(t=>{A(t.message).bindDestruct(this.j)}))})).catch((t=>{A(t.message,s).bindDestruct(this.j)}))}openImagePopup(t){const e=new k.GI(this.j),{changeImage:s}=(0,c.refs)(this.form);e.setZIndex(this.dialog.getZIndex()+1),e.setContent((0,ie.ov)(this.j,{upload:t=>{t.files&&t.files.length&&(0,c.attr)(this.state.image,"src",t.baseurl+t.files[0]),this.updateValues(),e.close()},filebrowser:t=>{t&&(0,c.isArray)(t.files)&&t.files.length&&((0,c.attr)(this.state.image,"src",t.files[0]),e.close(),this.updateValues())}},this.state.image,e.close)).open((()=>(0,c.position)(s))),t.stopPropagation()}afterInit(t){const e=this;t.e.on("afterConstructor changePlace",(()=>{t.e.off(t.editor,".imageproperties").on(t.editor,"dblclick.imageproperties",(s=>{const i=s.target;S.i.isTag(i,"img")&&(t.o.image.openOnDblClick?(e.state.image=i,t.o.readonly||(s.stopImmediatePropagation(),s.preventDefault(),e.open())):(s.stopImmediatePropagation(),t.s.select(i)))}))})).on("openImageProperties.imageproperties",(t=>{this.state.image=t,this.open()}))}beforeDestruct(t){this.dialog&&this.dialog.destruct(),t.e.off(t.editor,".imageproperties").off(".imageproperties")}}function ye(t){t.e.on("change afterInit changePlace",t.async.debounce((()=>{t.editor&&(0,c.$$)("img",t.editor).forEach((e=>{e.__jodit_imageprocessor_binded||(e.__jodit_imageprocessor_binded=!0,e.complete||e.addEventListener("load",(function s(){var i;!t.isInDestruct&&(null===(i=t.e)||void 0===i||i.fire("resize")),e.removeEventListener("load",s)})),t.e.on(e,"mousedown touchstart",(()=>{t.s.select(e)})))}))}),t.defaultTimeout))}function _e(t){t.registerButton({name:"image",group:"media"})}(0,r.__decorate)([(0,j.watch)("state.marginIsLocked")],we.prototype,"onChangeMarginIsLocked",null),(0,r.__decorate)([(0,j.watch)("state.sizeIsLocked")],we.prototype,"onChangeSizeIsLocked",null),(0,r.__decorate)([j.autobind],we.prototype,"onApply",null),(0,r.__decorate)([j.autobind],we.prototype,"openImageEditor",null),(0,r.__decorate)([j.autobind],we.prototype,"openImagePopup",null),n.D.prototype.controls.image={popup(t,e,s,i){let o=null;e&&!S.i.isText(e)&&S.i.isHTMLElement(e,t.ew)&&(S.i.isTag(e,"img")||(0,c.$$)("img",e).length)&&(o=S.i.isTag(e,"img")?e:(0,c.$$)("img",e)[0]);const r=t.s.save();return(0,ie.ov)(t,{filebrowser(e){t.s.restore(r),e.files&&e.files.forEach((s=>t.s.insertImage(e.baseurl+s,null,t.o.imageDefaultWidth))),i()},upload:!0,async url(e,s){t.s.restore(r);const n=o||t.createInside.element("img");n.setAttribute("src",e),n.setAttribute("alt",s),o||await t.s.insertImage(n,null,t.o.imageDefaultWidth),i()}},o,i)},tags:["img"],tooltip:"Insert Image"},n.D.prototype.controls.indent={tooltip:"Increase Indent"};const Ce=t=>"rtl"===t?"marginRight":"marginLeft";function je(t){const e=Ce(t.o.direction);t.registerButton({name:"indent",group:"indent"}).registerButton({name:"outdent",group:"indent"});const s=s=>{const i=[];return t.s.eachSelection((o=>{const r=t.s.save();let n=!!o&&S.i.up(o,(e=>S.i.isBlock(e,t.ew)),t.editor);const l=t.o.enter;if(!n&&o&&(n=S.i.wrapInline(o,l!==a.BR?l:a.PARAGRAPH,t)),!n)return t.s.restore(r),!1;const h=-1!==i.indexOf(n);if(n&&n.style&&!h){i.push(n);let o=n.style[e]?parseInt(n.style[e],10):0;o+=t.o.indentMargin*("outdent"===s?-1:1),n.style[e]=o>0?o+"px":"",(0,c.attr)(n,"style")||n.removeAttribute("style")}t.s.restore(r)})),t.setEditorValue(),!1};t.registerCommand("indent",{exec:s,hotkeys:["ctrl+]","cmd+]"]}),t.registerCommand("outdent",{exec:s,hotkeys:["ctrl+[","cmd+["]})}function xe(t){t.registerButton({name:"hr",group:"insert"}),t.registerCommand("insertHorizontalRule",(()=>{const e=t.createInside.element("hr");t.s.insertNode(e,!1,!1);const s=S.i.closest(e.parentElement,(e=>S.i.isBlock(e,t.ew)),t.editor);s&&S.i.isEmpty(s)&&s!==t.editor&&(S.i.after(s,e),S.i.safeRemove(s));let i=S.i.next(e,(e=>S.i.isBlock(e,t.ew)),t.editor,!1);return i||(i=t.createInside.element(t.o.enter),S.i.after(e,i)),t.s.setCursorIn(i),!1}))}n.D.prototype.controls.outdent={isDisabled(t){const e=t.s.current();if(e){const s=S.i.closest(e,(e=>S.i.isBlock(e,t.ew)),t.editor),i=Ce(t.o.direction);if(s&&s.style&&s.style[i])return 0>=parseInt(s.style[i],10)}return!0},tooltip:"Decrease Indent"},n.D.prototype.indentMargin=10,n.D.prototype.controls.hr={command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},n.D.prototype.toolbarInline=!0,n.D.prototype.toolbarInlineForSelection=!1,n.D.prototype.toolbarInlineDisableFor=[],n.D.prototype.toolbarInlineDisabledButtons=["source"],n.D.prototype.popup={a:s(44).Z,img:s(45).Z,cells:s(46).Z,jodit:[{name:"bin",tooltip:"Delete",exec(t,e){e&&t.s.removeNode(e)}}],"jodit-media":[{name:"bin",tooltip:"Delete",exec(t,e){e&&t.s.removeNode(e)}}],selection:["bold","underline","italic","ul","ol","\n","outdent","indent","fontsize","brush","cut","\n","paragraph","link","align","dots"]};class Ee extends H{constructor(){super(...arguments),this.type=null,this.popup=new p.G(this.jodit),this.toolbar=M(this.jodit,this.popup),this.snapRange=null}onClick(t){const e=t.target,s=(0,c.keys)(this.j.o.popup,!1),i=S.i.isTag(e,"img")?e:S.i.closest(e,s,this.j.editor);i&&this.canShowPopupForType(i.nodeName.toLowerCase())&&this.showPopup((()=>(0,c.position)(i,this.j)),i.nodeName.toLowerCase(),i)}showPopup(t,e,s){if(e=e.toLowerCase(),!this.canShowPopupForType(e))return!1;if(this.type!==e||s!==this.previousTarget){this.previousTarget=s;const t=this.j.o.popup[e];let i;i=(0,c.isFunction)(t)?t(this.j,s,this.popup.close):t,(0,c.isArray)(i)&&(this.toolbar.build(i,s),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,i=this.toolbar.container),this.popup.setContent(i),this.type=e}return this.popup.open(t),!0}hidePopup(t){t&&t!==this.type||this.popup.close()}canShowPopupForType(t){const e=this.j.o.popup[t.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!e||this.isExcludedTarget(t))}isExcludedTarget(t){return(0,c.splitArray)(this.j.o.toolbarInlineDisableFor).map((t=>t.toLowerCase())).includes(t.toLowerCase())}afterInit(t){this.j.e.on("getDiffButtons.mobile",(e=>{if(this.toolbar===e){const e=this.toolbar.getButtonsNames();return(0,c.toArray)(t.registeredButtons).filter((t=>!this.j.o.toolbarInlineDisabledButtons.includes(t.name))).filter((t=>{const s=(0,c.isString)(t)?t:t.name;return s&&"|"!==s&&"\n"!==s&&!e.includes(s)}))}})).on("hidePopup",this.hidePopup).on("showPopup",((t,e,s)=>{this.showPopup(e,s||((0,c.isString)(t)?t:t.nodeName),(0,c.isString)(t)?void 0:t)})).on("click",this.onClick).on("mousedown keydown",this.onSelectionStart).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd)}onSelectionStart(){this.snapRange=this.j.s.range.cloneRange()}onSelectionEnd(t){if(t&&t.target&&k.u1.closestElement(t.target,p.G))return;const{snapRange:e}=this,{range:s}=this.j.s;e&&!s.collapsed&&s.startContainer===e.startContainer&&s.startOffset===e.startOffset&&s.endContainer===e.endContainer&&s.endOffset===e.endOffset||this.onSelectionChange()}onSelectionChange(){if(!this.j.o.toolbarInlineForSelection)return;const t="selection",e=this.j.s.sel,s=this.j.s.range;(null==e?void 0:e.isCollapsed)||this.isSelectedTarget(s)||this.tableModule.getAllSelectedCells().length?this.type===t&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((()=>s.getBoundingClientRect()),t)}isSelectedTarget(t){const e=t.startContainer;return S.i.isElement(e)&&e===t.endContainer&&S.i.isTag(e.childNodes[t.startOffset],(0,c.keys)(this.j.o.popup,!1))&&t.startOffset===t.endOffset-1}get tableModule(){return this.j.getInstance("Table",this.j.o)}beforeDestruct(t){t.e.off("showPopup").off("click",this.onClick).off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd)}}(0,r.__decorate)([j.autobind],Ee.prototype,"onClick",null),(0,r.__decorate)([(0,j.wait)((t=>!t.j.isLocked))],Ee.prototype,"showPopup",null),(0,r.__decorate)([j.autobind],Ee.prototype,"hidePopup",null),(0,r.__decorate)([j.autobind],Ee.prototype,"onSelectionStart",null),(0,r.__decorate)([j.autobind],Ee.prototype,"onSelectionEnd",null),(0,r.__decorate)([(0,j.debounce)((t=>t.defaultTimeout))],Ee.prototype,"onSelectionChange",null),n.D.prototype.controls.align={name:"left",tooltip:"Align",update(t){const e=t.j,s=t.control,i=e.s.current();if(i){const o=S.i.closest(i,(t=>S.i.isBlock(t,e.ew)),e.editor)||e.editor;let r=""+(0,c.css)(o,"text-align");s.defaultValue&&-1!==s.defaultValue.indexOf(r)&&(r="left"),s.data&&s.data.currentValue!==r&&s.list&&-1!==s.list.indexOf(r)&&(e.o.textIcons?t.state.text=r:t.state.icon.name=r,s.data.currentValue=r)}},isActive(t,e){const s=t.s.current();if(s&&e.defaultValue){const i=S.i.closest(s,(e=>S.i.isBlock(e,t.ew)),t.editor)||t.editor;return-1===e.defaultValue.indexOf(""+(0,c.css)(i,"text-align"))}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},n.D.prototype.controls.center={command:"justifyCenter",css:{"text-align":"center"},tooltip:"Align Center"},n.D.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},n.D.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},n.D.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"};const Se=(t,e,s)=>{if(S.i.isNode(e,s.ew)&&S.i.isElement(e))switch(((t,e)=>{S.i.each(t,(t=>{S.i.isHTMLElement(t,e.ew)&&t.style.textAlign&&(t.style.textAlign="",t.style.cssText.trim().length||t.removeAttribute("style"))}))})(e,s),t.toLowerCase()){case"justifyfull":e.style.textAlign="justify";break;case"justifyright":e.style.textAlign="right";break;case"justifyleft":e.style.textAlign="left";break;case"justifycenter":e.style.textAlign="center"}};function ke(t){t.registerButton({name:"align",group:"indent"});const e=e=>(t.s.focus(),t.s.eachSelection((s=>{if(!s)return;let i=S.i.up(s,(e=>S.i.isBlock(e,t.ew)),t.editor);i||(i=S.i.wrapInline(s,t.o.enterBlock,t)),Se(e,i,t)})),!1);t.registerCommand("justifyfull",e),t.registerCommand("justifyright",e),t.registerCommand("justifyleft",e),t.registerCommand("justifycenter",e)}n.D.prototype.limitWords=!1,n.D.prototype.limitChars=!1,n.D.prototype.limitHTML=!1;class Te extends H{afterInit(t){const{limitWords:e,limitChars:s}=t.o;if(t&&(e||s)){let e=null;t.e.off(".limit").on("beforePaste.limit",(()=>{e=t.observer.snapshot.make()})).on("keydown.limit keyup.limit beforeEnter.limit beforePaste.limit",this.checkPreventKeyPressOrPaste).on("change.limit",this.checkPreventChanging).on("afterPaste.limit",(()=>{if(this.shouldPreventInsertHTML()&&e)return t.observer.snapshot.restore(e),!1}))}}shouldPreventInsertHTML(t=null,e=""){if(t&&a.COMMAND_KEYS.includes(t.key))return!1;const{jodit:s}=this,{limitWords:i,limitChars:o}=s.o,r=this.splitWords(e||(s.o.limitHTML?s.value:s.text));return!(!i||i>r.length)||!!o&&r.join("").length>=o}checkPreventKeyPressOrPaste(t){if(this.shouldPreventInsertHTML(t))return!1}checkPreventChanging(t,e){const{jodit:s}=this,{limitWords:i,limitChars:o}=s.o,r=s.o.limitHTML?t:(0,c.stripTags)(t),n=this.splitWords(r);(i&&n.length>i||o&&n.join("").length>o)&&(s.value=e)}splitWords(t){return t.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((t=>t.length))}beforeDestruct(t){t.e.off(".limit")}}(0,r.__decorate)([j.autobind],Te.prototype,"checkPreventKeyPressOrPaste",null),(0,r.__decorate)([j.autobind],Te.prototype,"checkPreventChanging",null);var Ie=s(40);n.D.prototype.link={formTemplate(t){const{openInNewTabCheckbox:e,noFollowCheckbox:s,modeClassName:i,selectSizeClassName:o,selectMultipleClassName:r,selectOptionsClassName:n}=t.o.link;return new Ie.x4(t,[new Ie.eC(t,[new Ie.u3(t,{name:"url",type:"text",ref:"url_input",label:"URL",placeholder:"http://",required:!0})]),new Ie.eC(t,[new Ie.u3(t,{name:"content",ref:"content_input",label:"Text"})],{ref:"content_input_box"}),i?new Ie.eC(t,["input"===i?new Ie.u3(t,{name:"className",ref:"className_input",label:"Class name"}):"select"===i?new Ie.Cj(t,{name:"className",ref:"className_select",label:"Class name",size:o,multiple:r,options:n}):null]):null,e?new Ie.mA(t,{name:"target",ref:"target_checkbox",label:"Open in new tab"}):null,s?new Ie.mA(t,{name:"nofollow",ref:"nofollow_checkbox",label:"No follow"}):null,new Ie.eC(t,[new f.y3(t,{name:"unlink",status:"default",text:"Unlink"}),new f.y3(t,{name:"insert",type:"submit",status:"primary",text:"Insert"})],{align:"full"})])},followOnDblClick:!1,processVideoLink:!0,processPastedLink:!0,noFollowCheckbox:!0,openInNewTabCheckbox:!0,modeClassName:"input",selectMultipleClassName:!0,selectSizeClassName:3,selectOptionsClassName:[],hotkeys:["ctrl+k","cmd+k"]},n.D.prototype.controls.unlink={exec(t,e){const s=S.i.closest(e,"a",t.editor);s&&S.i.unwrap(s),t.setEditorValue(),t.e.fire("hidePopup")},tooltip:"Unlink"},n.D.prototype.controls.link={isActive(t){const e=t.s.current();return!(!e||!S.i.closest(e,"a",t.editor))},popup:(t,e,s,i)=>t.e.fire("generateLinkForm.link",e,i),tags:["a"],tooltip:"Insert link"};class qe extends H{constructor(){super(...arguments),this.buttons=[{name:"link",group:"insert"}]}afterInit(t){t.o.link.followOnDblClick&&t.e.on("dblclick.link",this.onDblClickOnLink),t.o.link.processPastedLink&&t.e.on("processPaste.link",this.onProcessPasteLink),t.e.on("generateLinkForm.link",this.generateForm),t.registerCommand("openLinkDialog",{exec:()=>{const e=new R({resizable:!1}),s=this.generateForm(t.s.current(),(()=>{e.close()}));s.container.classList.add("jodit-dialog_alert"),e.setContent(s),e.open(),t.async.requestIdleCallback((()=>{const{url_input:t}=(0,c.refs)(s.container);null==t||t.focus()}))},hotkeys:t.o.link.hotkeys})}onDblClickOnLink(t){if(!S.i.isTag(t.target,"a"))return;const e=(0,c.attr)(t.target,"href");e&&(location.href=e,t.preventDefault())}onProcessPasteLink(t,e){const{jodit:s}=this;if((0,c.isURL)(e)){if(s.o.link.processVideoLink){const t=(0,c.convertMediaUrlToVideoEmbed)(e);if(t!==e)return s.createInside.fromHTML(t)}const t=s.createInside.element("a");return t.setAttribute("href",e),t.textContent=e,s.e.stopPropagation("processPaste"),t}}generateForm(t,e){const{jodit:s}=this,i=s.i18n.bind(s),{openInNewTabCheckbox:o,noFollowCheckbox:r,formTemplate:n,formClassName:a,modeClassName:l}=s.o.link,h=n(s),d=(0,c.isString)(h)?s.c.fromHTML(h,{target_checkbox_box:o,nofollow_checkbox_box:r}):h,u=S.i.isElement(d)?d:d.container,p=(0,c.refs)(u),{insert:f,unlink:m,content_input_box:g}=p,{target_checkbox:v,nofollow_checkbox:b,url_input:w}=p,y=S.i.isImage(t,s.ew);let{content_input:_}=p;const{className_input:C}=p,{className_select:j}=p;let x;_||(_=s.c.element("input",{type:"hidden",ref:"content_input"})),a&&u.classList.add(a),y&&S.i.hide(g);const E=()=>x?x.innerText:(0,c.stripTags)(s.s.range.cloneContents(),s.ed);if(x=!(!t||!S.i.closest(t,"a",s.editor))&&S.i.closest(t,"a",s.editor),!y&&t&&(_.value=E()),x){if(w.value=(0,c.attr)(x,"href")||"",l)switch(l){case"input":C&&(C.value=(0,c.attr)(x,"class")||"");break;case"select":if(j){for(let t=0;j.selectedOptions.length>t;t++){const e=j.options.item(t);e&&(e.selected=!1)}((0,c.attr)(x,"class")||"").split(" ").forEach((t=>{if(t)for(let e=0;j.options.length>e;e++){const s=j.options.item(e);(null==s?void 0:s.value)&&s.value===t&&(s.selected=!0)}}))}}o&&v&&(v.checked="_blank"===(0,c.attr)(x,"target")),r&&b&&(b.checked="nofollow"===(0,c.attr)(x,"rel")),f.textContent=i("Update")}else S.i.hide(m);const k=s.observer.snapshot.make();m&&s.e.on(m,"click",(t=>{s.observer.snapshot.restore(k),x&&S.i.unwrap(x),s.setEditorValue(),e(),t.preventDefault()}));const T=()=>{if(!w.value.trim().length)return w.focus(),w.classList.add("jodit_error"),!1;let t;s.observer.snapshot.restore(k);const i=E()!==_.value.trim();if(x)t=[x];else if(s.s.isCollapsed()){const e=s.createInside.element("a");s.s.insertNode(e),t=[e]}else t=s.s.wrapInTag("a");return t.forEach((t=>{var e;if((0,c.attr)(t,"href",w.value),l&&(null!=C?C:j))if("input"===l)""===C.value&&t.hasAttribute("class")&&(0,c.attr)(t,"class",null),""!==C.value&&(0,c.attr)(t,"class",C.value);else if("select"===l){t.hasAttribute("class")&&(0,c.attr)(t,"class",null);for(let s=0;j.selectedOptions.length>s;s++){const i=null===(e=j.selectedOptions.item(s))||void 0===e?void 0:e.value;i&&t.classList.add(i)}}y||(_.value.trim().length?i&&(t.textContent=_.value):t.textContent=w.value),o&&v&&(0,c.attr)(t,"target",v.checked?"_blank":null),r&&b&&(0,c.attr)(t,"rel",b.checked?"nofollow":null)})),s.setEditorValue(),e(),!1};return S.i.isElement(d)?s.e.on(d,"submit",(t=>(t.preventDefault(),t.stopImmediatePropagation(),T(),!1))):d.onSubmit(T),d}beforeDestruct(t){t.e.off("generateLinkForm.link",this.generateForm).off("dblclick.link",this.onDblClickOnLink).off("processPaste.link",this.onProcessPasteLink)}}function Le(t){const e="jodit_fake_wrapper",{mediaFakeTag:s,mediaBlocks:i,mediaInFakeBlock:o}=t.options;o&&t.e.on("afterGetValueFromEditor",(t=>{const i=RegExp(`<${s}[^>]+data-${e}[^>]+>(.+?)`,"ig");i.test(t.value)&&(t.value=t.value.replace(i,"$1"))})).on("change afterInit afterSetMode changePlace",t.async.debounce((()=>{t.isDestructed||t.getMode()===a.MODE_SOURCE||(0,c.$$)(i.join(","),t.editor).forEach((i=>{(0,c.dataBind)(i,e)||((0,c.dataBind)(i,e,!0),(i=>{if(i.parentNode&&(0,c.attr)(i.parentNode,"data-jodit_iframe_wrapper"))i=i.parentNode;else{const o=t.createInside.fromHTML(`<${s} data-jodit-temp="1" contenteditable="false" draggable="true" data-${e}="1">`);o.style.display="inline-block"===i.style.display?"inline-block":"block",o.style.width=i.offsetWidth+"px",o.style.height=i.offsetHeight+"px",i.parentNode&&i.parentNode.insertBefore(o,i),o.appendChild(i),i=o}t.e.off(i,"mousedown.select touchstart.select").on(i,"mousedown.select touchstart.select",(()=>{t.s.setCursorAfter(i)}))})(i))}))}),t.defaultTimeout))}function ze(t){t.registerButton({name:"video",group:"media"})}function Me(t){t.registerButton({name:"file",group:"media"})}function Pe(t){let e=0,s=(0,c.splitArray)(t.o.buttons);t.e.on("touchend",(s=>{if(s.changedTouches&&s.changedTouches.length){const i=(new Date).getTime();i-e>t.o.mobileTapTimeout&&(e=i,t.s.insertCursorAtPoint(s.changedTouches[0].clientX,s.changedTouches[0].clientY))}})).on("getDiffButtons.mobile",(e=>{if(e===t.toolbar){const e=(0,c.splitArray)(t.o.buttons),i=(0,D.q)(s);return e.reduce(((t,e)=>((0,D.A)(e)?t.push({...e,buttons:e.buttons.filter((t=>!i.has(t)))}):i.has(e)||t.push(e),t)),[])}})),t.o.toolbarAdaptive&&t.e.on("resize afterInit recalcAdaptive changePlace afterAddPlace",(()=>{if(!t.o.toolbar)return;const e=t.container.offsetWidth,i=(0,c.splitArray)(t.o.sizeLG>e?t.o.sizeMD>e?t.o.sizeSM>e?t.o.buttonsXS:t.o.buttonsSM:t.o.buttonsMD:t.o.buttons);""+i!=""+s&&(s=i,t.e.fire("closeAllPopups"),t.toolbar.setRemoveButtons(t.o.removeButtons).build(s.concat(t.o.extraButtons)))})).on(t.ow,"load",(()=>t.e.fire("recalcAdaptive")))}(0,r.__decorate)([j.autobind],qe.prototype,"onDblClickOnLink",null),(0,r.__decorate)([j.autobind],qe.prototype,"onProcessPasteLink",null),(0,r.__decorate)([j.autobind],qe.prototype,"generateForm",null),n.D.prototype.mediaFakeTag="jodit-media",n.D.prototype.mediaInFakeBlock=!0,n.D.prototype.mediaBlocks=["video","audio"],n.D.prototype.controls.video={popup(t,e,s,i){const o=new Ie.x4(t,[new Ie.eC(t,[new Ie.u3(t,{name:"url",required:!0,label:"URL",placeholder:"https://",validators:["url"]})]),new Ie.eC(t,[(0,f.zx)(t,"","Insert","primary").onAction((()=>o.submit()))])]),r=new Ie.x4(t,[new Ie.eC(t,[new Ie.GJ(t,{name:"code",required:!0,label:"Embed code"})]),new Ie.eC(t,[(0,f.zx)(t,"","Insert","primary").onAction((()=>r.submit()))])]),n=[],a=t.s.save(),l=e=>{t.s.restore(a),t.s.insertHTML(e),i()};return n.push({icon:"link",name:"Link",content:o.container},{icon:"source",name:"Code",content:r.container}),o.onSubmit((t=>{l((0,c.convertMediaUrlToVideoEmbed)(t.url))})),r.onSubmit((t=>{l(t.code)})),(0,ie.IL)(t,n)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"},n.D.prototype.controls.file={popup(t,e,s,i){const o=(e,s="")=>{t.s.insertNode(t.createInside.fromHTML(`${s||e}`))};let r=null;return e&&(S.i.isTag(e,"a")||S.i.closest(e,"a",t.editor))&&(r=S.i.isTag(e,"a")?e:S.i.closest(e,"a",t.editor)),(0,ie.ov)(t,{filebrowser(t){t.files&&t.files.forEach((e=>o(t.baseurl+e))),i()},upload:!0,url(t,e){r?(r.setAttribute("href",t),r.setAttribute("title",e)):o(t,e),i()}},r,i,!1)},tags:["a"],tooltip:"Insert file"},n.D.prototype.mobileTapTimeout=300,n.D.prototype.toolbarAdaptive=!0,n.D.prototype.controls.dots={mode:a.MODE_SOURCE+a.MODE_WYSIWYG,popup(t,e,s,i,o){let r=s.data;return void 0===r&&(r={toolbar:M(t),rebuild(){var e;if(o){const s=t.e.fire("getDiffButtons.mobile",o.closest(k.bz));if(s&&r){r.toolbar.build((0,c.splitArray)(s));const i=(null===(e=t.toolbar.firstButton)||void 0===e?void 0:e.container.offsetWidth)||36;r.toolbar.container.style.width=3*(i+4)+"px"}}}},s.data=r),r.rebuild(),r.toolbar},tooltip:"Show all"};const De=(t,e,{control:s})=>{const i="button"+s.command,o=s.args&&s.args[0]||(0,c.dataBind)(t,i);(0,c.dataBind)(t,i,o),t.execCommand(s.command,!1,o)};function Ne(t){const e=t=>/insert(un)?orderedlist/i.test(t),s=()=>S.i.up(t.s.current(),(t=>t&&/^UL|OL$/i.test(t.nodeName)),t.editor),i=(t,e)=>{"default"!==e&&e?t.style.setProperty("list-style-type",e):t.style.removeProperty("list-style-type")};t.e.on("beforeCommand",((t,o,r)=>{if(e(t)&&r){const e=s();if(e&&!((t,e)=>{const s=t.style.listStyleType;return s===e||!s&&"default"===e})(e,r)&&(S.i.isTag(e,"ul")&&/unordered/i.test(t)||S.i.isTag(e,"ol")&&!/unordered/i.test(t)))return i(e,r),!1}})).on("afterCommand",((o,r,n)=>{if(e(o)){const e=s();e&&(i(e,n),t.createInside.applyCreateAttributes(e),e.querySelectorAll("li").forEach((e=>{t.createInside.applyCreateAttributes(e)})));const o=[],r=t=>{S.i.isTag(t,["p","h1","h2","h3","h4","h5","h6"])&&o.push(t)};if(e&&(r(e.parentNode),e.querySelectorAll("li").forEach((t=>r(t.firstChild))),o.length)){const s=t.s.save();(0,c.toArray)(e.childNodes).forEach((t=>{S.i.isTag(t.lastChild,"br")&&S.i.safeRemove(t.lastChild)})),o.forEach((t=>S.i.unwrap(t))),t.s.restore(s)}t.setEditorValue()}}))}n.D.prototype.controls.ul={command:"insertUnorderedList",tags:["ul"],tooltip:"Insert Unordered List",list:{default:"Default",circle:"Circle",disc:"Dot",square:"Quadrate"},exec:De},n.D.prototype.controls.ol={command:"insertOrderedList",tags:["ol"],tooltip:"Insert Ordered List",list:{default:"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},exec:De},n.D.prototype.showPlaceholder=!0,n.D.prototype.useInputsPlaceholder=!0,n.D.prototype.placeholder="Type something";class Re extends H{constructor(){super(...arguments),this.addNativeListeners=()=>{this.j.e.off(this.j.editor,"input.placeholder keydown.placeholder").on(this.j.editor,"input.placeholder keydown.placeholder",this.toggle)},this.addEvents=()=>{const t=this.j;t.o.useInputsPlaceholder&&t.element.hasAttribute("placeholder")&&(this.placeholderElm.innerHTML=(0,c.attr)(t.element,"placeholder")||""),t.e.fire("placeholder",this.placeholderElm.innerHTML),t.e.off(".placeholder").on("changePlace.placeholder",this.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",this.toggle).on(window,"load",this.toggle),this.addNativeListeners(),this.toggle()}}afterInit(t){t.o.showPlaceholder&&(this.placeholderElm=t.c.fromHTML(``),"rtl"===t.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),t.e.on("readonly",(t=>{t?this.hide():this.toggle()})).on("changePlace",this.addEvents),this.addEvents())}show(){const t=this.j;if(t.o.readonly)return;let e=0,s=0;const i=t.s.current(),o=i&&S.i.closest(i,(e=>S.i.isBlock(e,t.ew)),t.editor)||t.editor,r=t.ew.getComputedStyle(o);if(t.workplace.appendChild(this.placeholderElm),S.i.isElement(t.editor.firstChild)){const i=t.ew.getComputedStyle(t.editor.firstChild);e=parseInt(i.getPropertyValue("margin-top"),10),s=parseInt(i.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=i.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(r.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=r.getPropertyValue("line-height");(0,c.css)(this.placeholderElm,{display:"block",textAlign:r.getPropertyValue("text-align"),marginTop:Math.max(parseInt(r.getPropertyValue("margin-top"),10),e),marginLeft:Math.max(parseInt(r.getPropertyValue("margin-left"),10),s)})}hide(){S.i.safeRemove(this.placeholderElm)}toggle(){const t=this.j;t.editor&&!t.isInDestruct&&(t.getRealMode()===a.MODE_WYSIWYG&&(t=>{if(!t.firstChild)return!0;const e=t.firstChild;if(a.MAY_BE_REMOVED_WITH_KEY.test(e.nodeName)||/^(TABLE)$/i.test(e.nodeName))return!1;const s=S.i.next(e,(t=>t&&!S.i.isEmptyTextNode(t)),t);return S.i.isText(e)&&!s?S.i.isEmptyTextNode(e):!s&&S.i.each(e,(t=>!S.i.isTag(t,["ul","li","ol"])&&(S.i.isEmpty(t)||S.i.isTag(t,"br"))))})(t.editor)?this.show():this.hide())}beforeDestruct(t){this.hide(),t.e.off(".placeholder").off(window,"load",this.toggle)}}(0,r.__decorate)([(0,j.debounce)((t=>t.defaultTimeout/10),!0)],Re.prototype,"toggle",null),n.D.prototype.controls.redo={mode:a.MODE_SPLIT,isDisabled:t=>!t.observer.stack.canRedo(),tooltip:"Redo"},n.D.prototype.controls.undo={mode:a.MODE_SPLIT,isDisabled:t=>!t.observer.stack.canUndo(),tooltip:"Undo"};class Ae extends H{constructor(){super(...arguments),this.buttons=[{name:"undo",group:"history"},{name:"redo",group:"history"}]}beforeDestruct(){}afterInit(t){const e=e=>(t.observer[e](),!1);t.registerCommand("redo",{exec:e,hotkeys:["ctrl+y","ctrl+shift+z","cmd+y","cmd+shift+z"]}),t.registerCommand("undo",{exec:e,hotkeys:["ctrl+z","cmd+z"]})}}n.D.prototype.useIframeResizer=!0,n.D.prototype.useTableResizer=!0,n.D.prototype.useImageResizer=!0,n.D.prototype.resizer={showSize:!0,hideSizeTimeout:1e3,min_width:10,min_height:10};const Be="__jodit-resizer_binded";class Oe extends H{constructor(){super(...arguments),this.LOCK_KEY="resizer",this.element=null,this.isResized=!1,this.isShown=!1,this.start_x=0,this.start_y=0,this.width=0,this.height=0,this.ratio=0,this.rect=this.j.c.fromHTML('
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t100x100\n\t\t\t
'),this.sizeViewer=this.rect.getElementsByTagName("span")[0],this.onResize=t=>{if(this.isResized){const e=t.clientX-this.start_x,s=t.clientY-this.start_y;if(!this.element)return;const i=this.handle.className;let o=0,r=0;S.i.isTag(this.element,"img")?(e?(o=this.width+(i.match(/left/)?-1:1)*e,r=Math.round(o/this.ratio)):(r=this.height+(i.match(/top/)?-1:1)*s,o=Math.round(r*this.ratio)),o>(0,c.innerWidth)(this.j.editor,this.j.ow)&&(o=(0,c.innerWidth)(this.j.editor,this.j.ow),r=Math.round(o/this.ratio))):(o=this.width+(i.match(/left/)?-1:1)*e,r=this.height+(i.match(/top/)?-1:1)*s),o>this.j.o.resizer.min_width&&(0,c.css)(this.element,"width",this.rect.parentNode.offsetWidth>o?o:"100%"),r>this.j.o.resizer.min_height&&(0,c.css)(this.element,"height",r),this.updateSize(),this.showSizeViewer(this.element.offsetWidth,this.element.offsetHeight),t.stopImmediatePropagation()}},this.onClickOutside=t=>{this.isShown&&(this.isResized?(this.j.unlock(),this.isResized=!1,this.j.setEditorValue(),t.stopImmediatePropagation(),this.j.e.off(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)):this.hide())},this.onClickElement=t=>{this.element===t&&this.isShown||(this.element=t,this.show(),S.i.isTag(this.element,"img")&&!this.element.complete&&this.j.e.on(this.element,"load",this.updateSize))},this.updateSize=()=>{if(!this.isInDestruct&&this.isShown&&this.element&&this.rect){const t=(0,c.offset)(this.rect.parentNode||this.j.od.documentElement,this.j,this.j.od,!0),e=(0,c.offset)(this.element,this.j,this.j.ed),s=parseInt(this.rect.style.left||"0",10),i=this.rect.offsetWidth,o=this.rect.offsetHeight,r=e.top-1-t.top,n=e.left-1-t.left;parseInt(this.rect.style.top||"0",10)===r&&s===n&&i===this.element.offsetWidth&&o===this.element.offsetHeight||((0,c.css)(this.rect,{top:r,left:n,width:this.element.offsetWidth,height:this.element.offsetHeight}),this.j.events&&(this.j.e.fire(this.element,"changesize"),isNaN(s)||this.j.e.fire("resize")))}},this.hideSizeViewer=()=>{this.sizeViewer.style.opacity="0"}}afterInit(t){(0,c.$$)("i",this.rect).forEach((e=>{t.e.on(e,"mousedown.resizer touchstart.resizer",this.onClickHandle.bind(this,e))})),C.TB.on("hideHelpers",this.hide),t.e.on("readonly",(t=>{t&&this.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(t=>{const e=/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>.*?<\/iframe>.*?)<\/jodit>/gi;e.test(t.value)&&(t.value=t.value.replace(e,"$1"))})).on("hideResizer",this.hide).on("change afterInit afterSetMode",t.async.debounce(this.onChangeEditor.bind(this),t.defaultTimeout)),this.addEventListeners(),this.onChangeEditor()}addEventListeners(){const t=this.j;t.e.off(t.editor,".resizer").off(t.ow,".resizer").on(t.editor,"keydown.resizer",(t=>{this.isShown&&t.key===a.KEY_DELETE&&this.element&&!S.i.isTag(this.element,"table")&&this.onDelete(t)})).on(t.ow,"resize.resizer",this.updateSize).on(t.ow,"mouseup.resizer keydown.resizer touchend.resizer",this.onClickOutside).on([t.ow,t.editor],"scroll.resizer",(()=>{this.isShown&&!this.isResized&&this.hide()}))}onClickHandle(t,e){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=t,e.preventDefault(),e.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResized=!0,this.start_x=e.clientX,this.start_y=e.clientY,this.j.e.fire("hidePopup"),this.j.lock(this.LOCK_KEY),this.j.e.on(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)}onDelete(t){this.element&&("JODIT"!==this.element.tagName?this.j.s.select(this.element):(S.i.safeRemove(this.element),this.hide(),t.preventDefault()))}onChangeEditor(){const t=this.j;this.isShown&&(this.element&&this.element.parentNode?this.updateSize():this.hide()),t.isDestructed||(0,c.$$)("img, table, iframe",t.editor).forEach((e=>{t.getMode()!==a.MODE_SOURCE&&!e[Be]&&(S.i.isTag(e,"iframe")&&t.o.useIframeResizer||S.i.isTag(e,"img")&&t.o.useImageResizer||S.i.isTag(e,"table")&&t.o.useTableResizer)&&(e[Be]=!0,this.bind(e))}))}bind(t){let e;if(S.i.isTag(t,"iframe")){const s=t;(0,c.attr)(t.parentNode,"-jodit_iframe_wrapper")?t=t.parentNode:(e=this.j.createInside.fromHTML(''),(0,c.css)(e,{display:"inline-block"===t.style.display?"inline-block":"block",width:t.offsetWidth,height:t.offsetHeight}),t.parentNode&&t.parentNode.insertBefore(e,t),e.appendChild(t),t=e),this.j.e.off(t,"mousedown.select touchstart.select").on(t,"mousedown.select touchstart.select",(()=>{this.j.s.select(t)})).off(t,"changesize").on(t,"changesize",(()=>{s.setAttribute("width",t.offsetWidth+"px"),s.setAttribute("height",t.offsetHeight+"px")}))}this.j.e.on(t,"dragstart",this.hide).on(t,"mousedown",(e=>{a.IS_IE&&S.i.isTag(t,"img")&&e.preventDefault()})).on(t,"click",(()=>this.onClickElement(t)))}showSizeViewer(t,e){this.j.o.resizer.showSize&&(this.sizeViewer.offsetWidth>t||this.sizeViewer.offsetHeight>e?this.hideSizeViewer():(this.sizeViewer.style.opacity="1",this.sizeViewer.textContent=`${t} x ${e}`,this.j.async.setTimeout(this.hideSizeViewer,{timeout:this.j.o.resizer.hideSizeTimeout,label:"hideSizeViewer"})))}show(){this.j.o.readonly||this.isShown||(this.isShown=!0,this.rect.parentNode||((0,c.markOwner)(this.j,this.rect),this.j.workplace.appendChild(this.rect)),this.j.isFullSize&&(this.rect.style.zIndex=""+(0,c.css)(this.j.container,"zIndex")),this.updateSize())}hide(){this.isResized=!1,this.isShown=!1,this.element=null,S.i.safeRemove(this.rect)}beforeDestruct(t){this.hide(),C.TB.off("hideHelpers",this.hide),t.e.off(this.j.ow,".resizer").off(".resizer")}}(0,r.__decorate)([j.autobind],Oe.prototype,"hide",null),n.D.prototype.useSearch=!0,n.D.prototype.controls.find={tooltip:"Find",icon:"search",exec(t,e,{control:s}){switch(s.args&&s.args[0]){case"findPrevious":t.e.fire("searchPrevious");break;case"findNext":t.e.fire("searchNext");break;case"replace":t.execCommand("openReplaceDialog");break;default:t.execCommand("openSearchDialog")}},list:{search:"Find",findNext:"Find Next",findPrevious:"Find Previous",replace:"Replace"},childTemplate:(t,e,s)=>s};class He extends H{constructor(){super(...arguments),this.buttons=[{name:"find",group:"search"}],this.template=``,this.isOpened=!1,this.selInfo=null,this.current=null,this.eachMap=(t,e,s)=>{S.i.findWithCurrent(t,(t=>!(!t||!e(t))),this.j.editor,s?"nextSibling":"previousSibling",s?"firstChild":"lastChild")},this.updateCounters=()=>{if(!this.isOpened)return;this.counterBox.style.display=this.queryInput.value.length?"inline-block":"none";const t=this.calcCounts(this.queryInput.value,this.j.s.range);this.counterBox.textContent=t.join("/")},this.calcCounts=(t,e=!1)=>{const s=[];let i=0,o=0,r=!1,n=this.j.editor.firstChild;for(;n&&t.length;)if(r=this.find(n,t,!0,0,r||this.j.ed.createRange()),r){if(this.boundAlreadyWas(r,s))break;s.push(r),n=r.startContainer,o+=1,e&&this.boundAlreadyWas(e,[r])&&(i=o)}else n=null;return[i,o]},this.findAndReplace=(t,e)=>{const s=this.find(t,e,!0,0,this.j.s.range);if(s&&s.startContainer&&s.endContainer){const t=this.j.ed.createRange();try{if(s&&s.startContainer&&s.endContainer){t.setStart(s.startContainer,s.startOffset),t.setEnd(s.endContainer,s.endOffset),t.deleteContents();const e=this.j.createInside.text(this.replaceInput.value);t.insertNode(e),this.j.s.select(e),this.tryScrollToElement(e)}}catch(t){}return!0}return!1},this.findAndSelect=(t,e,s)=>{const i=this.find(t,e,s,0,this.j.s.range);if(i&&i.startContainer&&i.endContainer){const t=this.j.ed.createRange();try{t.setStart(i.startContainer,i.startOffset),t.setEnd(i.endContainer,i.endOffset),this.j.s.selectRange(t)}catch(t){}return this.tryScrollToElement(i.startContainer),this.current=i.startContainer,this.updateCounters(),!0}return!1},this.find=(t,e,s,i,o)=>{if(t&&e.length){let r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null};if(this.eachMap(t,(t=>{if(S.i.isText(t)&&null!=t.nodeValue&&t.nodeValue.length){let a=t.nodeValue;s||t!==o.startContainer?s&&t===o.endContainer&&(a=i?a.substr(0,o.startOffset):a.substr(o.endOffset)):a=i?a.substr(o.endOffset):a.substr(0,o.startOffset);const l=s?r+a:a+r,h=He.findSomePartOfString(e,l,s);if(!1!==h){let o=He.findSomePartOfString(e,a,s);!0===o?o=(0,c.trim)(e):!1===o&&(o=He.findSomePartOfString(a,e,s),!0===o&&(o=(0,c.trim)(a)));let d=He.getSomePartOfStringIndex(e,a,s)||0;if((s&&!i||!s&&i)&&t.nodeValue.length-a.length>0&&(d+=t.nodeValue.length-a.length),null==n.startContainer&&(n.startContainer=t,n.startOffset=d),!0===h)return n.endContainer=t,n.endOffset=d,n.endOffset+=o.length,!0;r=l}else r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null}}else S.i.isBlock(t,this.j.ew)&&""!==r&&(r=s?r+" ":" "+r);return!1}),s),n.startContainer&&n.endContainer)return n;if(!i)return this.current=s?this.j.editor.firstChild:this.j.editor.lastChild,this.find(this.current,e,s,i+1,o)}return!1},this.open=(t=!1)=>{this.isOpened||(this.searchBox.classList.add("jodit-search_active"),this.isOpened=!0),this.calcSticky(this.j.e.fire("getStickyState.sticky")||!1),this.j.e.fire("hidePopup"),this.searchBox.classList.toggle("jodit-search_replace",t),this.current=this.j.s.current(),this.selInfo=this.j.s.save();const e=""+(this.j.s.sel||"");e&&(this.queryInput.value=e),this.updateCounters(),e?this.queryInput.select():this.queryInput.focus()},this.close=()=>{this.isOpened&&(this.selInfo&&(this.j.s.restore(this.selInfo),this.selInfo=null),this.searchBox.classList.remove("jodit-search_active"),this.isOpened=!1)}}static getSomePartOfStringIndex(t,e,s=!0){return this.findSomePartOfString(t,e,s,!0)}static findSomePartOfString(t,e,s=!0,i=!1){t=(0,c.trim)(t.toLowerCase().replace(a.SPACE_REG_EXP()," ")),e=e.toLowerCase();let o=s?0:e.length-1,r=s?0:t.length-1,n=0,l=null;const h=s?1:-1,d=[];for(;void 0!==e[o];o+=h){const c=t[r]===e[o];if(c||null!=l&&a.SPACE_REG_EXP().test(e[o])?(null!=l&&s||(l=o),d.push(e[o]),c&&(n+=1,r+=h)):(l=null,d.length=0,n=0,r=s?0:t.length-1),n===t.length)return!i||l}return i?null!=l&&l:!!d.length&&(s?d.join(""):d.reverse().join(""))}boundAlreadyWas(t,e){return e.some((e=>e.startContainer===t.startContainer&&e.endContainer===t.endContainer&&e.startOffset===t.startOffset&&e.endOffset===t.endOffset),!1)}tryScrollToElement(t){let e=S.i.closest(t,S.i.isElement,this.j.editor);e||(e=S.i.prev(t,S.i.isElement,this.j.editor)),e&&e!==this.j.editor&&e.scrollIntoView()}afterInit(t){if(t.o.useSearch){const e=this;e.searchBox=t.c.fromHTML(e.template);const{query:s,replace:i,cancel:o,next:r,prev:n,replaceBtn:l,counterBox:h}=(0,c.refs)(e.searchBox);e.queryInput=s,e.replaceInput=i,e.closeButton=o,e.nextButton=r,e.prevButton=n,e.replaceButton=l,e.counterBox=h;const d=()=>{t.workplace.appendChild(this.searchBox),t.e.off(this.j.container,"keydown.search").on(this.j.container,"keydown.search",(s=>{if(t.getRealMode()===a.MODE_WYSIWYG)switch(s.key){case a.KEY_ESC:this.close();break;case a.KEY_F3:e.queryInput.value&&(t.e.fire(s.shiftKey?"searchPrevious":"searchNext"),s.preventDefault())}}))};d(),t.e.on("changePlace",d).on(e.closeButton,"click",this.close).on(e.queryInput,"mousedown",(()=>{t.s.isFocused()&&(t.s.removeMarkers(),e.selInfo=t.s.save())})).on(e.replaceButton,"click",(s=>{e.findAndReplace(t.s.current()||t.editor.firstChild,e.queryInput.value),this.updateCounters(),s.preventDefault(),s.stopImmediatePropagation()})).on([e.nextButton,e.prevButton],"click",(function(s){t.e.fire(e.nextButton===this?"searchNext":"searchPrevious"),s.preventDefault(),s.stopImmediatePropagation()})).on(this.queryInput,"keydown",this.j.async.debounce((e=>{switch(e.key){case a.KEY_ENTER:e.preventDefault(),e.stopImmediatePropagation(),t.e.fire("searchNext")&&this.close();break;default:this.updateCounters()}}),this.j.defaultTimeout)).on("beforeSetMode.search",(()=>{this.close()})).on("keydown.search mousedown.search",(()=>{this.selInfo&&(t.s.removeMarkers(),this.selInfo=null),this.isOpened&&(this.current=this.j.s.current(),this.updateCounters())})).on("searchNext.search searchPrevious.search",(()=>e.isOpened?e.findAndSelect(t.s.current()||t.editor.firstChild,e.queryInput.value,"searchNext"===t.e.current):e.open())).on("search.search",((e,s=!0)=>{t.execCommand("search",e,s)})).on("toggleSticky.search",this.calcSticky),t.registerCommand("search",{exec:(s,i,o=!0)=>(e.findAndSelect(t.s.current()||t.editor.firstChild,i||"",o),!1)}).registerCommand("openSearchDialog",{exec:()=>(e.open(),!1),hotkeys:["ctrl+f","cmd+f"]}).registerCommand("openReplaceDialog",{exec:()=>(t.o.readonly||e.open(!0),!1),hotkeys:["ctrl+h","cmd+h"]})}}beforeDestruct(t){var e;S.i.safeRemove(this.searchBox),null===(e=t.events)||void 0===e||e.off(".search")}calcSticky(t){if(this.isOpened)if(this.searchBox.classList.toggle("jodit-search_sticky",t),t){const t=(0,c.position)(this.j.toolbarContainer);(0,c.css)(this.searchBox,{top:t.top+t.height,left:t.left+t.width})}else(0,c.css)(this.searchBox,{top:null,left:null})}}(0,r.__decorate)([j.autobind],He.prototype,"calcSticky",null),n.D.prototype.width="auto",n.D.prototype.minWidth=200,n.D.prototype.maxWidth="100%",n.D.prototype.allowResizeX=!1,n.D.prototype.allowResizeY=!0,n.D.prototype.height="auto",n.D.prototype.minHeight=200,n.D.prototype.maxHeight="auto",n.D.prototype.saveHeightInStorage=!1;let Fe=class extends H{constructor(){super(...arguments),this.isResized=!1,this.start={x:0,y:0,w:0,h:0},this.handle=this.j.c.div("jodit-editor__resize",'')}afterInit(t){"auto"!==t.o.height&&(t.o.allowResizeX||t.o.allowResizeY)&&(t.e.on("toggleFullSize.resizeHandler",(()=>{this.handle.style.display=t.isFullSize?"none":"block"})).on(this.handle,"mousedown touchstart",this.onHandleResizeStart).on(t.ow,"mouseup touchsend",this.onHandleResizeEnd),t.container.appendChild(this.handle))}onHandleResizeStart(t){this.isResized=!0,this.start.x=t.clientX,this.start.y=t.clientY,this.start.w=this.j.container.offsetWidth,this.start.h=this.j.container.offsetHeight,this.j.lock(),this.j.e.on(this.j.ow,"mousemove touchmove",this.onHandleResize),t.preventDefault()}onHandleResize(t){this.isResized&&(this.j.o.allowResizeY&&this.j.e.fire("setHeight",this.start.h+t.clientY-this.start.y),this.j.o.allowResizeX&&this.j.e.fire("setWidth",this.start.w+t.clientX-this.start.x),this.j.e.fire("resize"))}onHandleResizeEnd(){this.isResized&&(this.isResized=!1,this.j.e.off(this.j.ow,"mousemove touchmove",this.onHandleResize),this.j.unlock())}beforeDestruct(t){S.i.safeRemove(this.handle),this.j.e.off(this.j.ow,"mouseup touchsend",this.onHandleResizeEnd)}};Fe.requires=["size"],Fe=(0,r.__decorate)([j.autobind],Fe);let We=class extends H{constructor(){super(...arguments),this.resizeWorkspaces=this.j.async.debounce(this.resizeWorkspaceImd,this.j.defaultTimeout,!0)}afterInit(t){t.e.on("setHeight.size",this.setHeight).on("setWidth.size",this.setWidth).on("afterInit.size changePlace.size",this.initialize,void 0,!0).on(t.ow,"load.size",this.resizeWorkspaces).on("afterInit.size resize.size afterUpdateToolbar.size scroll.size afterResize.size toggleFullSize.size",this.resizeWorkspaces),this.initialize()}initialize(){const{j:t}=this;if(t.o.inline)return;let{height:e}=t.o;if(t.o.saveHeightInStorage&&"auto"!==e){const s=t.storage.get("height");s&&(e=s)}(0,c.css)(t.editor,{minHeight:"100%"}),(0,c.css)(t.container,{minHeight:t.o.minHeight,maxHeight:t.o.maxHeight,minWidth:t.o.minWidth,maxWidth:t.o.maxWidth}),this.setHeight(e),this.setWidth(t.o.width)}setHeight(t){if((0,c.isNumber)(t)){const{minHeight:e,maxHeight:s}=this.j.o;(0,c.isNumber)(e)&&e>t&&(t=e),(0,c.isNumber)(s)&&t>s&&(t=s)}(0,c.css)(this.j.container,"height",t),this.j.o.saveHeightInStorage&&this.j.storage.set("height",t),this.resizeWorkspaceImd()}setWidth(t){if((0,c.isNumber)(t)){const{minWidth:e,maxWidth:s}=this.j.o;(0,c.isNumber)(e)&&e>t&&(t=e),(0,c.isNumber)(s)&&t>s&&(t=s)}(0,c.css)(this.j.container,"width",t),this.resizeWorkspaceImd()}getNotWorkHeight(){var t,e;return((null===(t=this.j.toolbarContainer)||void 0===t?void 0:t.offsetHeight)||0)+((null===(e=this.j.statusbar)||void 0===e?void 0:e.getHeight())||0)+2}resizeWorkspaceImd(){if(!this.j||this.j.isDestructed||!this.j.o||this.j.o.inline)return;if(!this.j.container||!this.j.container.parentNode)return;const t=((0,c.css)(this.j.container,"minHeight")||0)-this.getNotWorkHeight();if((0,c.isNumber)(t)&&t>0&&([this.j.workplace,this.j.iframe,this.j.editor].map((e=>{e&&(0,c.css)(e,"minHeight",t)})),this.j.e.fire("setMinHeight",t)),(0,c.isNumber)(this.j.o.maxHeight)){const t=this.j.o.maxHeight-this.getNotWorkHeight();[this.j.workplace,this.j.iframe,this.j.editor].map((e=>{e&&(0,c.css)(e,"maxHeight",t)})),this.j.e.fire("setMaxHeight",t)}this.j.container&&(0,c.css)(this.j.workplace,"height","auto"!==this.j.o.height||this.j.isFullSize?this.j.container.offsetHeight-this.getNotWorkHeight():"auto")}beforeDestruct(t){this.j.e.off(this.j.ow,"load.size",this.resizeWorkspaces).off(".size")}};We=(0,r.__decorate)([j.autobind],We),n.D.prototype.beautifyHTML=!a.IS_IE,n.D.prototype.sourceEditor="ace",n.D.prototype.sourceEditorNativeOptions={showGutter:!0,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},n.D.prototype.sourceEditorCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"],n.D.prototype.beautifyHTMLCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js","https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify-html.min.js"],n.D.prototype.controls.source={mode:a.MODE_SPLIT,exec(t){t.toggleMode()},isActive:t=>t.getRealMode()===a.MODE_SOURCE,tooltip:"Change mode"};class $e{constructor(t,e,s,i){this.jodit=t,this.container=e,this.toWYSIWYG=s,this.fromWYSIWYG=i,this.className="",this.isReady=!1}get j(){return this.jodit}onReady(){this.replaceUndoManager(),this.isReady=!0,this.j.e.fire(this,"ready")}onReadyAlways(t){var e;this.isReady?t():null===(e=this.j.events)||void 0===e||e.on(this,"ready",t)}}class Ve extends $e{constructor(){super(...arguments),this.autosize=this.j.async.debounce((()=>{this.instance.style.height="auto",this.instance.style.height=this.instance.scrollHeight+"px"}),this.j.defaultTimeout)}init(t){this.instance=t.c.element("textarea",{class:"jodit-source__mirror"}),this.container.appendChild(this.instance),t.e.on(this.instance,"mousedown keydown touchstart input",t.async.debounce(this.toWYSIWYG,t.defaultTimeout)).on("setMinHeight.source",(t=>{(0,c.css)(this.instance,"minHeight",t)})).on(this.instance,"change keydown mousedown touchstart input",this.autosize).on("afterSetMode.source",this.autosize).on(this.instance,"mousedown focus",(e=>{t.e.fire(e.type,e)})),this.autosize(),this.onReady()}destruct(){S.i.safeRemove(this.instance)}getValue(){return this.instance.value}setValue(t){this.instance.value=t}insertRaw(t){const e=this.getValue();if(0>this.getSelectionStart())this.setValue(e+t);else{const s=this.getSelectionStart(),i=this.getSelectionEnd();this.setValue(e.substring(0,s)+t+e.substring(i,e.length))}}getSelectionStart(){return this.instance.selectionStart}getSelectionEnd(){return this.instance.selectionEnd}setSelectionRange(t,e=t){this.instance.setSelectionRange(t,e)}focus(){this.instance.focus()}setPlaceHolder(t){this.instance.setAttribute("placeholder",t)}setReadOnly(t){t?this.instance.setAttribute("readonly","true"):this.instance.removeAttribute("readonly")}selectAll(){this.instance.select()}replaceUndoManager(){const{observer:t}=this.jodit;this.j.e.on(this.instance,"keydown",(e=>{if((e.ctrlKey||e.metaKey)&&"z"===e.key)return e.shiftKey?t.redo():t.undo(),this.setSelectionRange(this.getValue().length),!1}))}}class Ye extends $e{constructor(){super(...arguments),this.className="jodit_ace_editor",this.proxyOnFocus=t=>{this.j.e.fire("focus",t)},this.proxyOnMouseDown=t=>{this.j.e.fire("mousedown",t)}}aceExists(){return void 0!==this.j.ow.ace}getLastColumnIndex(t){return this.instance.session.getLine(t).length}getLastColumnIndices(){const t=this.instance.session.getLength(),e=[];let s=0;for(let i=0;t>i;i++)s+=this.getLastColumnIndex(i),i>0&&(s+=1),e[i]=s;return e}getRowColumnIndices(t){const e=this.getLastColumnIndices();if(e[0]>=t)return{row:0,column:t};let s=1;for(let i=1;e.length>i;i++)t>e[i]&&(s=i+1);return{row:s,column:t-e[s-1]-1}}setSelectionRangeIndices(t,e){const s=this.getRowColumnIndices(t),i=this.getRowColumnIndices(e);this.instance.getSelection().setSelectionRange({start:s,end:i})}getIndexByRowColumn(t,e){return this.getLastColumnIndices()[t]-this.getLastColumnIndex(t)+e}init(t){const e=()=>{if(void 0!==this.instance||!this.aceExists())return;const e=this.j.c.div("jodit-source__mirror-fake");this.container.appendChild(e),this.instance=t.ow.ace.edit(e),this.instance.setTheme(t.o.sourceEditorNativeOptions.theme),this.instance.renderer.setShowGutter(t.o.sourceEditorNativeOptions.showGutter),this.instance.getSession().setMode(t.o.sourceEditorNativeOptions.mode),this.instance.setHighlightActiveLine(t.o.sourceEditorNativeOptions.highlightActiveLine),this.instance.getSession().setUseWrapMode(!0),this.instance.setOption("indentedSoftWrap",!1),this.instance.setOption("wrap",t.o.sourceEditorNativeOptions.wrap),this.instance.getSession().setUseWorker(!1),this.instance.$blockScrolling=1/0,this.instance.on("change",this.toWYSIWYG),this.instance.on("focus",this.proxyOnFocus),this.instance.on("mousedown",this.proxyOnMouseDown),t.getRealMode()!==a.MODE_WYSIWYG&&this.setValue(this.getValue());const s=this.j.async.debounce((()=>{t.isInDestruct||(this.instance.setOption("maxLines","auto"!==t.o.height?t.workplace.offsetHeight/this.instance.renderer.lineHeight:1/0),this.instance.resize())}),2*this.j.defaultTimeout);t.e.on("afterResize afterSetMode",s),s(),this.onReady()};t.e.on("afterSetMode",(()=>{t.getRealMode()!==a.MODE_SOURCE&&t.getMode()!==a.MODE_SPLIT||(this.fromWYSIWYG(),e())})),e(),this.aceExists()||(0,c.loadNext)(t,t.o.sourceEditorCDNUrlsJS).then((()=>{t.isInDestruct||e()}))}destruct(){var t,e;this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),null===(e=null===(t=this.j)||void 0===t?void 0:t.events)||void 0===e||e.off("aceInited.source")}setValue(t){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const e=this.j.e.fire("beautifyHTML",t);(0,c.isString)(e)&&(t=e)}this.instance.setValue(t),this.instance.clearSelection()}getValue(){return this.instance.getValue()}setReadOnly(t){this.instance.setReadOnly(t)}focus(){this.instance.focus()}getSelectionStart(){const t=this.instance.selection.getRange();return this.getIndexByRowColumn(t.start.row,t.start.column)}getSelectionEnd(){const t=this.instance.selection.getRange();return this.getIndexByRowColumn(t.end.row,t.end.column)}selectAll(){this.instance.selection.selectAll()}insertRaw(t){const e=this.instance.selection.getCursor(),s=this.instance.session.insert(e,t);this.instance.selection.setRange({start:e,end:s},!1)}setSelectionRange(t,e){this.setSelectionRangeIndices(t,e)}setPlaceHolder(t){}replaceUndoManager(){const{observer:t}=this.jodit;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec(){t.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec(){t.redo()}})}}function Ue(t,e,s,i,o){let r;switch(t){case"ace":if(!e.o.shadowRoot){r=new Ye(e,s,i,o);break}default:r=new Ve(e,s,i,o)}return r.init(e),r.onReadyAlways((()=>{r.setReadOnly(e.o.readonly)})),r}class Ge extends H{constructor(){super(...arguments),this.buttons=[{name:"source",group:"source"}],this.__lock=!1,this.__oldMirrorValue="",this.tempMarkerStart="{start-jodit-selection}",this.tempMarkerStartReg=/{start-jodit-selection}/g,this.tempMarkerEnd="{end-jodit-selection}",this.tempMarkerEndReg=/{end-jodit-selection}/g,this.selInfo=[],this.insertHTML=t=>{var e;null===(e=this.sourceEditor)||void 0===e||e.insertRaw(t),this.toWYSIWYG()},this.fromWYSIWYG=(t=!1)=>{if(!this.__lock||!0===t){this.__lock=!0;const t=this.j.getEditorValue(!1);t!==this.getMirrorValue()&&this.setMirrorValue(t),this.__lock=!1}},this.toWYSIWYG=()=>{if(this.__lock)return;const t=this.getMirrorValue();t!==this.__oldMirrorValue&&(this.__lock=!0,this.j.setEditorValue(t),this.__lock=!1,this.__oldMirrorValue=t)},this.getNormalPosition=(t,e)=>{let s=t;for(;s>0;){if(s--,"<"===e[s]&&void 0!==e[s+1]&&e[s+1].match(/[\w/]+/i))return s;if(">"===e[s])return t}return t},this.__clear=t=>t.replace(a.INVISIBLE_SPACE_REG_EXP(),""),this.selectAll=()=>{var t;null===(t=this.sourceEditor)||void 0===t||t.selectAll()},this.onSelectAll=t=>{if("selectall"===t.toLowerCase()&&this.j.getRealMode()===a.MODE_SOURCE)return this.selectAll(),!1},this.getSelectionStart=()=>{var t,e;return null!==(e=null===(t=this.sourceEditor)||void 0===t?void 0:t.getSelectionStart())&&void 0!==e?e:0},this.getSelectionEnd=()=>{var t,e;return null!==(e=null===(t=this.sourceEditor)||void 0===t?void 0:t.getSelectionEnd())&&void 0!==e?e:0},this.saveSelection=()=>{if(this.j.getRealMode()===a.MODE_WYSIWYG)this.selInfo=this.j.s.save()||[],this.j.setEditorValue(),this.fromWYSIWYG(!0);else{if(this.selInfo.length=0,this.j.o.editHTMLDocumentMode)return;const t=this.getMirrorValue();if(this.getSelectionStart()===this.getSelectionEnd()){const e=this.j.s.marker(!0);this.selInfo[0]={startId:e.id,collapsed:!0,startMarker:e.outerHTML};const s=this.getNormalPosition(this.getSelectionStart(),this.getMirrorValue());this.setMirrorValue(t.substr(0,s)+this.__clear(this.selInfo[0].startMarker)+t.substr(s))}else{const e=this.j.s.marker(!0),s=this.j.s.marker(!1);this.selInfo[0]={startId:e.id,endId:s.id,collapsed:!1,startMarker:this.__clear(e.outerHTML),endMarker:this.__clear(s.outerHTML)};const i=this.getNormalPosition(this.getSelectionStart(),t),o=this.getNormalPosition(this.getSelectionEnd(),t);this.setMirrorValue(t.substr(0,i)+this.selInfo[0].startMarker+t.substr(i,o-i)+this.selInfo[0].endMarker+t.substr(o))}this.toWYSIWYG()}},this.removeSelection=()=>{if(!this.selInfo.length)return;if(this.j.getRealMode()===a.MODE_WYSIWYG)return this.__lock=!0,this.j.s.restore(this.selInfo),void(this.__lock=!1);let t=this.getMirrorValue(),e=0,s=0;try{if(this.selInfo[0].startMarker&&(t=t.replace(/]+data-jodit-selection_marker="start"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerStart)),this.selInfo[0].endMarker&&(t=t.replace(/]+data-jodit-selection_marker="end"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerEnd)),!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const e=this.j.e.fire("beautifyHTML",t);(0,c.isString)(e)&&(t=e)}e=t.indexOf(this.tempMarkerStart),s=e,t=t.replace(this.tempMarkerStartReg,""),this.selInfo[0].collapsed&&-1!==e||(s=t.indexOf(this.tempMarkerEnd),-1===e&&(e=s)),t=t.replace(this.tempMarkerEndReg,"")}finally{t=t.replace(this.tempMarkerEndReg,"").replace(this.tempMarkerStartReg,"")}this.setMirrorValue(t),this.setMirrorSelectionRange(e,s),this.toWYSIWYG(),this.setFocusToMirror()},this.setMirrorSelectionRange=(t,e)=>{var s;null===(s=this.sourceEditor)||void 0===s||s.setSelectionRange(t,e)},this.onReadonlyReact=()=>{var t;null===(t=this.sourceEditor)||void 0===t||t.setReadOnly(this.j.o.readonly)}}getMirrorValue(){var t;return(null===(t=this.sourceEditor)||void 0===t?void 0:t.getValue())||""}setMirrorValue(t){var e;null===(e=this.sourceEditor)||void 0===e||e.setValue(t)}setFocusToMirror(){var t;null===(t=this.sourceEditor)||void 0===t||t.focus()}initSourceEditor(t){var e;if("area"!==t.o.sourceEditor){const e=Ue(t.o.sourceEditor,t,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG);e.onReadyAlways((()=>{var s,i;null===(s=this.sourceEditor)||void 0===s||s.destruct(),this.sourceEditor=e,this.fromWYSIWYG(!0),null===(i=t.events)||void 0===i||i.fire("sourceEditorReady",t)}))}else null===(e=this.sourceEditor)||void 0===e||e.onReadyAlways((()=>{var e;this.fromWYSIWYG(!0),null===(e=t.events)||void 0===e||e.fire("sourceEditorReady",t)}))}afterInit(t){if(this.mirrorContainer=t.c.div("jodit-source"),t.workplace.appendChild(this.mirrorContainer),t.e.on("afterAddPlace changePlace afterInit",(()=>{t.workplace.appendChild(this.mirrorContainer)})),this.sourceEditor=Ue("area",t,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG),(()=>{t.e.off("beforeSetMode.source afterSetMode.source").on("beforeSetMode.source",this.saveSelection).on("afterSetMode.source",this.removeSelection)})(),this.onReadonlyReact(),t.e.on("insertHTML.source",(e=>{if(!t.o.readonly&&!this.j.isEditorMode())return this.insertHTML(e),!1})).on("readonly.source",this.onReadonlyReact).on("placeholder.source",(t=>{var e;null===(e=this.sourceEditor)||void 0===e||e.setPlaceHolder(t)})).on("beforeCommand.source",this.onSelectAll).on("change.source",this.fromWYSIWYG),t.e.on("beautifyHTML",(t=>t)),t.o.beautifyHTML){const e=()=>{var e,s;const i=t.ow.html_beautify;return!(!i||t.isInDestruct||(null===(s=null===(e=t.events)||void 0===e?void 0:e.off("beautifyHTML"))||void 0===s||s.on("beautifyHTML",(t=>i(t))),0))};e()||(0,c.loadNext)(t,t.o.beautifyHTMLCDNUrlsJS).then(e)}this.fromWYSIWYG(),this.initSourceEditor(t)}beforeDestruct(t){this.sourceEditor&&(this.sourceEditor.destruct(),delete this.sourceEditor),S.i.safeRemove(this.mirrorContainer)}}n.D.prototype.showCharsCounter=!0,n.D.prototype.countHTMLChars=!1,n.D.prototype.showWordsCounter=!0;class Ke extends H{constructor(){super(...arguments),this.charCounter=null,this.wordCounter=null,this.reInit=()=>{this.j.o.showCharsCounter&&this.charCounter&&this.j.statusbar.append(this.charCounter,!0),this.j.o.showWordsCounter&&this.wordCounter&&this.j.statusbar.append(this.wordCounter,!0),this.j.e.off("change keyup",this.calc).on("change keyup",this.calc),this.calc()},this.calc=this.j.async.throttle((()=>{const t=this.j.text;if(this.j.o.showCharsCounter&&this.charCounter){const e=this.j.o.countHTMLChars?this.j.value:t.replace((0,a.SPACE_REG_EXP)(),"");this.charCounter.textContent=this.j.i18n("Chars: %d",e.length)}this.j.o.showWordsCounter&&this.wordCounter&&(this.wordCounter.textContent=this.j.i18n("Words: %d",t.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((t=>t.length)).length))}),this.j.defaultTimeout)}afterInit(){this.charCounter=this.j.c.span(),this.wordCounter=this.j.c.span(),this.j.e.on("afterInit changePlace afterAddPlace",this.reInit),this.reInit()}beforeDestruct(){S.i.safeRemove(this.charCounter),S.i.safeRemove(this.wordCounter),this.j.e.off("afterInit changePlace afterAddPlace",this.reInit),this.charCounter=null,this.wordCounter=null}}n.D.prototype.toolbarSticky=!0,n.D.prototype.toolbarDisableStickyForMobile=!0,n.D.prototype.toolbarStickyOffset=0;class Xe extends H{constructor(){super(...arguments),this.isToolbarSticked=!1,this.createDummy=t=>{a.IS_IE&&!this.dummyBox&&(this.dummyBox=this.j.c.div(),this.dummyBox.classList.add("jodit_sticky-dummy_toolbar"),this.j.container.insertBefore(this.dummyBox,t))},this.addSticky=t=>{this.isToolbarSticked||(this.createDummy(t),this.j.container.classList.add("jodit_sticky"),this.isToolbarSticked=!0),(0,c.css)(t,{top:this.j.o.toolbarStickyOffset||null,width:this.j.container.offsetWidth-2}),a.IS_IE&&this.dummyBox&&(0,c.css)(this.dummyBox,{height:t.offsetHeight})},this.removeSticky=t=>{this.isToolbarSticked&&((0,c.css)(t,{width:"",top:""}),this.j.container.classList.remove("jodit_sticky"),this.isToolbarSticked=!1)}}afterInit(t){t.e.on(t.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).on("getStickyState.sticky",(()=>this.isToolbarSticked))}onScroll(){const{jodit:t}=this,e=t.ow.pageYOffset||t.od.documentElement&&t.od.documentElement.scrollTop||0,s=(0,c.offset)(t.container,t,t.od,!0),i=t.getMode()===a.MODE_WYSIWYG&&e+t.o.toolbarStickyOffset>s.top&&s.top+s.height>e+t.o.toolbarStickyOffset&&!(t.o.toolbarDisableStickyForMobile&&this.isMobile());if(t.o.toolbarSticky&&!0===t.o.toolbar&&this.isToolbarSticked!==i){const e=t.toolbarContainer;e&&(i?this.addSticky(e):this.removeSticky(e)),t.e.fire("toggleSticky",i)}}isMobile(){return this.j&&this.j.options&&this.j.container&&this.j.o.sizeSM>=this.j.container.offsetWidth}beforeDestruct(t){this.dummyBox&&S.i.safeRemove(this.dummyBox),t.e.off(t.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).off(".sticky")}}(0,r.__decorate)([(0,j.throttle)()],Xe.prototype,"onScroll",null),n.D.prototype.usePopupForSpecialCharacters=!1,n.D.prototype.specialCharacters=["!",""","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","»","¬","®","¯","°","²","³","´","µ","¶","·","¸","¹","º","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"],n.D.prototype.controls.symbol={icon:"omega",hotkeys:["ctrl+shift+i","cmd+shift+i"],tooltip:"Insert Special Character",popup(t,e,s,i){const o=t.e.fire("generateSpecialCharactersTable.symbols");if(o){if(t.o.usePopupForSpecialCharacters){const e=t.c.div();return e.classList.add("jodit-symbols"),e.appendChild(o),t.e.on(o,"close_dialog",i),e}{A(o,t.i18n("Select Special Character"),void 0,"jodit-symbols").bindDestruct(t);const e=o.querySelector("a");e&&e.focus()}}}};class Je extends H{constructor(){super(...arguments),this.buttons=[{name:"symbol",group:"insert"}],this.countInRow=17}afterInit(t){t.e.on("generateSpecialCharactersTable.symbols",(()=>{const e=t.c.fromHTML('
'),s=e.querySelector(".jodit-symbols__preview"),i=e.querySelector("table").tBodies[0],o=[];for(let e=0;t.o.specialCharacters.length>e;){const s=t.c.element("tr");for(let i=0;this.countInRow>i&&t.o.specialCharacters.length>e;i+=1,e+=1){const r=t.c.element("td"),n=t.c.fromHTML(`${t.o.specialCharacters[e]}`);o.push(n),r.appendChild(n),s.appendChild(r)}i.appendChild(s)}const r=this;return t.e.on(o,"focus",(function(){s.innerHTML=this.innerHTML})).on(o,"mousedown",(function(e){S.i.isTag(this,"a")&&(t.s.focus(),t.s.insertHTML(this.innerHTML),t.e.fire(this,"close_dialog"),e&&e.preventDefault(),e&&e.stopImmediatePropagation())})).on(o,"mouseenter",(function(){S.i.isTag(this,"a")&&this.focus()})).on(o,"keydown",(e=>{const s=e.target;if(S.i.isTag(s,"a")){const i=parseInt((0,Nt.Lj)(s,"-index")||"0",10),n=parseInt((0,Nt.Lj)(s,"data-index-j")||"0",10);let l;switch(e.key){case a.KEY_UP:case a.KEY_DOWN:l=e.key===a.KEY_UP?i-r.countInRow:i+r.countInRow,void 0===o[l]&&(l=e.key===a.KEY_UP?Math.floor(o.length/r.countInRow)*r.countInRow+n:n,l>o.length-1&&(l-=r.countInRow)),o[l]&&o[l].focus();break;case a.KEY_RIGHT:case a.KEY_LEFT:l=e.key===a.KEY_LEFT?i-1:i+1,void 0===o[l]&&(l=e.key===a.KEY_LEFT?o.length-1:0),o[l]&&o[l].focus();break;case a.KEY_ENTER:t.e.fire(s,"mousedown"),e.stopImmediatePropagation(),e.preventDefault()}}})),e}))}beforeDestruct(t){t.e.off("generateSpecialCharactersTable.symbols")}}n.D.prototype.table={allowCellSelection:!0,selectionCellStyle:"border: 1px double #1e88e5 !important;",allowCellResize:!0,useExtraClassesOptions:!1},n.D.prototype.controls.table={data:{cols:10,rows:10,classList:{"table table-bordered":"Bootstrap Bordered","table table-striped":"Bootstrap Striped","table table-dark":"Bootstrap Dark"}},popup(t,e,s,i,o){const r=s.data&&s.data.rows?s.data.rows:10,n=s.data&&s.data.cols?s.data.cols:10,a=t.c.fromHTML('
'+(()=>{if(!t.o.table.useExtraClassesOptions)return"";const e=[];if(s.data){const t=s.data.classList;Object.keys(t).forEach((s=>{e.push(``)}))}return e.join("")})()+'
'),l=a.querySelectorAll("span")[0],h=a.querySelectorAll("span")[1],d=a.querySelector(".jodit-form__container"),u=a.querySelector(".jodit-form__options"),p=[],f=r*n;for(let e=0;f>e;e+=1)p[e]||p.push(t.c.element("span",{dataIndex:e}));if(t.e.on(d,"mousemove",((t,e)=>{const s=t.target;if(!S.i.isTag(s,"span"))return;const i=void 0===e||isNaN(e)?parseInt((0,Nt.Lj)(s,"-index")||"0",10):e||0,o=Math.ceil((i+1)/n),r=i%n+1;for(let t=0;p.length>t;t+=1)p[t].className=t%n+1>r||Math.ceil((t+1)/n)>o?"":"jodit_hovered";h.textContent=""+r,l.textContent=""+o})).on(d,"touchstart mousedown",(e=>{const s=e.target;if(e.preventDefault(),e.stopImmediatePropagation(),!S.i.isTag(s,"span"))return;const o=parseInt((0,Nt.Lj)(s,"-index")||"0",10),r=Math.ceil((o+1)/n),a=o%n+1,l=t.createInside,h=l.element("tbody"),d=l.element("table");d.appendChild(h),d.style.width="100%";let p,f,m=null;for(let t=1;r>=t;t+=1){p=l.element("tr");for(let t=1;a>=t;t+=1)f=l.element("td"),m||(m=f),f.appendChild(l.element("br")),p.appendChild(l.text("\n")),p.appendChild(l.text("\t")),p.appendChild(f);h.appendChild(l.text("\n")),h.appendChild(p)}const g=t.s.current();if(g&&t.s.isCollapsed()){const e=S.i.closest(g,(e=>S.i.isBlock(e,t.ew)),t.editor);e&&e!==t.editor&&!e.nodeName.match(/^TD|TH|TBODY|TABLE|THEADER|TFOOTER$/)&&t.s.setCursorAfter(e)}(0,c.$$)("input[type=checkbox]:checked",u).forEach((t=>{t.value.split(/[\s]+/).forEach((t=>{d.classList.add(t)}))})),t.s.insertNode(l.text("\n")),t.s.insertNode(d,!1),m&&(t.s.setCursorIn(m),(0,c.scrollIntoViewIfNeeded)(m,t.editor,t.ed)),i()})),o&&o.parentElement){for(let e=0;r>e;e+=1){const s=t.c.div();for(let t=0;n>t;t+=1)s.appendChild(p[e*n+t]);d.appendChild(s)}p[0]&&(p[0].className="hovered")}return a},tooltip:"Insert table"};const Ze="table_processor_observer-resize";class Qe extends H{constructor(){super(...arguments),this.selectMode=!1,this.resizeDelta=0,this.createResizeHandle=()=>{this.resizeHandler||(this.resizeHandler=this.j.c.div("jodit-table-resizer"),this.j.e.on(this.resizeHandler,"mousedown.table touchstart.table",this.onHandleMouseDown).on(this.resizeHandler,"mouseenter.table",(()=>{this.j.async.clearTimeout(this.hideTimeout)})))},this.hideTimeout=0,this.drag=!1,this.minX=0,this.maxX=0,this.startX=0}get module(){return this.j.getInstance("Table",this.j.o)}get isRTL(){return"rtl"===this.j.o.direction}showResizeHandle(){this.j.async.clearTimeout(this.hideTimeout),this.j.workplace.appendChild(this.resizeHandler)}hideResizeHandle(){this.hideTimeout=this.j.async.setTimeout((()=>{S.i.safeRemove(this.resizeHandler)}),{timeout:this.j.defaultTimeout,label:"hideResizer"})}onHandleMouseDown(t){if(this.j.isLocked)return;this.drag=!0,this.j.e.on(this.j.ow,"mouseup.resize-cells touchend.resize-cells",this.onMouseUp).on(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.startX=t.clientX,this.j.lock(Ze),this.resizeHandler.classList.add("jodit-table-resizer_moved");let e,s=this.workTable.getBoundingClientRect();if(this.minX=0,this.maxX=1e6,null!=this.wholeTable)s=this.workTable.parentNode.getBoundingClientRect(),this.minX=s.left,this.maxX=this.minX+s.width;else{const t=Ct.formalCoordinate(this.workTable,this.workCell,!0);Ct.formalMatrix(this.workTable,((s,i,o)=>{t[1]===o&&(e=s.getBoundingClientRect(),this.minX=Math.max(e.left+a.NEARBY/2,this.minX)),t[1]+(this.isRTL?-1:1)===o&&(e=s.getBoundingClientRect(),this.maxX=Math.min(e.left+e.width-a.NEARBY/2,this.maxX))}))}return!1}onMouseMove(t){if(!this.drag)return;this.j.e.fire("closeAllPopups");let e=t.clientX;const s=(0,c.offset)(this.resizeHandler.parentNode||this.j.od.documentElement,this.j,this.j.od,!0);this.minX>e&&(e=this.minX),e>this.maxX&&(e=this.maxX),this.resizeDelta=e-this.startX+(this.j.o.iframe?s.left:0),this.resizeHandler.style.left=e-(this.j.o.iframe?0:s.left)+"px";const i=this.j.s.sel;i&&i.removeAllRanges()}onMouseUp(t){(this.selectMode||this.drag)&&(this.selectMode=!1,this.j.unlock()),this.resizeHandler&&this.drag&&(this.drag=!1,this.j.e.off(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.resizeHandler.classList.remove("jodit-table-resizer_moved"),this.startX!==t.clientX&&(null==this.wholeTable?this.resizeColumns():this.resizeTable()),this.j.setEditorValue(),this.j.s.focus())}resizeColumns(){const t=this.resizeDelta,e=[];Ct.setColumnWidthByDelta(this.workTable,Ct.formalCoordinate(this.workTable,this.workCell,!0)[1],t,!0,e);const s=(0,c.call)(this.isRTL?S.i.prev:S.i.next,this.workCell,(t=>S.i.isCell(t,this.j.ew)),this.workCell.parentNode);Ct.setColumnWidthByDelta(this.workTable,Ct.formalCoordinate(this.workTable,s)[1],-t,!1,e)}resizeTable(){const t=this.resizeDelta*(this.isRTL?-1:1),e=this.workTable.offsetWidth,s=(0,c.getContentWidth)(this.workTable.parentNode,this.j.ew),i=!this.wholeTable;if(this.isRTL?!i:i)this.workTable.style.width=(e+t)/s*100+"%";else{const i=this.isRTL?"marginRight":"marginLeft",o=parseInt(this.j.ew.getComputedStyle(this.workTable)[i]||"0",10);this.workTable.style.width=(e-t)/s*100+"%",this.workTable.style[i]=(o+t)/s*100+"%"}}setWorkCell(t,e=null){this.wholeTable=e,this.workCell=t,this.workTable=S.i.up(t,(t=>S.i.isTag(t,"table")),this.j.editor)}calcHandlePosition(t,e,s=0,i=0){const o=(0,c.offset)(e,this.j,this.j.ed);if(s>a.NEARBY&&o.width-a.NEARBY>s)return void this.hideResizeHandle();const r=(0,c.offset)(this.j.workplace,this.j,this.j.od,!0),n=(0,c.offset)(t,this.j,this.j.ed);if(this.resizeHandler.style.left=(s>a.NEARBY?o.left+o.width:o.left)-r.left+i+"px",Object.assign(this.resizeHandler.style,{height:n.height+"px",top:n.top-r.top+"px"}),this.showResizeHandle(),s>a.NEARBY){const t=(0,c.call)(this.isRTL?S.i.prev:S.i.next,e,(t=>S.i.isCell(t,this.j.ew)),e.parentNode);this.setWorkCell(e,!!t&&null)}else{const t=(0,c.call)(this.isRTL?S.i.next:S.i.prev,e,(t=>S.i.isCell(t,this.j.ew)),e.parentNode);this.setWorkCell(t||e,!t||null)}}afterInit(t){t.o.table.allowCellResize&&t.e.off(this.j.ow,".resize-cells").off(".resize-cells").on("change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells",(()=>{(0,c.$$)("table",t.editor).forEach(this.observe)})).on(this.j.ow,"scroll.resize-cells",(()=>{if(!this.drag)return;const e=S.i.up(this.workCell,(t=>S.i.isTag(t,"table")),t.editor);if(e){const t=e.getBoundingClientRect();this.resizeHandler.style.top=t.top+"px"}})).on("beforeSetMode.resize-cells",(()=>{this.module.getAllSelectedCells().forEach((e=>{this.module.removeSelection(e),Ct.normalizeTable(S.i.closest(e,"table",t.editor))}))}))}observe(t){(0,c.dataBind)(t,Ze)||((0,c.dataBind)(t,Ze,!0),this.j.e.on(t,"mouseleave.resize-cells",(t=>{this.resizeHandler&&this.resizeHandler!==t.relatedTarget&&this.hideResizeHandle()})).on(t,"mousemove.resize-cells touchmove.resize-cells",(e=>{if(this.j.isLocked)return;const s=S.i.up(e.target,(t=>S.i.isCell(t,this.j.ew)),t);s&&this.calcHandlePosition(t,s,e.offsetX)})),this.createResizeHandle())}beforeDestruct(t){t.events&&(t.e.off(this.j.ow,".resize-cells"),t.e.off(".resize-cells"))}}(0,r.__decorate)([j.autobind],Qe.prototype,"onHandleMouseDown",null),(0,r.__decorate)([j.autobind],Qe.prototype,"onMouseMove",null),(0,r.__decorate)([j.autobind],Qe.prototype,"onMouseUp",null),(0,r.__decorate)([j.autobind],Qe.prototype,"observe",null);const ts="table_processor_observer";class es extends H{constructor(){super(...arguments),this.selectedCell=null}get module(){return this.j.getInstance("Table",this.j.o)}afterInit(t){t.o.table.allowCellSelection&&t.e.on(this.j.ow,"click.select-cells",this.onRemoveSelection).on("keydown.select-cells",(t=>{t.key===a.KEY_TAB&&this.unselectCells()})).on("beforeCommand.select-cells",this.onExecCommand).on("afterCommand.select-cells",this.onAfterCommand).on("change afterCommand afterSetMode click afterInit".split(" ").map((t=>t+".select-cells")).join(" "),(()=>{(0,c.$$)("table",t.editor).forEach(this.observe)}))}observe(t){(0,c.dataBind)(t,ts)||(this.onRemoveSelection(),(0,c.dataBind)(t,ts,!0),this.j.e.on(t,"mousedown.select-cells touchstart.select-cells",this.onStartSelection.bind(this,t)))}onStartSelection(t,e){if(this.j.o.readonly)return;this.unselectCells();const s=S.i.closest(e.target,["td","th"],t);s&&(s.firstChild||s.appendChild(this.j.createInside.element("br")),this.selectedCell=s,this.module.addSelection(s),this.j.e.on(t,"mousemove.select-cells touchmove.select-cells",this.onMove.bind(this,t)).on(t,"mouseup.select-cells touchend.select-cells",this.onStopSelection.bind(this,t)),this.j.e.fire("showPopup",t,(()=>(0,c.position)(s,this.j)),"cells"))}onMove(t,e){if(this.j.o.readonly)return;if(this.j.isLockedNotBy(ts))return;const s=this.j.ed.elementFromPoint(e.clientX,e.clientY);if(!s)return;const i=S.i.closest(s,["td","th"],t);if(!i||!this.selectedCell)return;i!==this.selectedCell&&this.j.lock(ts),this.unselectCells(t);const o=Ct.getSelectedBound(t,[i,this.selectedCell]),r=Ct.formalMatrix(t);for(let t=o[0][0];o[1][0]>=t;t+=1)for(let e=o[0][1];o[1][1]>=e;e+=1)this.module.addSelection(r[t][e]);this.j.e.fire("hidePopup"),e.stopPropagation(),(()=>{const t=this.j.createInside.fromHTML('
 
');i.appendChild(t),this.j.async.setTimeout((()=>{var e;null===(e=t.parentNode)||void 0===e||e.removeChild(t)}),this.j.defaultTimeout/5)})()}onRemoveSelection(t){var e;if(!(null===(e=null==t?void 0:t.buffer)||void 0===e?void 0:e.actionTrigger)&&!this.selectedCell&&this.module.getAllSelectedCells().length)return this.j.unlock(),this.unselectCells(),void this.j.e.fire("hidePopup","cells");this.selectedCell=null}onStopSelection(t,e){if(!this.selectedCell)return;this.j.unlock();const s=this.j.ed.elementFromPoint(e.clientX,e.clientY);if(!s)return;const i=S.i.closest(s,["td","th"],t);if(!i)return;const o=S.i.closest(i,"table",t);if(o&&o!==t)return;const r=Ct.getSelectedBound(t,[i,this.selectedCell]),n=Ct.formalMatrix(t),a=n[r[1][0]][r[1][1]],l=n[r[0][0]][r[0][1]];this.j.e.fire("showPopup",t,(()=>{const t=(0,c.position)(l,this.j),e=(0,c.position)(a,this.j);return{left:t.left,top:t.top,width:e.left-t.left+e.width,height:e.top-t.top+e.height}}),"cells"),(0,c.$$)("table",this.j.editor).forEach((t=>{this.j.e.off(t,"mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells")}))}unselectCells(t,e){const s=this.module,i=s.getAllSelectedCells();i.length&&i.forEach((t=>{e&&e===t||s.removeSelection(t)}))}onExecCommand(t){if(/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(t)){t=t.replace("table","");const e=this.module.getAllSelectedCells();if(e.length){const s=e.shift();if(!s)return;const i=S.i.closest(s,"table",this.j.editor);if(!i)return;switch(t){case"splitv":Ct.splitVertical(i,this.j);break;case"splitg":Ct.splitHorizontal(i,this.j);break;case"merge":Ct.mergeSelected(i,this.j);break;case"empty":e.forEach((t=>t.innerHTML=""));break;case"bin":S.i.safeRemove(i);break;case"binrow":Ct.removeRow(i,s.parentNode.rowIndex);break;case"bincolumn":Ct.removeColumn(i,s.cellIndex);break;case"addcolumnafter":case"addcolumnbefore":Ct.appendColumn(i,s.cellIndex,"addcolumnafter"===t,this.j.createInside);break;case"addrowafter":case"addrowbefore":Ct.appendRow(i,s.parentNode,"addrowafter"===t,this.j.createInside)}}return!1}}onAfterCommand(t){/^justify/.test(t)&&this.module.getAllSelectedCells().forEach((e=>Se(t,e,this.j)))}beforeDestruct(t){this.onRemoveSelection(),t.e.off(".select-cells")}}function ss(t){t.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(e=>{let s,i;if(e.key!==a.KEY_TAB&&e.key!==a.KEY_LEFT&&e.key!==a.KEY_RIGHT&&e.key!==a.KEY_UP&&e.key!==a.KEY_DOWN)return;{if(s=t.s.current(),i=S.i.up(s,(t=>t&&t.nodeName&&/^td|th$/i.test(t.nodeName)),t.editor),!i)return;const o=t.s.range;if(e.key!==a.KEY_TAB&&s!==i&&((e.key===a.KEY_LEFT||e.key===a.KEY_UP)&&(S.i.prev(s,(t=>e.key===a.KEY_UP?S.i.isTag(t,"br"):!!t),i)||e.key!==a.KEY_UP&&S.i.isText(s)&&0!==o.startOffset)||(e.key===a.KEY_RIGHT||e.key===a.KEY_DOWN)&&(S.i.next(s,(t=>e.key===a.KEY_DOWN?S.i.isTag(t,"br"):!!t),i)||e.key!==a.KEY_DOWN&&S.i.isText(s)&&s.nodeValue&&o.startOffset!==s.nodeValue.length)))return}const o=S.i.up(i,(t=>t&&/^table$/i.test(t.nodeName)),t.editor);let r=null;switch(e.key){case a.KEY_TAB:case a.KEY_LEFT:{const s=e.key===a.KEY_LEFT||e.shiftKey?"prev":"next";r=S.i[s](i,(t=>t&&/^td|th$/i.test(t.tagName)),o),r||(Ct.appendRow(o,"next"!==s&&o.querySelector("tr"),"next"===s,t.createInside),r=S.i[s](i,(e=>e&&S.i.isCell(e,t.ew)),o));break}case a.KEY_UP:case a.KEY_DOWN:{let t=0,s=0;const n=Ct.formalMatrix(o,((e,o,r)=>{e===i&&(t=o,s=r)}));e.key===a.KEY_UP?void 0!==n[t-1]&&(r=n[t-1][s]):void 0!==n[t+1]&&(r=n[t+1][s])}}if(r){if(r.firstChild)e.key===a.KEY_TAB?t.s.select(r,!0):t.s.setCursorIn(r,e.key===a.KEY_RIGHT||e.key===a.KEY_DOWN);else{const e=t.createInside.element("br");r.appendChild(e),t.s.setCursorBefore(e)}return!1}}))}function is(t){t.registerButton({name:"table",group:"insert"})}(0,r.__decorate)([j.autobind],es.prototype,"observe",null),(0,r.__decorate)([j.autobind],es.prototype,"onRemoveSelection",null),(0,r.__decorate)([j.autobind],es.prototype,"onStopSelection",null),(0,r.__decorate)([j.autobind],es.prototype,"onExecCommand",null),(0,r.__decorate)([j.autobind],es.prototype,"onAfterCommand",null);class os extends H{constructor(){super(...arguments),this.isOpened=!1,this.delayShowTimeout=0}afterInit(t){this.container=t.c.div("jodit-tooltip"),(0,C.ZO)(this.j,os).appendChild(this.container);let e=0;t.e.off(".tooltip").on("showTooltip.tooltip",((s,i)=>{t.async.clearTimeout(e),this.open(s,i)})).on("delayShowTooltip.tooltip",this.delayOpen).on("escape.tooltip",this.close).on("hideTooltip.tooltip change.tooltip scroll.tooltip changePlace.tooltip hidePopup.tooltip closeAllPopups.tooltip",(()=>{this.j.async.clearTimeout(this.delayShowTimeout),e=t.async.setTimeout(this.close,this.j.defaultTimeout)}))}delayOpen(t,e){const s=this.j.o.showTooltipDelay||this.j.defaultTimeout;this.j.async.clearTimeout(this.delayShowTimeout),this.delayShowTimeout=this.j.async.setTimeout((()=>this.open(t,e)),{timeout:s,label:"tooltip"})}open(t,e){this.container.classList.add("jodit-tooltip_visible"),this.container.innerHTML=e,this.isOpened=!0,this.setPosition(t)}setPosition(t){const e=t();(0,c.css)(this.container,{left:e.x,top:e.y})}close(){this.j.async.clearTimeout(this.delayShowTimeout),this.isOpened&&(this.isOpened=!1,this.container.classList.remove("jodit-tooltip_visible"),(0,c.css)(this.container,{left:-5e3}))}beforeDestruct(t){null==t||t.e.off(".tooltip"),this.close(),S.i.safeRemove(this.container)}}function rs(t){t.registerButton({name:"preview"})}function ns(t){t.registerButton({name:"print"})}(0,r.__decorate)([j.autobind],os.prototype,"delayOpen",null),(0,r.__decorate)([j.autobind],os.prototype,"close",null),n.D.prototype.controls.preview={icon:"eye",exec(t){const e=t.getInstance("Dialog",{language:t.o.language,theme:t.o.theme}),s=t.c.div();if((0,c.css)(s,{padding:16}),t.iframe){const i=t.create.element("iframe");(0,c.css)(i,{minWidth:800,minHeight:600,border:0}),s.appendChild(i),e.open(s,t.i18n("Preview"));const o=i.contentWindow;o&&(t.e.fire("generateDocumentStructure.iframe",o.document,t),o.document.body.innerHTML=t.value)}else(0,c.css)(s,{minWidth:1024,minHeight:600,border:0}),s.innerHTML=t.value,e.open(s,t.i18n("Preview"));e.setModal(!0)},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Preview"},n.D.prototype.controls.print={exec(t){const e=t.create.element("iframe");Object.assign(e.style,{position:"fixed",right:0,bottom:0,width:0,height:0,border:0}),(0,C.ZO)(t,n.D).appendChild(e);const s=()=>{t.e.off(t.ow,"mousemove",s),S.i.safeRemove(e)},i=e.contentWindow;i&&(t.e.on(i,"onbeforeunload onafterprint",s).on(t.ow,"mousemove",s),t.o.iframe?(t.e.fire("generateDocumentStructure.iframe",i.document,t),i.document.body.innerHTML=t.value):(i.document.write(''+t.value+""),i.document.close()),i.focus(),i.print())},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Print"},n.D.prototype.showXPathInStatusbar=!0;class as extends H{constructor(){super(...arguments),this.onContext=(t,e)=>(this.menu||(this.menu=new g(this.j)),this.menu.show(e.clientX,e.clientY,[{icon:"bin",title:t===this.j.editor?"Clear":"Remove",exec:()=>{t!==this.j.editor?S.i.safeRemove(t):this.j.value="",this.j.setEditorValue()}},{icon:"select-all",title:"Select",exec:()=>{this.j.s.select(t)}}]),!1),this.onSelectPath=(t,e)=>{this.j.s.focus();const s=(0,c.attr)(e.target,"-path")||"/";if("/"===s)return this.j.execCommand("selectall"),!1;try{const t=this.j.ed.evaluate(s,this.j.editor,null,XPathResult.ANY_TYPE,null).iterateNext();if(t)return this.j.s.select(t),!1}catch(t){}return this.j.s.select(t),!1},this.tpl=(t,e,s,i)=>{const o=this.j.c.fromHTML(`${(0,c.trim)(s)}`),r=o.firstChild;return this.j.e.on(r,"click",this.onSelectPath.bind(this,t)).on(r,"contextmenu",this.onContext.bind(this,t)),o},this.removeSelectAll=()=>{this.selectAllButton&&(this.selectAllButton.destruct(),delete this.selectAllButton)},this.appendSelectAll=()=>{this.removeSelectAll(),this.selectAllButton=P(this.j,{name:"selectall",...this.j.o.controls.selectall}),this.selectAllButton.state.size="tiny",this.container&&this.container.insertBefore(this.selectAllButton.container,this.container.firstChild)},this.calcPathImd=()=>{if(this.isDestructed)return;const t=this.j.s.current();if(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),t){let e,s,i;S.i.up(t,(t=>{t&&this.j.editor!==t&&!S.i.isText(t)&&(e=t.nodeName.toLowerCase(),s=(0,c.getXPathByElement)(t,this.j.editor).replace(/^\//,""),i=this.tpl(t,s,e,this.j.i18n("Select %s",e)),this.container&&this.container.insertBefore(i,this.container.firstChild))}),this.j.editor)}this.appendSelectAll()},this.calcPath=this.j.async.debounce(this.calcPathImd,2*this.j.defaultTimeout)}afterInit(){this.j.o.showXPathInStatusbar&&(this.container=this.j.c.div("jodit-xpath"),this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath",this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath",(()=>{this.j.o.showXPathInStatusbar&&this.container&&(this.j.statusbar.append(this.container),this.j.getRealMode()===a.MODE_WYSIWYG?this.calcPath():(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),this.appendSelectAll()))})),this.calcPath())}beforeDestruct(){this.j&&this.j.events&&this.j.e.off(".xpath"),this.removeSelectAll(),this.menu&&this.menu.destruct(),S.i.safeRemove(this.container),delete this.menu,delete this.container}}var ls=s(47),cs=s(48),hs=s(49),ds=s(50),us=s(51),ps=s(52),fs=s(53),ms=s(54),gs=s(55),vs=s(56),bs=s(57),ws=s(58),ys=s(59),_s=s(60),Cs=s(61),js=s(62),xs=s(63),Es=s(64),Ss=s(65),ks=s(66),Ts=s(67),Is=s(68),qs=s(69),Ls=s(70),zs=s(71),Ms=s(72),Ps=s(73),Ds=s(74),Ns=s(75),Rs=s(76),As=s(77),Bs=s(78),Os=s(79),Hs=s(80),Fs=s(81),Ws=s(82),$s=s(83),Vs=s(84),Ys=s(85),Us=s(86),Gs=s(87),Ks=s(88),Xs=s(89),Js=s(90),Zs=s(91),Qs=s(92),ti=s(93),ei=s(94),si=s(95),ii=s(96),oi=s(97),ri=s(98),ni=s(99),ai=s(100),li=s(101),ci=s(102),hi=s(103),di=s(104),ui=s(105),pi=s(106),fi=s(107),mi=s(108),gi=s(109),vi=s(110),bi=s(111),wi=s(112),yi=s(113),_i=s(114),Ci=s(115),ji=s(116),xi=s(117),Ei=s(118),Si=s(119),ki=s(120),Ti=s(121),Ii=s(122),qi=s(123),Li=s(124),zi=s(125),Mi=s(126),Pi=s(127);Object.keys(a).forEach((t=>{Jodit[t]=a[t]}));const Di=t=>"__esModule"!==t;Object.keys(o).filter(Di).forEach((t=>{k.JO.set(t.replace("_","-"),o[t])})),Object.keys(t).filter(Di).forEach((e=>{Jodit.modules[e]=t[e]})),Object.keys(j).filter(Di).forEach((t=>{Jodit.decorators[t]=j[t]})),["Confirm","Alert","Prompt"].forEach((e=>{Jodit[e]=t[e]})),Object.keys(e).filter(Di).forEach((t=>{Jodit.plugins.add(t,e[t])})),Object.keys(qt).filter(Di).forEach((t=>{Jodit.lang[t]=qt[t]}));const Ni=Jodit})(),i})()})); \ No newline at end of file +((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}})(self,(function(){return(()=>{var t=[,(t,e,s)=>{"use strict";s.d(e,{D:()=>o});var i=s(2);class o{constructor(){this.namespace="",this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window:null,this.shadowRoot=null,this.zIndex=0,this.readonly=!1,this.disabled=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots","selectall"],this.toolbarButtonSize="middle",this.allowTabNavigation=!1,this.inline=!1,this.theme="default",this.saveModeInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n=!1,this.tabIndex=-1,this.toolbar=!0,this.statusbar=!0,this.showTooltip=!0,this.showTooltipDelay=1e3,this.useNativeTooltip=!1,this.enter=i.PARAGRAPH,this.enterBlock="br"!==this.enter?this.enter:i.PARAGRAPH,this.defaultMode=i.MODE_WYSIWYG,this.useSplitMode=!1,this.colors={greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]},this.colorPickerDefaultTab="background",this.imageDefaultWidth=300,this.removeButtons=[],this.disablePlugins=[],this.extraPlugins=[],this.extraButtons=[],this.extraIcons={},this.createAttributes={},this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=[{group:"source",buttons:[]},{group:"font-style",buttons:[]},{group:"script",buttons:[]},{group:"list",buttons:["ul","ol"]},{group:"indent",buttons:[]},{group:"font",buttons:[]},{group:"color",buttons:[]},{group:"media",buttons:[]},"\n",{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}],this.buttonsMD=["source","|","bold","italic","|","ul","ol","eraser","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","\n","undo","redo","|","hr","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","eraser","|","fontsize","brush","paragraph","|","image","table","\n","link","|","align","|","undo","redo","|","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","eraser","\n","align","|","undo","redo","|","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!0}static get defaultOptions(){return o.__defaultOptions||(o.__defaultOptions=new o),o.__defaultOptions}}o.prototype.controls={}},(t,e,s)=>{"use strict";s.r(e),s.d(e,{INVISIBLE_SPACE:()=>i,NBSP_SPACE:()=>o,INVISIBLE_SPACE_REG_EXP:()=>r,INVISIBLE_SPACE_REG_EXP_END:()=>n,INVISIBLE_SPACE_REG_EXP_START:()=>a,SPACE_REG_EXP:()=>l,SPACE_REG_EXP_START:()=>c,SPACE_REG_EXP_END:()=>h,IS_BLOCK:()=>d,IS_INLINE:()=>u,INSEPARABLE_TAGS:()=>p,MAY_BE_REMOVED_WITH_KEY:()=>f,KEY_BACKSPACE:()=>m,KEY_TAB:()=>g,KEY_ENTER:()=>v,KEY_ESC:()=>b,KEY_LEFT:()=>w,KEY_UP:()=>y,KEY_RIGHT:()=>_,KEY_DOWN:()=>C,KEY_SPACE:()=>j,KEY_DELETE:()=>x,KEY_F3:()=>E,NEARBY:()=>S,ACCURACY:()=>k,COMMAND_KEYS:()=>T,BR:()=>I,PARAGRAPH:()=>q,MODE_WYSIWYG:()=>L,MODE_SOURCE:()=>z,MODE_SPLIT:()=>M,IS_IE:()=>P,TEXT_PLAIN:()=>D,TEXT_HTML:()=>N,MARKER_CLASS:()=>R,EMULATE_DBLCLICK_TIMEOUT:()=>A,INSERT_AS_HTML:()=>B,INSERT_CLEAR_HTML:()=>O,INSERT_AS_TEXT:()=>H,INSERT_ONLY_TEXT:()=>F,SAFE_COUNT_CHANGE_CALL:()=>W,IS_MAC:()=>$,KEY_ALIASES:()=>V,BASE_PATH:()=>Y});const i="\ufeff",o=" ",r=()=>/[\uFEFF]/g,n=()=>/[\uFEFF]+$/g,a=()=>/^[\uFEFF]+/g,l=()=>/[\s\n\t\r\uFEFF\u200b]+/g,c=()=>/^[\s\n\t\r\uFEFF\u200b]+/g,h=()=>/[\s\n\t\r\uFEFF\u200b]+$/g,d=/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i,u=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i,p=["img","br","video","iframe","script","input","textarea","hr","link","jodit","jodit-media"],f=RegExp(`^${p.join("|")}$`,"i"),m="Backspace",g="Tab",v="Enter",b="Escape",w="ArrowLeft",y="ArrowUp",_="ArrowRight",C="ArrowDown",j="Space",x="Delete",E="F3",S=5,k=10,T=[m,x,y,C,_,w,v,b,E,g],I="br",q="p",L=1,z=2,M=3,P="undefined"!=typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),D=P?"text":"text/plain",N=P?"html":"text/html",R="jodit-selection_marker",A=300,B="insert_as_html",O="insert_clear_html",H="insert_as_text",F="insert_only_text",W=10,$="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),V={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:$?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Y=(()=>{if("undefined"==typeof document)return"";const t=document.currentScript,e=t=>t.replace(/\/[^/]+.js$/,"/");if(t)return e(t.src);const s=document.querySelectorAll("script[src]");return s&&s.length?e(s[s.length-1].src):window.location.href})()},(t,e,s)=>{"use strict";s.d(e,{DG:()=>o,ng:()=>c,P5:()=>p,rO:()=>i});const i="JoditEventDefaultNamespace";class o{constructor(){this.__store={}}get(t,e){if(void 0!==this.__store[e])return this.__store[e][t]}indexOf(t,e,s){const i=this.get(t,e);if(i)for(let t=0;i.length>t;t+=1)if(i[t].originalCallback===s)return t;return!1}namespaces(t=!1){const e=Object.keys(this.__store);return t?e.filter((t=>t!==i)):e}events(t){return this.__store[t]?Object.keys(this.__store[t]):[]}set(t,e,s,i=!1){void 0===this.__store[e]&&(this.__store[e]={}),void 0===this.__store[e][t]&&(this.__store[e][t]=[]),i?this.__store[e][t].unshift(s):this.__store[e][t].push(s)}clear(){this.__store={}}}var r=s(5),n=s(6),a=s(7),l=s(4);class c{constructor(t){this.__key="__JoditEventsNativeNamespaces",this.doc=document,this.prepareEvent=t=>{t.cancelBubble||(t.type.match(/^touch/)&&t.changedTouches&&t.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach((e=>{Object.defineProperty(t,e,{value:t.changedTouches[0][e],configurable:!0,enumerable:!0})})),t.originalEvent||(t.originalEvent=t),"paste"===t.type&&void 0===t.clipboardData&&this.doc.defaultView.clipboardData&&Object.defineProperty(t,"clipboardData",{get:()=>this.doc.defaultView.clipboardData,configurable:!0,enumerable:!0}))},this.currents=[],this.__stopped=[],this.isDestructed=!1,t&&(this.doc=t),this.__key+=(new Date).getTime()}eachEvent(t,e){t.split(/[\s,]+/).forEach((t=>{const s=t.split(".");e.call(this,s[0],s[1]||i)}))}getStore(t){if(!t)throw(0,l.vU)("Need subject");if(void 0===t[this.__key]){const e=new o;Object.defineProperty(t,this.__key,{enumerable:!1,configurable:!0,value:e})}return t[this.__key]}clearStore(t){void 0!==t[this.__key]&&delete t[this.__key]}triggerNativeEvent(t,e){const s=this.doc.createEvent("HTMLEvents");"string"==typeof e?s.initEvent(e,!0,!0):(s.initEvent(e.type,e.bubbles,e.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach((t=>{Object.defineProperty(s,t,{value:e[t],enumerable:!0})})),Object.defineProperty(s,"originalEvent",{value:e,enumerable:!0})),t.dispatchEvent(s)}get current(){return this.currents[this.currents.length-1]}on(t,e,s,i=!1){const o=(0,r.H)(t)?this:t,c=(0,r.H)(e)?e:t;let h=s;void 0===h&&(0,n.m)(e)&&(h=e);const d=this.getStore(o);if(!(0,r.H)(c)||""===c)throw(0,l.vU)("Need events names");if(!(0,n.m)(h))throw(0,l.vU)("Need event handler");if((0,a.k)(o))return o.forEach((t=>{this.on(t,c,h,i)})),this;const u=(0,n.m)(o.addEventListener),p=this;let f=function(t,...e){return h&&h.call(this,t,...e)};return u&&(f=function(t){if(p.prepareEvent(t),h&&!1===h.call(this,t))return t.preventDefault(),t.stopImmediatePropagation(),!1}),this.eachEvent(c,((t,e)=>{if(""===t)throw(0,l.vU)("Need event name");if(!1===d.indexOf(t,e,h)&&(d.set(t,e,{event:t,originalCallback:h,syntheticCallback:f},i),u)){const e=!!["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"].includes(t)&&{passive:!0};o.addEventListener(t,f,e)}})),this}one(t,e,s,i=!1){const o=(0,r.H)(t)?this:t,a=(0,r.H)(e)?e:t;let l=s;void 0===l&&(0,n.m)(e)&&(l=e);const c=(...t)=>{this.off(o,a,c),l(...t)};return this.on(o,a,c,i),this}off(t,e,s){const o=(0,r.H)(t)?this:t,a=(0,r.H)(e)?e:t,l=this.getStore(o);let c=s;if(!(0,r.H)(a)||!a)return l.namespaces().forEach((t=>{this.off(o,"."+t)})),this.clearStore(o),this;void 0===c&&(0,n.m)(e)&&(c=e);const h=(0,n.m)(o.removeEventListener),d=t=>{h&&o.removeEventListener(t.event,t.syntheticCallback,!1)},u=(t,e)=>{if(""!==t){const s=l.get(t,e);if(s&&s.length)if((0,n.m)(c)){const i=l.indexOf(t,e,c);!1!==i&&(d(s[i]),s.splice(i,1))}else s.forEach(d),s.length=0}else l.events(e).forEach((t=>{""!==t&&u(t,e)}))};return this.eachEvent(a,((t,e)=>{e===i?l.namespaces().forEach((e=>{u(t,e)})):u(t,e)})),this}stopPropagation(t,e){const s=(0,r.H)(t)?this:t,o=(0,r.H)(t)?t:e;if("string"!=typeof o)throw(0,l.vU)("Need event names");const n=this.getStore(s);this.eachEvent(o,((t,e)=>{const o=n.get(t,e);o&&this.__stopped.push(o),e===i&&n.namespaces(!0).forEach((e=>this.stopPropagation(s,t+"."+e)))}))}removeStop(t){if(t){const e=this.__stopped.indexOf(t);-1!==e&&this.__stopped.splice(0,e+1)}}isStopped(t){return void 0!==t&&-1!==this.__stopped.indexOf(t)}fire(t,e,...s){let o,a;const c=(0,r.H)(t)?this:t,h=(0,r.H)(t)?t:e,d=(0,r.H)(t)?[e,...s]:s,u=(0,n.m)(c.dispatchEvent);if(!u&&!(0,r.H)(h))throw(0,l.vU)("Need events names");const p=this.getStore(c);return!(0,r.H)(h)&&u?this.triggerNativeEvent(c,e):this.eachEvent(h,((t,e)=>{if(u)this.triggerNativeEvent(c,t);else{const s=p.get(t,e);if(s)try{[...s].every((e=>!this.isStopped(s)&&(this.currents.push(t),a=e.syntheticCallback.apply(c,d),this.currents.pop(),void 0!==a&&(o=a),!0)))}finally{this.removeStop(s)}e!==i||u||p.namespaces().filter((t=>t!==e)).forEach((e=>{const s=this.fire.call(this,c,t+"."+e,...d);void 0!==s&&(o=s)}))}})),o}destruct(){this.isDestructed&&(this.isDestructed=!0,this.off(this),this.getStore(this).clear(),delete this[this.__key])}}var h=s(36),d=s(8),u=s(33);class p{constructor(t,e=[],s={}){this.__lockEvent={},this.__data=t,this.__prefix=e,this.__onEvents=s,Object.keys(t).forEach((e=>{const s=this.__prefix.concat(e).filter((t=>t.length));Object.defineProperty(this,e,{set:i=>{var o;const r=t[e];if(!(0,d.isFastEqual)(r,i)){this.fire(["beforeChange","beforeChange."+s.join(".")],e,i),(0,d.isPlainObject)(i)&&(i=new p(i,s,this.__onEvents)),t[e]=i;const n=[];this.fire(["change",...s.reduce(((t,e)=>(n.push(e),t.push("change."+n.join(".")),t)),[])],s.join("."),r,(null===(o=i)||void 0===o?void 0:o.valueOf)?i.valueOf():i)}},get:()=>t[e],enumerable:!0,configurable:!0}),(0,d.isPlainObject)(t[e])&&(t[e]=new p(t[e],s,this.__onEvents))}))}valueOf(){return this.__data}toString(){return JSON.stringify(this.valueOf())}on(t,e){return(0,d.isArray)(t)?(t.map((t=>this.on(t,e))),this):(this.__onEvents[t]||(this.__onEvents[t]=[]),this.__onEvents[t].push(e),this)}fire(t,...e){if((0,d.isArray)(t))t.map((t=>this.fire(t,...e)));else try{!this.__lockEvent[t]&&this.__onEvents[t]&&(this.__lockEvent[t]=!0,this.__onEvents[t].forEach((t=>t.call(this,...e))))}finally{this.__lockEvent[t]=!1}}static create(t,e=[]){return t instanceof p?t:new p(t,e)}}(0,h.__decorate)([u.nonenumerable],p.prototype,"__data",void 0),(0,h.__decorate)([u.nonenumerable],p.prototype,"__prefix",void 0),(0,h.__decorate)([u.nonenumerable],p.prototype,"__onEvents",void 0),(0,h.__decorate)([u.nonenumerable],p.prototype,"__lockEvent",void 0)},(t,e,s)=>{"use strict";s.d(e,{RI:()=>r,dt:()=>n,vU:()=>a});const i={},o=i.toString,r=i.hasOwnProperty;["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment","DOMStringList","HTMLCollection"].forEach((t=>{i["[object "+t+"]"]=t.toLowerCase()}));const n=t=>null===t?"null":"object"==typeof t||"function"==typeof t?i[o.call(t)]||"object":typeof t;function a(t){return new TypeError(t)}},(t,e,s)=>{"use strict";function i(t){return"string"==typeof t}s.d(e,{H:()=>i})},(t,e,s)=>{"use strict";function i(t){return"function"==typeof t}s.d(e,{m:()=>i})},(t,e,s)=>{"use strict";function i(t){return Array.isArray(t)}s.d(e,{k:()=>i})},(t,e,s)=>{"use strict";s.r(e),s.d(e,{$$:()=>k,ConfigFlatten:()=>y,ConfigProto:()=>w,LimitedStack:()=>i.lI,appendScript:()=>Y,appendScriptAsync:()=>U,appendStyleAsync:()=>G,applyStyles:()=>M,asArray:()=>r,attr:()=>i.Lj,browser:()=>X,buildQuery:()=>rt,call:()=>i.RE,callPromise:()=>i.C6,camelCase:()=>x.eV,cleanFromWord:()=>P,clearCenterAlign:()=>Q.b,clearTimeout:()=>d,cns:()=>i.H5,colorToHex:()=>v.h,completeUrl:()=>W,convertMediaUrlToVideoEmbed:()=>Z,css:()=>Q.i,cssPath:()=>q,ctrlKey:()=>tt,dataBind:()=>et.q,defaultLanguage:()=>st.X,each:()=>it,error:()=>j.vU,fastClone:()=>m,get:()=>i.U2,getClassName:()=>i.gj,getContentWidth:()=>B,getXPathByElement:()=>T,hasBrowserColorPicker:()=>g.EO,hasContainer:()=>g.Zt,hasOwn:()=>j.RI,htmlspecialchars:()=>D,humanSizeToBytes:()=>ot,i18n:()=>x.ag,inView:()=>nt,innerWidth:()=>O,isArray:()=>g.kJ,isAtom:()=>p,isBoolean:()=>g.jn,isDestructable:()=>g.Z$,isEqual:()=>g.Xy,isFastEqual:()=>g.LP,isFunction:()=>g.mf,isHTML:()=>g.FP,isHtmlFromWord:()=>g.I4,isInitable:()=>g.Gu,isInt:()=>g.GN,isJoditObject:()=>g.Zu,isLicense:()=>g.A1,isNativeFunction:()=>g.QC,isNumber:()=>g.hj,isNumeric:()=>g.kE,isPlainObject:()=>g.PO,isPromise:()=>g.tI,isString:()=>g.HD,isURL:()=>g.PX,isValidName:()=>g.r1,isViewObject:()=>g.f2,isVoid:()=>g.nj,isWindow:()=>g.FJ,kebabCase:()=>x.GL,keepNames:()=>i.kc,keys:()=>i.XP,loadImage:()=>i.po,loadNext:()=>K,markAsAtomic:()=>f,markDeprecated:()=>i.Q8,markOwner:()=>i.MN,memorizeExec:()=>i.u3,nl2br:()=>R,normalizeColor:()=>A.ut,normalizeCssValue:()=>A.Zh,normalizeKeyAliases:()=>A.T2,normalizeLicense:()=>A.Pd,normalizeNode:()=>A.Tz,normalizePath:()=>A.AH,normalizeRelativePath:()=>A.Jf,normalizeSize:()=>A.aC,normalizeUrl:()=>A.D5,offset:()=>H,parseQuery:()=>J,position:()=>F,refs:()=>I,reset:()=>i.mc,resolveElement:()=>L,scrollIntoViewIfNeeded:()=>at,set:()=>i.t8,setTimeout:()=>h,splitArray:()=>a,sprintf:()=>x.gB,stringify:()=>x.Pz,stripTags:()=>N,toArray:()=>c,trim:()=>x.fy,trimInv:()=>x.as,type:()=>j.dt,ucfirst:()=>x.Ps,val:()=>lt});var i=s(9),o=s(7);const r=t=>(0,o.k)(t)?t:[t];var n=s(5);function a(t){return(0,n.H)(t)?t.split(/[,\s]+/):t}var l=s(19);const c=(...t)=>{var e;return((0,l.Q)(Array.from)?Array.from:null!==(e=(0,i.mc)("Array.from"))&&void 0!==e?e:Array.from).apply(Array,t)};function h(t,e,...s){return e?window.setTimeout(t,e,...s):(t.call(null,...s),0)}function d(t){window.clearTimeout(t)}var u=s(16);function p(t){return t&&t.isAtom}function f(t){return Object.defineProperty(t,"isAtom",{enumerable:!1,value:!0,configurable:!1}),t}function m(t){return JSON.parse((0,u.P)(t))}var g=s(15),v=s(21),b=s(1);function w(t,e,s=0){if(Object.getPrototypeOf(t)!==Object.prototype)return t;const i=b.D.defaultOptions;if((0,g.HD)(t.preset)){if(void 0!==i.presets[t.preset]){const e=i.presets[t.preset];Object.keys(e).forEach((s=>{(0,g.nj)(t[s])&&(t[s]=e[s])}))}delete t.preset}const o={};return Object.keys(t).forEach((i=>{const r=t[i],n=e?e[i]:null;o[i]=(0,g.PO)(r)&&(0,g.PO)(n)&&!p(r)?w(r,n,s+1):0!==s&&(0,g.kJ)(r)&&!p(r)&&(0,g.kJ)(n)?[...r,...n.slice(r.length)]:r})),Object.setPrototypeOf(o,e),o}function y(t){return(0,i.XP)(t,!1).reduce(((e,s)=>(e[s]=t[s],e)),{})}var _=s(14),C=s(2),j=s(4),x=s(22),E=s(24);let S=1;function k(t,e){let s;if(!/:scope/.test(t)||!C.IS_IE||e&&e.nodeType===Node.DOCUMENT_NODE)s=e.querySelectorAll(t);else{const i=e.id,o=i||"_selector_id_"+(Math.random()+"").slice(2)+(S++,S);t=t.replace(/:scope/g,"#"+o),!i&&e.setAttribute("id",o),s=e.parentNode.querySelectorAll(t),i||e.removeAttribute("id")}return[].slice.call(s)}const T=(t,e)=>{if(!t||t.nodeType!==Node.ELEMENT_NODE)return"";if(!t.parentNode||e===t)return"";if(t.id)return"//*[@id='"+t.id+"']";const s=[].filter.call(t.parentNode.childNodes,(e=>e.nodeName===t.nodeName));return T(t.parentNode,e)+"/"+t.nodeName.toLowerCase()+(s.length>1?"["+(c(s).indexOf(t)+1)+"]":"")},I=t=>(t instanceof E.u1&&(t=t.container),k("[ref],[data-ref]",t).reduce(((t,e)=>{const s=(0,i.Lj)(e,"-ref");return s&&(0,g.HD)(s)&&(t[(0,x.eV)(s)]=e,t[s]=e),t}),{})),q=t=>{if(!_.i.isElement(t))return null;const e=[];let s=t;for(;s&&s.nodeType===Node.ELEMENT_NODE;){let t=s.nodeName.toLowerCase();if(s.id){t+="#"+s.id,e.unshift(t);break}{let e=s,i=1;do{e=e.previousElementSibling,e&&e.nodeName.toLowerCase()===t&&i++}while(e);t+=":nth-of-type("+i+")"}e.unshift(t),s=s.parentNode}return e.join(" > ")};function L(t,e){let s=t;if((0,g.HD)(t))try{s=e.querySelector(t)}catch(e){throw(0,j.vU)('String "'+t+'" should be valid HTML selector')}if(!s||"object"!=typeof s||!_.i.isElement(s)||!s.cloneNode)throw(0,j.vU)('Element "'+t+'" should be string or HTMLElement instance');return s}function z(t){return t.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";]+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,((t,e,s)=>{switch(s.toLowerCase()){case"pt":return(1.328*parseFloat(e)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(e)).toFixed(0)+"px"}return t}))}function M(t){if(-1===t.indexOf("")+7);const e=document.createElement("iframe");e.style.display="none",document.body.appendChild(e);let s="",i=[],o=[];try{const r=e.contentDocument||(e.contentWindow?e.contentWindow.document:null);if(r){r.open(),r.write(t),r.close(),r.styleSheets.length&&(o=r.styleSheets[r.styleSheets.length-1].cssRules);for(let t=0;o.length>t;t+=1)""!==o[t].selectorText&&(i=k(o[t].selectorText,r.body),i.forEach((e=>{e.style.cssText=z(o[t].style.cssText+";"+e.style.cssText)})));_.i.each(r.body,(t=>{if(_.i.isElement(t)){const e=t,s=e.style.cssText;s&&(e.style.cssText=z(s)),e.hasAttribute("lang")&&e.removeAttribute("lang")}})),s=r.firstChild?(0,x.fy)(r.body.innerHTML):""}}catch(t){}finally{_.i.safeRemove(e)}return s&&(t=s),(0,x.fy)(t.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(//i);-1!==e&&(t=t.substr(e+20));const s=t.search(//i);return-1!==s&&(t=t.substr(0,s)),t})(s)),e.s.insertHTML(s)}const Gt="clipboard";class Kt{constructor(){this.buttons=[{name:"cut",group:"clipboard"},{name:"copy",group:"clipboard"},{name:"paste",group:"clipboard"},{name:"selectall",group:"clipboard"}]}init(t){var e;null===(e=this.buttons)||void 0===e||e.forEach((e=>t.registerButton(e))),t.e.off("copy.clipboard cut.clipboard").on("copy.clipboard cut.clipboard",(e=>{var s;const i=t.s.html,o=Yt(e)||Yt(t.ew)||Yt(e.originalEvent);o&&(o.setData(a.TEXT_PLAIN,(0,c.stripTags)(i)),o.setData(a.TEXT_HTML,i)),t.buffer.set(Gt,i),t.e.fire("pasteStack",{html:i,action:t.o.defaultActionOnPaste}),"cut"===e.type&&(t.s.remove(),t.s.focus()),e.preventDefault(),null===(s=null==t?void 0:t.events)||void 0===s||s.fire("afterCopy",i)}))}destruct(t){var e,s;null===(e=null==t?void 0:t.buffer)||void 0===e||e.set(Gt,""),null===(s=null==t?void 0:t.events)||void 0===s||s.off(".clipboard")}}n.D.prototype.askBeforePasteHTML=!0,n.D.prototype.processPasteHTML=!0,n.D.prototype.askBeforePasteFromWord=!0,n.D.prototype.processPasteFromWord=!0,n.D.prototype.nl2brInPlainText=!0,n.D.prototype.defaultActionOnPaste=a.INSERT_AS_HTML,n.D.prototype.defaultActionOnPasteFromWord=null,n.D.prototype.draggableTags=["img","a","jodit-media","jodit"],n.D.prototype.controls.cut={command:"cut",isDisabled:t=>t.s.isCollapsed(),tooltip:"Cut selection"},n.D.prototype.controls.copy={command:"copy",isDisabled:t=>t.s.isCollapsed(),tooltip:"Copy selection"};const Xt="pasteStorage";n.D.prototype.controls.paste={tooltip:"Paste from clipboard",async exec(t,e,{control:s}){if(s.name===Xt)return void t.execCommand("showPasteStorage");t.s.focus();let i="",o=!0;if(navigator.clipboard){try{const t=await navigator.clipboard.read();if(t&&t.length){const e=await t[0].getType(a.TEXT_PLAIN);i=await new Response(e).text()}o=!1}catch(t){}if(o)try{i=await navigator.clipboard.readText(),o=!1}catch(t){}}o&&(i=t.buffer.get(Gt)||"",o=0===i.length);const r=t.value;o?(t.ed.execCommand("paste"),o=r===t.value,!o&&t.e.fire("afterPaste")):i.length?(Ut(null,t,i),t.e.fire("afterPaste")):o&&A(t.i18n("Your browser doesn't support direct access to the clipboard."),(()=>{t.s.focus()})).bindDestruct(t)},list:{[Xt]:"Paste Storage"},isChildDisabled(t){return 2>t.e.fire("pasteStorageList")}},n.D.prototype.controls.selectall={icon:"select-all",command:"selectall",tooltip:"Select all"};class Jt extends H{constructor(){super(...arguments),this.pasteStack=new c.LimitedStack(20)}afterInit(t){t.e.on("paste.paste",this.onPaste).on("pasteStack.paste",(t=>this.pasteStack.push(t))),t.o.nl2brInPlainText&&this.j.e.on("processPaste.paste",this.onProcessPasteReplaceNl2Br)}onPaste(t){try{if(!1===this.j.e.fire("beforePaste",t)||!1===this.customPasteProcess(t))return t.preventDefault(),!1;this.defaultPasteProcess(t)}finally{this.j.e.fire("afterPaste",t)}}customPasteProcess(t){if(!this.j.o.processPasteHTML)return;const e=Yt(t),s=[null==e?void 0:e.getData(a.TEXT_HTML),null==e?void 0:e.getData(a.TEXT_PLAIN)];for(const e of s)if((0,c.isHTML)(e)&&(this.processWordHTML(t,e)||this.processHTML(t,e)))return!1}defaultPasteProcess(t){const e=Yt(t);let s=(null==e?void 0:e.getData(a.TEXT_HTML))||(null==e?void 0:e.getData(a.TEXT_PLAIN));if(e&&s&&""!==(0,c.trim)(s)){const i=this.j.e.fire("processPaste",t,s,(t=>{const e=t.types;let s="";if((0,c.isArray)(e)||"domstringlist"===(0,c.type)(e))for(let t=0;e.length>t;t+=1)s+=e[t]+";";else s=(e||a.TEXT_PLAIN)+";";return s})(e));void 0!==i&&(s=i),((0,c.isString)(s)||S.i.isNode(s,this.j.ew))&&this.insertByType(t,s,this.j.o.defaultActionOnPaste),t.preventDefault(),t.stopPropagation()}}processWordHTML(t,e){return!(!this.j.o.processPasteFromWord||!(0,c.isHtmlFromWord)(e)||(this.j.o.askBeforePasteFromWord?this.askInsertTypeDialog("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","Word Paste Detected",(s=>{this.insertFromWordByType(t,e,s)})):this.insertFromWordByType(t,e,this.j.o.defaultActionOnPasteFromWord||this.j.o.defaultActionOnPaste),0))}processHTML(t,e){if(this.j.o.askBeforePasteHTML){const s=this.pasteStack.find((t=>t.html===e));return s?(this.insertByType(t,e,s.action||this.j.o.defaultActionOnPaste),!0):(this.askInsertTypeDialog("Your code is similar to HTML. Keep as HTML?","Paste as HTML",(s=>{this.insertByType(t,e,s)}),"Insert as Text"),!0)}return!1}insertFromWordByType(t,e,s){var i;switch(s){case a.INSERT_AS_HTML:if(e=(0,c.applyStyles)(e),this.j.o.beautifyHTML){const t=null===(i=this.j.events)||void 0===i?void 0:i.fire("beautifyHTML",e);(0,c.isString)(t)&&(e=t)}break;case a.INSERT_AS_TEXT:e=(0,c.cleanFromWord)(e);break;case a.INSERT_ONLY_TEXT:e=(0,c.stripTags)((0,c.cleanFromWord)(e))}Ut(t,this.j,e)}insertByType(t,e,s){if(this.pasteStack.push({html:e,action:s}),(0,c.isString)(e))switch(this.j.buffer.set(Gt,e),s){case a.INSERT_CLEAR_HTML:e=(0,c.cleanFromWord)(e);break;case a.INSERT_ONLY_TEXT:e=(0,c.stripTags)(e);break;case a.INSERT_AS_TEXT:e=(0,c.htmlspecialchars)(e)}Ut(t,this.j,e)}askInsertTypeDialog(t,e,s,i="Clean",o="Insert only Text"){var r,n,l,h;if(!1===(null===(n=null===(r=this.j)||void 0===r?void 0:r.e)||void 0===n?void 0:n.fire("beforeOpenPasteDialog",t,e,s,i,o)))return;const d=O(`
${this.j.i18n(t)}
`,this.j.i18n(e));d.bindDestruct(this.j),(0,c.markOwner)(this.j,d.container);const u=(0,f.zx)(this.j,{text:"Keep",name:"keep",status:"primary",tabIndex:0}),p=(0,f.zx)(this.j,{text:i,tabIndex:0}),m=(0,f.zx)(this.j,{text:o,tabIndex:0}),g=(0,f.zx)(this.j,{text:"Cancel",tabIndex:0});return u.onAction((()=>{d.close(),s&&s(a.INSERT_AS_HTML)})),p.onAction((()=>{d.close(),s&&s(a.INSERT_AS_TEXT)})),m.onAction((()=>{d.close(),s&&s(a.INSERT_ONLY_TEXT)})),g.onAction((()=>{d.close()})),d.setFooter([u,p,o?m:"",g]),u.focus(),null===(h=null===(l=this.j)||void 0===l?void 0:l.e)||void 0===h||h.fire("afterOpenPasteDialog",d,t,e,s,i,o),d}onProcessPasteReplaceNl2Br(t,e,s){if(s===a.TEXT_PLAIN+";"&&!(0,c.isHTML)(e))return(0,c.nl2br)(e)}useFakeDivBox(t){const e=this.j.c.div("",{tabindex:-1,contenteditable:!0,style:{left:-9999,top:0,width:0,height:"100%",lineHeight:"140%",overflow:"hidden",position:"fixed",zIndex:2147483647,wordBreak:"break-all"}});this.j.container.appendChild(e);const s=this.j.s.save();e.focus();let i=0;const o=()=>{S.i.safeRemove(e),this.j.selection&&this.j.s.restore(s)},r=()=>{if(i+=1,e.childNodes&&e.childNodes.length>0){const s=e.innerHTML;return o(),void this.processHTML(t,s)}5>i?this.j.async.setTimeout(r,20):o()};r()}beforeDestruct(t){t.e.off("paste.paste",this.onPaste)}}(0,r.__decorate)([j.autobind],Jt.prototype,"onPaste",null),(0,r.__decorate)([j.autobind],Jt.prototype,"onProcessPasteReplaceNl2Br",null);class Zt extends H{constructor(){super(...arguments),this.currentIndex=0,this.list=[],this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.paste=()=>{if(this.j.s.focus(),this.j.s.insertHTML(this.list[this.currentIndex]),0!==this.currentIndex){const t=this.list[0];this.list[0]=this.list[this.currentIndex],this.list[this.currentIndex]=t}this.dialog&&this.dialog.close(),this.j.setEditorValue(),this.j.e.fire("afterPaste")},this.onKeyDown=t=>{let e=this.currentIndex;-1!==[a.KEY_UP,a.KEY_DOWN,a.KEY_ENTER].indexOf(t.key)&&(t.key===a.KEY_UP&&(0===e?e=this.list.length-1:e-=1),t.key===a.KEY_DOWN&&(e===this.list.length-1?e=0:e+=1),t.key!==a.KEY_ENTER?(e!==this.currentIndex&&this.selectIndex(e),t.stopImmediatePropagation(),t.preventDefault()):this.paste())},this.selectIndex=t=>{this.listBox&&(0,c.toArray)(this.listBox.childNodes).forEach(((e,s)=>{e.classList.remove("jodit_active"),t===s&&this.previewBox&&(e.classList.add("jodit_active"),this.previewBox.innerHTML=this.list[t],e.focus())})),this.currentIndex=t},this.showDialog=()=>{2>this.list.length||(this.dialog||this.createDialog(),this.listBox&&(this.listBox.innerHTML=""),this.previewBox&&(this.previewBox.innerHTML=""),this.list.forEach(((t,e)=>{const s=this.j.c.element("a");s.textContent=e+1+". "+t.replace((0,a.SPACE_REG_EXP)(),""),this.j.e.on(s,"keydown",this.onKeyDown),(0,c.attr)(s,"href","javascript:void(0)"),(0,c.attr)(s,"data-index",""+e),(0,c.attr)(s,"tab-index","-1"),this.listBox&&this.listBox.appendChild(s)})),this.dialog&&this.dialog.open(),this.j.async.setTimeout((()=>{this.selectIndex(0)}),100))}}createDialog(){this.dialog=new R({language:this.j.o.language});const t=this.j.c.fromHTML(''+this.j.i18n("Paste")+"");this.j.e.on(t,"click",this.paste);const e=this.j.c.fromHTML(''+this.j.i18n("Cancel")+"");this.j.e.on(e,"click",this.dialog.close),this.container=this.j.c.div(),this.container.classList.add("jodit-paste-storage"),this.listBox=this.j.c.div(),this.previewBox=this.j.c.div(),this.container.appendChild(this.listBox),this.container.appendChild(this.previewBox),this.dialog.setHeader(this.j.i18n("Choose Content to Paste")),this.dialog.setContent(this.container),this.dialog.setFooter([t,e]),this.j.e.on(this.listBox,"click dblclick",(t=>{const e=t.target;return S.i.isTag(e,"a")&&e.hasAttribute("data-index")&&this.selectIndex(parseInt((0,c.attr)(e,"-index")||"0",10)),"dblclick"===t.type&&this.paste(),!1}))}afterInit(){this.j.e.off("afterCopy.paste-storage").on("pasteStorageList.paste-storage",(()=>this.list.length)).on("afterCopy.paste-storage",(t=>{-1!==this.list.indexOf(t)&&this.list.splice(this.list.indexOf(t),1),this.list.unshift(t),this.list.length>5&&(this.list.length=5)})),this.j.registerCommand("showPasteStorage",{exec:this.showDialog,hotkeys:["ctrl+shift+v","cmd+shift+v"]})}beforeDestruct(){this.dialog&&this.dialog.destruct(),this.j.e.off(".paste-storage"),S.i.safeRemove(this.previewBox),S.i.safeRemove(this.listBox),S.i.safeRemove(this.container),this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.list=[]}}const Qt="copyformat",te=["fontWeight","fontStyle","fontSize","color","margin","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textDecorationLine","fontFamily"],ee=(t,e,s,i)=>{let o=(0,c.css)(s,e);return o===i[e]&&(o=s.parentNode&&s!==t.editor&&s.parentNode!==t.editor?ee(t,e,s.parentNode,i):void 0),o};function se(t){t.registerButton({name:"copyformat",group:"clipboard"})}n.D.prototype.controls.copyformat={exec(t,e,{button:s}){if(e){if(t.buffer.exists(Qt))t.buffer.delete(Qt),t.e.off(t.editor,"mouseup.copyformat");else{const s={},i=S.i.up(e,(t=>t&&!S.i.isText(t)),t.editor)||t.editor,o=t.createInside.span();t.editor.appendChild(o),te.forEach((t=>{s[t]=(0,c.css)(o,t)})),o!==t.editor&&S.i.safeRemove(o);const r=((t,e,s)=>{const i={};return e&&te.forEach((o=>{i[o]=ee(t,o,e,s),o.match(/border(Style|Color)/)&&!i.borderWidth&&(i[o]=void 0)})),i})(t,i,s),n=()=>{t.buffer.delete(Qt);const e=t.s.current();e&&(S.i.isTag(e,"img")?(0,c.css)(e,r):t.s.applyStyle(r)),t.e.off(t.editor,"mouseup.copyformat")};t.e.on(t.editor,"mouseup.copyformat",n),t.buffer.set(Qt,!0)}s.update()}},isActive:t=>t.buffer.exists(Qt),tooltip:"Paint format"};var ie=s(43);function oe(t){t.registerButton({name:"brush",group:"color"});const e=(e,s,i)=>{const o=(0,c.normalizeColor)(i);switch(e){case"background":t.s.applyStyle({backgroundColor:o||""});break;case"forecolor":t.s.applyStyle({color:o||""})}return t.setEditorValue(),!1};t.registerCommand("forecolor",e).registerCommand("background",e)}n.D.prototype.controls.brush={update(t){const e=(0,c.dataBind)(t,"color"),s=t.j,i=(e,i)=>{i&&i!==""+(0,c.css)(s.editor,e)&&(t.state.icon.fill=i)};if(e){const s=(0,c.dataBind)(t,"color");return void i("color"===s?s:"background-color",e)}const o=s.s.current();if(o&&!t.state.disabled){const t=S.i.closest(o,(t=>S.i.isBlock(t,s.ew)||t&&S.i.isElement(t)),s.editor)||s.editor;i("color",""+(0,c.css)(t,"color")),i("background-color",""+(0,c.css)(t,"background-color"))}t.state.icon.fill="",t.state.activated=!1},popup(t,e,s,i,o){let r="",n="",a=[],l=null;return e&&e!==t.editor&&S.i.isNode(e,t.ew)&&(S.i.isElement(e)&&t.s.isCollapsed()&&!S.i.isTag(e,["br","hr"])&&(l=e),S.i.up(e,(e=>{if(S.i.isHTMLElement(e,t.ew)){const t=(0,c.css)(e,"color",void 0,!0),s=(0,c.css)(e,"background-color",void 0,!0);if(t)return r=""+t,!0;if(s)return n=""+s,!0}}),t.editor)),a=[{name:"Background",content:(0,ie.YW)(t,(e=>{l?l.style.backgroundColor=e:t.execCommand("background",!1,e),(0,c.dataBind)(o,"color",e),(0,c.dataBind)(o,"color-mode","background"),i()}),n)},{name:"Text",content:(0,ie.YW)(t,(e=>{l?l.style.color=e:t.execCommand("forecolor",!1,e),(0,c.dataBind)(o,"color",e),(0,c.dataBind)(o,"color-mode","color"),i()}),r)}],"background"!==t.o.colorPickerDefaultTab&&(a=a.reverse()),(0,ie.IL)(t,a,l)},exec(t,e,{button:s}){const i=(0,c.dataBind)(s,"color-mode"),o=(0,c.dataBind)(s,"color");if(!i)return!1;if(e&&e!==t.editor&&S.i.isNode(e,t.ew)&&S.i.isElement(e))switch(i){case"color":e.style.color=o;break;case"background":e.style.backgroundColor=o}else t.execCommand("background"===i?i:"forecolor",!1,o)},tooltip:"Fill color or set the text color"};class re extends H{constructor(){super(...arguments),this.isFragmentFromEditor=!1,this.isCopyMode=!1,this.startDragPoint={x:0,y:0},this.draggable=null,this.bufferRange=null,this.getText=t=>{const e=Yt(t);return e?e.getData(a.TEXT_HTML)||e.getData(a.TEXT_PLAIN):null}}afterInit(){this.j.e.on([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}onDragStart(t){let e=t.target;if(this.onDragEnd(),this.isFragmentFromEditor=S.i.isOrContains(this.j.editor,e,!0),this.isCopyMode=!this.isFragmentFromEditor||(0,c.ctrlKey)(t),this.isFragmentFromEditor){const t=this.j.s.sel,e=t&&t.rangeCount?t.getRangeAt(0):null;e&&(this.bufferRange=e.cloneRange())}else this.bufferRange=null;this.startDragPoint.x=t.clientX,this.startDragPoint.y=t.clientY,S.i.isElement(e)&&e.classList.contains("jodit-filebrowser__files-item")&&(e=e.querySelector("img")),S.i.isTag(e,"img")&&(this.draggable=e.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",e)),this.addDragListeners()}addDragListeners(){this.j.e.on("dragover",this.onDrag).on("drop.DragAndDrop",this.onDrop).on(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}removeDragListeners(){this.j.e.off("dragover",this.onDrag).off("drop.DragAndDrop",this.onDrop).off(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}onDrag(t){this.draggable&&(this.j.e.fire("hidePopup"),this.j.s.insertCursorAtPoint(t.clientX,t.clientY),t.preventDefault(),t.stopPropagation())}onDragEnd(){this.draggable&&(S.i.safeRemove(this.draggable),this.draggable=null),this.isCopyMode=!1,this.removeDragListeners()}onDrop(t){if(!t.dataTransfer||!t.dataTransfer.files||!t.dataTransfer.files.length){if(!this.isFragmentFromEditor&&!this.draggable)return this.j.e.fire("paste",t),t.preventDefault(),t.stopPropagation(),!1;const e=this.j.s.sel,s=this.bufferRange||(e&&e.rangeCount?e.getRangeAt(0):null);let i=null;if(!this.draggable&&s)i=this.isCopyMode?s.cloneContents():s.extractContents();else if(this.draggable)if(this.isCopyMode){const[t,e]="1"===(0,c.attr)(this.draggable,"-is-file")?["a","href"]:["img","src"];i=this.j.createInside.element(t),i.setAttribute(e,(0,c.attr)(this.draggable,"data-src")||(0,c.attr)(this.draggable,"src")||""),"a"===t&&(i.textContent=(0,c.attr)(i,e)||"")}else i=(0,c.dataBind)(this.draggable,"target");else this.getText(t)&&(i=this.j.createInside.fromHTML(this.getText(t)));e&&e.removeAllRanges(),this.j.s.insertCursorAtPoint(t.clientX,t.clientY),i&&(this.j.s.insertNode(i,!1,!1),s&&i.firstChild&&i.lastChild&&(s.setStartBefore(i.firstChild),s.setEndAfter(i.lastChild),this.j.s.selectRange(s),this.j.e.fire("synchro")),S.i.isTag(i,"img")&&this.j.events&&this.j.e.fire("afterInsertImage",i)),t.preventDefault(),t.stopPropagation()}this.isFragmentFromEditor=!1,this.removeDragListeners()}beforeDestruct(){this.onDragEnd(),this.j.e.off(window,".DragAndDrop").off(".DragAndDrop").off([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}}(0,r.__decorate)([j.autobind],re.prototype,"onDragStart",null),(0,r.__decorate)([(0,j.throttle)((t=>t.j.defaultTimeout/10))],re.prototype,"onDrag",null),(0,r.__decorate)([j.autobind],re.prototype,"onDragEnd",null),(0,r.__decorate)([j.autobind],re.prototype,"onDrop",null);class ne extends H{constructor(){super(...arguments),this.dragList=[],this.draggable=null,this.wasMoved=!1,this.isCopyMode=!1,this.diffStep=10,this.startX=0,this.startY=0}afterInit(){this.dragList=this.j.o.draggableTags?(0,c.splitArray)(this.j.o.draggableTags).filter(Boolean).map((t=>t.toLowerCase())):[],this.dragList.length&&this.j.e.on("mousedown touchstart dragstart",this.onDragStart)}onDragStart(t){if("dragstart"===t.type&&this.draggable)return!1;const e=t.target;if(!this.dragList.length||!e)return;const s=t=>t&&this.dragList.includes(t.nodeName.toLowerCase()),i=S.i.furthest(e,s,this.j.editor)||(s(e)?e:null);i&&(this.startX=t.clientX,this.startY=t.clientY,this.isCopyMode=(0,c.ctrlKey)(t),this.onDragEnd(),this.draggable=i.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",i),this.addDragListeners())}onDrag(t){var e,s;if(!this.draggable)return;const i=t.clientY;if(Math.sqrt(Math.pow(t.clientX-this.startX,2)+Math.pow(i-this.startY,2))>=this.diffStep){if(this.wasMoved=!0,this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){const i=(0,c.dataBind)(this.draggable,"target");(0,c.css)(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",opacity:.7,display:"inline-block",left:t.clientX,top:t.clientY,width:null!==(e=null==i?void 0:i.offsetWidth)&&void 0!==e?e:100,height:null!==(s=null==i?void 0:i.offsetHeight)&&void 0!==s?s:100}),(0,C.ZO)(this.j,ne).appendChild(this.draggable)}(0,c.css)(this.draggable,{left:t.clientX,top:t.clientY}),this.j.s.insertCursorAtPoint(t.clientX,t.clientY)}}onDragEnd(){this.isInDestruct||this.draggable&&(S.i.safeRemove(this.draggable),this.draggable=null,this.wasMoved=!1,this.removeDragListeners())}onDrop(){if(!this.draggable||!this.wasMoved)return void this.onDragEnd();let t=(0,c.dataBind)(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(t=t.cloneNode(!0));const{parentElement:e}=t;this.j.s.insertNode(t,!0,!1),e&&S.i.isEmpty(e)&&S.i.safeRemove(e),S.i.isTag(t,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",t),this.j.e.fire("synchro")}addDragListeners(){this.j.e.on(this.j.editor,"mousemove touchmove",this.onDrag).on("mouseup touchend",this.onDrop).on([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}removeDragListeners(){this.j.e.off(this.j.editor,"mousemove touchmove",this.onDrag).off("mouseup touchend",this.onDrop).off([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}beforeDestruct(){this.onDragEnd(),this.j.e.off("mousedown touchstart dragstart",this.onDragStart),this.removeDragListeners()}}(0,r.__decorate)([j.autobind],ne.prototype,"onDragStart",null),(0,r.__decorate)([(0,j.throttle)((t=>t.j.defaultTimeout/10))],ne.prototype,"onDrag",null),(0,r.__decorate)([j.autobind],ne.prototype,"onDragEnd",null),(0,r.__decorate)([j.autobind],ne.prototype,"onDrop",null);const ae=(t,e,s,i)=>{var o;const r=t.createInside.element(s),n=t.createInside.element("br");r.appendChild(n),i&&i.cssText&&r.setAttribute("style",i.cssText),t.s.insertNode(r,!1,!1),t.s.setCursorBefore(n);const a=t.s.createRange();return a.setStartBefore("br"!==s.toLowerCase()?n:r),a.collapse(!0),t.s.selectRange(a),S.i.safeRemove(e),(0,c.scrollIntoViewIfNeeded)(r,t.editor,t.ed),null===(o=t.events)||void 0===o||o.fire("synchro"),r};class le extends H{constructor(){super(...arguments),this.brMode=!1,this.defaultTag=a.PARAGRAPH}afterInit(t){this.defaultTag=t.o.enter.toLowerCase(),this.brMode=this.defaultTag===a.BR.toLowerCase(),t.o.enterBlock||(t.o.enterBlock=this.brMode?a.PARAGRAPH:this.defaultTag),t.e.off(".enter").on("keydown.enter",(e=>{if(e.key===a.KEY_ENTER){const s=t.e.fire("beforeEnter",e);return void 0!==s?s:(t.s.isCollapsed()||t.execCommand("Delete"),t.s.focus(),this.onEnter(e),!1)}}))}onEnter(t){const e=this.j,s=e.selection,i=this.defaultTag;let o=s.current(!1);o&&o!==e.editor||(o=e.createInside.text(a.INVISIBLE_SPACE),s.insertNode(o),s.select(o));let r=this.getBlockWrapper(o);const n=S.i.isTag(r,"li");if((!n||t.shiftKey)&&!this.checkBR(o,t.shiftKey))return!1;if(r||this.hasPreviousBlock(o)||(r=this.wrapText(o)),!r||r===o)return ae(e,null,n?"li":i),!1;if(!this.checkUnsplittableBox(r))return!1;if(n&&S.i.isEmpty(r))return this.enterInsideEmptyLIelement(r),!1;const l=r.tagName.toLowerCase()===this.defaultTag||n,c=s.cursorOnTheRight(r),h=s.cursorOnTheLeft(r);if(!l&&(c||h)){let t=null;return t=c?s.setCursorAfter(r):s.setCursorBefore(r),ae(e,t,this.defaultTag),void(h&&!c&&s.setCursorIn(r,!0))}s.splitSelection(r)}getBlockWrapper(t,e=a.IS_BLOCK){let s=t;const i=this.j.editor;do{if(!s||s===i)break;if(e.test(s.nodeName))return S.i.isTag(s,"li")?s:this.getBlockWrapper(s.parentNode,/^li$/i)||s;s=s.parentNode}while(s&&s!==i);return null}checkBR(t,e){const s=S.i.closest(t,["pre","blockquote"],this.j.editor);if(this.brMode||e&&!s||!e&&s){const t=this.j.createInside.element("br");return this.j.s.insertNode(t,!0),(0,c.scrollIntoViewIfNeeded)(t,this.j.editor,this.j.ed),!1}return!0}wrapText(t){let e=t;S.i.up(e,(t=>{t&&t.hasChildNodes()&&t!==this.j.editor&&(e=t)}),this.j.editor);const s=S.i.wrapInline(e,this.j.o.enter,this.j);if(S.i.isEmpty(s)){const t=this.j.createInside.element("br");s.appendChild(t),this.j.s.setCursorBefore(t)}return s}hasPreviousBlock(t){const e=this.j;return!!S.i.prev(t,(t=>S.i.isBlock(t,e.ew)||S.i.isImage(t,e.ew)),e.editor)}checkUnsplittableBox(t){const e=this.j,s=e.selection;if(!S.i.canSplitBlock(t,e.ew)){const t=e.createInside.element("br");return s.insertNode(t,!1),s.setCursorAfter(t),!1}return!0}enterInsideEmptyLIelement(t){let e=null;const s=S.i.closest(t,["ol","ul"],this.j.editor);if(s){if(S.i.prev(t,(t=>S.i.isTag(t,"li")),s))if(S.i.next(t,(t=>S.i.isTag(t,"li")),s)){const i=this.j.s.createRange();i.setStartBefore(s),i.setEndAfter(t);const o=i.extractContents();s.parentNode&&s.parentNode.insertBefore(o,s),e=this.j.s.setCursorBefore(s)}else e=this.j.s.setCursorAfter(s);else e=this.j.s.setCursorBefore(s);S.i.safeRemove(t),ae(this.j,e,this.defaultTag),(0,c.$$)("li",s).length||S.i.safeRemove(s)}}beforeDestruct(t){t.e.off("keydown.enter")}}function ce(t){if(t.o.showMessageErrors){let e;const s=t.c.div("jodit_error_box_for_messages"),i=()=>{e=5,(0,c.toArray)(s.childNodes).forEach((i=>{(0,c.css)(s,"bottom",e+"px"),e+=i.offsetWidth+t.o.showMessageErrorOffsetPx}))};t.e.on("beforeDestruct",(()=>{S.i.safeRemove(s)})).on("errorMessage",((e,o,r)=>{t.workplace.appendChild(s);const n=t.c.div("active "+(o||""),e);s.appendChild(n),i(),t.async.setTimeout((()=>{n.classList.remove("active"),t.async.setTimeout((()=>{S.i.safeRemove(n),i()}),300)}),r||t.o.showMessageErrorTime)}))}}function he(t){t.registerButton({name:"font",group:"font"}).registerButton({name:"fontsize",group:"font"});const e=(e,s,i)=>{switch(e){case"fontsize":t.s.applyStyle({fontSize:(0,c.normalizeSize)(i)});break;case"fontname":t.s.applyStyle({fontFamily:i})}return t.e.fire("synchro"),!1};t.registerCommand("fontsize",e).registerCommand("fontname",e)}function de(t){t.registerButton({name:"paragraph",group:"font"}),t.registerCommand("formatblock",((e,s,i)=>(t.s.applyStyle(void 0,{element:i}),t.setEditorValue(),!1)))}function ue(t){t.registerButton({name:"fullsize"});let e=!1,s=0,i=0,o=!1;const r=()=>{t.events&&(e?(s=(0,c.css)(t.container,"height",void 0,!0),i=(0,c.css)(t.container,"width",void 0,!0),(0,c.css)(t.container,{height:t.ow.innerHeight,width:t.ow.innerWidth}),o=!0):o&&(0,c.css)(t.container,{height:s||"auto",width:i||"auto"}))},n=s=>{var i;if(t.container){if(void 0===s&&(s=!t.container.classList.contains("jodit_fullsize")),t.setMod("fullsize",s),t.o.fullsize=s,e=s,t.container.classList.toggle("jodit_fullsize",s),t.toolbar&&((0,c.isJoditObject)(t)&&t.toolbarContainer.appendChild(t.toolbar.container),(0,c.css)(t.toolbar.container,"width","auto")),t.o.globalFullSize){let e=t.container.parentNode;for(;e&&e.nodeType!==Node.DOCUMENT_NODE;)e.classList.toggle("jodit_fullsize-box_true",s),e=e.parentNode;r()}null===(i=t.events)||void 0===i||i.fire("afterResize")}};t.o.globalFullSize&&t.e.on(t.ow,"resize",r),t.e.on("afterInit afterOpen",(()=>{var e;t.toggleFullSize(null===(e=null==t?void 0:t.options)||void 0===e?void 0:e.fullsize)})).on("toggleFullSize",n).on("beforeDestruct",(()=>{e&&n(!1)})).on("beforeDestruct",(()=>{t.events&&t.e.off(t.ow,"resize",r)}))}n.D.prototype.showMessageErrors=!0,n.D.prototype.showMessageErrorTime=3e3,n.D.prototype.showMessageErrorOffsetPx=3,n.D.prototype.defaultFontSizePoints="px",n.D.prototype.controls.fontsize={command:"fontSize",data:{cssRule:"font-size"},list:["8","9","10","11","12","14","16","18","24","30","36","48","60","72","96"],exec:(t,e,{control:s})=>(0,c.memorizeExec)(t,e,{control:s},(e=>{var i;return"fontsize"===(null===(i=s.command)||void 0===i?void 0:i.toLowerCase())?`${e}${t.o.defaultFontSizePoints}`:e})),childTemplate:(t,e,s)=>`${s}${t.o.defaultFontSizePoints}`,tooltip:"Font size",isChildActive(t,e){var s,i;const o=t.s.current(),r=(null===(s=e.data)||void 0===s?void 0:s.cssRule)||"font-size",n=(null===(i=e.data)||void 0===i?void 0:i.normalize)||(e=>/pt$/i.test(e)&&"pt"===t.o.defaultFontSizePoints?e.replace(/pt$/i,""):e);if(o){const s=S.i.closest(o,(e=>S.i.isBlock(e,t.ew)||e&&S.i.isElement(e)),t.editor)||t.editor,i=(0,c.css)(s,r);return!(!i||!e.args||n(""+e.args[0])!==n(""+i))}return!1}},n.D.prototype.controls.font={...n.D.prototype.controls.fontsize,command:"fontname",list:{"":"Default","Helvetica,sans-serif":"Helvetica","Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","'Times New Roman',Times,serif":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},childTemplate:(t,e,s)=>`${s}`,data:{cssRule:"font-family",normalize:t=>t.toLowerCase().replace(/['"]+/g,"").replace(/[^a-z0-9]+/g,",")},tooltip:"Font family"},n.D.prototype.controls.paragraph={command:"formatBlock",update(t){const e=t.j,s=t.control,i=e.s.current();if(i&&e.o.textIcons){const o=(S.i.closest(i,(t=>S.i.isBlock(t,e.ew)),e.editor)||e.editor).nodeName.toLowerCase(),r=s.list;t&&s.data&&s.data.currentValue!==o&&r&&r[o]&&(e.o.textIcons?t.state.text=o:t.state.icon.name=o,s.data.currentValue=o)}return!1},exec:c.memorizeExec,data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote"},isChildActive(t,e){const s=t.s.current();if(s){const i=S.i.closest(s,(e=>S.i.isBlock(e,t.ew)),t.editor);return!(!i||i===t.editor||void 0===e.args||i.nodeName.toLowerCase()!==e.args[0])}return!1},isActive(t,e){const s=t.s.current();if(s){const i=S.i.closest(s,(e=>S.i.isBlock(e,t.ew)),t.editor);return!(!i||i===t.editor||void 0===e.list||S.i.isTag(i,"p")||void 0===e.list[i.nodeName.toLowerCase()])}return!1},childTemplate:(t,e,s)=>`<${e} style="margin:0;padding:0">${t.i18n(s)}`,tooltip:"Insert format block"},n.D.prototype.fullsize=!1,n.D.prototype.globalFullSize=!0,n.D.prototype.controls.fullsize={exec(t){t.toggleFullSize()},update(t){const e=t.j,s=e.isFullSize?"shrink":"fullsize";t.state.activated=e.isFullSize,e.o.textIcons?t.state.text=s:t.state.icon.name=s},tooltip:"Open editor in fullsize",mode:a.MODE_SOURCE+a.MODE_WYSIWYG},n.D.prototype.commandToHotkeys={removeFormat:["ctrl+shift+m","cmd+shift+m"],insertOrderedList:["ctrl+shift+7","cmd+shift+7"],insertUnorderedList:["ctrl+shift+8, cmd+shift+8"],selectall:["ctrl+a","cmd+a"]};class pe extends H{constructor(){super(...arguments),this.onKeyPress=t=>{const e=this.specialKeys[t.which],s=(t.key||String.fromCharCode(t.which)).toLowerCase(),i=[e||s];return["alt","ctrl","shift","meta"].forEach((s=>{t[s+"Key"]&&e!==s&&i.push(s)})),(0,c.normalizeKeyAliases)(i.join("+"))},this.specialKeys={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",91:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}}afterInit(t){(0,c.keys)(t.o.commandToHotkeys,!1).forEach((e=>{const s=t.o.commandToHotkeys[e];s&&((0,c.isArray)(s)||(0,c.isString)(s))&&t.registerHotkeyToCommand(s,e)}));let e=!1;t.e.off(".hotkeys").on([t.ow,t.ew],"keydown.hotkeys",(t=>{if(t.key===a.KEY_ESC)return this.j.e.fire("escape",t)})).on("keydown.hotkeys",(s=>{const i=this.onKeyPress(s),o={shouldStop:!0};if(!1===this.j.e.fire(i+".hotkey",s.type,o)){if(o.shouldStop)return e=!0,t.e.stopPropagation("keydown"),!1;s.preventDefault()}}),void 0,!0).on("keyup.hotkeys",(()=>{if(e)return e=!1,t.e.stopPropagation("keyup"),!1}),void 0,!0)}beforeDestruct(t){t.events&&t.e.off(".hotkeys")}}function fe(t){const e=t.options;t.e.on("afterSetMode",(()=>{t.isEditorMode()&&t.s.focus()})).on("generateDocumentStructure.iframe",((t,s)=>{const i=t||s.iframe.contentWindow.document;if(i.open(),i.write(e.iframeDoctype+``+`${e.iframeTitle}`+(e.iframeBaseUrl?``:"")+''),i.close(),e.iframeCSSLinks&&e.iframeCSSLinks.forEach((t=>{const e=i.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",t),i.head&&i.head.appendChild(e)})),e.iframeStyle){const t=i.createElement("style");t.innerHTML=e.iframeStyle,i.head&&i.head.appendChild(t)}})).on("createEditor",(()=>{if(!e.iframe)return;const s=t.c.element("iframe");s.style.display="block",s.src="about:blank",s.className="jodit-wysiwyg_iframe",s.setAttribute("allowtransparency","true"),s.setAttribute("tabindex",""+e.tabIndex),s.setAttribute("frameborder","0"),t.workplace.appendChild(s),t.iframe=s;const i=t.e.fire("generateDocumentStructure.iframe",null,t);return(0,c.callPromise)(i,(()=>{if(!t.iframe)return;const s=t.iframe.contentWindow.document;t.editorWindow=t.iframe.contentWindow;const i=()=>{(0,c.attr)(s.body,"contenteditable",t.getMode()!==a.MODE_SOURCE&&!t.getReadOnly()||null)},o=t=>{const e=//im,s="{%%BODY%%}",i=e.exec(t);return i&&(t=t.replace(e,s).replace(/]*?)>(.*?)<\/span>/gim,"").replace(/<span([^&]*?)>(.*?)<\/span>/gim,"").replace(s,i[0].replace(/(]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im,"$1").replace(/(]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5").replace(/(<[^<]+?)\sclass="[\s]*"/gim,"$1").replace(/(<[^<]+?)\sstyle="[\s;]*"/gim,"$1").replace(/(<[^<]+?)\sdir="[\s]*"/gim,"$1")),t};if(e.editHTMLDocumentMode){const e=t.element.tagName;if("TEXTAREA"!==e&&"INPUT"!==e)throw(0,c.error)("If enable `editHTMLDocumentMode` - source element should be INPUT or TEXTAREA");t.e.on("beforeGetNativeEditorValue",(()=>o(t.o.iframeDoctype+s.documentElement.outerHTML))).on("beforeSetNativeEditorValue",(e=>!t.isLocked&&(/<(html|body)/i.test(e)?o(s.documentElement.outerHTML)!==o(e)&&(s.open(),s.write(t.o.iframeDoctype+o(e)),s.close(),t.editor=s.body,i(),t.e.fire("prepareWYSIWYGEditor")):s.body.innerHTML=e,!0)))}if(t.editor=s.body,t.e.on("afterSetMode afterInit afterAddPlace",i),"auto"===e.height){s.documentElement&&(s.documentElement.style.overflowY="hidden");const i=t.async.throttle((()=>{t.editor&&t.iframe&&"auto"===e.height&&(0,c.css)(t.iframe,"height",t.editor.offsetHeight)}),t.defaultTimeout/2);t.e.on("change afterInit afterSetMode resize",i).on([t.iframe,t.ew,s.documentElement],"load",i).on(s,"readystatechange DOMContentLoaded",i)}return s.documentElement&&t.e.on(s.documentElement,"mousedown touchend",(()=>{t.s.isFocused()||(t.s.focus(),t.editor===s.body&&t.s.setCursorIn(s.body))})).on(t.ew,"mousedown touchstart keydown keyup touchend click mouseup mousemove scroll",(e=>{var s;null===(s=t.events)||void 0===s||s.fire(t.ow,e)})),!1}))}))}function me(t){const e=t.o,s=t.i18n.bind(t),i=k.JO.get.bind(k.JO),o=e.filebrowser.ajax.url||e.uploader.url,r=e.image.useImageEditor;return t.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t${i("image")}\n\t\t\t\t\t\t${i("crop")}\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
`)}function ge(t){const e=t.o,s=t.i18n.bind(t),i=k.JO.get.bind(k.JO);return t.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t${i("lock")}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t`)}n.D.prototype.iframeBaseUrl="",n.D.prototype.iframeTitle="Jodit Editor",n.D.prototype.iframeDoctype="",n.D.prototype.iframeDefaultSrc="about:blank",n.D.prototype.iframeStyle='html{margin:0;padding:0;min-height: 100%;}body{box-sizing:border-box;font-size:13px;line-height:1.6;padding:10px;margin:0;background:transparent;color:#000;position:relative;z-index:2;user-select:auto;margin:0px;overflow:auto;outline:none;}table{width:100%;border:none;border-collapse:collapse;empty-cells: show;max-width: 100%;}th,td{padding: 2px 5px;border:1px solid #ccc;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}p{margin-top:0;}.jodit_editor .jodit_iframe_wrapper{display: block;clear: both;user-select: none;position: relative;}.jodit_editor .jodit_iframe_wrapper:after {position:absolute;content:"";z-index:1;top:0;left:0;right: 0;bottom: 0;cursor: pointer;display: block;background: rgba(0, 0, 0, 0);} .jodit_disabled{user-select: none;-o-user-select: none;-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none}',n.D.prototype.iframeCSSLinks=[],n.D.prototype.editHTMLDocumentMode=!1,n.D.prototype.image={dialogWidth:600,openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editBorderRadius:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0};const ve=t=>(t=(0,c.trim)(t),/^[0-9]+$/.test(t)?t+"px":t),be=t=>/^[-+]?[0-9.]+px$/.test(""+t)?parseFloat(""+t):t;class we extends H{constructor(){super(...arguments),this.state={image:new Image,get ratio(){return this.image.naturalWidth/this.image.naturalHeight||1},sizeIsLocked:!0,marginIsLocked:!0}}onChangeMarginIsLocked(){if(!this.form)return;const{marginRight:t,marginBottom:e,marginLeft:s,lockMargin:i}=(0,c.refs)(this.form);[t,e,s].forEach((t=>{(0,c.attr)(t,"disabled",this.state.marginIsLocked||null)})),i.innerHTML=k.JO.get(this.state.marginIsLocked?"lock":"unlock")}onChangeSizeIsLocked(){if(!this.form)return;const{lockSize:t,imageWidth:e}=(0,c.refs)(this.form);t.innerHTML=k.JO.get(this.state.sizeIsLocked?"lock":"unlock"),t.classList.remove("jodit-properties__lock"),t.classList.remove("jodit-properties__unlock"),t.classList.add(this.state.sizeIsLocked?"jodit-properties__lock":"jodit-properties__unlock"),this.j.e.fire(e,"change")}open(){return this.makeForm(),this.j.e.fire("hidePopup"),(0,c.markOwner)(this.j,this.dialog.container),this.state.marginIsLocked=!0,this.state.sizeIsLocked=!0,this.updateValues(),this.dialog.open().setModal(!0).setPosition(),!1}makeForm(){if(this.dialog)return;this.dialog=new R({fullsize:this.j.o.fullsize,globalFullSize:this.j.o.globalFullSize,theme:this.j.o.theme,language:this.j.o.language,minWidth:Math.min(400,screen.width),minHeight:400,buttons:["fullsize","dialog.close"]});const t=this.j,e=t.o,s=t.i18n.bind(t),i={check:(0,f.zx)(t,"ok","Apply"),remove:(0,f.zx)(t,"bin","Delete")};t.e.on(this.dialog,"afterClose",(()=>{this.state.image.parentNode&&e.image.selectImageAfterClose&&t.s.select(this.state.image)})),i.remove.onAction((()=>{t.s.removeNode(this.state.image),this.dialog.close()}));const{dialog:o}=this;o.setHeader(s("Image properties"));const r=(t=>{const{showPreview:e,editSize:s}=t.o.image,i=k.JO.get.bind(k.JO);return t.c.fromHTML(`
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t${i("lock")}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t
`)})(t);this.form=r,o.setContent(r);const{tabsBox:n}=(0,c.refs)(this.form);n&&n.appendChild((0,ie.IL)(t,[{name:"Image",content:me(t)},{name:"Advanced",content:ge(t)}])),i.check.onAction(this.onApply);const{changeImage:a,editImage:l}=(0,c.refs)(this.form);t.e.on(a,"click",this.openImagePopup),e.image.useImageEditor&&t.e.on(l,"click",this.openImageEditor);const{lockSize:h,lockMargin:d,imageWidth:u,imageHeight:p}=(0,c.refs)(r);h&&t.e.on(h,"click",(()=>{this.state.sizeIsLocked=!this.state.sizeIsLocked})),t.e.on(d,"click",(t=>{this.state.marginIsLocked=!this.state.marginIsLocked,t.preventDefault()}));const m=t=>{if(!(0,c.isNumeric)(u.value)||!(0,c.isNumeric)(p.value))return;const e=parseFloat(u.value),s=parseFloat(p.value);t.target===u?p.value=""+Math.round(e/this.state.ratio):u.value=""+Math.round(s*this.state.ratio)};t.e.on([u,p],"change keydown mousedown paste",(e=>{this.state.sizeIsLocked&&t.async.setTimeout(m.bind(this,e),{timeout:t.defaultTimeout,label:"image-properties-changeSize"})})),o.setFooter([i.remove,i.check]),o.setSize(this.j.o.image.dialogWidth)}updateValues(){const t=this.j.o,{image:e}=this.state,{marginTop:s,marginRight:i,marginBottom:o,marginLeft:r,lockMargin:n,imageSrc:a,id:l,classes:h,align:d,style:u,imageTitle:p,imageAlt:f,borderRadius:m,imageLink:g,imageWidth:v,imageHeight:b,imageLinkOpenInNewTab:w,imageViewSrc:y,lockSize:_}=(0,c.refs)(this.form);(()=>{n.checked=this.state.marginIsLocked,_.checked=this.state.sizeIsLocked})(),a.value=(0,c.attr)(e,"src")||"",y&&(0,c.attr)(y,"src",(0,c.attr)(e,"src")||""),(()=>{p.value=(0,c.attr)(e,"title")||"",f.value=(0,c.attr)(e,"alt")||"";const t=S.i.closest(e,"a",this.j.editor);t?(g.value=(0,c.attr)(t,"href")||"",w.checked="_blank"===(0,c.attr)(t,"target")):(g.value="",w.checked=!1)})(),(()=>{const t=(0,c.attr)(e,"width")||(0,c.css)(e,"width",void 0,!0)||!1,s=(0,c.attr)(e,"height")||(0,c.css)(e,"height",void 0,!0)||!1;v.value=!1!==t?""+be(t):""+e.offsetWidth,b.value=!1!==s?""+be(s):""+e.offsetHeight,this.state.sizeIsLocked=(()=>!(!(0,c.isNumeric)(v.value)||!(0,c.isNumeric)(b.value))&&1>Math.abs(parseFloat(v.value)-parseFloat(b.value)*this.state.ratio))()})(),(()=>{if(!t.image.editMargins)return;let n=!0,a=!1;[s,i,o,r].forEach((t=>{const i=(0,c.attr)(t,"data-ref")||"";let o=e.style.getPropertyValue((0,c.kebabCase)(i));if(!o)return a=!0,void(t.value="");/^[0-9]+(px)?$/.test(o)&&(o=parseInt(o,10)),t.value=""+o||"",(a&&t.value||n&&"marginTop"!==i&&t.value!==s.value)&&(n=!1)})),this.state.marginIsLocked=n})(),h.value=((0,c.attr)(e,"class")||"").replace(/jodit_focused_image[\s]*/,""),l.value=(0,c.attr)(e,"id")||"",m.value=""+(parseInt(e.style.borderRadius||"0",10)||"0"),e.style.cssFloat&&-1!==["left","right"].indexOf(e.style.cssFloat.toLowerCase())?d.value=(0,c.css)(e,"float"):"block"===(0,c.css)(e,"display")&&"auto"===e.style.marginLeft&&"auto"===e.style.marginRight&&(d.value="center"),u.value=(0,c.attr)(e,"style")||""}onApply(){const{style:t,imageSrc:e,borderRadius:s,imageTitle:i,imageAlt:o,imageLink:r,imageWidth:n,imageHeight:a,marginTop:l,marginRight:h,marginBottom:d,marginLeft:u,imageLinkOpenInNewTab:p,align:f,classes:m,id:g}=(0,c.refs)(this.form),v=this.j.o,{image:b}=this.state;if(v.image.editStyle&&(0,c.attr)(b,"style",t.value||null),!e.value)return S.i.safeRemove(b),void this.dialog.close();(0,c.attr)(b,"src",e.value),b.style.borderRadius="0"!==s.value&&/^[0-9]+$/.test(s.value)?s.value+"px":"",(0,c.attr)(b,"title",i.value||null),(0,c.attr)(b,"alt",o.value||null);let w=S.i.closest(b,"a",this.j.editor);r.value?(w||(w=S.i.wrap(b,"a",this.j)),(0,c.attr)(w,"href",r.value),(0,c.attr)(w,"target",p.checked?"_blank":null)):w&&w.parentNode&&w.parentNode.replaceChild(b,w),n.value===""+b.offsetWidth&&a.value===""+b.offsetHeight||((0,c.css)(b,{width:(0,c.trim)(n.value)?ve(n.value):null,height:(0,c.trim)(a.value)?ve(a.value):null}),(0,c.attr)(b,"width",null),(0,c.attr)(b,"height",null));const y=[l,h,d,u];v.image.editMargins&&(this.state.marginIsLocked?(0,c.css)(b,"margin",ve(l.value)):y.forEach((t=>{const e=(0,c.attr)(t,"data-ref")||"";(0,c.css)(b,e,ve(t.value))}))),v.image.editClass&&(0,c.attr)(b,"class",m.value||null),v.image.editId&&(0,c.attr)(b,"id",g.value||null),v.image.editAlign&&(f.value?["right","left"].includes(f.value.toLowerCase())?((0,c.css)(b,"float",f.value),(0,c.clearCenterAlign)(b)):(0,c.css)(b,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):((0,c.css)(b,"float")&&-1!==["right","left"].indexOf((""+(0,c.css)(b,"float")).toLowerCase())&&(0,c.css)(b,"float",""),(0,c.clearCenterAlign)(b))),this.j.setEditorValue(),this.dialog.close()}openImageEditor(){const t=(0,c.attr)(this.state.image,"src")||"",e=this.j.c.element("a"),s=()=>{e.host===location.host||O(this.j.i18n("You can only edit your own images. Download this image on the host?"),(t=>{t&&this.j.uploader&&this.j.uploader.uploadRemoteImage(""+e.href,(t=>{A(this.j.i18n("The image has been successfully uploaded to the host!"),(()=>{(0,c.isString)(t.newfilename)&&((0,c.attr)(this.state.image,"src",t.baseurl+t.newfilename),this.updateValues())})).bindDestruct(this.j)}),(t=>{A(this.j.i18n("There was an error loading %s",t.message)).bindDestruct(this.j)}))})).bindDestruct(this.j)};e.href=t,this.j.filebrowser.dataProvider.getPathByUrl(""+e.href).then((s=>{rt.call(this.j.filebrowser,e.href,s.name,s.path,s.source,(()=>{const e=(new Date).getTime();(0,c.attr)(this.state.image,"src",t+(-1!==t.indexOf("?")?"":"?")+"&_tmp="+e),this.updateValues()}),(t=>{A(t.message).bindDestruct(this.j)}))})).catch((t=>{A(t.message,s).bindDestruct(this.j)}))}openImagePopup(t){const e=new k.GI(this.j),{changeImage:s}=(0,c.refs)(this.form);e.setZIndex(this.dialog.getZIndex()+1),e.setContent((0,ie.ov)(this.j,{upload:t=>{t.files&&t.files.length&&(0,c.attr)(this.state.image,"src",t.baseurl+t.files[0]),this.updateValues(),e.close()},filebrowser:t=>{t&&(0,c.isArray)(t.files)&&t.files.length&&((0,c.attr)(this.state.image,"src",t.files[0]),e.close(),this.updateValues())}},this.state.image,e.close)).open((()=>(0,c.position)(s))),t.stopPropagation()}afterInit(t){const e=this;t.e.on("afterConstructor changePlace",(()=>{t.e.off(t.editor,".imageproperties").on(t.editor,"dblclick.imageproperties",(s=>{const i=s.target;S.i.isTag(i,"img")&&(t.o.image.openOnDblClick?(e.state.image=i,t.o.readonly||(s.stopImmediatePropagation(),s.preventDefault(),e.open())):(s.stopImmediatePropagation(),t.s.select(i)))}))})).on("openImageProperties.imageproperties",(t=>{this.state.image=t,this.open()}))}beforeDestruct(t){this.dialog&&this.dialog.destruct(),t.e.off(t.editor,".imageproperties").off(".imageproperties")}}function ye(t){t.e.on("change afterInit changePlace",t.async.debounce((()=>{t.editor&&(0,c.$$)("img",t.editor).forEach((e=>{e.__jodit_imageprocessor_binded||(e.__jodit_imageprocessor_binded=!0,e.complete||e.addEventListener("load",(function s(){var i;!t.isInDestruct&&(null===(i=t.e)||void 0===i||i.fire("resize")),e.removeEventListener("load",s)})),t.e.on(e,"mousedown touchstart",(()=>{t.s.select(e)})))}))}),t.defaultTimeout))}function _e(t){t.registerButton({name:"image",group:"media"})}(0,r.__decorate)([(0,j.watch)("state.marginIsLocked")],we.prototype,"onChangeMarginIsLocked",null),(0,r.__decorate)([(0,j.watch)("state.sizeIsLocked")],we.prototype,"onChangeSizeIsLocked",null),(0,r.__decorate)([j.autobind],we.prototype,"onApply",null),(0,r.__decorate)([j.autobind],we.prototype,"openImageEditor",null),(0,r.__decorate)([j.autobind],we.prototype,"openImagePopup",null),n.D.prototype.controls.image={popup(t,e,s,i){let o=null;e&&!S.i.isText(e)&&S.i.isHTMLElement(e,t.ew)&&(S.i.isTag(e,"img")||(0,c.$$)("img",e).length)&&(o=S.i.isTag(e,"img")?e:(0,c.$$)("img",e)[0]);const r=t.s.save();return(0,ie.ov)(t,{filebrowser(e){t.s.restore(r),e.files&&e.files.forEach((s=>t.s.insertImage(e.baseurl+s,null,t.o.imageDefaultWidth))),i()},upload:!0,async url(e,s){t.s.restore(r);const n=o||t.createInside.element("img");n.setAttribute("src",e),n.setAttribute("alt",s),o||await t.s.insertImage(n,null,t.o.imageDefaultWidth),i()}},o,i)},tags:["img"],tooltip:"Insert Image"},n.D.prototype.controls.indent={tooltip:"Increase Indent"};const Ce=t=>"rtl"===t?"marginRight":"marginLeft";function je(t){const e=Ce(t.o.direction);t.registerButton({name:"indent",group:"indent"}).registerButton({name:"outdent",group:"indent"});const s=s=>{const i=[];return t.s.eachSelection((o=>{const r=t.s.save();let n=!!o&&S.i.up(o,(e=>S.i.isBlock(e,t.ew)),t.editor);const l=t.o.enter;if(!n&&o&&(n=S.i.wrapInline(o,l!==a.BR?l:a.PARAGRAPH,t)),!n)return t.s.restore(r),!1;const h=-1!==i.indexOf(n);if(n&&n.style&&!h){i.push(n);let o=n.style[e]?parseInt(n.style[e],10):0;o+=t.o.indentMargin*("outdent"===s?-1:1),n.style[e]=o>0?o+"px":"",(0,c.attr)(n,"style")||n.removeAttribute("style")}t.s.restore(r)})),t.setEditorValue(),!1};t.registerCommand("indent",{exec:s,hotkeys:["ctrl+]","cmd+]"]}),t.registerCommand("outdent",{exec:s,hotkeys:["ctrl+[","cmd+["]})}function xe(t){t.registerButton({name:"hr",group:"insert"}),t.registerCommand("insertHorizontalRule",(()=>{const e=t.createInside.element("hr");t.s.insertNode(e,!1,!1);const s=S.i.closest(e.parentElement,(e=>S.i.isBlock(e,t.ew)),t.editor);s&&S.i.isEmpty(s)&&s!==t.editor&&(S.i.after(s,e),S.i.safeRemove(s));let i=S.i.next(e,(e=>S.i.isBlock(e,t.ew)),t.editor,!1);return i||(i=t.createInside.element(t.o.enter),S.i.after(e,i)),t.s.setCursorIn(i),!1}))}n.D.prototype.controls.outdent={isDisabled(t){const e=t.s.current();if(e){const s=S.i.closest(e,(e=>S.i.isBlock(e,t.ew)),t.editor),i=Ce(t.o.direction);if(s&&s.style&&s.style[i])return 0>=parseInt(s.style[i],10)}return!0},tooltip:"Decrease Indent"},n.D.prototype.indentMargin=10,n.D.prototype.controls.hr={command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},n.D.prototype.toolbarInline=!0,n.D.prototype.toolbarInlineForSelection=!1,n.D.prototype.toolbarInlineDisableFor=[],n.D.prototype.toolbarInlineDisabledButtons=["source"],n.D.prototype.popup={a:s(44).Z,img:s(45).Z,cells:s(46).Z,jodit:[{name:"bin",tooltip:"Delete",exec(t,e){e&&t.s.removeNode(e)}}],"jodit-media":[{name:"bin",tooltip:"Delete",exec(t,e){e&&t.s.removeNode(e)}}],selection:["bold","underline","italic","ul","ol","\n","outdent","indent","fontsize","brush","cut","\n","paragraph","link","align","dots"]};class Ee extends H{constructor(){super(...arguments),this.requires=["select"],this.type=null,this.popup=new p.G(this.jodit,!1),this.toolbar=M(this.jodit,this.popup),this.snapRange=null,this.elmsList=(0,c.keys)(this.j.o.popup,!1).filter((t=>!this.isExcludedTarget(t)))}onClick(t){const e=this.elmsList,s=S.i.isTag(t,"img")?t:S.i.closest(t,e,this.j.editor);if(s&&this.canShowPopupForType(s.nodeName.toLowerCase()))return this.showPopup((()=>(0,c.position)(s,this.j)),s.nodeName.toLowerCase(),s),!1}showPopup(t,e,s){if(e=e.toLowerCase(),!this.canShowPopupForType(e))return!1;if(this.type!==e||s!==this.previousTarget){this.previousTarget=s;const t=this.j.o.popup[e];let i;i=(0,c.isFunction)(t)?t(this.j,s,this.popup.close):t,(0,c.isArray)(i)&&(this.toolbar.build(i,s),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,i=this.toolbar.container),this.popup.setContent(i),this.type=e}return this.popup.open(t),!0}hidePopup(t){(0,c.isString)(t)&&t!==this.type||this.popup.close()}onOutsideClick(t){this.popup.close()}canShowPopupForType(t){const e=this.j.o.popup[t.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!e||this.isExcludedTarget(t))}isExcludedTarget(t){return(0,c.splitArray)(this.j.o.toolbarInlineDisableFor).map((t=>t.toLowerCase())).includes(t.toLowerCase())}afterInit(t){this.j.e.on("getDiffButtons.mobile",(e=>{if(this.toolbar===e){const e=this.toolbar.getButtonsNames();return(0,c.toArray)(t.registeredButtons).filter((t=>!this.j.o.toolbarInlineDisabledButtons.includes(t.name))).filter((t=>{const s=(0,c.isString)(t)?t:t.name;return s&&"|"!==s&&"\n"!==s&&!e.includes(s)}))}})).on("hidePopup",this.hidePopup).on("showPopup",((t,e,s)=>{this.showPopup(e,s||((0,c.isString)(t)?t:t.nodeName),(0,c.isString)(t)?void 0:t)})).on("mousedown keydown",this.onSelectionStart).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.addListenersForElements()}onSelectionStart(){this.snapRange=this.j.s.range.cloneRange()}onSelectionEnd(t){if(t&&t.target&&k.u1.closestElement(t.target,p.G))return;const{snapRange:e}=this,{range:s}=this.j.s;e&&!s.collapsed&&s.startContainer===e.startContainer&&s.startOffset===e.startOffset&&s.endContainer===e.endContainer&&s.endOffset===e.endOffset||this.onSelectionChange()}onSelectionChange(){if(!this.j.o.toolbarInlineForSelection)return;const t="selection",e=this.j.s.sel,s=this.j.s.range;(null==e?void 0:e.isCollapsed)||this.isSelectedTarget(s)||this.tableModule.getAllSelectedCells().length?this.type===t&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((()=>s.getBoundingClientRect()),t)}isSelectedTarget(t){const e=t.startContainer;return S.i.isElement(e)&&e===t.endContainer&&S.i.isTag(e.childNodes[t.startOffset],(0,c.keys)(this.j.o.popup,!1))&&t.startOffset===t.endOffset-1}get tableModule(){return this.j.getInstance("Table",this.j.o)}beforeDestruct(t){t.e.off("showPopup").off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.removeListenersForElements()}addListenersForElements(){this.j.e.on(this.elmsList.map((t=>(0,c.camelCase)("click_"+t))).join(" "),this.onClick)}removeListenersForElements(){this.j.e.off(this.elmsList.map((t=>(0,c.camelCase)("click_"+t))).join(" "),this.onClick)}}(0,r.__decorate)([j.autobind],Ee.prototype,"onClick",null),(0,r.__decorate)([(0,j.wait)((t=>!t.j.isLocked))],Ee.prototype,"showPopup",null),(0,r.__decorate)([(0,j.watch)(":clickEditor"),j.autobind],Ee.prototype,"hidePopup",null),(0,r.__decorate)([(0,j.watch)(":outsideClick")],Ee.prototype,"onOutsideClick",null),(0,r.__decorate)([j.autobind],Ee.prototype,"onSelectionStart",null),(0,r.__decorate)([j.autobind],Ee.prototype,"onSelectionEnd",null),(0,r.__decorate)([(0,j.debounce)((t=>t.defaultTimeout))],Ee.prototype,"onSelectionChange",null),n.D.prototype.controls.align={name:"left",tooltip:"Align",update(t){const e=t.j,s=t.control,i=e.s.current();if(i){const o=S.i.closest(i,(t=>S.i.isBlock(t,e.ew)),e.editor)||e.editor;let r=""+(0,c.css)(o,"text-align");s.defaultValue&&-1!==s.defaultValue.indexOf(r)&&(r="left"),s.data&&s.data.currentValue!==r&&s.list&&-1!==s.list.indexOf(r)&&(e.o.textIcons?t.state.text=r:t.state.icon.name=r,s.data.currentValue=r)}},isActive(t,e){const s=t.s.current();if(s&&e.defaultValue){const i=S.i.closest(s,(e=>S.i.isBlock(e,t.ew)),t.editor)||t.editor;return-1===e.defaultValue.indexOf(""+(0,c.css)(i,"text-align"))}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},n.D.prototype.controls.center={command:"justifyCenter",css:{"text-align":"center"},tooltip:"Align Center"},n.D.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},n.D.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},n.D.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"};const Se=(t,e,s)=>{if(S.i.isNode(e,s.ew)&&S.i.isElement(e))switch(((t,e)=>{S.i.each(t,(t=>{S.i.isHTMLElement(t,e.ew)&&t.style.textAlign&&(t.style.textAlign="",t.style.cssText.trim().length||t.removeAttribute("style"))}))})(e,s),t.toLowerCase()){case"justifyfull":e.style.textAlign="justify";break;case"justifyright":e.style.textAlign="right";break;case"justifyleft":e.style.textAlign="left";break;case"justifycenter":e.style.textAlign="center"}};function ke(t){t.registerButton({name:"align",group:"indent"});const e=e=>(t.s.focus(),t.s.eachSelection((s=>{if(!s)return;let i=S.i.up(s,(e=>S.i.isBlock(e,t.ew)),t.editor);i||(i=S.i.wrapInline(s,t.o.enterBlock,t)),Se(e,i,t)})),!1);t.registerCommand("justifyfull",e),t.registerCommand("justifyright",e),t.registerCommand("justifyleft",e),t.registerCommand("justifycenter",e)}n.D.prototype.limitWords=!1,n.D.prototype.limitChars=!1,n.D.prototype.limitHTML=!1;class Te extends H{afterInit(t){const{limitWords:e,limitChars:s}=t.o;if(t&&(e||s)){let e=null;t.e.off(".limit").on("beforePaste.limit",(()=>{e=t.observer.snapshot.make()})).on("keydown.limit keyup.limit beforeEnter.limit beforePaste.limit",this.checkPreventKeyPressOrPaste).on("change.limit",this.checkPreventChanging).on("afterPaste.limit",(()=>{if(this.shouldPreventInsertHTML()&&e)return t.observer.snapshot.restore(e),!1}))}}shouldPreventInsertHTML(t=null,e=""){if(t&&a.COMMAND_KEYS.includes(t.key))return!1;const{jodit:s}=this,{limitWords:i,limitChars:o}=s.o,r=this.splitWords(e||(s.o.limitHTML?s.value:s.text));return!(!i||i>r.length)||!!o&&r.join("").length>=o}checkPreventKeyPressOrPaste(t){if(this.shouldPreventInsertHTML(t))return!1}checkPreventChanging(t,e){const{jodit:s}=this,{limitWords:i,limitChars:o}=s.o,r=s.o.limitHTML?t:(0,c.stripTags)(t),n=this.splitWords(r);(i&&n.length>i||o&&n.join("").length>o)&&(s.value=e)}splitWords(t){return t.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((t=>t.length))}beforeDestruct(t){t.e.off(".limit")}}(0,r.__decorate)([j.autobind],Te.prototype,"checkPreventKeyPressOrPaste",null),(0,r.__decorate)([j.autobind],Te.prototype,"checkPreventChanging",null);var Ie=s(40);n.D.prototype.link={formTemplate(t){const{openInNewTabCheckbox:e,noFollowCheckbox:s,modeClassName:i,selectSizeClassName:o,selectMultipleClassName:r,selectOptionsClassName:n}=t.o.link;return new Ie.x4(t,[new Ie.eC(t,[new Ie.u3(t,{name:"url",type:"text",ref:"url_input",label:"URL",placeholder:"http://",required:!0})]),new Ie.eC(t,[new Ie.u3(t,{name:"content",ref:"content_input",label:"Text"})],{ref:"content_input_box"}),i?new Ie.eC(t,["input"===i?new Ie.u3(t,{name:"className",ref:"className_input",label:"Class name"}):"select"===i?new Ie.Cj(t,{name:"className",ref:"className_select",label:"Class name",size:o,multiple:r,options:n}):null]):null,e?new Ie.mA(t,{name:"target",ref:"target_checkbox",label:"Open in new tab"}):null,s?new Ie.mA(t,{name:"nofollow",ref:"nofollow_checkbox",label:"No follow"}):null,new Ie.eC(t,[new f.y3(t,{name:"unlink",status:"default",text:"Unlink"}),new f.y3(t,{name:"insert",type:"submit",status:"primary",text:"Insert"})],{align:"full"})])},followOnDblClick:!1,processVideoLink:!0,processPastedLink:!0,noFollowCheckbox:!0,openInNewTabCheckbox:!0,modeClassName:"input",selectMultipleClassName:!0,selectSizeClassName:3,selectOptionsClassName:[],hotkeys:["ctrl+k","cmd+k"]},n.D.prototype.controls.unlink={exec(t,e){const s=S.i.closest(e,"a",t.editor);s&&S.i.unwrap(s),t.setEditorValue(),t.e.fire("hidePopup")},tooltip:"Unlink"},n.D.prototype.controls.link={isActive(t){const e=t.s.current();return!(!e||!S.i.closest(e,"a",t.editor))},popup:(t,e,s,i)=>t.e.fire("generateLinkForm.link",e,i),tags:["a"],tooltip:"Insert link"};class qe extends H{constructor(){super(...arguments),this.buttons=[{name:"link",group:"insert"}]}afterInit(t){t.o.link.followOnDblClick&&t.e.on("dblclick.link",this.onDblClickOnLink),t.o.link.processPastedLink&&t.e.on("processPaste.link",this.onProcessPasteLink),t.e.on("generateLinkForm.link",this.generateForm),t.registerCommand("openLinkDialog",{exec:()=>{const e=new R({resizable:!1}),s=this.generateForm(t.s.current(),(()=>{e.close()}));s.container.classList.add("jodit-dialog_alert"),e.setContent(s),e.open(),t.async.requestIdleCallback((()=>{const{url_input:t}=(0,c.refs)(s.container);null==t||t.focus()}))},hotkeys:t.o.link.hotkeys})}onDblClickOnLink(t){if(!S.i.isTag(t.target,"a"))return;const e=(0,c.attr)(t.target,"href");e&&(location.href=e,t.preventDefault())}onProcessPasteLink(t,e){const{jodit:s}=this;if((0,c.isURL)(e)){if(s.o.link.processVideoLink){const t=(0,c.convertMediaUrlToVideoEmbed)(e);if(t!==e)return s.createInside.fromHTML(t)}const t=s.createInside.element("a");return t.setAttribute("href",e),t.textContent=e,s.e.stopPropagation("processPaste"),t}}generateForm(t,e){const{jodit:s}=this,i=s.i18n.bind(s),{openInNewTabCheckbox:o,noFollowCheckbox:r,formTemplate:n,formClassName:a,modeClassName:l}=s.o.link,h=n(s),d=(0,c.isString)(h)?s.c.fromHTML(h,{target_checkbox_box:o,nofollow_checkbox_box:r}):h,u=S.i.isElement(d)?d:d.container,p=(0,c.refs)(u),{insert:f,unlink:m,content_input_box:g}=p,{target_checkbox:v,nofollow_checkbox:b,url_input:w}=p,y=S.i.isImage(t,s.ew);let{content_input:_}=p;const{className_input:C}=p,{className_select:j}=p;let x;_||(_=s.c.element("input",{type:"hidden",ref:"content_input"})),a&&u.classList.add(a),y&&S.i.hide(g);const E=()=>x?x.innerText:(0,c.stripTags)(s.s.range.cloneContents(),s.ed);if(x=!(!t||!S.i.closest(t,"a",s.editor))&&S.i.closest(t,"a",s.editor),!y&&t&&(_.value=E()),x){if(w.value=(0,c.attr)(x,"href")||"",l)switch(l){case"input":C&&(C.value=(0,c.attr)(x,"class")||"");break;case"select":if(j){for(let t=0;j.selectedOptions.length>t;t++){const e=j.options.item(t);e&&(e.selected=!1)}((0,c.attr)(x,"class")||"").split(" ").forEach((t=>{if(t)for(let e=0;j.options.length>e;e++){const s=j.options.item(e);(null==s?void 0:s.value)&&s.value===t&&(s.selected=!0)}}))}}o&&v&&(v.checked="_blank"===(0,c.attr)(x,"target")),r&&b&&(b.checked="nofollow"===(0,c.attr)(x,"rel")),f.textContent=i("Update")}else S.i.hide(m);const k=s.observer.snapshot.make();m&&s.e.on(m,"click",(t=>{s.observer.snapshot.restore(k),x&&S.i.unwrap(x),s.setEditorValue(),e(),t.preventDefault()}));const T=()=>{if(!w.value.trim().length)return w.focus(),w.classList.add("jodit_error"),!1;let t;s.observer.snapshot.restore(k);const i=E()!==_.value.trim();if(x)t=[x];else if(s.s.isCollapsed()){const e=s.createInside.element("a");s.s.insertNode(e),t=[e]}else{const e=s.s.current();t=S.i.isTag(e,["img"])?[S.i.wrap(e,"a",s)]:s.s.wrapInTag("a")}return t.forEach((t=>{var e;if((0,c.attr)(t,"href",w.value),l&&(null!=C?C:j))if("input"===l)""===C.value&&t.hasAttribute("class")&&(0,c.attr)(t,"class",null),""!==C.value&&(0,c.attr)(t,"class",C.value);else if("select"===l){t.hasAttribute("class")&&(0,c.attr)(t,"class",null);for(let s=0;j.selectedOptions.length>s;s++){const i=null===(e=j.selectedOptions.item(s))||void 0===e?void 0:e.value;i&&t.classList.add(i)}}y||(_.value.trim().length?i&&(t.textContent=_.value):t.textContent=w.value),o&&v&&(0,c.attr)(t,"target",v.checked?"_blank":null),r&&b&&(0,c.attr)(t,"rel",b.checked?"nofollow":null)})),s.setEditorValue(),e(),!1};return S.i.isElement(d)?s.e.on(d,"submit",(t=>(t.preventDefault(),t.stopImmediatePropagation(),T(),!1))):d.onSubmit(T),d}beforeDestruct(t){t.e.off("generateLinkForm.link",this.generateForm).off("dblclick.link",this.onDblClickOnLink).off("processPaste.link",this.onProcessPasteLink)}}function Le(t){const e="jodit_fake_wrapper",{mediaFakeTag:s,mediaBlocks:i,mediaInFakeBlock:o}=t.options;o&&t.e.on("afterGetValueFromEditor",(t=>{const i=RegExp(`<${s}[^>]+data-${e}[^>]+>(.+?)`,"ig");i.test(t.value)&&(t.value=t.value.replace(i,"$1"))})).on("change afterInit afterSetMode changePlace",t.async.debounce((()=>{t.isDestructed||t.getMode()===a.MODE_SOURCE||(0,c.$$)(i.join(","),t.editor).forEach((i=>{(0,c.dataBind)(i,e)||((0,c.dataBind)(i,e,!0),(i=>{if(i.parentNode&&(0,c.attr)(i.parentNode,"data-jodit_iframe_wrapper"))i=i.parentNode;else{const o=t.createInside.fromHTML(`<${s} data-jodit-temp="1" contenteditable="false" draggable="true" data-${e}="1">`);o.style.display="inline-block"===i.style.display?"inline-block":"block",o.style.width=i.offsetWidth+"px",o.style.height=i.offsetHeight+"px",i.parentNode&&i.parentNode.insertBefore(o,i),o.appendChild(i),i=o}t.e.off(i,"mousedown.select touchstart.select").on(i,"mousedown.select touchstart.select",(()=>{t.s.setCursorAfter(i)}))})(i))}))}),t.defaultTimeout))}function ze(t){t.registerButton({name:"video",group:"media"})}function Me(t){t.registerButton({name:"file",group:"media"})}function Pe(t){let e=0,s=(0,c.splitArray)(t.o.buttons);t.e.on("touchend",(s=>{if(s.changedTouches&&s.changedTouches.length){const i=(new Date).getTime();i-e>t.o.mobileTapTimeout&&(e=i,t.s.insertCursorAtPoint(s.changedTouches[0].clientX,s.changedTouches[0].clientY))}})).on("getDiffButtons.mobile",(e=>{if(e===t.toolbar){const e=(0,c.splitArray)(t.o.buttons),i=(0,D.q)(s);return e.reduce(((t,e)=>((0,D.A)(e)?t.push({...e,buttons:e.buttons.filter((t=>!i.has(t)))}):i.has(e)||t.push(e),t)),[])}})),t.o.toolbarAdaptive&&t.e.on("resize afterInit recalcAdaptive changePlace afterAddPlace",(()=>{if(!t.o.toolbar)return;const e=t.container.offsetWidth,i=(0,c.splitArray)(t.o.sizeLG>e?t.o.sizeMD>e?t.o.sizeSM>e?t.o.buttonsXS:t.o.buttonsSM:t.o.buttonsMD:t.o.buttons);""+i!=""+s&&(s=i,t.e.fire("closeAllPopups"),t.toolbar.setRemoveButtons(t.o.removeButtons).build(s.concat(t.o.extraButtons)))})).on(t.ow,"load",(()=>t.e.fire("recalcAdaptive")))}(0,r.__decorate)([j.autobind],qe.prototype,"onDblClickOnLink",null),(0,r.__decorate)([j.autobind],qe.prototype,"onProcessPasteLink",null),(0,r.__decorate)([j.autobind],qe.prototype,"generateForm",null),n.D.prototype.mediaFakeTag="jodit-media",n.D.prototype.mediaInFakeBlock=!0,n.D.prototype.mediaBlocks=["video","audio"],n.D.prototype.controls.video={popup(t,e,s,i){const o=new Ie.x4(t,[new Ie.eC(t,[new Ie.u3(t,{name:"url",required:!0,label:"URL",placeholder:"https://",validators:["url"]})]),new Ie.eC(t,[(0,f.zx)(t,"","Insert","primary").onAction((()=>o.submit()))])]),r=new Ie.x4(t,[new Ie.eC(t,[new Ie.GJ(t,{name:"code",required:!0,label:"Embed code"})]),new Ie.eC(t,[(0,f.zx)(t,"","Insert","primary").onAction((()=>r.submit()))])]),n=[],a=t.s.save(),l=e=>{t.s.restore(a),t.s.insertHTML(e),i()};return n.push({icon:"link",name:"Link",content:o.container},{icon:"source",name:"Code",content:r.container}),o.onSubmit((t=>{l((0,c.convertMediaUrlToVideoEmbed)(t.url))})),r.onSubmit((t=>{l(t.code)})),(0,ie.IL)(t,n)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"},n.D.prototype.controls.file={popup(t,e,s,i){const o=(e,s="")=>{t.s.insertNode(t.createInside.fromHTML(`${s||e}`))};let r=null;return e&&(S.i.isTag(e,"a")||S.i.closest(e,"a",t.editor))&&(r=S.i.isTag(e,"a")?e:S.i.closest(e,"a",t.editor)),(0,ie.ov)(t,{filebrowser(t){t.files&&t.files.forEach((e=>o(t.baseurl+e))),i()},upload:!0,url(t,e){r?(r.setAttribute("href",t),r.setAttribute("title",e)):o(t,e),i()}},r,i,!1)},tags:["a"],tooltip:"Insert file"},n.D.prototype.mobileTapTimeout=300,n.D.prototype.toolbarAdaptive=!0,n.D.prototype.controls.dots={mode:a.MODE_SOURCE+a.MODE_WYSIWYG,popup(t,e,s,i,o){let r=s.data;return void 0===r&&(r={toolbar:M(t),rebuild(){var e;if(o){const s=t.e.fire("getDiffButtons.mobile",o.closest(k.bz));if(s&&r){r.toolbar.build((0,c.splitArray)(s));const i=(null===(e=t.toolbar.firstButton)||void 0===e?void 0:e.container.offsetWidth)||36;r.toolbar.container.style.width=3*(i+4)+"px"}}}},s.data=r),r.rebuild(),r.toolbar},tooltip:"Show all"};const De=(t,e,{control:s})=>{const i="button"+s.command,o=s.args&&s.args[0]||(0,c.dataBind)(t,i);(0,c.dataBind)(t,i,o),t.execCommand(s.command,!1,o)};function Ne(t){const e=t=>/insert(un)?orderedlist/i.test(t),s=()=>S.i.up(t.s.current(),(t=>t&&/^UL|OL$/i.test(t.nodeName)),t.editor),i=(t,e)=>{"default"!==e&&e?t.style.setProperty("list-style-type",e):t.style.removeProperty("list-style-type")};t.e.on("beforeCommand",((t,o,r)=>{if(e(t)&&r){const e=s();if(e&&!((t,e)=>{const s=t.style.listStyleType;return s===e||!s&&"default"===e})(e,r)&&(S.i.isTag(e,"ul")&&/unordered/i.test(t)||S.i.isTag(e,"ol")&&!/unordered/i.test(t)))return i(e,r),!1}})).on("afterCommand",((o,r,n)=>{if(e(o)){const e=s();e&&(i(e,n),t.createInside.applyCreateAttributes(e),e.querySelectorAll("li").forEach((e=>{t.createInside.applyCreateAttributes(e)})));const o=[],r=t=>{S.i.isTag(t,["p","h1","h2","h3","h4","h5","h6"])&&o.push(t)};if(e&&(r(e.parentNode),e.querySelectorAll("li").forEach((t=>r(t.firstChild))),o.length)){const s=t.s.save();(0,c.toArray)(e.childNodes).forEach((t=>{S.i.isTag(t.lastChild,"br")&&S.i.safeRemove(t.lastChild)})),o.forEach((t=>S.i.unwrap(t))),t.s.restore(s)}t.setEditorValue()}}))}n.D.prototype.controls.ul={command:"insertUnorderedList",tags:["ul"],tooltip:"Insert Unordered List",list:{default:"Default",circle:"Circle",disc:"Dot",square:"Quadrate"},exec:De},n.D.prototype.controls.ol={command:"insertOrderedList",tags:["ol"],tooltip:"Insert Ordered List",list:{default:"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},exec:De},n.D.prototype.showPlaceholder=!0,n.D.prototype.useInputsPlaceholder=!0,n.D.prototype.placeholder="Type something";class Re extends H{constructor(){super(...arguments),this.addNativeListeners=()=>{this.j.e.off(this.j.editor,"input.placeholder keydown.placeholder").on(this.j.editor,"input.placeholder keydown.placeholder",this.toggle)},this.addEvents=()=>{const t=this.j;t.o.useInputsPlaceholder&&t.element.hasAttribute("placeholder")&&(this.placeholderElm.innerHTML=(0,c.attr)(t.element,"placeholder")||""),t.e.fire("placeholder",this.placeholderElm.innerHTML),t.e.off(".placeholder").on("changePlace.placeholder",this.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",this.toggle).on(window,"load",this.toggle),this.addNativeListeners(),this.toggle()}}afterInit(t){t.o.showPlaceholder&&(this.placeholderElm=t.c.fromHTML(``),"rtl"===t.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),t.e.on("readonly",(t=>{t?this.hide():this.toggle()})).on("changePlace",this.addEvents),this.addEvents())}show(){const t=this.j;if(t.o.readonly)return;let e=0,s=0;const i=t.s.current(),o=i&&S.i.closest(i,(e=>S.i.isBlock(e,t.ew)),t.editor)||t.editor,r=t.ew.getComputedStyle(o);if(t.workplace.appendChild(this.placeholderElm),S.i.isElement(t.editor.firstChild)){const i=t.ew.getComputedStyle(t.editor.firstChild);e=parseInt(i.getPropertyValue("margin-top"),10),s=parseInt(i.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=i.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(r.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=r.getPropertyValue("line-height");(0,c.css)(this.placeholderElm,{display:"block",textAlign:r.getPropertyValue("text-align"),marginTop:Math.max(parseInt(r.getPropertyValue("margin-top"),10),e),marginLeft:Math.max(parseInt(r.getPropertyValue("margin-left"),10),s)})}hide(){S.i.safeRemove(this.placeholderElm)}toggle(){const t=this.j;t.editor&&!t.isInDestruct&&(t.getRealMode()===a.MODE_WYSIWYG&&(t=>{if(!t.firstChild)return!0;const e=t.firstChild;if(a.MAY_BE_REMOVED_WITH_KEY.test(e.nodeName)||/^(TABLE)$/i.test(e.nodeName))return!1;const s=S.i.next(e,(t=>t&&!S.i.isEmptyTextNode(t)),t);return S.i.isText(e)&&!s?S.i.isEmptyTextNode(e):!s&&S.i.each(e,(t=>!S.i.isTag(t,["ul","li","ol"])&&(S.i.isEmpty(t)||S.i.isTag(t,"br"))))})(t.editor)?this.show():this.hide())}beforeDestruct(t){this.hide(),t.e.off(".placeholder").off(window,"load",this.toggle)}}(0,r.__decorate)([(0,j.debounce)((t=>t.defaultTimeout/10),!0)],Re.prototype,"toggle",null),n.D.prototype.controls.redo={mode:a.MODE_SPLIT,isDisabled:t=>!t.observer.stack.canRedo(),tooltip:"Redo"},n.D.prototype.controls.undo={mode:a.MODE_SPLIT,isDisabled:t=>!t.observer.stack.canUndo(),tooltip:"Undo"};class Ae extends H{constructor(){super(...arguments),this.buttons=[{name:"undo",group:"history"},{name:"redo",group:"history"}]}beforeDestruct(){}afterInit(t){const e=e=>(t.observer[e](),!1);t.registerCommand("redo",{exec:e,hotkeys:["ctrl+y","ctrl+shift+z","cmd+y","cmd+shift+z"]}),t.registerCommand("undo",{exec:e,hotkeys:["ctrl+z","cmd+z"]})}}n.D.prototype.useIframeResizer=!0,n.D.prototype.useTableResizer=!0,n.D.prototype.useImageResizer=!0,n.D.prototype.resizer={showSize:!0,hideSizeTimeout:1e3,min_width:10,min_height:10};const Be="__jodit-resizer_binded";class Oe extends H{constructor(){super(...arguments),this.LOCK_KEY="resizer",this.element=null,this.isResized=!1,this.isShown=!1,this.start_x=0,this.start_y=0,this.width=0,this.height=0,this.ratio=0,this.rect=this.j.c.fromHTML('
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t100x100\n\t\t\t
'),this.sizeViewer=this.rect.getElementsByTagName("span")[0],this.onResize=t=>{if(this.isResized){const e=t.clientX-this.start_x,s=t.clientY-this.start_y;if(!this.element)return;const i=this.handle.className;let o=0,r=0;S.i.isTag(this.element,"img")?(e?(o=this.width+(i.match(/left/)?-1:1)*e,r=Math.round(o/this.ratio)):(r=this.height+(i.match(/top/)?-1:1)*s,o=Math.round(r*this.ratio)),o>(0,c.innerWidth)(this.j.editor,this.j.ow)&&(o=(0,c.innerWidth)(this.j.editor,this.j.ow),r=Math.round(o/this.ratio))):(o=this.width+(i.match(/left/)?-1:1)*e,r=this.height+(i.match(/top/)?-1:1)*s),o>this.j.o.resizer.min_width&&(0,c.css)(this.element,"width",this.rect.parentNode.offsetWidth>o?o:"100%"),r>this.j.o.resizer.min_height&&(0,c.css)(this.element,"height",r),this.updateSize(),this.showSizeViewer(this.element.offsetWidth,this.element.offsetHeight),t.stopImmediatePropagation()}},this.onClickOutside=t=>{this.isShown&&(this.isResized?(this.j.unlock(),this.isResized=!1,this.j.setEditorValue(),t.stopImmediatePropagation(),this.j.e.off(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)):this.hide())},this.onClickElement=(t,e)=>{this.element===t&&this.isShown||(this.element=t,this.show(),S.i.isTag(this.element,"img")&&!this.element.complete&&this.j.e.on(this.element,"load",this.updateSize))},this.updateSize=()=>{if(!this.isInDestruct&&this.isShown&&this.element&&this.rect){const t=(0,c.offset)(this.rect.parentNode||this.j.od.documentElement,this.j,this.j.od,!0),e=(0,c.offset)(this.element,this.j,this.j.ed),s=parseInt(this.rect.style.left||"0",10),i=this.rect.offsetWidth,o=this.rect.offsetHeight,r=e.top-1-t.top,n=e.left-1-t.left;parseInt(this.rect.style.top||"0",10)===r&&s===n&&i===this.element.offsetWidth&&o===this.element.offsetHeight||((0,c.css)(this.rect,{top:r,left:n,width:this.element.offsetWidth,height:this.element.offsetHeight}),this.j.events&&(this.j.e.fire(this.element,"changesize"),isNaN(s)||this.j.e.fire("resize")))}},this.hideSizeViewer=()=>{this.sizeViewer.style.opacity="0"}}afterInit(t){(0,c.$$)("i",this.rect).forEach((e=>{t.e.on(e,"mousedown.resizer touchstart.resizer",this.onClickHandle.bind(this,e))})),C.TB.on("hideHelpers",this.hide),t.e.on("readonly",(t=>{t&&this.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(t=>{const e=/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>.*?<\/iframe>.*?)<\/jodit>/gi;e.test(t.value)&&(t.value=t.value.replace(e,"$1"))})).on("hideResizer",this.hide).on("change afterInit afterSetMode",this.onChangeEditor),this.addEventListeners(),this.onChangeEditor()}addEventListeners(){const t=this.j;t.e.off(t.editor,".resizer").off(t.ow,".resizer").on(t.editor,"keydown.resizer",(t=>{this.isShown&&t.key===a.KEY_DELETE&&this.element&&!S.i.isTag(this.element,"table")&&this.onDelete(t)})).on(t.ow,"resize.resizer",this.updateSize).on(t.ow,"mouseup.resizer keydown.resizer touchend.resizer",this.onClickOutside).on([t.ow,t.editor],"scroll.resizer",(()=>{this.isShown&&!this.isResized&&this.hide()}))}onClickHandle(t,e){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=t,e.preventDefault(),e.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResized=!0,this.start_x=e.clientX,this.start_y=e.clientY,this.j.e.fire("hidePopup"),this.j.lock(this.LOCK_KEY),this.j.e.on(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)}onDelete(t){this.element&&("JODIT"!==this.element.tagName?this.j.s.select(this.element):(S.i.safeRemove(this.element),this.hide(),t.preventDefault()))}onChangeEditor(){const t=this.j;this.isShown&&(this.element&&this.element.parentNode?this.updateSize():this.hide()),t.isDestructed||(0,c.$$)("img, table, iframe",t.editor).forEach((e=>{t.getMode()!==a.MODE_SOURCE&&!e[Be]&&(S.i.isTag(e,"iframe")&&t.o.useIframeResizer||S.i.isTag(e,"img")&&t.o.useImageResizer||S.i.isTag(e,"table")&&t.o.useTableResizer)&&(e[Be]=!0,this.bind(e))}))}bind(t){let e;if(S.i.isTag(t,"iframe")){const s=t;(0,c.attr)(t.parentNode,"-jodit_iframe_wrapper")?t=t.parentNode:(e=this.j.createInside.fromHTML(''),(0,c.css)(e,{display:"inline-block"===t.style.display?"inline-block":"block",width:t.offsetWidth,height:t.offsetHeight}),t.parentNode&&t.parentNode.insertBefore(e,t),e.appendChild(t),t=e),this.j.e.off(t,"mousedown.select touchstart.select").on(t,"mousedown.select touchstart.select",(()=>{this.j.s.select(t)})).off(t,"changesize").on(t,"changesize",(()=>{s.setAttribute("width",t.offsetWidth+"px"),s.setAttribute("height",t.offsetHeight+"px")}))}this.j.e.on(t,"dragstart",this.hide).on(t,"mousedown",(e=>{a.IS_IE&&S.i.isTag(t,"img")&&e.preventDefault()})).on(t,"click",(e=>this.onClickElement(t,e)))}showSizeViewer(t,e){this.j.o.resizer.showSize&&(this.sizeViewer.offsetWidth>t||this.sizeViewer.offsetHeight>e?this.hideSizeViewer():(this.sizeViewer.style.opacity="1",this.sizeViewer.textContent=`${t} x ${e}`,this.j.async.setTimeout(this.hideSizeViewer,{timeout:this.j.o.resizer.hideSizeTimeout,label:"hideSizeViewer"})))}show(){this.j.o.readonly||this.isShown||(this.isShown=!0,this.rect.parentNode||((0,c.markOwner)(this.j,this.rect),this.j.workplace.appendChild(this.rect)),this.j.isFullSize&&(this.rect.style.zIndex=""+(0,c.css)(this.j.container,"zIndex")),this.updateSize())}hide(){this.isResized=!1,this.isShown=!1,this.element=null,S.i.safeRemove(this.rect)}beforeDestruct(t){this.hide(),C.TB.off("hideHelpers",this.hide),t.e.off(this.j.ow,".resizer").off(".resizer")}}(0,r.__decorate)([(0,j.debounce)()],Oe.prototype,"onChangeEditor",null),(0,r.__decorate)([j.autobind],Oe.prototype,"hide",null),n.D.prototype.useSearch=!0,n.D.prototype.controls.find={tooltip:"Find",icon:"search",exec(t,e,{control:s}){switch(s.args&&s.args[0]){case"findPrevious":t.e.fire("searchPrevious");break;case"findNext":t.e.fire("searchNext");break;case"replace":t.execCommand("openReplaceDialog");break;default:t.execCommand("openSearchDialog")}},list:{search:"Find",findNext:"Find Next",findPrevious:"Find Previous",replace:"Replace"},childTemplate:(t,e,s)=>s};class He extends H{constructor(){super(...arguments),this.buttons=[{name:"find",group:"search"}],this.template=``,this.isOpened=!1,this.selInfo=null,this.current=null,this.eachMap=(t,e,s)=>{S.i.findWithCurrent(t,(t=>!(!t||!e(t))),this.j.editor,s?"nextSibling":"previousSibling",s?"firstChild":"lastChild")},this.updateCounters=()=>{if(!this.isOpened)return;this.counterBox.style.display=this.queryInput.value.length?"inline-block":"none";const t=this.calcCounts(this.queryInput.value,this.j.s.range);this.counterBox.textContent=t.join("/")},this.calcCounts=(t,e=!1)=>{const s=[];let i=0,o=0,r=!1,n=this.j.editor.firstChild;for(;n&&t.length;)if(r=this.find(n,t,!0,0,r||this.j.ed.createRange()),r){if(this.boundAlreadyWas(r,s))break;s.push(r),n=r.startContainer,o+=1,e&&this.boundAlreadyWas(e,[r])&&(i=o)}else n=null;return[i,o]},this.findAndReplace=(t,e)=>{const s=this.find(t,e,!0,0,this.j.s.range);if(s&&s.startContainer&&s.endContainer){const t=this.j.ed.createRange();try{if(s&&s.startContainer&&s.endContainer){t.setStart(s.startContainer,s.startOffset),t.setEnd(s.endContainer,s.endOffset),t.deleteContents();const e=this.j.createInside.text(this.replaceInput.value);t.insertNode(e),this.j.s.select(e),this.tryScrollToElement(e)}}catch(t){}return!0}return!1},this.findAndSelect=(t,e,s)=>{const i=this.find(t,e,s,0,this.j.s.range);if(i&&i.startContainer&&i.endContainer){const t=this.j.ed.createRange();try{t.setStart(i.startContainer,i.startOffset),t.setEnd(i.endContainer,i.endOffset),this.j.s.selectRange(t)}catch(t){}return this.tryScrollToElement(i.startContainer),this.current=i.startContainer,this.updateCounters(),!0}return!1},this.find=(t,e,s,i,o)=>{if(t&&e.length){let r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null};if(this.eachMap(t,(t=>{if(S.i.isText(t)&&null!=t.nodeValue&&t.nodeValue.length){let a=t.nodeValue;s||t!==o.startContainer?s&&t===o.endContainer&&(a=i?a.substr(0,o.startOffset):a.substr(o.endOffset)):a=i?a.substr(o.endOffset):a.substr(0,o.startOffset);const l=s?r+a:a+r,h=He.findSomePartOfString(e,l,s);if(!1!==h){let o=He.findSomePartOfString(e,a,s);!0===o?o=(0,c.trim)(e):!1===o&&(o=He.findSomePartOfString(a,e,s),!0===o&&(o=(0,c.trim)(a)));let d=He.getSomePartOfStringIndex(e,a,s)||0;if((s&&!i||!s&&i)&&t.nodeValue.length-a.length>0&&(d+=t.nodeValue.length-a.length),null==n.startContainer&&(n.startContainer=t,n.startOffset=d),!0===h)return n.endContainer=t,n.endOffset=d,n.endOffset+=o.length,!0;r=l}else r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null}}else S.i.isBlock(t,this.j.ew)&&""!==r&&(r=s?r+" ":" "+r);return!1}),s),n.startContainer&&n.endContainer)return n;if(!i)return this.current=s?this.j.editor.firstChild:this.j.editor.lastChild,this.find(this.current,e,s,i+1,o)}return!1},this.open=(t=!1)=>{this.isOpened||(this.searchBox.classList.add("jodit-search_active"),this.isOpened=!0),this.calcSticky(this.j.e.fire("getStickyState.sticky")||!1),this.j.e.fire("hidePopup"),this.searchBox.classList.toggle("jodit-search_replace",t),this.current=this.j.s.current(),this.selInfo=this.j.s.save();const e=""+(this.j.s.sel||"");e&&(this.queryInput.value=e),this.updateCounters(),e?this.queryInput.select():this.queryInput.focus()},this.close=()=>{this.isOpened&&(this.selInfo&&(this.j.s.restore(this.selInfo),this.selInfo=null),this.searchBox.classList.remove("jodit-search_active"),this.isOpened=!1)}}static getSomePartOfStringIndex(t,e,s=!0){return this.findSomePartOfString(t,e,s,!0)}static findSomePartOfString(t,e,s=!0,i=!1){t=(0,c.trim)(t.toLowerCase().replace(a.SPACE_REG_EXP()," ")),e=e.toLowerCase();let o=s?0:e.length-1,r=s?0:t.length-1,n=0,l=null;const h=s?1:-1,d=[];for(;void 0!==e[o];o+=h){const c=t[r]===e[o];if(c||null!=l&&a.SPACE_REG_EXP().test(e[o])?(null!=l&&s||(l=o),d.push(e[o]),c&&(n+=1,r+=h)):(l=null,d.length=0,n=0,r=s?0:t.length-1),n===t.length)return!i||l}return i?null!=l&&l:!!d.length&&(s?d.join(""):d.reverse().join(""))}boundAlreadyWas(t,e){return e.some((e=>e.startContainer===t.startContainer&&e.endContainer===t.endContainer&&e.startOffset===t.startOffset&&e.endOffset===t.endOffset),!1)}tryScrollToElement(t){let e=S.i.closest(t,S.i.isElement,this.j.editor);e||(e=S.i.prev(t,S.i.isElement,this.j.editor)),e&&e!==this.j.editor&&e.scrollIntoView()}afterInit(t){if(t.o.useSearch){const e=this;e.searchBox=t.c.fromHTML(e.template);const{query:s,replace:i,cancel:o,next:r,prev:n,replaceBtn:l,counterBox:h}=(0,c.refs)(e.searchBox);e.queryInput=s,e.replaceInput=i,e.closeButton=o,e.nextButton=r,e.prevButton=n,e.replaceButton=l,e.counterBox=h;const d=()=>{t.workplace.appendChild(this.searchBox),t.e.off(this.j.container,"keydown.search").on(this.j.container,"keydown.search",(s=>{if(t.getRealMode()===a.MODE_WYSIWYG)switch(s.key){case a.KEY_ESC:this.close();break;case a.KEY_F3:e.queryInput.value&&(t.e.fire(s.shiftKey?"searchPrevious":"searchNext"),s.preventDefault())}}))};d(),t.e.on("changePlace",d).on(e.closeButton,"click",this.close).on(e.queryInput,"mousedown",(()=>{t.s.isFocused()&&(t.s.removeMarkers(),e.selInfo=t.s.save())})).on(e.replaceButton,"click",(s=>{e.findAndReplace(t.s.current()||t.editor.firstChild,e.queryInput.value),this.updateCounters(),s.preventDefault(),s.stopImmediatePropagation()})).on([e.nextButton,e.prevButton],"click",(function(s){t.e.fire(e.nextButton===this?"searchNext":"searchPrevious"),s.preventDefault(),s.stopImmediatePropagation()})).on(this.queryInput,"keydown",this.j.async.debounce((e=>{switch(e.key){case a.KEY_ENTER:e.preventDefault(),e.stopImmediatePropagation(),t.e.fire("searchNext")&&this.close();break;default:this.updateCounters()}}),this.j.defaultTimeout)).on("beforeSetMode.search",(()=>{this.close()})).on("keydown.search mousedown.search",(()=>{this.selInfo&&(t.s.removeMarkers(),this.selInfo=null),this.isOpened&&(this.current=this.j.s.current(),this.updateCounters())})).on("searchNext.search searchPrevious.search",(()=>e.isOpened?e.findAndSelect(t.s.current()||t.editor.firstChild,e.queryInput.value,"searchNext"===t.e.current):e.open())).on("search.search",((e,s=!0)=>{t.execCommand("search",e,s)})).on("toggleSticky.search",this.calcSticky),t.registerCommand("search",{exec:(s,i,o=!0)=>(e.findAndSelect(t.s.current()||t.editor.firstChild,i||"",o),!1)}).registerCommand("openSearchDialog",{exec:()=>(e.open(),!1),hotkeys:["ctrl+f","cmd+f"]}).registerCommand("openReplaceDialog",{exec:()=>(t.o.readonly||e.open(!0),!1),hotkeys:["ctrl+h","cmd+h"]})}}beforeDestruct(t){var e;S.i.safeRemove(this.searchBox),null===(e=t.events)||void 0===e||e.off(".search")}calcSticky(t){if(this.isOpened)if(this.searchBox.classList.toggle("jodit-search_sticky",t),t){const t=(0,c.position)(this.j.toolbarContainer);(0,c.css)(this.searchBox,{top:t.top+t.height,left:t.left+t.width})}else(0,c.css)(this.searchBox,{top:null,left:null})}}(0,r.__decorate)([j.autobind],He.prototype,"calcSticky",null);class Fe extends H{constructor(){super(...arguments),this.proxyEventsList=["click","mousedown","touchstart","mouseup","touchend"]}afterInit(t){this.proxyEventsList.forEach((e=>{t.e.on(e+".inline-popup",this.onStartSelection)}))}beforeDestruct(t){this.proxyEventsList.forEach((e=>{t.e.on(e+".inline-popup",this.onStartSelection)}))}onStartSelection(t){const{j:e}=this;let s,i=t.target;for(;void 0===s&&i&&i!==e.editor;)s=e.e.fire((0,c.camelCase)(t.type+"_"+i.nodeName.toLowerCase()),i,t),i=i.parentElement;"click"===t.type&&void 0===s&&i===e.editor&&e.e.fire(t.type+"Editor",i,t)}onOutsideClick(t){const e=t.target;S.i.up(e,(t=>t===this.j.editor))||k.u1.closestElement(e,k.GI)||this.j.e.fire("outsideClick",t)}}(0,r.__decorate)([j.autobind],Fe.prototype,"onStartSelection",null),(0,r.__decorate)([(0,j.watch)("ow:click")],Fe.prototype,"onOutsideClick",null),n.D.prototype.width="auto",n.D.prototype.minWidth=200,n.D.prototype.maxWidth="100%",n.D.prototype.allowResizeX=!1,n.D.prototype.allowResizeY=!0,n.D.prototype.height="auto",n.D.prototype.minHeight=200,n.D.prototype.maxHeight="auto",n.D.prototype.saveHeightInStorage=!1;let We=class extends H{constructor(){super(...arguments),this.isResized=!1,this.start={x:0,y:0,w:0,h:0},this.handle=this.j.c.div("jodit-editor__resize",'')}afterInit(t){"auto"!==t.o.height&&(t.o.allowResizeX||t.o.allowResizeY)&&(t.e.on("toggleFullSize.resizeHandler",(()=>{this.handle.style.display=t.isFullSize?"none":"block"})).on(this.handle,"mousedown touchstart",this.onHandleResizeStart).on(t.ow,"mouseup touchsend",this.onHandleResizeEnd),t.container.appendChild(this.handle))}onHandleResizeStart(t){this.isResized=!0,this.start.x=t.clientX,this.start.y=t.clientY,this.start.w=this.j.container.offsetWidth,this.start.h=this.j.container.offsetHeight,this.j.lock(),this.j.e.on(this.j.ow,"mousemove touchmove",this.onHandleResize),t.preventDefault()}onHandleResize(t){this.isResized&&(this.j.o.allowResizeY&&this.j.e.fire("setHeight",this.start.h+t.clientY-this.start.y),this.j.o.allowResizeX&&this.j.e.fire("setWidth",this.start.w+t.clientX-this.start.x),this.j.e.fire("resize"))}onHandleResizeEnd(){this.isResized&&(this.isResized=!1,this.j.e.off(this.j.ow,"mousemove touchmove",this.onHandleResize),this.j.unlock())}beforeDestruct(t){S.i.safeRemove(this.handle),this.j.e.off(this.j.ow,"mouseup touchsend",this.onHandleResizeEnd)}};We.requires=["size"],We=(0,r.__decorate)([j.autobind],We);let $e=class extends H{constructor(){super(...arguments),this.resizeWorkspaces=this.j.async.debounce(this.resizeWorkspaceImd,this.j.defaultTimeout,!0)}afterInit(t){t.e.on("setHeight.size",this.setHeight).on("setWidth.size",this.setWidth).on("afterInit.size changePlace.size",this.initialize,void 0,!0).on(t.ow,"load.size",this.resizeWorkspaces).on("afterInit.size resize.size afterUpdateToolbar.size scroll.size afterResize.size toggleFullSize.size",this.resizeWorkspaces),this.initialize()}initialize(){const{j:t}=this;if(t.o.inline)return;let{height:e}=t.o;if(t.o.saveHeightInStorage&&"auto"!==e){const s=t.storage.get("height");s&&(e=s)}(0,c.css)(t.editor,{minHeight:"100%"}),(0,c.css)(t.container,{minHeight:t.o.minHeight,maxHeight:t.o.maxHeight,minWidth:t.o.minWidth,maxWidth:t.o.maxWidth}),this.setHeight(e),this.setWidth(t.o.width)}setHeight(t){if((0,c.isNumber)(t)){const{minHeight:e,maxHeight:s}=this.j.o;(0,c.isNumber)(e)&&e>t&&(t=e),(0,c.isNumber)(s)&&t>s&&(t=s)}(0,c.css)(this.j.container,"height",t),this.j.o.saveHeightInStorage&&this.j.storage.set("height",t),this.resizeWorkspaceImd()}setWidth(t){if((0,c.isNumber)(t)){const{minWidth:e,maxWidth:s}=this.j.o;(0,c.isNumber)(e)&&e>t&&(t=e),(0,c.isNumber)(s)&&t>s&&(t=s)}(0,c.css)(this.j.container,"width",t),this.resizeWorkspaceImd()}getNotWorkHeight(){var t,e;return((null===(t=this.j.toolbarContainer)||void 0===t?void 0:t.offsetHeight)||0)+((null===(e=this.j.statusbar)||void 0===e?void 0:e.getHeight())||0)+2}resizeWorkspaceImd(){if(!this.j||this.j.isDestructed||!this.j.o||this.j.o.inline)return;if(!this.j.container||!this.j.container.parentNode)return;const t=((0,c.css)(this.j.container,"minHeight")||0)-this.getNotWorkHeight();if((0,c.isNumber)(t)&&t>0&&([this.j.workplace,this.j.iframe,this.j.editor].map((e=>{e&&(0,c.css)(e,"minHeight",t)})),this.j.e.fire("setMinHeight",t)),(0,c.isNumber)(this.j.o.maxHeight)){const t=this.j.o.maxHeight-this.getNotWorkHeight();[this.j.workplace,this.j.iframe,this.j.editor].map((e=>{e&&(0,c.css)(e,"maxHeight",t)})),this.j.e.fire("setMaxHeight",t)}this.j.container&&(0,c.css)(this.j.workplace,"height","auto"!==this.j.o.height||this.j.isFullSize?this.j.container.offsetHeight-this.getNotWorkHeight():"auto")}beforeDestruct(t){this.j.e.off(this.j.ow,"load.size",this.resizeWorkspaces).off(".size")}};$e=(0,r.__decorate)([j.autobind],$e),n.D.prototype.beautifyHTML=!a.IS_IE,n.D.prototype.sourceEditor="ace",n.D.prototype.sourceEditorNativeOptions={showGutter:!0,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},n.D.prototype.sourceEditorCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"],n.D.prototype.beautifyHTMLCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js","https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify-html.min.js"],n.D.prototype.controls.source={mode:a.MODE_SPLIT,exec(t){t.toggleMode()},isActive:t=>t.getRealMode()===a.MODE_SOURCE,tooltip:"Change mode"};class Ve{constructor(t,e,s,i){this.jodit=t,this.container=e,this.toWYSIWYG=s,this.fromWYSIWYG=i,this.className="",this.isReady=!1}get j(){return this.jodit}onReady(){this.replaceUndoManager(),this.isReady=!0,this.j.e.fire(this,"ready")}onReadyAlways(t){var e;this.isReady?t():null===(e=this.j.events)||void 0===e||e.on(this,"ready",t)}}class Ye extends Ve{constructor(){super(...arguments),this.autosize=this.j.async.debounce((()=>{this.instance.style.height="auto",this.instance.style.height=this.instance.scrollHeight+"px"}),this.j.defaultTimeout)}init(t){this.instance=t.c.element("textarea",{class:"jodit-source__mirror"}),this.container.appendChild(this.instance),t.e.on(this.instance,"mousedown keydown touchstart input",t.async.debounce(this.toWYSIWYG,t.defaultTimeout)).on("setMinHeight.source",(t=>{(0,c.css)(this.instance,"minHeight",t)})).on(this.instance,"change keydown mousedown touchstart input",this.autosize).on("afterSetMode.source",this.autosize).on(this.instance,"mousedown focus",(e=>{t.e.fire(e.type,e)})),this.autosize(),this.onReady()}destruct(){S.i.safeRemove(this.instance)}getValue(){return this.instance.value}setValue(t){this.instance.value=t}insertRaw(t){const e=this.getValue();if(0>this.getSelectionStart())this.setValue(e+t);else{const s=this.getSelectionStart(),i=this.getSelectionEnd();this.setValue(e.substring(0,s)+t+e.substring(i,e.length))}}getSelectionStart(){return this.instance.selectionStart}getSelectionEnd(){return this.instance.selectionEnd}setSelectionRange(t,e=t){this.instance.setSelectionRange(t,e)}focus(){this.instance.focus()}setPlaceHolder(t){this.instance.setAttribute("placeholder",t)}setReadOnly(t){t?this.instance.setAttribute("readonly","true"):this.instance.removeAttribute("readonly")}selectAll(){this.instance.select()}replaceUndoManager(){const{observer:t}=this.jodit;this.j.e.on(this.instance,"keydown",(e=>{if((e.ctrlKey||e.metaKey)&&"z"===e.key)return e.shiftKey?t.redo():t.undo(),this.setSelectionRange(this.getValue().length),!1}))}}class Ue extends Ve{constructor(){super(...arguments),this.className="jodit_ace_editor",this.proxyOnFocus=t=>{this.j.e.fire("focus",t)},this.proxyOnMouseDown=t=>{this.j.e.fire("mousedown",t)}}aceExists(){return void 0!==this.j.ow.ace}getLastColumnIndex(t){return this.instance.session.getLine(t).length}getLastColumnIndices(){const t=this.instance.session.getLength(),e=[];let s=0;for(let i=0;t>i;i++)s+=this.getLastColumnIndex(i),i>0&&(s+=1),e[i]=s;return e}getRowColumnIndices(t){const e=this.getLastColumnIndices();if(e[0]>=t)return{row:0,column:t};let s=1;for(let i=1;e.length>i;i++)t>e[i]&&(s=i+1);return{row:s,column:t-e[s-1]-1}}setSelectionRangeIndices(t,e){const s=this.getRowColumnIndices(t),i=this.getRowColumnIndices(e);this.instance.getSelection().setSelectionRange({start:s,end:i})}getIndexByRowColumn(t,e){return this.getLastColumnIndices()[t]-this.getLastColumnIndex(t)+e}init(t){const e=()=>{if(void 0!==this.instance||!this.aceExists())return;const e=this.j.c.div("jodit-source__mirror-fake");this.container.appendChild(e),this.instance=t.ow.ace.edit(e),this.instance.setTheme(t.o.sourceEditorNativeOptions.theme),this.instance.renderer.setShowGutter(t.o.sourceEditorNativeOptions.showGutter),this.instance.getSession().setMode(t.o.sourceEditorNativeOptions.mode),this.instance.setHighlightActiveLine(t.o.sourceEditorNativeOptions.highlightActiveLine),this.instance.getSession().setUseWrapMode(!0),this.instance.setOption("indentedSoftWrap",!1),this.instance.setOption("wrap",t.o.sourceEditorNativeOptions.wrap),this.instance.getSession().setUseWorker(!1),this.instance.$blockScrolling=1/0,this.instance.on("change",this.toWYSIWYG),this.instance.on("focus",this.proxyOnFocus),this.instance.on("mousedown",this.proxyOnMouseDown),t.getRealMode()!==a.MODE_WYSIWYG&&this.setValue(this.getValue());const s=this.j.async.debounce((()=>{t.isInDestruct||(this.instance.setOption("maxLines","auto"!==t.o.height?t.workplace.offsetHeight/this.instance.renderer.lineHeight:1/0),this.instance.resize())}),2*this.j.defaultTimeout);t.e.on("afterResize afterSetMode",s),s(),this.onReady()};t.e.on("afterSetMode",(()=>{t.getRealMode()!==a.MODE_SOURCE&&t.getMode()!==a.MODE_SPLIT||(this.fromWYSIWYG(),e())})),e(),this.aceExists()||(0,c.loadNext)(t,t.o.sourceEditorCDNUrlsJS).then((()=>{t.isInDestruct||e()}))}destruct(){var t,e;this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),null===(e=null===(t=this.j)||void 0===t?void 0:t.events)||void 0===e||e.off("aceInited.source")}setValue(t){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const e=this.j.e.fire("beautifyHTML",t);(0,c.isString)(e)&&(t=e)}this.instance.setValue(t),this.instance.clearSelection()}getValue(){return this.instance.getValue()}setReadOnly(t){this.instance.setReadOnly(t)}focus(){this.instance.focus()}getSelectionStart(){const t=this.instance.selection.getRange();return this.getIndexByRowColumn(t.start.row,t.start.column)}getSelectionEnd(){const t=this.instance.selection.getRange();return this.getIndexByRowColumn(t.end.row,t.end.column)}selectAll(){this.instance.selection.selectAll()}insertRaw(t){const e=this.instance.selection.getCursor(),s=this.instance.session.insert(e,t);this.instance.selection.setRange({start:e,end:s},!1)}setSelectionRange(t,e){this.setSelectionRangeIndices(t,e)}setPlaceHolder(t){}replaceUndoManager(){const{observer:t}=this.jodit;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec(){t.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec(){t.redo()}})}}function Ge(t,e,s,i,o){let r;switch(t){case"ace":if(!e.o.shadowRoot){r=new Ue(e,s,i,o);break}default:r=new Ye(e,s,i,o)}return r.init(e),r.onReadyAlways((()=>{r.setReadOnly(e.o.readonly)})),r}class Ke extends H{constructor(){super(...arguments),this.buttons=[{name:"source",group:"source"}],this.__lock=!1,this.__oldMirrorValue="",this.tempMarkerStart="{start-jodit-selection}",this.tempMarkerStartReg=/{start-jodit-selection}/g,this.tempMarkerEnd="{end-jodit-selection}",this.tempMarkerEndReg=/{end-jodit-selection}/g,this.selInfo=[],this.insertHTML=t=>{var e;null===(e=this.sourceEditor)||void 0===e||e.insertRaw(t),this.toWYSIWYG()},this.fromWYSIWYG=(t=!1)=>{if(!this.__lock||!0===t){this.__lock=!0;const t=this.j.getEditorValue(!1);t!==this.getMirrorValue()&&this.setMirrorValue(t),this.__lock=!1}},this.toWYSIWYG=()=>{if(this.__lock)return;const t=this.getMirrorValue();t!==this.__oldMirrorValue&&(this.__lock=!0,this.j.setEditorValue(t),this.__lock=!1,this.__oldMirrorValue=t)},this.getNormalPosition=(t,e)=>{let s=t;for(;s>0;){if(s--,"<"===e[s]&&void 0!==e[s+1]&&e[s+1].match(/[\w/]+/i))return s;if(">"===e[s])return t}return t},this.__clear=t=>t.replace(a.INVISIBLE_SPACE_REG_EXP(),""),this.selectAll=()=>{var t;null===(t=this.sourceEditor)||void 0===t||t.selectAll()},this.onSelectAll=t=>{if("selectall"===t.toLowerCase()&&this.j.getRealMode()===a.MODE_SOURCE)return this.selectAll(),!1},this.getSelectionStart=()=>{var t,e;return null!==(e=null===(t=this.sourceEditor)||void 0===t?void 0:t.getSelectionStart())&&void 0!==e?e:0},this.getSelectionEnd=()=>{var t,e;return null!==(e=null===(t=this.sourceEditor)||void 0===t?void 0:t.getSelectionEnd())&&void 0!==e?e:0},this.saveSelection=()=>{if(this.j.getRealMode()===a.MODE_WYSIWYG)this.selInfo=this.j.s.save()||[],this.j.setEditorValue(),this.fromWYSIWYG(!0);else{if(this.selInfo.length=0,this.j.o.editHTMLDocumentMode)return;const t=this.getMirrorValue();if(this.getSelectionStart()===this.getSelectionEnd()){const e=this.j.s.marker(!0);this.selInfo[0]={startId:e.id,collapsed:!0,startMarker:e.outerHTML};const s=this.getNormalPosition(this.getSelectionStart(),this.getMirrorValue());this.setMirrorValue(t.substr(0,s)+this.__clear(this.selInfo[0].startMarker)+t.substr(s))}else{const e=this.j.s.marker(!0),s=this.j.s.marker(!1);this.selInfo[0]={startId:e.id,endId:s.id,collapsed:!1,startMarker:this.__clear(e.outerHTML),endMarker:this.__clear(s.outerHTML)};const i=this.getNormalPosition(this.getSelectionStart(),t),o=this.getNormalPosition(this.getSelectionEnd(),t);this.setMirrorValue(t.substr(0,i)+this.selInfo[0].startMarker+t.substr(i,o-i)+this.selInfo[0].endMarker+t.substr(o))}this.toWYSIWYG()}},this.removeSelection=()=>{if(!this.selInfo.length)return;if(this.j.getRealMode()===a.MODE_WYSIWYG)return this.__lock=!0,this.j.s.restore(this.selInfo),void(this.__lock=!1);let t=this.getMirrorValue(),e=0,s=0;try{if(this.selInfo[0].startMarker&&(t=t.replace(/]+data-jodit-selection_marker="start"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerStart)),this.selInfo[0].endMarker&&(t=t.replace(/]+data-jodit-selection_marker="end"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerEnd)),!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const e=this.j.e.fire("beautifyHTML",t);(0,c.isString)(e)&&(t=e)}e=t.indexOf(this.tempMarkerStart),s=e,t=t.replace(this.tempMarkerStartReg,""),this.selInfo[0].collapsed&&-1!==e||(s=t.indexOf(this.tempMarkerEnd),-1===e&&(e=s)),t=t.replace(this.tempMarkerEndReg,"")}finally{t=t.replace(this.tempMarkerEndReg,"").replace(this.tempMarkerStartReg,"")}this.setMirrorValue(t),this.setMirrorSelectionRange(e,s),this.toWYSIWYG(),this.setFocusToMirror()},this.setMirrorSelectionRange=(t,e)=>{var s;null===(s=this.sourceEditor)||void 0===s||s.setSelectionRange(t,e)},this.onReadonlyReact=()=>{var t;null===(t=this.sourceEditor)||void 0===t||t.setReadOnly(this.j.o.readonly)}}getMirrorValue(){var t;return(null===(t=this.sourceEditor)||void 0===t?void 0:t.getValue())||""}setMirrorValue(t){var e;null===(e=this.sourceEditor)||void 0===e||e.setValue(t)}setFocusToMirror(){var t;null===(t=this.sourceEditor)||void 0===t||t.focus()}initSourceEditor(t){var e;if("area"!==t.o.sourceEditor){const e=Ge(t.o.sourceEditor,t,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG);e.onReadyAlways((()=>{var s,i;null===(s=this.sourceEditor)||void 0===s||s.destruct(),this.sourceEditor=e,this.fromWYSIWYG(!0),null===(i=t.events)||void 0===i||i.fire("sourceEditorReady",t)}))}else null===(e=this.sourceEditor)||void 0===e||e.onReadyAlways((()=>{var e;this.fromWYSIWYG(!0),null===(e=t.events)||void 0===e||e.fire("sourceEditorReady",t)}))}afterInit(t){if(this.mirrorContainer=t.c.div("jodit-source"),t.workplace.appendChild(this.mirrorContainer),t.e.on("afterAddPlace changePlace afterInit",(()=>{t.workplace.appendChild(this.mirrorContainer)})),this.sourceEditor=Ge("area",t,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG),(()=>{t.e.off("beforeSetMode.source afterSetMode.source").on("beforeSetMode.source",this.saveSelection).on("afterSetMode.source",this.removeSelection)})(),this.onReadonlyReact(),t.e.on("insertHTML.source",(e=>{if(!t.o.readonly&&!this.j.isEditorMode())return this.insertHTML(e),!1})).on("readonly.source",this.onReadonlyReact).on("placeholder.source",(t=>{var e;null===(e=this.sourceEditor)||void 0===e||e.setPlaceHolder(t)})).on("beforeCommand.source",this.onSelectAll).on("change.source",this.fromWYSIWYG),t.e.on("beautifyHTML",(t=>t)),t.o.beautifyHTML){const e=()=>{var e,s;const i=t.ow.html_beautify;return!(!i||t.isInDestruct||(null===(s=null===(e=t.events)||void 0===e?void 0:e.off("beautifyHTML"))||void 0===s||s.on("beautifyHTML",(t=>i(t))),0))};e()||(0,c.loadNext)(t,t.o.beautifyHTMLCDNUrlsJS).then(e)}this.fromWYSIWYG(),this.initSourceEditor(t)}beforeDestruct(t){this.sourceEditor&&(this.sourceEditor.destruct(),delete this.sourceEditor),S.i.safeRemove(this.mirrorContainer)}}n.D.prototype.showCharsCounter=!0,n.D.prototype.countHTMLChars=!1,n.D.prototype.showWordsCounter=!0;class Xe extends H{constructor(){super(...arguments),this.charCounter=null,this.wordCounter=null,this.reInit=()=>{this.j.o.showCharsCounter&&this.charCounter&&this.j.statusbar.append(this.charCounter,!0),this.j.o.showWordsCounter&&this.wordCounter&&this.j.statusbar.append(this.wordCounter,!0),this.j.e.off("change keyup",this.calc).on("change keyup",this.calc),this.calc()},this.calc=this.j.async.throttle((()=>{const t=this.j.text;if(this.j.o.showCharsCounter&&this.charCounter){const e=this.j.o.countHTMLChars?this.j.value:t.replace((0,a.SPACE_REG_EXP)(),"");this.charCounter.textContent=this.j.i18n("Chars: %d",e.length)}this.j.o.showWordsCounter&&this.wordCounter&&(this.wordCounter.textContent=this.j.i18n("Words: %d",t.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((t=>t.length)).length))}),this.j.defaultTimeout)}afterInit(){this.charCounter=this.j.c.span(),this.wordCounter=this.j.c.span(),this.j.e.on("afterInit changePlace afterAddPlace",this.reInit),this.reInit()}beforeDestruct(){S.i.safeRemove(this.charCounter),S.i.safeRemove(this.wordCounter),this.j.e.off("afterInit changePlace afterAddPlace",this.reInit),this.charCounter=null,this.wordCounter=null}}n.D.prototype.toolbarSticky=!0,n.D.prototype.toolbarDisableStickyForMobile=!0,n.D.prototype.toolbarStickyOffset=0;class Je extends H{constructor(){super(...arguments),this.isToolbarSticked=!1,this.createDummy=t=>{a.IS_IE&&!this.dummyBox&&(this.dummyBox=this.j.c.div(),this.dummyBox.classList.add("jodit_sticky-dummy_toolbar"),this.j.container.insertBefore(this.dummyBox,t))},this.addSticky=t=>{this.isToolbarSticked||(this.createDummy(t),this.j.container.classList.add("jodit_sticky"),this.isToolbarSticked=!0),(0,c.css)(t,{top:this.j.o.toolbarStickyOffset||null,width:this.j.container.offsetWidth-2}),a.IS_IE&&this.dummyBox&&(0,c.css)(this.dummyBox,{height:t.offsetHeight})},this.removeSticky=t=>{this.isToolbarSticked&&((0,c.css)(t,{width:"",top:""}),this.j.container.classList.remove("jodit_sticky"),this.isToolbarSticked=!1)}}afterInit(t){t.e.on(t.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).on("getStickyState.sticky",(()=>this.isToolbarSticked))}onScroll(){const{jodit:t}=this,e=t.ow.pageYOffset||t.od.documentElement&&t.od.documentElement.scrollTop||0,s=(0,c.offset)(t.container,t,t.od,!0),i=t.getMode()===a.MODE_WYSIWYG&&e+t.o.toolbarStickyOffset>s.top&&s.top+s.height>e+t.o.toolbarStickyOffset&&!(t.o.toolbarDisableStickyForMobile&&this.isMobile());if(t.o.toolbarSticky&&!0===t.o.toolbar&&this.isToolbarSticked!==i){const e=t.toolbarContainer;e&&(i?this.addSticky(e):this.removeSticky(e)),t.e.fire("toggleSticky",i)}}isMobile(){return this.j&&this.j.options&&this.j.container&&this.j.o.sizeSM>=this.j.container.offsetWidth}beforeDestruct(t){this.dummyBox&&S.i.safeRemove(this.dummyBox),t.e.off(t.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).off(".sticky")}}(0,r.__decorate)([(0,j.throttle)()],Je.prototype,"onScroll",null),n.D.prototype.usePopupForSpecialCharacters=!1,n.D.prototype.specialCharacters=["!",""","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","»","¬","®","¯","°","²","³","´","µ","¶","·","¸","¹","º","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"],n.D.prototype.controls.symbol={icon:"omega",hotkeys:["ctrl+shift+i","cmd+shift+i"],tooltip:"Insert Special Character",popup(t,e,s,i){const o=t.e.fire("generateSpecialCharactersTable.symbols");if(o){if(t.o.usePopupForSpecialCharacters){const e=t.c.div();return e.classList.add("jodit-symbols"),e.appendChild(o),t.e.on(o,"close_dialog",i),e}{A(o,t.i18n("Select Special Character"),void 0,"jodit-symbols").bindDestruct(t);const e=o.querySelector("a");e&&e.focus()}}}};class Ze extends H{constructor(){super(...arguments),this.buttons=[{name:"symbol",group:"insert"}],this.countInRow=17}afterInit(t){t.e.on("generateSpecialCharactersTable.symbols",(()=>{const e=t.c.fromHTML('
'),s=e.querySelector(".jodit-symbols__preview"),i=e.querySelector("table").tBodies[0],o=[];for(let e=0;t.o.specialCharacters.length>e;){const s=t.c.element("tr");for(let i=0;this.countInRow>i&&t.o.specialCharacters.length>e;i+=1,e+=1){const r=t.c.element("td"),n=t.c.fromHTML(`${t.o.specialCharacters[e]}`);o.push(n),r.appendChild(n),s.appendChild(r)}i.appendChild(s)}const r=this;return t.e.on(o,"focus",(function(){s.innerHTML=this.innerHTML})).on(o,"mousedown",(function(e){S.i.isTag(this,"a")&&(t.s.focus(),t.s.insertHTML(this.innerHTML),t.e.fire(this,"close_dialog"),e&&e.preventDefault(),e&&e.stopImmediatePropagation())})).on(o,"mouseenter",(function(){S.i.isTag(this,"a")&&this.focus()})).on(o,"keydown",(e=>{const s=e.target;if(S.i.isTag(s,"a")){const i=parseInt((0,Nt.Lj)(s,"-index")||"0",10),n=parseInt((0,Nt.Lj)(s,"data-index-j")||"0",10);let l;switch(e.key){case a.KEY_UP:case a.KEY_DOWN:l=e.key===a.KEY_UP?i-r.countInRow:i+r.countInRow,void 0===o[l]&&(l=e.key===a.KEY_UP?Math.floor(o.length/r.countInRow)*r.countInRow+n:n,l>o.length-1&&(l-=r.countInRow)),o[l]&&o[l].focus();break;case a.KEY_RIGHT:case a.KEY_LEFT:l=e.key===a.KEY_LEFT?i-1:i+1,void 0===o[l]&&(l=e.key===a.KEY_LEFT?o.length-1:0),o[l]&&o[l].focus();break;case a.KEY_ENTER:t.e.fire(s,"mousedown"),e.stopImmediatePropagation(),e.preventDefault()}}})),e}))}beforeDestruct(t){t.e.off("generateSpecialCharactersTable.symbols")}}n.D.prototype.table={allowCellSelection:!0,selectionCellStyle:"border: 1px double #1e88e5 !important;",allowCellResize:!0,useExtraClassesOptions:!1},n.D.prototype.controls.table={data:{cols:10,rows:10,classList:{"table table-bordered":"Bootstrap Bordered","table table-striped":"Bootstrap Striped","table table-dark":"Bootstrap Dark"}},popup(t,e,s,i,o){const r=s.data&&s.data.rows?s.data.rows:10,n=s.data&&s.data.cols?s.data.cols:10,a=t.c.fromHTML('
'+(()=>{if(!t.o.table.useExtraClassesOptions)return"";const e=[];if(s.data){const t=s.data.classList;Object.keys(t).forEach((s=>{e.push(``)}))}return e.join("")})()+'
'),l=a.querySelectorAll("span")[0],h=a.querySelectorAll("span")[1],d=a.querySelector(".jodit-form__container"),u=a.querySelector(".jodit-form__options"),p=[],f=r*n;for(let e=0;f>e;e+=1)p[e]||p.push(t.c.element("span",{dataIndex:e}));if(t.e.on(d,"mousemove",((t,e)=>{const s=t.target;if(!S.i.isTag(s,"span"))return;const i=void 0===e||isNaN(e)?parseInt((0,Nt.Lj)(s,"-index")||"0",10):e||0,o=Math.ceil((i+1)/n),r=i%n+1;for(let t=0;p.length>t;t+=1)p[t].className=t%n+1>r||Math.ceil((t+1)/n)>o?"":"jodit_hovered";h.textContent=""+r,l.textContent=""+o})).on(d,"touchstart mousedown",(e=>{const s=e.target;if(e.preventDefault(),e.stopImmediatePropagation(),!S.i.isTag(s,"span"))return;const o=parseInt((0,Nt.Lj)(s,"-index")||"0",10),r=Math.ceil((o+1)/n),a=o%n+1,l=t.createInside,h=l.element("tbody"),d=l.element("table");d.appendChild(h),d.style.width="100%";let p,f,m=null;for(let t=1;r>=t;t+=1){p=l.element("tr");for(let t=1;a>=t;t+=1)f=l.element("td"),m||(m=f),f.appendChild(l.element("br")),p.appendChild(l.text("\n")),p.appendChild(l.text("\t")),p.appendChild(f);h.appendChild(l.text("\n")),h.appendChild(p)}const g=t.s.current();if(g&&t.s.isCollapsed()){const e=S.i.closest(g,(e=>S.i.isBlock(e,t.ew)),t.editor);e&&e!==t.editor&&!e.nodeName.match(/^TD|TH|TBODY|TABLE|THEADER|TFOOTER$/)&&t.s.setCursorAfter(e)}(0,c.$$)("input[type=checkbox]:checked",u).forEach((t=>{t.value.split(/[\s]+/).forEach((t=>{d.classList.add(t)}))})),t.s.insertNode(l.text("\n")),t.s.insertNode(d,!1),m&&(t.s.setCursorIn(m),(0,c.scrollIntoViewIfNeeded)(m,t.editor,t.ed)),i()})),o&&o.parentElement){for(let e=0;r>e;e+=1){const s=t.c.div();for(let t=0;n>t;t+=1)s.appendChild(p[e*n+t]);d.appendChild(s)}p[0]&&(p[0].className="hovered")}return a},tooltip:"Insert table"};const Qe="table_processor_observer-resize";class ts extends H{constructor(){super(...arguments),this.selectMode=!1,this.resizeDelta=0,this.createResizeHandle=()=>{this.resizeHandler||(this.resizeHandler=this.j.c.div("jodit-table-resizer"),this.j.e.on(this.resizeHandler,"mousedown.table touchstart.table",this.onHandleMouseDown).on(this.resizeHandler,"mouseenter.table",(()=>{this.j.async.clearTimeout(this.hideTimeout)})))},this.hideTimeout=0,this.drag=!1,this.minX=0,this.maxX=0,this.startX=0}get module(){return this.j.getInstance("Table",this.j.o)}get isRTL(){return"rtl"===this.j.o.direction}showResizeHandle(){this.j.async.clearTimeout(this.hideTimeout),this.j.workplace.appendChild(this.resizeHandler)}hideResizeHandle(){this.hideTimeout=this.j.async.setTimeout((()=>{S.i.safeRemove(this.resizeHandler)}),{timeout:this.j.defaultTimeout,label:"hideResizer"})}onHandleMouseDown(t){if(this.j.isLocked)return;this.drag=!0,this.j.e.on(this.j.ow,"mouseup.resize-cells touchend.resize-cells",this.onMouseUp).on(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.startX=t.clientX,this.j.lock(Qe),this.resizeHandler.classList.add("jodit-table-resizer_moved");let e,s=this.workTable.getBoundingClientRect();if(this.minX=0,this.maxX=1e6,null!=this.wholeTable)s=this.workTable.parentNode.getBoundingClientRect(),this.minX=s.left,this.maxX=this.minX+s.width;else{const t=Ct.formalCoordinate(this.workTable,this.workCell,!0);Ct.formalMatrix(this.workTable,((s,i,o)=>{t[1]===o&&(e=s.getBoundingClientRect(),this.minX=Math.max(e.left+a.NEARBY/2,this.minX)),t[1]+(this.isRTL?-1:1)===o&&(e=s.getBoundingClientRect(),this.maxX=Math.min(e.left+e.width-a.NEARBY/2,this.maxX))}))}return!1}onMouseMove(t){if(!this.drag)return;this.j.e.fire("closeAllPopups");let e=t.clientX;const s=(0,c.offset)(this.resizeHandler.parentNode||this.j.od.documentElement,this.j,this.j.od,!0);this.minX>e&&(e=this.minX),e>this.maxX&&(e=this.maxX),this.resizeDelta=e-this.startX+(this.j.o.iframe?s.left:0),this.resizeHandler.style.left=e-(this.j.o.iframe?0:s.left)+"px";const i=this.j.s.sel;i&&i.removeAllRanges()}onMouseUp(t){(this.selectMode||this.drag)&&(this.selectMode=!1,this.j.unlock()),this.resizeHandler&&this.drag&&(this.drag=!1,this.j.e.off(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.resizeHandler.classList.remove("jodit-table-resizer_moved"),this.startX!==t.clientX&&(null==this.wholeTable?this.resizeColumns():this.resizeTable()),this.j.setEditorValue(),this.j.s.focus())}resizeColumns(){const t=this.resizeDelta,e=[];Ct.setColumnWidthByDelta(this.workTable,Ct.formalCoordinate(this.workTable,this.workCell,!0)[1],t,!0,e);const s=(0,c.call)(this.isRTL?S.i.prev:S.i.next,this.workCell,(t=>S.i.isCell(t,this.j.ew)),this.workCell.parentNode);Ct.setColumnWidthByDelta(this.workTable,Ct.formalCoordinate(this.workTable,s)[1],-t,!1,e)}resizeTable(){const t=this.resizeDelta*(this.isRTL?-1:1),e=this.workTable.offsetWidth,s=(0,c.getContentWidth)(this.workTable.parentNode,this.j.ew),i=!this.wholeTable;if(this.isRTL?!i:i)this.workTable.style.width=(e+t)/s*100+"%";else{const i=this.isRTL?"marginRight":"marginLeft",o=parseInt(this.j.ew.getComputedStyle(this.workTable)[i]||"0",10);this.workTable.style.width=(e-t)/s*100+"%",this.workTable.style[i]=(o+t)/s*100+"%"}}setWorkCell(t,e=null){this.wholeTable=e,this.workCell=t,this.workTable=S.i.up(t,(t=>S.i.isTag(t,"table")),this.j.editor)}calcHandlePosition(t,e,s=0,i=0){const o=(0,c.offset)(e,this.j,this.j.ed);if(s>a.NEARBY&&o.width-a.NEARBY>s)return void this.hideResizeHandle();const r=(0,c.offset)(this.j.workplace,this.j,this.j.od,!0),n=(0,c.offset)(t,this.j,this.j.ed);if(this.resizeHandler.style.left=(s>a.NEARBY?o.left+o.width:o.left)-r.left+i+"px",Object.assign(this.resizeHandler.style,{height:n.height+"px",top:n.top-r.top+"px"}),this.showResizeHandle(),s>a.NEARBY){const t=(0,c.call)(this.isRTL?S.i.prev:S.i.next,e,(t=>S.i.isCell(t,this.j.ew)),e.parentNode);this.setWorkCell(e,!!t&&null)}else{const t=(0,c.call)(this.isRTL?S.i.next:S.i.prev,e,(t=>S.i.isCell(t,this.j.ew)),e.parentNode);this.setWorkCell(t||e,!t||null)}}afterInit(t){t.o.table.allowCellResize&&t.e.off(this.j.ow,".resize-cells").off(".resize-cells").on("change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells",(()=>{(0,c.$$)("table",t.editor).forEach(this.observe)})).on(this.j.ow,"scroll.resize-cells",(()=>{if(!this.drag)return;const e=S.i.up(this.workCell,(t=>S.i.isTag(t,"table")),t.editor);if(e){const t=e.getBoundingClientRect();this.resizeHandler.style.top=t.top+"px"}})).on("beforeSetMode.resize-cells",(()=>{this.module.getAllSelectedCells().forEach((e=>{this.module.removeSelection(e),Ct.normalizeTable(S.i.closest(e,"table",t.editor))}))}))}observe(t){(0,c.dataBind)(t,Qe)||((0,c.dataBind)(t,Qe,!0),this.j.e.on(t,"mouseleave.resize-cells",(t=>{this.resizeHandler&&this.resizeHandler!==t.relatedTarget&&this.hideResizeHandle()})).on(t,"mousemove.resize-cells touchmove.resize-cells",(e=>{if(this.j.isLocked)return;const s=S.i.up(e.target,(t=>S.i.isCell(t,this.j.ew)),t);s&&this.calcHandlePosition(t,s,e.offsetX)})),this.createResizeHandle())}beforeDestruct(t){t.events&&(t.e.off(this.j.ow,".resize-cells"),t.e.off(".resize-cells"))}}(0,r.__decorate)([j.autobind],ts.prototype,"onHandleMouseDown",null),(0,r.__decorate)([j.autobind],ts.prototype,"onMouseMove",null),(0,r.__decorate)([j.autobind],ts.prototype,"onMouseUp",null),(0,r.__decorate)([j.autobind],ts.prototype,"observe",null);const es="table_processor_observer";class ss extends H{constructor(){super(...arguments),this.requires=["select"],this.selectedCell=null}get module(){return this.j.getInstance("Table",this.j.o)}afterInit(t){t.o.table.allowCellSelection&&t.e.on("keydown.select-cells",(t=>{t.key===a.KEY_TAB&&this.unselectCells()})).on("beforeCommand.select-cells",this.onExecCommand).on("afterCommand.select-cells",this.onAfterCommand).on(["clickEditor","mousedownTd","mousedownTh","touchstartTd","touchstartTh"].map((t=>t+".select-cells")).join(" "),this.onStartSelection).on("clickTr",(()=>{if(this.module.getAllSelectedCells().length)return!1}))}onStartSelection(t){if(this.j.o.readonly)return;if(this.unselectCells(),t===this.j.editor)return;const e=S.i.closest(t,"table",this.j.editor);return t&&e?(t.firstChild||t.appendChild(this.j.createInside.element("br")),this.selectedCell=t,this.module.addSelection(t),this.j.e.on(e,"mousemove.select-cells touchmove.select-cells",this.onMove.bind(this,e)).on(e,"mouseup.select-cells touchend.select-cells",this.onStopSelection.bind(this,e)),!1):void 0}onOutsideClick(t){this.unselectCells()}onMove(t,e){if(this.j.o.readonly)return;if(this.j.isLockedNotBy(es))return;const s=this.j.ed.elementFromPoint(e.clientX,e.clientY);if(!s)return;const i=S.i.closest(s,["td","th"],t);if(!i||!this.selectedCell)return;i!==this.selectedCell&&this.j.lock(es),this.unselectCells(t);const o=Ct.getSelectedBound(t,[i,this.selectedCell]),r=Ct.formalMatrix(t);for(let t=o[0][0];o[1][0]>=t;t+=1)for(let e=o[0][1];o[1][1]>=e;e+=1)this.module.addSelection(r[t][e]);this.j.e.fire("hidePopup"),e.stopPropagation(),(()=>{const t=this.j.createInside.fromHTML('
 
');i.appendChild(t),this.j.async.setTimeout((()=>{var e;null===(e=t.parentNode)||void 0===e||e.removeChild(t)}),this.j.defaultTimeout/5)})()}onRemoveSelection(t){var e;if(!(null===(e=null==t?void 0:t.buffer)||void 0===e?void 0:e.actionTrigger)&&!this.selectedCell&&this.module.getAllSelectedCells().length)return this.j.unlock(),this.unselectCells(),void this.j.e.fire("hidePopup","cells");this.selectedCell=null}onStopSelection(t,e){if(!this.selectedCell)return;this.j.unlock();const s=this.j.ed.elementFromPoint(e.clientX,e.clientY);if(!s)return;const i=S.i.closest(s,["td","th"],t);if(!i)return;const o=S.i.closest(i,"table",t);if(o&&o!==t)return;const r=Ct.getSelectedBound(t,[i,this.selectedCell]),n=Ct.formalMatrix(t),a=n[r[1][0]][r[1][1]],l=n[r[0][0]][r[0][1]];this.j.e.fire("showPopup",t,(()=>{const t=(0,c.position)(l,this.j),e=(0,c.position)(a,this.j);return{left:t.left,top:t.top,width:e.left-t.left+e.width,height:e.top-t.top+e.height}}),"cells"),(0,c.$$)("table",this.j.editor).forEach((t=>{this.j.e.off(t,"mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells")}))}unselectCells(t,e){const s=this.module,i=s.getAllSelectedCells();i.length&&i.forEach((t=>{e&&e===t||s.removeSelection(t)}))}onExecCommand(t){if(/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(t)){t=t.replace("table","");const e=this.module.getAllSelectedCells();if(e.length){const[s]=e;if(!s)return;const i=S.i.closest(s,"table",this.j.editor);if(!i)return;switch(t){case"splitv":Ct.splitVertical(i,this.j);break;case"splitg":Ct.splitHorizontal(i,this.j);break;case"merge":Ct.mergeSelected(i,this.j);break;case"empty":e.forEach((t=>S.i.detach(t)));break;case"bin":S.i.safeRemove(i);break;case"binrow":Ct.removeRow(i,s.parentNode.rowIndex);break;case"bincolumn":Ct.removeColumn(i,s.cellIndex);break;case"addcolumnafter":case"addcolumnbefore":Ct.appendColumn(i,s.cellIndex,"addcolumnafter"===t,this.j.createInside);break;case"addrowafter":case"addrowbefore":Ct.appendRow(i,s.parentNode,"addrowafter"===t,this.j.createInside)}}return!1}}onAfterCommand(t){/^justify/.test(t)&&this.module.getAllSelectedCells().forEach((e=>Se(t,e,this.j)))}beforeDestruct(t){this.onRemoveSelection(),t.e.off(".select-cells")}}function is(t){t.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(e=>{let s,i;if(e.key!==a.KEY_TAB&&e.key!==a.KEY_LEFT&&e.key!==a.KEY_RIGHT&&e.key!==a.KEY_UP&&e.key!==a.KEY_DOWN)return;{if(s=t.s.current(),i=S.i.up(s,(t=>t&&t.nodeName&&/^td|th$/i.test(t.nodeName)),t.editor),!i)return;const o=t.s.range;if(e.key!==a.KEY_TAB&&s!==i&&((e.key===a.KEY_LEFT||e.key===a.KEY_UP)&&(S.i.prev(s,(t=>e.key===a.KEY_UP?S.i.isTag(t,"br"):!!t),i)||e.key!==a.KEY_UP&&S.i.isText(s)&&0!==o.startOffset)||(e.key===a.KEY_RIGHT||e.key===a.KEY_DOWN)&&(S.i.next(s,(t=>e.key===a.KEY_DOWN?S.i.isTag(t,"br"):!!t),i)||e.key!==a.KEY_DOWN&&S.i.isText(s)&&s.nodeValue&&o.startOffset!==s.nodeValue.length)))return}const o=S.i.up(i,(t=>t&&/^table$/i.test(t.nodeName)),t.editor);let r=null;switch(e.key){case a.KEY_TAB:case a.KEY_LEFT:{const s=e.key===a.KEY_LEFT||e.shiftKey?"prev":"next";r=S.i[s](i,(t=>t&&/^td|th$/i.test(t.tagName)),o),r||(Ct.appendRow(o,"next"!==s&&o.querySelector("tr"),"next"===s,t.createInside),r=S.i[s](i,(e=>e&&S.i.isCell(e,t.ew)),o));break}case a.KEY_UP:case a.KEY_DOWN:{let t=0,s=0;const n=Ct.formalMatrix(o,((e,o,r)=>{e===i&&(t=o,s=r)}));e.key===a.KEY_UP?void 0!==n[t-1]&&(r=n[t-1][s]):void 0!==n[t+1]&&(r=n[t+1][s])}}if(r){if(r.firstChild)e.key===a.KEY_TAB?t.s.select(r,!0):t.s.setCursorIn(r,e.key===a.KEY_RIGHT||e.key===a.KEY_DOWN);else{const e=t.createInside.element("br");r.appendChild(e),t.s.setCursorBefore(e)}return!1}}))}function os(t){t.registerButton({name:"table",group:"insert"})}(0,r.__decorate)([j.autobind],ss.prototype,"onStartSelection",null),(0,r.__decorate)([(0,j.watch)(":outsideClick")],ss.prototype,"onOutsideClick",null),(0,r.__decorate)([j.autobind],ss.prototype,"onRemoveSelection",null),(0,r.__decorate)([j.autobind],ss.prototype,"onStopSelection",null),(0,r.__decorate)([j.autobind],ss.prototype,"onExecCommand",null),(0,r.__decorate)([j.autobind],ss.prototype,"onAfterCommand",null);class rs extends H{constructor(){super(...arguments),this.isOpened=!1,this.delayShowTimeout=0}afterInit(t){this.container=t.c.div("jodit-tooltip"),(0,C.ZO)(this.j,rs).appendChild(this.container);let e=0;t.e.off(".tooltip").on("showTooltip.tooltip",((s,i)=>{t.async.clearTimeout(e),this.open(s,i)})).on("delayShowTooltip.tooltip",this.delayOpen).on("escape.tooltip",this.close).on("hideTooltip.tooltip change.tooltip scroll.tooltip changePlace.tooltip hidePopup.tooltip closeAllPopups.tooltip",(()=>{this.j.async.clearTimeout(this.delayShowTimeout),e=t.async.setTimeout(this.close,this.j.defaultTimeout)}))}delayOpen(t,e){const s=this.j.o.showTooltipDelay||this.j.defaultTimeout;this.j.async.clearTimeout(this.delayShowTimeout),this.delayShowTimeout=this.j.async.setTimeout((()=>this.open(t,e)),{timeout:s,label:"tooltip"})}open(t,e){this.container.classList.add("jodit-tooltip_visible"),this.container.innerHTML=e,this.isOpened=!0,this.setPosition(t)}setPosition(t){const e=t();(0,c.css)(this.container,{left:e.x,top:e.y})}close(){this.j.async.clearTimeout(this.delayShowTimeout),this.isOpened&&(this.isOpened=!1,this.container.classList.remove("jodit-tooltip_visible"),(0,c.css)(this.container,{left:-5e3}))}beforeDestruct(t){null==t||t.e.off(".tooltip"),this.close(),S.i.safeRemove(this.container)}}function ns(t){t.registerButton({name:"preview"})}function as(t){t.registerButton({name:"print"})}(0,r.__decorate)([j.autobind],rs.prototype,"delayOpen",null),(0,r.__decorate)([j.autobind],rs.prototype,"close",null),n.D.prototype.controls.preview={icon:"eye",exec(t){const e=t.getInstance("Dialog",{language:t.o.language,theme:t.o.theme}),s=t.c.div();if((0,c.css)(s,{padding:16}),t.iframe){const i=t.create.element("iframe");(0,c.css)(i,{minWidth:800,minHeight:600,border:0}),s.appendChild(i),e.open(s,t.i18n("Preview"));const o=i.contentWindow;o&&(t.e.fire("generateDocumentStructure.iframe",o.document,t),o.document.body.innerHTML=t.value)}else(0,c.css)(s,{minWidth:1024,minHeight:600,border:0}),s.innerHTML=t.value,e.open(s,t.i18n("Preview"));e.setModal(!0)},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Preview"},n.D.prototype.controls.print={exec(t){const e=t.create.element("iframe");Object.assign(e.style,{position:"fixed",right:0,bottom:0,width:0,height:0,border:0}),(0,C.ZO)(t,n.D).appendChild(e);const s=()=>{t.e.off(t.ow,"mousemove",s),S.i.safeRemove(e)},i=e.contentWindow;i&&(t.e.on(i,"onbeforeunload onafterprint",s).on(t.ow,"mousemove",s),t.o.iframe?(t.e.fire("generateDocumentStructure.iframe",i.document,t),i.document.body.innerHTML=t.value):(i.document.write(''+t.value+""),i.document.close()),i.focus(),i.print())},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Print"},n.D.prototype.showXPathInStatusbar=!0;class ls extends H{constructor(){super(...arguments),this.onContext=(t,e)=>(this.menu||(this.menu=new g(this.j)),this.menu.show(e.clientX,e.clientY,[{icon:"bin",title:t===this.j.editor?"Clear":"Remove",exec:()=>{t!==this.j.editor?S.i.safeRemove(t):this.j.value="",this.j.setEditorValue()}},{icon:"select-all",title:"Select",exec:()=>{this.j.s.select(t)}}]),!1),this.onSelectPath=(t,e)=>{this.j.s.focus();const s=(0,c.attr)(e.target,"-path")||"/";if("/"===s)return this.j.execCommand("selectall"),!1;try{const t=this.j.ed.evaluate(s,this.j.editor,null,XPathResult.ANY_TYPE,null).iterateNext();if(t)return this.j.s.select(t),!1}catch(t){}return this.j.s.select(t),!1},this.tpl=(t,e,s,i)=>{const o=this.j.c.fromHTML(`${(0,c.trim)(s)}`),r=o.firstChild;return this.j.e.on(r,"click",this.onSelectPath.bind(this,t)).on(r,"contextmenu",this.onContext.bind(this,t)),o},this.removeSelectAll=()=>{this.selectAllButton&&(this.selectAllButton.destruct(),delete this.selectAllButton)},this.appendSelectAll=()=>{this.removeSelectAll(),this.selectAllButton=P(this.j,{name:"selectall",...this.j.o.controls.selectall}),this.selectAllButton.state.size="tiny",this.container&&this.container.insertBefore(this.selectAllButton.container,this.container.firstChild)},this.calcPathImd=()=>{if(this.isDestructed)return;const t=this.j.s.current();if(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),t){let e,s,i;S.i.up(t,(t=>{t&&this.j.editor!==t&&!S.i.isText(t)&&(e=t.nodeName.toLowerCase(),s=(0,c.getXPathByElement)(t,this.j.editor).replace(/^\//,""),i=this.tpl(t,s,e,this.j.i18n("Select %s",e)),this.container&&this.container.insertBefore(i,this.container.firstChild))}),this.j.editor)}this.appendSelectAll()},this.calcPath=this.j.async.debounce(this.calcPathImd,2*this.j.defaultTimeout)}afterInit(){this.j.o.showXPathInStatusbar&&(this.container=this.j.c.div("jodit-xpath"),this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath",this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath",(()=>{this.j.o.showXPathInStatusbar&&this.container&&(this.j.statusbar.append(this.container),this.j.getRealMode()===a.MODE_WYSIWYG?this.calcPath():(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),this.appendSelectAll()))})),this.calcPath())}beforeDestruct(){this.j&&this.j.events&&this.j.e.off(".xpath"),this.removeSelectAll(),this.menu&&this.menu.destruct(),S.i.safeRemove(this.container),delete this.menu,delete this.container}}var cs=s(47),hs=s(48),ds=s(49),us=s(50),ps=s(51),fs=s(52),ms=s(53),gs=s(54),vs=s(55),bs=s(56),ws=s(57),ys=s(58),_s=s(59),Cs=s(60),js=s(61),xs=s(62),Es=s(63),Ss=s(64),ks=s(65),Ts=s(66),Is=s(67),qs=s(68),Ls=s(69),zs=s(70),Ms=s(71),Ps=s(72),Ds=s(73),Ns=s(74),Rs=s(75),As=s(76),Bs=s(77),Os=s(78),Hs=s(79),Fs=s(80),Ws=s(81),$s=s(82),Vs=s(83),Ys=s(84),Us=s(85),Gs=s(86),Ks=s(87),Xs=s(88),Js=s(89),Zs=s(90),Qs=s(91),ti=s(92),ei=s(93),si=s(94),ii=s(95),oi=s(96),ri=s(97),ni=s(98),ai=s(99),li=s(100),ci=s(101),hi=s(102),di=s(103),ui=s(104),pi=s(105),fi=s(106),mi=s(107),gi=s(108),vi=s(109),bi=s(110),wi=s(111),yi=s(112),_i=s(113),Ci=s(114),ji=s(115),xi=s(116),Ei=s(117),Si=s(118),ki=s(119),Ti=s(120),Ii=s(121),qi=s(122),Li=s(123),zi=s(124),Mi=s(125),Pi=s(126),Di=s(127);Object.keys(a).forEach((t=>{Jodit[t]=a[t]}));const Ni=t=>"__esModule"!==t;Object.keys(o).filter(Ni).forEach((t=>{k.JO.set(t.replace("_","-"),o[t])})),Object.keys(t).filter(Ni).forEach((e=>{Jodit.modules[e]=t[e]})),Object.keys(j).filter(Ni).forEach((t=>{Jodit.decorators[t]=j[t]})),["Confirm","Alert","Prompt"].forEach((e=>{Jodit[e]=t[e]})),Object.keys(e).filter(Ni).forEach((t=>{Jodit.plugins.add(t,e[t])})),Object.keys(qt).filter(Ni).forEach((t=>{Jodit.lang[t]=qt[t]}));const Ri=Jodit})(),i})()})); \ No newline at end of file diff --git a/build/jodit.es2018.js b/build/jodit.es2018.js index ebc1bd6f9..035b85c6d 100644 --- a/build/jodit.es2018.js +++ b/build/jodit.es2018.js @@ -1,7 +1,7 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ @@ -35,6 +35,7 @@ return /******/ (() => { // webpackBootstrap class Config { constructor() { + this.namespace = ''; this.iframe = false; this.license = ''; this.preset = 'custom'; @@ -5461,7 +5462,7 @@ function persistent(target, propertyKey) { target.hookStatus(core_component/* STATUSES.ready */.n$.ready, (component) => { const jodit = (0,helpers.isViewObject)(component) ? component - : component.jodit, storageKey = `${component.componentName}_prop_${propertyKey}`, initialValue = component[propertyKey]; + : component.jodit, storageKey = `${jodit.options.namespace}${component.componentName}_prop_${propertyKey}`, initialValue = component[propertyKey]; Object.defineProperty(component, propertyKey, { get() { var _a; @@ -5551,6 +5552,11 @@ function watch(observeFields, context) { view.events .on(context || component, eventName, callback) .on(eventName, callback); + view.hookStatus('beforeDestruct', () => { + view.events + .off(context || component, eventName, callback) + .off(eventName, callback); + }); return; } const parts = field.split('.'), [key] = parts; @@ -6254,8 +6260,9 @@ var decorators = __webpack_require__(33); class Popup extends ui_element/* UIElement */.u { - constructor(jodit) { + constructor(jodit, smart = true) { super(jodit); + this.smart = smart; this.isOpened = false; this.strategy = 'leftBottom'; this.viewBound = () => ({ @@ -6429,26 +6436,32 @@ class Popup extends ui_element/* UIElement */.u { addGlobalListeners() { const up = this.updatePosition, ow = this.ow; global/* eventEmitter.on */.TB.on('closeAllPopups', this.close); + if (this.smart) { + this.j.e + .on('escape', this.close) + .on('mousedown touchstart', this.closeOnOutsideClick) + .on(ow, 'mousedown touchstart', this.closeOnOutsideClick); + } this.j.e .on('closeAllPopups', this.close) - .on('escape', this.close) .on('resize', up) .on(this.container, 'scroll mousewheel', up) - .on('mousedown touchstart', this.closeOnOutsideClick) - .on(ow, 'mousedown touchstart', this.closeOnOutsideClick) .on(ow, 'scroll', up) .on(ow, 'resize', up); } removeGlobalListeners() { const up = this.updatePosition, ow = this.ow; global/* eventEmitter.off */.TB.off('closeAllPopups', this.close); + if (this.smart) { + this.j.e + .off('escape', this.close) + .off('mousedown touchstart', this.closeOnOutsideClick) + .off(ow, 'mousedown touchstart', this.closeOnOutsideClick); + } this.j.e .off('closeAllPopups', this.close) - .off('escape', this.close) .off('resize', up) .off(this.container, 'scroll mousewheel', up) - .off('mousedown touchstart', this.closeOnOutsideClick) - .off(ow, 'mousedown touchstart', this.closeOnOutsideClick) .off(ow, 'scroll', up) .off(ow, 'resize', up); } @@ -12496,6 +12509,7 @@ __webpack_require__.d(plugins_namespaceObject, { "resizeHandler": () => (resizeHandler), "resizer": () => (resizer), "search": () => (search), + "select": () => (select_select), "selectCells": () => (selectCells), "size": () => (size), "source": () => (source), @@ -13182,7 +13196,7 @@ class View extends component/* Component */.wA { this.isView = true; this.mods = {}; this.components = new Set(); - this.version = "3.6.2"; + this.version = "3.6.3"; this.async = new Async(); this.buffer = Storage.makeStorage(); this.storage = Storage.makeStorage(true, this.componentName); @@ -13280,7 +13294,10 @@ class View extends component/* Component */.wA { return this.__isFullSize; } getVersion() { - return this.version; + return "3.6.3"; + } + static getVersion() { + return "3.6.3"; } initOptions(options) { this.options = (0,helpers.ConfigProto)(options || {}, (0,helpers.ConfigProto)(this.options || {}, View.defaultOptions)); @@ -13339,6 +13356,7 @@ class View extends component/* Component */.wA { View.defaultOptions = { extraButtons: [], textIcons: false, + namespace: '', removeButtons: [], zIndex: 100002, defaultTimeout: 100, @@ -14023,6 +14041,7 @@ class ViewWithToolbar extends View { config/* Config.prototype.dialog */.D.prototype.dialog = { + namespace: '', extraButtons: [], resizable: true, draggable: true, @@ -14747,6 +14766,7 @@ const ICON_LOADER = ''; config/* Config.prototype.filebrowser */.D.prototype.filebrowser = { + namespace: '', extraButtons: [], filter(item, search) { search = search.toLowerCase(); @@ -20217,6 +20237,7 @@ class Jodit extends ViewWithToolbar { super.destruct(); } } +Jodit.fatMode = false; Jodit.plugins = global/* pluginSystem */.pw; Jodit.modules = global/* modules */.qz; Jodit.ns = global/* modules */.qz; @@ -22795,6 +22816,7 @@ class DragAndDropElement extends Plugin { pointerEvents: 'none', pointer: 'drag', position: 'fixed', + opacity: 0.7, display: 'inline-block', left: event.clientX, top: event.clientY, @@ -24702,17 +24724,20 @@ config/* Config.prototype.popup */.D.prototype.popup = { class inlinePopup extends Plugin { constructor() { super(...arguments); + this.requires = ['select']; this.type = null; - this.popup = new ui_popup/* Popup */.G(this.jodit); + this.popup = new ui_popup/* Popup */.G(this.jodit, false); this.toolbar = makeCollection(this.jodit, this.popup); this.snapRange = null; + this.elmsList = (0,helpers.keys)(this.j.o.popup, false).filter(s => !this.isExcludedTarget(s)); } - onClick(e) { - const node = e.target, elements = (0,helpers.keys)(this.j.o.popup, false), target = dom/* Dom.isTag */.i.isTag(node, 'img') + onClick(node) { + const elements = this.elmsList, target = dom/* Dom.isTag */.i.isTag(node, 'img') ? node : dom/* Dom.closest */.i.closest(node, elements, this.j.editor); if (target && this.canShowPopupForType(target.nodeName.toLowerCase())) { this.showPopup(() => (0,helpers.position)(target, this.j), target.nodeName.toLowerCase(), target); + return false; } } showPopup(rect, type, target) { @@ -24742,10 +24767,13 @@ class inlinePopup extends Plugin { return true; } hidePopup(type) { - if (!type || type === this.type) { + if (!(0,helpers.isString)(type) || type === this.type) { this.popup.close(); } } + onOutsideClick(e) { + this.popup.close(); + } canShowPopupForType(type) { const data = this.j.o.popup[type.toLowerCase()]; if (this.j.o.readonly || !this.j.o.toolbarInline || !data) { @@ -24778,9 +24806,9 @@ class inlinePopup extends Plugin { .on('showPopup', (elm, rect, type) => { this.showPopup(rect, type || ((0,helpers.isString)(elm) ? elm : elm.nodeName), (0,helpers.isString)(elm) ? undefined : elm); }) - .on('click', this.onClick) .on('mousedown keydown', this.onSelectionStart) .on([this.j.ew, this.j.ow], 'mouseup keyup', this.onSelectionEnd); + this.addListenersForElements(); } onSelectionStart() { this.snapRange = this.j.s.range.cloneRange(); @@ -24833,8 +24861,14 @@ class inlinePopup extends Plugin { beforeDestruct(jodit) { jodit.e .off('showPopup') - .off('click', this.onClick) .off([this.j.ew, this.j.ow], 'mouseup keyup', this.onSelectionEnd); + this.removeListenersForElements(); + } + addListenersForElements() { + this.j.e.on(this.elmsList.map(e => (0,helpers.camelCase)(`click_${e}`)).join(' '), this.onClick); + } + removeListenersForElements() { + this.j.e.off(this.elmsList.map(e => (0,helpers.camelCase)(`click_${e}`)).join(' '), this.onClick); } } (0,tslib_es6.__decorate)([ @@ -24844,8 +24878,12 @@ class inlinePopup extends Plugin { (0,decorators.wait)((ctx) => !ctx.j.isLocked) ], inlinePopup.prototype, "showPopup", null); (0,tslib_es6.__decorate)([ + (0,decorators.watch)(':clickEditor'), decorators.autobind ], inlinePopup.prototype, "hidePopup", null); +(0,tslib_es6.__decorate)([ + (0,decorators.watch)(':outsideClick') +], inlinePopup.prototype, "onOutsideClick", null); (0,tslib_es6.__decorate)([ decorators.autobind ], inlinePopup.prototype, "onSelectionStart", null); @@ -25372,7 +25410,13 @@ class link_link extends Plugin { const textWasChanged = getSelectionText() !== content_input.value.trim(); if (!link) { if (!jodit.s.isCollapsed()) { - links = jodit.s.wrapInTag('a'); + const node = jodit.s.current(); + if (dom/* Dom.isTag */.i.isTag(node, ['img'])) { + links = [dom/* Dom.wrap */.i.wrap(node, 'a', jodit)]; + } + else { + links = jodit.s.wrapInTag('a'); + } } else { const a = jodit.createInside.element('a'); @@ -26169,7 +26213,7 @@ class resizer extends Plugin { } } }; - this.onClickElement = (element) => { + this.onClickElement = (element, e) => { if (this.element !== element || !this.isShown) { this.element = element; this.show(); @@ -26228,7 +26272,7 @@ class resizer extends Plugin { } }) .on('hideResizer', this.hide) - .on('change afterInit afterSetMode', editor.async.debounce(this.onChangeEditor.bind(this), editor.defaultTimeout)); + .on('change afterInit afterSetMode', this.onChangeEditor); this.addEventListeners(); this.onChangeEditor(); } @@ -26357,7 +26401,7 @@ class resizer extends Plugin { event.preventDefault(); } }) - .on(element, 'click', () => this.onClickElement(element)); + .on(element, 'click', (e) => this.onClickElement(element, e)); } showSizeViewer(w, h) { if (!this.j.o.resizer.showSize) { @@ -26401,6 +26445,9 @@ class resizer extends Plugin { jodit.e.off(this.j.ow, '.resizer').off('.resizer'); } } +(0,tslib_es6.__decorate)([ + (0,decorators.debounce)() +], resizer.prototype, "onChangeEditor", null); (0,tslib_es6.__decorate)([ decorators.autobind ], resizer.prototype, "hide", null); @@ -26874,6 +26921,62 @@ class search extends Plugin { decorators.autobind ], search.prototype, "calcSticky", null); +;// CONCATENATED MODULE: ./src/plugins/select.ts +/*! + * Jodit Editor (https://xdsoft.net/jodit/) + * Released under MIT see LICENSE.txt in the project root for license information. + * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net + */ + + + + + + +class select_select extends Plugin { + constructor() { + super(...arguments); + this.proxyEventsList = ['click', 'mousedown', 'touchstart', 'mouseup', 'touchend']; + } + afterInit(jodit) { + this.proxyEventsList.forEach((eventName) => { + jodit.e.on(eventName + '.inline-popup', this.onStartSelection); + }); + } + beforeDestruct(jodit) { + this.proxyEventsList.forEach((eventName) => { + jodit.e.on(eventName + '.inline-popup', this.onStartSelection); + }); + } + onStartSelection(e) { + const { j } = this; + let result, target = e.target; + while (result === undefined && target && target !== j.editor) { + result = j.e.fire((0,helpers.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e); + target = target.parentElement; + } + if (e.type === 'click' && result === undefined && target === j.editor) { + j.e.fire(e.type + 'Editor', target, e); + } + } + onOutsideClick(e) { + const node = e.target; + if (dom/* Dom.up */.i.up(node, (elm) => elm === this.j.editor)) { + return; + } + const box = ui/* UIElement.closestElement */.u1.closestElement(node, ui/* Popup */.GI); + if (!box) { + this.j.e.fire('outsideClick', e); + } + } +} +(0,tslib_es6.__decorate)([ + decorators.autobind +], select_select.prototype, "onStartSelection", null); +(0,tslib_es6.__decorate)([ + (0,decorators.watch)('ow:click') +], select_select.prototype, "onOutsideClick", null); + ;// CONCATENATED MODULE: ./src/plugins/size/config.ts config/* Config.prototype.width */.D.prototype.width = 'auto'; @@ -28727,6 +28830,7 @@ const select_cells_key = 'table_processor_observer'; class selectCells extends Plugin { constructor() { super(...arguments); + this.requires = ['select']; this.selectedCell = null; } get module() { @@ -28737,7 +28841,6 @@ class selectCells extends Plugin { return; } jodit.e - .on(this.j.ow, 'click.select-cells', this.onRemoveSelection) .on('keydown.select-cells', (event) => { if (event.key === constants.KEY_TAB) { this.unselectCells(); @@ -28745,28 +28848,31 @@ class selectCells extends Plugin { }) .on('beforeCommand.select-cells', this.onExecCommand) .on('afterCommand.select-cells', this.onAfterCommand) - .on('change afterCommand afterSetMode click afterInit' - .split(' ') + .on([ + 'clickEditor', + 'mousedownTd', + 'mousedownTh', + 'touchstartTd', + 'touchstartTh' + ] .map(e => e + '.select-cells') - .join(' '), () => { - (0,helpers.$$)('table', jodit.editor).forEach(this.observe); + .join(' '), this.onStartSelection) + .on('clickTr', () => { + if (this.module.getAllSelectedCells().length) { + return false; + } }); } - observe(table) { - if ((0,helpers.dataBind)(table, select_cells_key)) { - return; - } - this.onRemoveSelection(); - (0,helpers.dataBind)(table, select_cells_key, true); - this.j.e.on(table, 'mousedown.select-cells touchstart.select-cells', this.onStartSelection.bind(this, table)); - } - onStartSelection(table, e) { + onStartSelection(cell) { if (this.j.o.readonly) { return; } this.unselectCells(); - const cell = dom/* Dom.closest */.i.closest(e.target, ['td', 'th'], table); - if (!cell) { + if (cell === this.j.editor) { + return; + } + const table = dom/* Dom.closest */.i.closest(cell, 'table', this.j.editor); + if (!cell || !table) { return; } if (!cell.firstChild) { @@ -28777,7 +28883,10 @@ class selectCells extends Plugin { this.j.e .on(table, 'mousemove.select-cells touchmove.select-cells', this.onMove.bind(this, table)) .on(table, 'mouseup.select-cells touchend.select-cells', this.onStopSelection.bind(this, table)); - this.j.e.fire('showPopup', table, () => (0,helpers.position)(cell, this.j), 'cells'); + return false; + } + onOutsideClick(e) { + this.unselectCells(); } onMove(table, e) { if (this.j.o.readonly) { @@ -28875,7 +28984,7 @@ class selectCells extends Plugin { command = command.replace('table', ''); const cells = this.module.getAllSelectedCells(); if (cells.length) { - const cell = cells.shift(); + const [cell] = cells; if (!cell) { return; } @@ -28894,7 +29003,7 @@ class selectCells extends Plugin { Table.mergeSelected(table, this.j); break; case 'empty': - cells.forEach(td => (td.innerHTML = '')); + cells.forEach(td => dom/* Dom.detach */.i.detach(td)); break; case 'bin': dom/* Dom.safeRemove */.i.safeRemove(table); @@ -28932,7 +29041,10 @@ class selectCells extends Plugin { } (0,tslib_es6.__decorate)([ decorators.autobind -], selectCells.prototype, "observe", null); +], selectCells.prototype, "onStartSelection", null); +(0,tslib_es6.__decorate)([ + (0,decorators.watch)(':outsideClick') +], selectCells.prototype, "onOutsideClick", null); (0,tslib_es6.__decorate)([ decorators.autobind ], selectCells.prototype, "onRemoveSelection", null); @@ -29482,6 +29594,7 @@ class xpath extends Plugin { + // EXTERNAL MODULE: ./src/styles/icons/about.svg diff --git a/build/jodit.es2018.min.js b/build/jodit.es2018.min.js index d9068dffa..a33b9000c 100644 --- a/build/jodit.es2018.min.js +++ b/build/jodit.es2018.min.js @@ -1,10 +1,10 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ -((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}})(self,(function(){return(()=>{var e=[,(e,t,i)=>{"use strict";i.d(t,{D:()=>s});var o=i(2);class s{constructor(){this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window:null,this.shadowRoot=null,this.zIndex=0,this.readonly=!1,this.disabled=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots","selectall"],this.toolbarButtonSize="middle",this.allowTabNavigation=!1,this.inline=!1,this.theme="default",this.saveModeInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n=!1,this.tabIndex=-1,this.toolbar=!0,this.statusbar=!0,this.showTooltip=!0,this.showTooltipDelay=1e3,this.useNativeTooltip=!1,this.enter=o.PARAGRAPH,this.enterBlock="br"!==this.enter?this.enter:o.PARAGRAPH,this.defaultMode=o.MODE_WYSIWYG,this.useSplitMode=!1,this.colors={greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]},this.colorPickerDefaultTab="background",this.imageDefaultWidth=300,this.removeButtons=[],this.disablePlugins=[],this.extraPlugins=[],this.extraButtons=[],this.extraIcons={},this.createAttributes={},this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=[{group:"source",buttons:[]},{group:"font-style",buttons:[]},{group:"script",buttons:[]},{group:"list",buttons:["ul","ol"]},{group:"indent",buttons:[]},{group:"font",buttons:[]},{group:"color",buttons:[]},{group:"media",buttons:[]},"\n",{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}],this.buttonsMD=["source","|","bold","italic","|","ul","ol","eraser","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","\n","undo","redo","|","hr","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","eraser","|","fontsize","brush","paragraph","|","image","table","\n","link","|","align","|","undo","redo","|","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","eraser","\n","align","|","undo","redo","|","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!0}static get defaultOptions(){return s.__defaultOptions||(s.__defaultOptions=new s),s.__defaultOptions}}s.prototype.controls={}},(e,t,i)=>{"use strict";i.r(t),i.d(t,{INVISIBLE_SPACE:()=>o,NBSP_SPACE:()=>s,INVISIBLE_SPACE_REG_EXP:()=>r,INVISIBLE_SPACE_REG_EXP_END:()=>n,INVISIBLE_SPACE_REG_EXP_START:()=>a,SPACE_REG_EXP:()=>l,SPACE_REG_EXP_START:()=>c,SPACE_REG_EXP_END:()=>d,IS_BLOCK:()=>h,IS_INLINE:()=>u,INSEPARABLE_TAGS:()=>p,MAY_BE_REMOVED_WITH_KEY:()=>m,KEY_BACKSPACE:()=>f,KEY_TAB:()=>g,KEY_ENTER:()=>v,KEY_ESC:()=>b,KEY_LEFT:()=>y,KEY_UP:()=>w,KEY_RIGHT:()=>k,KEY_DOWN:()=>C,KEY_SPACE:()=>S,KEY_DELETE:()=>E,KEY_F3:()=>I,NEARBY:()=>j,ACCURACY:()=>x,COMMAND_KEYS:()=>_,BR:()=>z,PARAGRAPH:()=>T,MODE_WYSIWYG:()=>L,MODE_SOURCE:()=>A,MODE_SPLIT:()=>D,IS_IE:()=>M,TEXT_PLAIN:()=>P,TEXT_HTML:()=>R,MARKER_CLASS:()=>q,EMULATE_DBLCLICK_TIMEOUT:()=>B,INSERT_AS_HTML:()=>N,INSERT_CLEAR_HTML:()=>H,INSERT_AS_TEXT:()=>O,INSERT_ONLY_TEXT:()=>F,SAFE_COUNT_CHANGE_CALL:()=>W,IS_MAC:()=>V,KEY_ALIASES:()=>U,BASE_PATH:()=>Y});const o="\ufeff",s=" ",r=()=>/[\uFEFF]/g,n=()=>/[\uFEFF]+$/g,a=()=>/^[\uFEFF]+/g,l=()=>/[\s\n\t\r\uFEFF\u200b]+/g,c=()=>/^[\s\n\t\r\uFEFF\u200b]+/g,d=()=>/[\s\n\t\r\uFEFF\u200b]+$/g,h=/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i,u=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i,p=["img","br","video","iframe","script","input","textarea","hr","link","jodit","jodit-media"],m=RegExp(`^${p.join("|")}$`,"i"),f="Backspace",g="Tab",v="Enter",b="Escape",y="ArrowLeft",w="ArrowUp",k="ArrowRight",C="ArrowDown",S="Space",E="Delete",I="F3",j=5,x=10,_=[f,E,w,C,k,y,v,b,I,g],z="br",T="p",L=1,A=2,D=3,M="undefined"!=typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),P=M?"text":"text/plain",R=M?"html":"text/html",q="jodit-selection_marker",B=300,N="insert_as_html",H="insert_clear_html",O="insert_as_text",F="insert_only_text",W=10,V="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),U={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:V?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Y=(()=>{if("undefined"==typeof document)return"";const e=document.currentScript,t=e=>e.replace(/\/[^/]+.js$/,"/");if(e)return t(e.src);const i=document.querySelectorAll("script[src]");return i&&i.length?t(i[i.length-1].src):window.location.href})()},(e,t,i)=>{"use strict";i.d(t,{DG:()=>s,ng:()=>c,P5:()=>p,rO:()=>o});const o="JoditEventDefaultNamespace";class s{constructor(){this.__store={}}get(e,t){if(void 0!==this.__store[t])return this.__store[t][e]}indexOf(e,t,i){const o=this.get(e,t);if(o)for(let e=0;o.length>e;e+=1)if(o[e].originalCallback===i)return e;return!1}namespaces(e=!1){const t=Object.keys(this.__store);return e?t.filter((e=>e!==o)):t}events(e){return this.__store[e]?Object.keys(this.__store[e]):[]}set(e,t,i,o=!1){void 0===this.__store[t]&&(this.__store[t]={}),void 0===this.__store[t][e]&&(this.__store[t][e]=[]),o?this.__store[t][e].unshift(i):this.__store[t][e].push(i)}clear(){this.__store={}}}var r=i(5),n=i(6),a=i(7),l=i(4);class c{constructor(e){this.__key="__JoditEventsNativeNamespaces",this.doc=document,this.prepareEvent=e=>{e.cancelBubble||(e.type.match(/^touch/)&&e.changedTouches&&e.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach((t=>{Object.defineProperty(e,t,{value:e.changedTouches[0][t],configurable:!0,enumerable:!0})})),e.originalEvent||(e.originalEvent=e),"paste"===e.type&&void 0===e.clipboardData&&this.doc.defaultView.clipboardData&&Object.defineProperty(e,"clipboardData",{get:()=>this.doc.defaultView.clipboardData,configurable:!0,enumerable:!0}))},this.currents=[],this.__stopped=[],this.isDestructed=!1,e&&(this.doc=e),this.__key+=(new Date).getTime()}eachEvent(e,t){e.split(/[\s,]+/).forEach((e=>{const i=e.split(".");t.call(this,i[0],i[1]||o)}))}getStore(e){if(!e)throw(0,l.vU)("Need subject");if(void 0===e[this.__key]){const t=new s;Object.defineProperty(e,this.__key,{enumerable:!1,configurable:!0,value:t})}return e[this.__key]}clearStore(e){void 0!==e[this.__key]&&delete e[this.__key]}triggerNativeEvent(e,t){const i=this.doc.createEvent("HTMLEvents");"string"==typeof t?i.initEvent(t,!0,!0):(i.initEvent(t.type,t.bubbles,t.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach((e=>{Object.defineProperty(i,e,{value:t[e],enumerable:!0})})),Object.defineProperty(i,"originalEvent",{value:t,enumerable:!0})),e.dispatchEvent(i)}get current(){return this.currents[this.currents.length-1]}on(e,t,i,o=!1){const s=(0,r.H)(e)?this:e,c=(0,r.H)(t)?t:e;let d=i;void 0===d&&(0,n.m)(t)&&(d=t);const h=this.getStore(s);if(!(0,r.H)(c)||""===c)throw(0,l.vU)("Need events names");if(!(0,n.m)(d))throw(0,l.vU)("Need event handler");if((0,a.k)(s))return s.forEach((e=>{this.on(e,c,d,o)})),this;const u=(0,n.m)(s.addEventListener),p=this;let m=function(e,...t){return d&&d.call(this,e,...t)};return u&&(m=function(e){if(p.prepareEvent(e),d&&!1===d.call(this,e))return e.preventDefault(),e.stopImmediatePropagation(),!1}),this.eachEvent(c,((e,t)=>{if(""===e)throw(0,l.vU)("Need event name");if(!1===h.indexOf(e,t,d)&&(h.set(e,t,{event:e,originalCallback:d,syntheticCallback:m},o),u)){const t=!!["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"].includes(e)&&{passive:!0};s.addEventListener(e,m,t)}})),this}one(e,t,i,o=!1){const s=(0,r.H)(e)?this:e,a=(0,r.H)(t)?t:e;let l=i;void 0===l&&(0,n.m)(t)&&(l=t);const c=(...e)=>{this.off(s,a,c),l(...e)};return this.on(s,a,c,o),this}off(e,t,i){const s=(0,r.H)(e)?this:e,a=(0,r.H)(t)?t:e,l=this.getStore(s);let c=i;if(!(0,r.H)(a)||!a)return l.namespaces().forEach((e=>{this.off(s,"."+e)})),this.clearStore(s),this;void 0===c&&(0,n.m)(t)&&(c=t);const d=(0,n.m)(s.removeEventListener),h=e=>{d&&s.removeEventListener(e.event,e.syntheticCallback,!1)},u=(e,t)=>{if(""!==e){const i=l.get(e,t);if(i&&i.length)if((0,n.m)(c)){const o=l.indexOf(e,t,c);!1!==o&&(h(i[o]),i.splice(o,1))}else i.forEach(h),i.length=0}else l.events(t).forEach((e=>{""!==e&&u(e,t)}))};return this.eachEvent(a,((e,t)=>{t===o?l.namespaces().forEach((t=>{u(e,t)})):u(e,t)})),this}stopPropagation(e,t){const i=(0,r.H)(e)?this:e,s=(0,r.H)(e)?e:t;if("string"!=typeof s)throw(0,l.vU)("Need event names");const n=this.getStore(i);this.eachEvent(s,((e,t)=>{const s=n.get(e,t);s&&this.__stopped.push(s),t===o&&n.namespaces(!0).forEach((t=>this.stopPropagation(i,e+"."+t)))}))}removeStop(e){if(e){const t=this.__stopped.indexOf(e);-1!==t&&this.__stopped.splice(0,t+1)}}isStopped(e){return void 0!==e&&-1!==this.__stopped.indexOf(e)}fire(e,t,...i){let s,a;const c=(0,r.H)(e)?this:e,d=(0,r.H)(e)?e:t,h=(0,r.H)(e)?[t,...i]:i,u=(0,n.m)(c.dispatchEvent);if(!u&&!(0,r.H)(d))throw(0,l.vU)("Need events names");const p=this.getStore(c);return!(0,r.H)(d)&&u?this.triggerNativeEvent(c,t):this.eachEvent(d,((e,t)=>{if(u)this.triggerNativeEvent(c,e);else{const i=p.get(e,t);if(i)try{[...i].every((t=>!this.isStopped(i)&&(this.currents.push(e),a=t.syntheticCallback.apply(c,h),this.currents.pop(),void 0!==a&&(s=a),!0)))}finally{this.removeStop(i)}t!==o||u||p.namespaces().filter((e=>e!==t)).forEach((t=>{const i=this.fire.call(this,c,e+"."+t,...h);void 0!==i&&(s=i)}))}})),s}destruct(){this.isDestructed&&(this.isDestructed=!0,this.off(this),this.getStore(this).clear(),delete this[this.__key])}}var d=i(36),h=i(8),u=i(33);class p{constructor(e,t=[],i={}){this.__lockEvent={},this.__data=e,this.__prefix=t,this.__onEvents=i,Object.keys(e).forEach((t=>{const i=this.__prefix.concat(t).filter((e=>e.length));Object.defineProperty(this,t,{set:o=>{var s;const r=e[t];if(!(0,h.isFastEqual)(r,o)){this.fire(["beforeChange","beforeChange."+i.join(".")],t,o),(0,h.isPlainObject)(o)&&(o=new p(o,i,this.__onEvents)),e[t]=o;const n=[];this.fire(["change",...i.reduce(((e,t)=>(n.push(t),e.push("change."+n.join(".")),e)),[])],i.join("."),r,(null===(s=o)||void 0===s?void 0:s.valueOf)?o.valueOf():o)}},get:()=>e[t],enumerable:!0,configurable:!0}),(0,h.isPlainObject)(e[t])&&(e[t]=new p(e[t],i,this.__onEvents))}))}valueOf(){return this.__data}toString(){return JSON.stringify(this.valueOf())}on(e,t){return(0,h.isArray)(e)?(e.map((e=>this.on(e,t))),this):(this.__onEvents[e]||(this.__onEvents[e]=[]),this.__onEvents[e].push(t),this)}fire(e,...t){if((0,h.isArray)(e))e.map((e=>this.fire(e,...t)));else try{!this.__lockEvent[e]&&this.__onEvents[e]&&(this.__lockEvent[e]=!0,this.__onEvents[e].forEach((e=>e.call(this,...t))))}finally{this.__lockEvent[e]=!1}}static create(e,t=[]){return e instanceof p?e:new p(e,t)}}(0,d.__decorate)([u.nonenumerable],p.prototype,"__data",void 0),(0,d.__decorate)([u.nonenumerable],p.prototype,"__prefix",void 0),(0,d.__decorate)([u.nonenumerable],p.prototype,"__onEvents",void 0),(0,d.__decorate)([u.nonenumerable],p.prototype,"__lockEvent",void 0)},(e,t,i)=>{"use strict";i.d(t,{RI:()=>r,dt:()=>n,vU:()=>a});const o={},s=o.toString,r=o.hasOwnProperty;["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment","DOMStringList","HTMLCollection"].forEach((e=>{o["[object "+e+"]"]=e.toLowerCase()}));const n=e=>null===e?"null":"object"==typeof e||"function"==typeof e?o[s.call(e)]||"object":typeof e;function a(e){return new TypeError(e)}},(e,t,i)=>{"use strict";function o(e){return"string"==typeof e}i.d(t,{H:()=>o})},(e,t,i)=>{"use strict";function o(e){return"function"==typeof e}i.d(t,{m:()=>o})},(e,t,i)=>{"use strict";function o(e){return Array.isArray(e)}i.d(t,{k:()=>o})},(e,t,i)=>{"use strict";i.r(t),i.d(t,{$$:()=>x,ConfigFlatten:()=>w,ConfigProto:()=>y,LimitedStack:()=>o.lI,appendScript:()=>Y,appendScriptAsync:()=>$,appendStyleAsync:()=>K,applyStyles:()=>D,asArray:()=>r,attr:()=>o.Lj,browser:()=>J,buildQuery:()=>re,call:()=>o.RE,callPromise:()=>o.C6,camelCase:()=>E.eV,cleanFromWord:()=>M,clearCenterAlign:()=>Q.b,clearTimeout:()=>h,cns:()=>o.H5,colorToHex:()=>v.h,completeUrl:()=>W,convertMediaUrlToVideoEmbed:()=>Z,css:()=>Q.i,cssPath:()=>T,ctrlKey:()=>ee,dataBind:()=>te.q,defaultLanguage:()=>ie.X,each:()=>oe,error:()=>S.vU,fastClone:()=>f,get:()=>o.U2,getClassName:()=>o.gj,getContentWidth:()=>N,getXPathByElement:()=>_,hasBrowserColorPicker:()=>g.EO,hasContainer:()=>g.Zt,hasOwn:()=>S.RI,htmlspecialchars:()=>P,humanSizeToBytes:()=>se,i18n:()=>E.ag,inView:()=>ne,innerWidth:()=>H,isArray:()=>g.kJ,isAtom:()=>p,isBoolean:()=>g.jn,isDestructable:()=>g.Z$,isEqual:()=>g.Xy,isFastEqual:()=>g.LP,isFunction:()=>g.mf,isHTML:()=>g.FP,isHtmlFromWord:()=>g.I4,isInitable:()=>g.Gu,isInt:()=>g.GN,isJoditObject:()=>g.Zu,isLicense:()=>g.A1,isNativeFunction:()=>g.QC,isNumber:()=>g.hj,isNumeric:()=>g.kE,isPlainObject:()=>g.PO,isPromise:()=>g.tI,isString:()=>g.HD,isURL:()=>g.PX,isValidName:()=>g.r1,isViewObject:()=>g.f2,isVoid:()=>g.nj,isWindow:()=>g.FJ,kebabCase:()=>E.GL,keepNames:()=>o.kc,keys:()=>o.XP,loadImage:()=>o.po,loadNext:()=>G,markAsAtomic:()=>m,markDeprecated:()=>o.Q8,markOwner:()=>o.MN,memorizeExec:()=>o.u3,nl2br:()=>q,normalizeColor:()=>B.ut,normalizeCssValue:()=>B.Zh,normalizeKeyAliases:()=>B.T2,normalizeLicense:()=>B.Pd,normalizeNode:()=>B.Tz,normalizePath:()=>B.AH,normalizeRelativePath:()=>B.Jf,normalizeSize:()=>B.aC,normalizeUrl:()=>B.D5,offset:()=>O,parseQuery:()=>X,position:()=>F,refs:()=>z,reset:()=>o.mc,resolveElement:()=>L,scrollIntoViewIfNeeded:()=>ae,set:()=>o.t8,setTimeout:()=>d,splitArray:()=>a,sprintf:()=>E.gB,stringify:()=>E.Pz,stripTags:()=>R,toArray:()=>c,trim:()=>E.fy,trimInv:()=>E.as,type:()=>S.dt,ucfirst:()=>E.Ps,val:()=>le});var o=i(9),s=i(7);const r=e=>(0,s.k)(e)?e:[e];var n=i(5);function a(e){return(0,n.H)(e)?e.split(/[,\s]+/):e}var l=i(19);const c=(...e)=>{var t;return((0,l.Q)(Array.from)?Array.from:null!==(t=(0,o.mc)("Array.from"))&&void 0!==t?t:Array.from).apply(Array,e)};function d(e,t,...i){return t?window.setTimeout(e,t,...i):(e.call(null,...i),0)}function h(e){window.clearTimeout(e)}var u=i(16);function p(e){return e&&e.isAtom}function m(e){return Object.defineProperty(e,"isAtom",{enumerable:!1,value:!0,configurable:!1}),e}function f(e){return JSON.parse((0,u.P)(e))}var g=i(15),v=i(21),b=i(1);function y(e,t,i=0){if(Object.getPrototypeOf(e)!==Object.prototype)return e;const o=b.D.defaultOptions;if((0,g.HD)(e.preset)){if(void 0!==o.presets[e.preset]){const t=o.presets[e.preset];Object.keys(t).forEach((i=>{(0,g.nj)(e[i])&&(e[i]=t[i])}))}delete e.preset}const s={};return Object.keys(e).forEach((o=>{const r=e[o],n=t?t[o]:null;s[o]=(0,g.PO)(r)&&(0,g.PO)(n)&&!p(r)?y(r,n,i+1):0!==i&&(0,g.kJ)(r)&&!p(r)&&(0,g.kJ)(n)?[...r,...n.slice(r.length)]:r})),Object.setPrototypeOf(s,t),s}function w(e){return(0,o.XP)(e,!1).reduce(((t,i)=>(t[i]=e[i],t)),{})}var k=i(14),C=i(2),S=i(4),E=i(22),I=i(24);let j=1;function x(e,t){let i;if(!/:scope/.test(e)||!C.IS_IE||t&&t.nodeType===Node.DOCUMENT_NODE)i=t.querySelectorAll(e);else{const o=t.id,s=o||"_selector_id_"+(Math.random()+"").slice(2)+(j++,j);e=e.replace(/:scope/g,"#"+s),!o&&t.setAttribute("id",s),i=t.parentNode.querySelectorAll(e),o||t.removeAttribute("id")}return[].slice.call(i)}const _=(e,t)=>{if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";if(!e.parentNode||t===e)return"";if(e.id)return"//*[@id='"+e.id+"']";const i=[].filter.call(e.parentNode.childNodes,(t=>t.nodeName===e.nodeName));return _(e.parentNode,t)+"/"+e.nodeName.toLowerCase()+(i.length>1?"["+(c(i).indexOf(e)+1)+"]":"")},z=e=>(e instanceof I.u1&&(e=e.container),x("[ref],[data-ref]",e).reduce(((e,t)=>{const i=(0,o.Lj)(t,"-ref");return i&&(0,g.HD)(i)&&(e[(0,E.eV)(i)]=t,e[i]=t),e}),{})),T=e=>{if(!k.i.isElement(e))return null;const t=[];let i=e;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let e=i.nodeName.toLowerCase();if(i.id){e+="#"+i.id,t.unshift(e);break}{let t=i,o=1;do{t=t.previousElementSibling,t&&t.nodeName.toLowerCase()===e&&o++}while(t);e+=":nth-of-type("+o+")"}t.unshift(e),i=i.parentNode}return t.join(" > ")};function L(e,t){let i=e;if((0,g.HD)(e))try{i=t.querySelector(e)}catch(t){throw(0,S.vU)('String "'+e+'" should be valid HTML selector')}if(!i||"object"!=typeof i||!k.i.isElement(i)||!i.cloneNode)throw(0,S.vU)('Element "'+e+'" should be string or HTMLElement instance');return i}function A(e){return e.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";]+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,((e,t,i)=>{switch(i.toLowerCase()){case"pt":return(1.328*parseFloat(t)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(t)).toFixed(0)+"px"}return e}))}function D(e){if(-1===e.indexOf("")+7);const t=document.createElement("iframe");t.style.display="none",document.body.appendChild(t);let i="",o=[],s=[];try{const r=t.contentDocument||(t.contentWindow?t.contentWindow.document:null);if(r){r.open(),r.write(e),r.close(),r.styleSheets.length&&(s=r.styleSheets[r.styleSheets.length-1].cssRules);for(let e=0;s.length>e;e+=1)""!==s[e].selectorText&&(o=x(s[e].selectorText,r.body),o.forEach((t=>{t.style.cssText=A(s[e].style.cssText+";"+t.style.cssText)})));k.i.each(r.body,(e=>{if(k.i.isElement(e)){const t=e,i=t.style.cssText;i&&(t.style.cssText=A(i)),t.hasAttribute("lang")&&t.removeAttribute("lang")}})),i=r.firstChild?(0,E.fy)(r.body.innerHTML):""}}catch(e){}finally{k.i.safeRemove(t)}return i&&(e=i),(0,E.fy)(e.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(//i);-1!==t&&(e=e.substr(t+20));const i=e.search(//i);return-1!==i&&(e=e.substr(0,i)),e})(i)),t.s.insertHTML(i)}const Ke="clipboard";class Ge{constructor(){this.buttons=[{name:"cut",group:"clipboard"},{name:"copy",group:"clipboard"},{name:"paste",group:"clipboard"},{name:"selectall",group:"clipboard"}]}init(e){var t;null===(t=this.buttons)||void 0===t||t.forEach((t=>e.registerButton(t))),e.e.off("copy.clipboard cut.clipboard").on("copy.clipboard cut.clipboard",(t=>{var i;const o=e.s.html,s=Ye(t)||Ye(e.ew)||Ye(t.originalEvent);s&&(s.setData(a.TEXT_PLAIN,(0,c.stripTags)(o)),s.setData(a.TEXT_HTML,o)),e.buffer.set(Ke,o),e.e.fire("pasteStack",{html:o,action:e.o.defaultActionOnPaste}),"cut"===t.type&&(e.s.remove(),e.s.focus()),t.preventDefault(),null===(i=null==e?void 0:e.events)||void 0===i||i.fire("afterCopy",o)}))}destruct(e){var t,i;null===(t=null==e?void 0:e.buffer)||void 0===t||t.set(Ke,""),null===(i=null==e?void 0:e.events)||void 0===i||i.off(".clipboard")}}n.D.prototype.askBeforePasteHTML=!0,n.D.prototype.processPasteHTML=!0,n.D.prototype.askBeforePasteFromWord=!0,n.D.prototype.processPasteFromWord=!0,n.D.prototype.nl2brInPlainText=!0,n.D.prototype.defaultActionOnPaste=a.INSERT_AS_HTML,n.D.prototype.defaultActionOnPasteFromWord=null,n.D.prototype.draggableTags=["img","a","jodit-media","jodit"],n.D.prototype.controls.cut={command:"cut",isDisabled:e=>e.s.isCollapsed(),tooltip:"Cut selection"},n.D.prototype.controls.copy={command:"copy",isDisabled:e=>e.s.isCollapsed(),tooltip:"Copy selection"};const Je="pasteStorage";n.D.prototype.controls.paste={tooltip:"Paste from clipboard",async exec(e,t,{control:i}){if(i.name===Je)return void e.execCommand("showPasteStorage");e.s.focus();let o="",s=!0;if(navigator.clipboard){try{const e=await navigator.clipboard.read();if(e&&e.length){const t=await e[0].getType(a.TEXT_PLAIN);o=await new Response(t).text()}s=!1}catch(e){}if(s)try{o=await navigator.clipboard.readText(),s=!1}catch(e){}}s&&(o=e.buffer.get(Ke)||"",s=0===o.length);const r=e.value;s?(e.ed.execCommand("paste"),s=r===e.value,!s&&e.e.fire("afterPaste")):o.length?($e(null,e,o),e.e.fire("afterPaste")):s&&B(e.i18n("Your browser doesn't support direct access to the clipboard."),(()=>{e.s.focus()})).bindDestruct(e)},list:{[Je]:"Paste Storage"},isChildDisabled(e){return 2>e.e.fire("pasteStorageList")}},n.D.prototype.controls.selectall={icon:"select-all",command:"selectall",tooltip:"Select all"};class Xe extends O{constructor(){super(...arguments),this.pasteStack=new c.LimitedStack(20)}afterInit(e){e.e.on("paste.paste",this.onPaste).on("pasteStack.paste",(e=>this.pasteStack.push(e))),e.o.nl2brInPlainText&&this.j.e.on("processPaste.paste",this.onProcessPasteReplaceNl2Br)}onPaste(e){try{if(!1===this.j.e.fire("beforePaste",e)||!1===this.customPasteProcess(e))return e.preventDefault(),!1;this.defaultPasteProcess(e)}finally{this.j.e.fire("afterPaste",e)}}customPasteProcess(e){if(!this.j.o.processPasteHTML)return;const t=Ye(e),i=[null==t?void 0:t.getData(a.TEXT_HTML),null==t?void 0:t.getData(a.TEXT_PLAIN)];for(const t of i)if((0,c.isHTML)(t)&&(this.processWordHTML(e,t)||this.processHTML(e,t)))return!1}defaultPasteProcess(e){const t=Ye(e);let i=(null==t?void 0:t.getData(a.TEXT_HTML))||(null==t?void 0:t.getData(a.TEXT_PLAIN));if(t&&i&&""!==(0,c.trim)(i)){const o=this.j.e.fire("processPaste",e,i,(e=>{const t=e.types;let i="";if((0,c.isArray)(t)||"domstringlist"===(0,c.type)(t))for(let e=0;t.length>e;e+=1)i+=t[e]+";";else i=(t||a.TEXT_PLAIN)+";";return i})(t));void 0!==o&&(i=o),((0,c.isString)(i)||j.i.isNode(i,this.j.ew))&&this.insertByType(e,i,this.j.o.defaultActionOnPaste),e.preventDefault(),e.stopPropagation()}}processWordHTML(e,t){return!(!this.j.o.processPasteFromWord||!(0,c.isHtmlFromWord)(t)||(this.j.o.askBeforePasteFromWord?this.askInsertTypeDialog("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","Word Paste Detected",(i=>{this.insertFromWordByType(e,t,i)})):this.insertFromWordByType(e,t,this.j.o.defaultActionOnPasteFromWord||this.j.o.defaultActionOnPaste),0))}processHTML(e,t){if(this.j.o.askBeforePasteHTML){const i=this.pasteStack.find((e=>e.html===t));return i?(this.insertByType(e,t,i.action||this.j.o.defaultActionOnPaste),!0):(this.askInsertTypeDialog("Your code is similar to HTML. Keep as HTML?","Paste as HTML",(i=>{this.insertByType(e,t,i)}),"Insert as Text"),!0)}return!1}insertFromWordByType(e,t,i){var o;switch(i){case a.INSERT_AS_HTML:if(t=(0,c.applyStyles)(t),this.j.o.beautifyHTML){const e=null===(o=this.j.events)||void 0===o?void 0:o.fire("beautifyHTML",t);(0,c.isString)(e)&&(t=e)}break;case a.INSERT_AS_TEXT:t=(0,c.cleanFromWord)(t);break;case a.INSERT_ONLY_TEXT:t=(0,c.stripTags)((0,c.cleanFromWord)(t))}$e(e,this.j,t)}insertByType(e,t,i){if(this.pasteStack.push({html:t,action:i}),(0,c.isString)(t))switch(this.j.buffer.set(Ke,t),i){case a.INSERT_CLEAR_HTML:t=(0,c.cleanFromWord)(t);break;case a.INSERT_ONLY_TEXT:t=(0,c.stripTags)(t);break;case a.INSERT_AS_TEXT:t=(0,c.htmlspecialchars)(t)}$e(e,this.j,t)}askInsertTypeDialog(e,t,i,o="Clean",s="Insert only Text"){var r,n,l,d;if(!1===(null===(n=null===(r=this.j)||void 0===r?void 0:r.e)||void 0===n?void 0:n.fire("beforeOpenPasteDialog",e,t,i,o,s)))return;const h=H(`
${this.j.i18n(e)}
`,this.j.i18n(t));h.bindDestruct(this.j),(0,c.markOwner)(this.j,h.container);const u=(0,m.zx)(this.j,{text:"Keep",name:"keep",status:"primary",tabIndex:0}),p=(0,m.zx)(this.j,{text:o,tabIndex:0}),f=(0,m.zx)(this.j,{text:s,tabIndex:0}),g=(0,m.zx)(this.j,{text:"Cancel",tabIndex:0});return u.onAction((()=>{h.close(),i&&i(a.INSERT_AS_HTML)})),p.onAction((()=>{h.close(),i&&i(a.INSERT_AS_TEXT)})),f.onAction((()=>{h.close(),i&&i(a.INSERT_ONLY_TEXT)})),g.onAction((()=>{h.close()})),h.setFooter([u,p,s?f:"",g]),u.focus(),null===(d=null===(l=this.j)||void 0===l?void 0:l.e)||void 0===d||d.fire("afterOpenPasteDialog",h,e,t,i,o,s),h}onProcessPasteReplaceNl2Br(e,t,i){if(i===a.TEXT_PLAIN+";"&&!(0,c.isHTML)(t))return(0,c.nl2br)(t)}useFakeDivBox(e){const t=this.j.c.div("",{tabindex:-1,contenteditable:!0,style:{left:-9999,top:0,width:0,height:"100%",lineHeight:"140%",overflow:"hidden",position:"fixed",zIndex:2147483647,wordBreak:"break-all"}});this.j.container.appendChild(t);const i=this.j.s.save();t.focus();let o=0;const s=()=>{j.i.safeRemove(t),this.j.selection&&this.j.s.restore(i)},r=()=>{if(o+=1,t.childNodes&&t.childNodes.length>0){const i=t.innerHTML;return s(),void this.processHTML(e,i)}5>o?this.j.async.setTimeout(r,20):s()};r()}beforeDestruct(e){e.e.off("paste.paste",this.onPaste)}}(0,r.__decorate)([S.autobind],Xe.prototype,"onPaste",null),(0,r.__decorate)([S.autobind],Xe.prototype,"onProcessPasteReplaceNl2Br",null);class Ze extends O{constructor(){super(...arguments),this.currentIndex=0,this.list=[],this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.paste=()=>{if(this.j.s.focus(),this.j.s.insertHTML(this.list[this.currentIndex]),0!==this.currentIndex){const e=this.list[0];this.list[0]=this.list[this.currentIndex],this.list[this.currentIndex]=e}this.dialog&&this.dialog.close(),this.j.setEditorValue(),this.j.e.fire("afterPaste")},this.onKeyDown=e=>{let t=this.currentIndex;-1!==[a.KEY_UP,a.KEY_DOWN,a.KEY_ENTER].indexOf(e.key)&&(e.key===a.KEY_UP&&(0===t?t=this.list.length-1:t-=1),e.key===a.KEY_DOWN&&(t===this.list.length-1?t=0:t+=1),e.key!==a.KEY_ENTER?(t!==this.currentIndex&&this.selectIndex(t),e.stopImmediatePropagation(),e.preventDefault()):this.paste())},this.selectIndex=e=>{this.listBox&&(0,c.toArray)(this.listBox.childNodes).forEach(((t,i)=>{t.classList.remove("jodit_active"),e===i&&this.previewBox&&(t.classList.add("jodit_active"),this.previewBox.innerHTML=this.list[e],t.focus())})),this.currentIndex=e},this.showDialog=()=>{2>this.list.length||(this.dialog||this.createDialog(),this.listBox&&(this.listBox.innerHTML=""),this.previewBox&&(this.previewBox.innerHTML=""),this.list.forEach(((e,t)=>{const i=this.j.c.element("a");i.textContent=t+1+". "+e.replace((0,a.SPACE_REG_EXP)(),""),this.j.e.on(i,"keydown",this.onKeyDown),(0,c.attr)(i,"href","javascript:void(0)"),(0,c.attr)(i,"data-index",""+t),(0,c.attr)(i,"tab-index","-1"),this.listBox&&this.listBox.appendChild(i)})),this.dialog&&this.dialog.open(),this.j.async.setTimeout((()=>{this.selectIndex(0)}),100))}}createDialog(){this.dialog=new q({language:this.j.o.language});const e=this.j.c.fromHTML(''+this.j.i18n("Paste")+"");this.j.e.on(e,"click",this.paste);const t=this.j.c.fromHTML(''+this.j.i18n("Cancel")+"");this.j.e.on(t,"click",this.dialog.close),this.container=this.j.c.div(),this.container.classList.add("jodit-paste-storage"),this.listBox=this.j.c.div(),this.previewBox=this.j.c.div(),this.container.appendChild(this.listBox),this.container.appendChild(this.previewBox),this.dialog.setHeader(this.j.i18n("Choose Content to Paste")),this.dialog.setContent(this.container),this.dialog.setFooter([e,t]),this.j.e.on(this.listBox,"click dblclick",(e=>{const t=e.target;return j.i.isTag(t,"a")&&t.hasAttribute("data-index")&&this.selectIndex(parseInt((0,c.attr)(t,"-index")||"0",10)),"dblclick"===e.type&&this.paste(),!1}))}afterInit(){this.j.e.off("afterCopy.paste-storage").on("pasteStorageList.paste-storage",(()=>this.list.length)).on("afterCopy.paste-storage",(e=>{-1!==this.list.indexOf(e)&&this.list.splice(this.list.indexOf(e),1),this.list.unshift(e),this.list.length>5&&(this.list.length=5)})),this.j.registerCommand("showPasteStorage",{exec:this.showDialog,hotkeys:["ctrl+shift+v","cmd+shift+v"]})}beforeDestruct(){this.dialog&&this.dialog.destruct(),this.j.e.off(".paste-storage"),j.i.safeRemove(this.previewBox),j.i.safeRemove(this.listBox),j.i.safeRemove(this.container),this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.list=[]}}const Qe="copyformat",et=["fontWeight","fontStyle","fontSize","color","margin","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textDecorationLine","fontFamily"],tt=(e,t,i,o)=>{let s=(0,c.css)(i,t);return s===o[t]&&(s=i.parentNode&&i!==e.editor&&i.parentNode!==e.editor?tt(e,t,i.parentNode,o):void 0),s};function it(e){e.registerButton({name:"copyformat",group:"clipboard"})}n.D.prototype.controls.copyformat={exec(e,t,{button:i}){if(t){if(e.buffer.exists(Qe))e.buffer.delete(Qe),e.e.off(e.editor,"mouseup.copyformat");else{const i={},o=j.i.up(t,(e=>e&&!j.i.isText(e)),e.editor)||e.editor,s=e.createInside.span();e.editor.appendChild(s),et.forEach((e=>{i[e]=(0,c.css)(s,e)})),s!==e.editor&&j.i.safeRemove(s);const r=((e,t,i)=>{const o={};return t&&et.forEach((s=>{o[s]=tt(e,s,t,i),s.match(/border(Style|Color)/)&&!o.borderWidth&&(o[s]=void 0)})),o})(e,o,i),n=()=>{e.buffer.delete(Qe);const t=e.s.current();t&&(j.i.isTag(t,"img")?(0,c.css)(t,r):e.s.applyStyle(r)),e.e.off(e.editor,"mouseup.copyformat")};e.e.on(e.editor,"mouseup.copyformat",n),e.buffer.set(Qe,!0)}i.update()}},isActive:e=>e.buffer.exists(Qe),tooltip:"Paint format"};var ot=i(61);function st(e){e.registerButton({name:"brush",group:"color"});const t=(t,i,o)=>{const s=(0,c.normalizeColor)(o);switch(t){case"background":e.s.applyStyle({backgroundColor:s||""});break;case"forecolor":e.s.applyStyle({color:s||""})}return e.setEditorValue(),!1};e.registerCommand("forecolor",t).registerCommand("background",t)}n.D.prototype.controls.brush={update(e){const t=(0,c.dataBind)(e,"color"),i=e.j,o=(t,o)=>{o&&o!==""+(0,c.css)(i.editor,t)&&(e.state.icon.fill=o)};if(t){const i=(0,c.dataBind)(e,"color");return void o("color"===i?i:"background-color",t)}const s=i.s.current();if(s&&!e.state.disabled){const e=j.i.closest(s,(e=>j.i.isBlock(e,i.ew)||e&&j.i.isElement(e)),i.editor)||i.editor;o("color",""+(0,c.css)(e,"color")),o("background-color",""+(0,c.css)(e,"background-color"))}e.state.icon.fill="",e.state.activated=!1},popup(e,t,i,o,s){let r="",n="",a=[],l=null;return t&&t!==e.editor&&j.i.isNode(t,e.ew)&&(j.i.isElement(t)&&e.s.isCollapsed()&&!j.i.isTag(t,["br","hr"])&&(l=t),j.i.up(t,(t=>{if(j.i.isHTMLElement(t,e.ew)){const e=(0,c.css)(t,"color",void 0,!0),i=(0,c.css)(t,"background-color",void 0,!0);if(e)return r=""+e,!0;if(i)return n=""+i,!0}}),e.editor)),a=[{name:"Background",content:(0,ot.YW)(e,(t=>{l?l.style.backgroundColor=t:e.execCommand("background",!1,t),(0,c.dataBind)(s,"color",t),(0,c.dataBind)(s,"color-mode","background"),o()}),n)},{name:"Text",content:(0,ot.YW)(e,(t=>{l?l.style.color=t:e.execCommand("forecolor",!1,t),(0,c.dataBind)(s,"color",t),(0,c.dataBind)(s,"color-mode","color"),o()}),r)}],"background"!==e.o.colorPickerDefaultTab&&(a=a.reverse()),(0,ot.IL)(e,a,l)},exec(e,t,{button:i}){const o=(0,c.dataBind)(i,"color-mode"),s=(0,c.dataBind)(i,"color");if(!o)return!1;if(t&&t!==e.editor&&j.i.isNode(t,e.ew)&&j.i.isElement(t))switch(o){case"color":t.style.color=s;break;case"background":t.style.backgroundColor=s}else e.execCommand("background"===o?o:"forecolor",!1,s)},tooltip:"Fill color or set the text color"};class rt extends O{constructor(){super(...arguments),this.isFragmentFromEditor=!1,this.isCopyMode=!1,this.startDragPoint={x:0,y:0},this.draggable=null,this.bufferRange=null,this.getText=e=>{const t=Ye(e);return t?t.getData(a.TEXT_HTML)||t.getData(a.TEXT_PLAIN):null}}afterInit(){this.j.e.on([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}onDragStart(e){let t=e.target;if(this.onDragEnd(),this.isFragmentFromEditor=j.i.isOrContains(this.j.editor,t,!0),this.isCopyMode=!this.isFragmentFromEditor||(0,c.ctrlKey)(e),this.isFragmentFromEditor){const e=this.j.s.sel,t=e&&e.rangeCount?e.getRangeAt(0):null;t&&(this.bufferRange=t.cloneRange())}else this.bufferRange=null;this.startDragPoint.x=e.clientX,this.startDragPoint.y=e.clientY,j.i.isElement(t)&&t.classList.contains("jodit-filebrowser__files-item")&&(t=t.querySelector("img")),j.i.isTag(t,"img")&&(this.draggable=t.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",t)),this.addDragListeners()}addDragListeners(){this.j.e.on("dragover",this.onDrag).on("drop.DragAndDrop",this.onDrop).on(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}removeDragListeners(){this.j.e.off("dragover",this.onDrag).off("drop.DragAndDrop",this.onDrop).off(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}onDrag(e){this.draggable&&(this.j.e.fire("hidePopup"),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),e.preventDefault(),e.stopPropagation())}onDragEnd(){this.draggable&&(j.i.safeRemove(this.draggable),this.draggable=null),this.isCopyMode=!1,this.removeDragListeners()}onDrop(e){if(!e.dataTransfer||!e.dataTransfer.files||!e.dataTransfer.files.length){if(!this.isFragmentFromEditor&&!this.draggable)return this.j.e.fire("paste",e),e.preventDefault(),e.stopPropagation(),!1;const t=this.j.s.sel,i=this.bufferRange||(t&&t.rangeCount?t.getRangeAt(0):null);let o=null;if(!this.draggable&&i)o=this.isCopyMode?i.cloneContents():i.extractContents();else if(this.draggable)if(this.isCopyMode){const[e,t]="1"===(0,c.attr)(this.draggable,"-is-file")?["a","href"]:["img","src"];o=this.j.createInside.element(e),o.setAttribute(t,(0,c.attr)(this.draggable,"data-src")||(0,c.attr)(this.draggable,"src")||""),"a"===e&&(o.textContent=(0,c.attr)(o,t)||"")}else o=(0,c.dataBind)(this.draggable,"target");else this.getText(e)&&(o=this.j.createInside.fromHTML(this.getText(e)));t&&t.removeAllRanges(),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),o&&(this.j.s.insertNode(o,!1,!1),i&&o.firstChild&&o.lastChild&&(i.setStartBefore(o.firstChild),i.setEndAfter(o.lastChild),this.j.s.selectRange(i),this.j.e.fire("synchro")),j.i.isTag(o,"img")&&this.j.events&&this.j.e.fire("afterInsertImage",o)),e.preventDefault(),e.stopPropagation()}this.isFragmentFromEditor=!1,this.removeDragListeners()}beforeDestruct(){this.onDragEnd(),this.j.e.off(window,".DragAndDrop").off(".DragAndDrop").off([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}}(0,r.__decorate)([S.autobind],rt.prototype,"onDragStart",null),(0,r.__decorate)([(0,S.throttle)((e=>e.j.defaultTimeout/10))],rt.prototype,"onDrag",null),(0,r.__decorate)([S.autobind],rt.prototype,"onDragEnd",null),(0,r.__decorate)([S.autobind],rt.prototype,"onDrop",null);class nt extends O{constructor(){super(...arguments),this.dragList=[],this.draggable=null,this.wasMoved=!1,this.isCopyMode=!1,this.diffStep=10,this.startX=0,this.startY=0}afterInit(){this.dragList=this.j.o.draggableTags?(0,c.splitArray)(this.j.o.draggableTags).filter(Boolean).map((e=>e.toLowerCase())):[],this.dragList.length&&this.j.e.on("mousedown touchstart dragstart",this.onDragStart)}onDragStart(e){if("dragstart"===e.type&&this.draggable)return!1;const t=e.target;if(!this.dragList.length||!t)return;const i=e=>e&&this.dragList.includes(e.nodeName.toLowerCase()),o=j.i.furthest(t,i,this.j.editor)||(i(t)?t:null);o&&(this.startX=e.clientX,this.startY=e.clientY,this.isCopyMode=(0,c.ctrlKey)(e),this.onDragEnd(),this.draggable=o.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",o),this.addDragListeners())}onDrag(e){var t,i;if(!this.draggable)return;const o=e.clientY;if(Math.sqrt(Math.pow(e.clientX-this.startX,2)+Math.pow(o-this.startY,2))>=this.diffStep){if(this.wasMoved=!0,this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){const o=(0,c.dataBind)(this.draggable,"target");(0,c.css)(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",display:"inline-block",left:e.clientX,top:e.clientY,width:null!==(t=null==o?void 0:o.offsetWidth)&&void 0!==t?t:100,height:null!==(i=null==o?void 0:o.offsetHeight)&&void 0!==i?i:100}),(0,C.ZO)(this.j,nt).appendChild(this.draggable)}(0,c.css)(this.draggable,{left:e.clientX,top:e.clientY}),this.j.s.insertCursorAtPoint(e.clientX,e.clientY)}}onDragEnd(){this.isInDestruct||this.draggable&&(j.i.safeRemove(this.draggable),this.draggable=null,this.wasMoved=!1,this.removeDragListeners())}onDrop(){if(!this.draggable||!this.wasMoved)return void this.onDragEnd();let e=(0,c.dataBind)(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(e=e.cloneNode(!0));const{parentElement:t}=e;this.j.s.insertNode(e,!0,!1),t&&j.i.isEmpty(t)&&j.i.safeRemove(t),j.i.isTag(e,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",e),this.j.e.fire("synchro")}addDragListeners(){this.j.e.on(this.j.editor,"mousemove touchmove",this.onDrag).on("mouseup touchend",this.onDrop).on([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}removeDragListeners(){this.j.e.off(this.j.editor,"mousemove touchmove",this.onDrag).off("mouseup touchend",this.onDrop).off([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}beforeDestruct(){this.onDragEnd(),this.j.e.off("mousedown touchstart dragstart",this.onDragStart),this.removeDragListeners()}}(0,r.__decorate)([S.autobind],nt.prototype,"onDragStart",null),(0,r.__decorate)([(0,S.throttle)((e=>e.j.defaultTimeout/10))],nt.prototype,"onDrag",null),(0,r.__decorate)([S.autobind],nt.prototype,"onDragEnd",null),(0,r.__decorate)([S.autobind],nt.prototype,"onDrop",null);const at=(e,t,i,o)=>{var s;const r=e.createInside.element(i),n=e.createInside.element("br");r.appendChild(n),o&&o.cssText&&r.setAttribute("style",o.cssText),e.s.insertNode(r,!1,!1),e.s.setCursorBefore(n);const a=e.s.createRange();return a.setStartBefore("br"!==i.toLowerCase()?n:r),a.collapse(!0),e.s.selectRange(a),j.i.safeRemove(t),(0,c.scrollIntoViewIfNeeded)(r,e.editor,e.ed),null===(s=e.events)||void 0===s||s.fire("synchro"),r};class lt extends O{constructor(){super(...arguments),this.brMode=!1,this.defaultTag=a.PARAGRAPH}afterInit(e){this.defaultTag=e.o.enter.toLowerCase(),this.brMode=this.defaultTag===a.BR.toLowerCase(),e.o.enterBlock||(e.o.enterBlock=this.brMode?a.PARAGRAPH:this.defaultTag),e.e.off(".enter").on("keydown.enter",(t=>{if(t.key===a.KEY_ENTER){const i=e.e.fire("beforeEnter",t);return void 0!==i?i:(e.s.isCollapsed()||e.execCommand("Delete"),e.s.focus(),this.onEnter(t),!1)}}))}onEnter(e){const t=this.j,i=t.selection,o=this.defaultTag;let s=i.current(!1);s&&s!==t.editor||(s=t.createInside.text(a.INVISIBLE_SPACE),i.insertNode(s),i.select(s));let r=this.getBlockWrapper(s);const n=j.i.isTag(r,"li");if((!n||e.shiftKey)&&!this.checkBR(s,e.shiftKey))return!1;if(r||this.hasPreviousBlock(s)||(r=this.wrapText(s)),!r||r===s)return at(t,null,n?"li":o),!1;if(!this.checkUnsplittableBox(r))return!1;if(n&&j.i.isEmpty(r))return this.enterInsideEmptyLIelement(r),!1;const l=r.tagName.toLowerCase()===this.defaultTag||n,c=i.cursorOnTheRight(r),d=i.cursorOnTheLeft(r);if(!l&&(c||d)){let e=null;return e=c?i.setCursorAfter(r):i.setCursorBefore(r),at(t,e,this.defaultTag),void(d&&!c&&i.setCursorIn(r,!0))}i.splitSelection(r)}getBlockWrapper(e,t=a.IS_BLOCK){let i=e;const o=this.j.editor;do{if(!i||i===o)break;if(t.test(i.nodeName))return j.i.isTag(i,"li")?i:this.getBlockWrapper(i.parentNode,/^li$/i)||i;i=i.parentNode}while(i&&i!==o);return null}checkBR(e,t){const i=j.i.closest(e,["pre","blockquote"],this.j.editor);if(this.brMode||t&&!i||!t&&i){const e=this.j.createInside.element("br");return this.j.s.insertNode(e,!0),(0,c.scrollIntoViewIfNeeded)(e,this.j.editor,this.j.ed),!1}return!0}wrapText(e){let t=e;j.i.up(t,(e=>{e&&e.hasChildNodes()&&e!==this.j.editor&&(t=e)}),this.j.editor);const i=j.i.wrapInline(t,this.j.o.enter,this.j);if(j.i.isEmpty(i)){const e=this.j.createInside.element("br");i.appendChild(e),this.j.s.setCursorBefore(e)}return i}hasPreviousBlock(e){const t=this.j;return!!j.i.prev(e,(e=>j.i.isBlock(e,t.ew)||j.i.isImage(e,t.ew)),t.editor)}checkUnsplittableBox(e){const t=this.j,i=t.selection;if(!j.i.canSplitBlock(e,t.ew)){const e=t.createInside.element("br");return i.insertNode(e,!1),i.setCursorAfter(e),!1}return!0}enterInsideEmptyLIelement(e){let t=null;const i=j.i.closest(e,["ol","ul"],this.j.editor);if(i){if(j.i.prev(e,(e=>j.i.isTag(e,"li")),i))if(j.i.next(e,(e=>j.i.isTag(e,"li")),i)){const o=this.j.s.createRange();o.setStartBefore(i),o.setEndAfter(e);const s=o.extractContents();i.parentNode&&i.parentNode.insertBefore(s,i),t=this.j.s.setCursorBefore(i)}else t=this.j.s.setCursorAfter(i);else t=this.j.s.setCursorBefore(i);j.i.safeRemove(e),at(this.j,t,this.defaultTag),(0,c.$$)("li",i).length||j.i.safeRemove(i)}}beforeDestruct(e){e.e.off("keydown.enter")}}function ct(e){if(e.o.showMessageErrors){let t;const i=e.c.div("jodit_error_box_for_messages"),o=()=>{t=5,(0,c.toArray)(i.childNodes).forEach((o=>{(0,c.css)(i,"bottom",t+"px"),t+=o.offsetWidth+e.o.showMessageErrorOffsetPx}))};e.e.on("beforeDestruct",(()=>{j.i.safeRemove(i)})).on("errorMessage",((t,s,r)=>{e.workplace.appendChild(i);const n=e.c.div("active "+(s||""),t);i.appendChild(n),o(),e.async.setTimeout((()=>{n.classList.remove("active"),e.async.setTimeout((()=>{j.i.safeRemove(n),o()}),300)}),r||e.o.showMessageErrorTime)}))}}function dt(e){e.registerButton({name:"font",group:"font"}).registerButton({name:"fontsize",group:"font"});const t=(t,i,o)=>{switch(t){case"fontsize":e.s.applyStyle({fontSize:(0,c.normalizeSize)(o)});break;case"fontname":e.s.applyStyle({fontFamily:o})}return e.e.fire("synchro"),!1};e.registerCommand("fontsize",t).registerCommand("fontname",t)}function ht(e){e.registerButton({name:"paragraph",group:"font"}),e.registerCommand("formatblock",((t,i,o)=>(e.s.applyStyle(void 0,{element:o}),e.setEditorValue(),!1)))}function ut(e){e.registerButton({name:"fullsize"});let t=!1,i=0,o=0,s=!1;const r=()=>{e.events&&(t?(i=(0,c.css)(e.container,"height",void 0,!0),o=(0,c.css)(e.container,"width",void 0,!0),(0,c.css)(e.container,{height:e.ow.innerHeight,width:e.ow.innerWidth}),s=!0):s&&(0,c.css)(e.container,{height:i||"auto",width:o||"auto"}))},n=i=>{var o;if(e.container){if(void 0===i&&(i=!e.container.classList.contains("jodit_fullsize")),e.setMod("fullsize",i),e.o.fullsize=i,t=i,e.container.classList.toggle("jodit_fullsize",i),e.toolbar&&((0,c.isJoditObject)(e)&&e.toolbarContainer.appendChild(e.toolbar.container),(0,c.css)(e.toolbar.container,"width","auto")),e.o.globalFullSize){let t=e.container.parentNode;for(;t&&t.nodeType!==Node.DOCUMENT_NODE;)t.classList.toggle("jodit_fullsize-box_true",i),t=t.parentNode;r()}null===(o=e.events)||void 0===o||o.fire("afterResize")}};e.o.globalFullSize&&e.e.on(e.ow,"resize",r),e.e.on("afterInit afterOpen",(()=>{var t;e.toggleFullSize(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.fullsize)})).on("toggleFullSize",n).on("beforeDestruct",(()=>{t&&n(!1)})).on("beforeDestruct",(()=>{e.events&&e.e.off(e.ow,"resize",r)}))}n.D.prototype.showMessageErrors=!0,n.D.prototype.showMessageErrorTime=3e3,n.D.prototype.showMessageErrorOffsetPx=3,n.D.prototype.defaultFontSizePoints="px",n.D.prototype.controls.fontsize={command:"fontSize",data:{cssRule:"font-size"},list:["8","9","10","11","12","14","16","18","24","30","36","48","60","72","96"],exec:(e,t,{control:i})=>(0,c.memorizeExec)(e,t,{control:i},(t=>{var o;return"fontsize"===(null===(o=i.command)||void 0===o?void 0:o.toLowerCase())?`${t}${e.o.defaultFontSizePoints}`:t})),childTemplate:(e,t,i)=>`${i}${e.o.defaultFontSizePoints}`,tooltip:"Font size",isChildActive(e,t){var i,o;const s=e.s.current(),r=(null===(i=t.data)||void 0===i?void 0:i.cssRule)||"font-size",n=(null===(o=t.data)||void 0===o?void 0:o.normalize)||(t=>/pt$/i.test(t)&&"pt"===e.o.defaultFontSizePoints?t.replace(/pt$/i,""):t);if(s){const i=j.i.closest(s,(t=>j.i.isBlock(t,e.ew)||t&&j.i.isElement(t)),e.editor)||e.editor,o=(0,c.css)(i,r);return!(!o||!t.args||n(""+t.args[0])!==n(""+o))}return!1}},n.D.prototype.controls.font={...n.D.prototype.controls.fontsize,command:"fontname",list:{"":"Default","Helvetica,sans-serif":"Helvetica","Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","'Times New Roman',Times,serif":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},childTemplate:(e,t,i)=>`${i}`,data:{cssRule:"font-family",normalize:e=>e.toLowerCase().replace(/['"]+/g,"").replace(/[^a-z0-9]+/g,",")},tooltip:"Font family"},n.D.prototype.controls.paragraph={command:"formatBlock",update(e){const t=e.j,i=e.control,o=t.s.current();if(o&&t.o.textIcons){const s=(j.i.closest(o,(e=>j.i.isBlock(e,t.ew)),t.editor)||t.editor).nodeName.toLowerCase(),r=i.list;e&&i.data&&i.data.currentValue!==s&&r&&r[s]&&(t.o.textIcons?e.state.text=s:e.state.icon.name=s,i.data.currentValue=s)}return!1},exec:c.memorizeExec,data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote"},isChildActive(e,t){const i=e.s.current();if(i){const o=j.i.closest(i,(t=>j.i.isBlock(t,e.ew)),e.editor);return!(!o||o===e.editor||void 0===t.args||o.nodeName.toLowerCase()!==t.args[0])}return!1},isActive(e,t){const i=e.s.current();if(i){const o=j.i.closest(i,(t=>j.i.isBlock(t,e.ew)),e.editor);return!(!o||o===e.editor||void 0===t.list||j.i.isTag(o,"p")||void 0===t.list[o.nodeName.toLowerCase()])}return!1},childTemplate:(e,t,i)=>`<${t} style="margin:0;padding:0">${e.i18n(i)}`,tooltip:"Insert format block"},n.D.prototype.fullsize=!1,n.D.prototype.globalFullSize=!0,n.D.prototype.controls.fullsize={exec(e){e.toggleFullSize()},update(e){const t=e.j,i=t.isFullSize?"shrink":"fullsize";e.state.activated=t.isFullSize,t.o.textIcons?e.state.text=i:e.state.icon.name=i},tooltip:"Open editor in fullsize",mode:a.MODE_SOURCE+a.MODE_WYSIWYG},n.D.prototype.commandToHotkeys={removeFormat:["ctrl+shift+m","cmd+shift+m"],insertOrderedList:["ctrl+shift+7","cmd+shift+7"],insertUnorderedList:["ctrl+shift+8, cmd+shift+8"],selectall:["ctrl+a","cmd+a"]};class pt extends O{constructor(){super(...arguments),this.onKeyPress=e=>{const t=this.specialKeys[e.which],i=(e.key||String.fromCharCode(e.which)).toLowerCase(),o=[t||i];return["alt","ctrl","shift","meta"].forEach((i=>{e[i+"Key"]&&t!==i&&o.push(i)})),(0,c.normalizeKeyAliases)(o.join("+"))},this.specialKeys={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",91:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}}afterInit(e){(0,c.keys)(e.o.commandToHotkeys,!1).forEach((t=>{const i=e.o.commandToHotkeys[t];i&&((0,c.isArray)(i)||(0,c.isString)(i))&&e.registerHotkeyToCommand(i,t)}));let t=!1;e.e.off(".hotkeys").on([e.ow,e.ew],"keydown.hotkeys",(e=>{if(e.key===a.KEY_ESC)return this.j.e.fire("escape",e)})).on("keydown.hotkeys",(i=>{const o=this.onKeyPress(i),s={shouldStop:!0};if(!1===this.j.e.fire(o+".hotkey",i.type,s)){if(s.shouldStop)return t=!0,e.e.stopPropagation("keydown"),!1;i.preventDefault()}}),void 0,!0).on("keyup.hotkeys",(()=>{if(t)return t=!1,e.e.stopPropagation("keyup"),!1}),void 0,!0)}beforeDestruct(e){e.events&&e.e.off(".hotkeys")}}function mt(e){const t=e.options;e.e.on("afterSetMode",(()=>{e.isEditorMode()&&e.s.focus()})).on("generateDocumentStructure.iframe",((e,i)=>{const o=e||i.iframe.contentWindow.document;if(o.open(),o.write(t.iframeDoctype+``+`${t.iframeTitle}`+(t.iframeBaseUrl?``:"")+''),o.close(),t.iframeCSSLinks&&t.iframeCSSLinks.forEach((e=>{const t=o.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),o.head&&o.head.appendChild(t)})),t.iframeStyle){const e=o.createElement("style");e.innerHTML=t.iframeStyle,o.head&&o.head.appendChild(e)}})).on("createEditor",(()=>{if(!t.iframe)return;const i=e.c.element("iframe");i.style.display="block",i.src="about:blank",i.className="jodit-wysiwyg_iframe",i.setAttribute("allowtransparency","true"),i.setAttribute("tabindex",""+t.tabIndex),i.setAttribute("frameborder","0"),e.workplace.appendChild(i),e.iframe=i;const o=e.e.fire("generateDocumentStructure.iframe",null,e);return(0,c.callPromise)(o,(()=>{if(!e.iframe)return;const i=e.iframe.contentWindow.document;e.editorWindow=e.iframe.contentWindow;const o=()=>{(0,c.attr)(i.body,"contenteditable",e.getMode()!==a.MODE_SOURCE&&!e.getReadOnly()||null)},s=e=>{const t=//im,i="{%%BODY%%}",o=t.exec(e);return o&&(e=e.replace(t,i).replace(/]*?)>(.*?)<\/span>/gim,"").replace(/<span([^&]*?)>(.*?)<\/span>/gim,"").replace(i,o[0].replace(/(]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im,"$1").replace(/(]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5").replace(/(<[^<]+?)\sclass="[\s]*"/gim,"$1").replace(/(<[^<]+?)\sstyle="[\s;]*"/gim,"$1").replace(/(<[^<]+?)\sdir="[\s]*"/gim,"$1")),e};if(t.editHTMLDocumentMode){const t=e.element.tagName;if("TEXTAREA"!==t&&"INPUT"!==t)throw(0,c.error)("If enable `editHTMLDocumentMode` - source element should be INPUT or TEXTAREA");e.e.on("beforeGetNativeEditorValue",(()=>s(e.o.iframeDoctype+i.documentElement.outerHTML))).on("beforeSetNativeEditorValue",(t=>!e.isLocked&&(/<(html|body)/i.test(t)?s(i.documentElement.outerHTML)!==s(t)&&(i.open(),i.write(e.o.iframeDoctype+s(t)),i.close(),e.editor=i.body,o(),e.e.fire("prepareWYSIWYGEditor")):i.body.innerHTML=t,!0)))}if(e.editor=i.body,e.e.on("afterSetMode afterInit afterAddPlace",o),"auto"===t.height){i.documentElement&&(i.documentElement.style.overflowY="hidden");const o=e.async.throttle((()=>{e.editor&&e.iframe&&"auto"===t.height&&(0,c.css)(e.iframe,"height",e.editor.offsetHeight)}),e.defaultTimeout/2);e.e.on("change afterInit afterSetMode resize",o).on([e.iframe,e.ew,i.documentElement],"load",o).on(i,"readystatechange DOMContentLoaded",o)}return i.documentElement&&e.e.on(i.documentElement,"mousedown touchend",(()=>{e.s.isFocused()||(e.s.focus(),e.editor===i.body&&e.s.setCursorIn(i.body))})).on(e.ew,"mousedown touchstart keydown keyup touchend click mouseup mousemove scroll",(t=>{var i;null===(i=e.events)||void 0===i||i.fire(e.ow,t)})),!1}))}))}function ft(e){const t=e.o,i=e.i18n.bind(e),o=x.JO.get.bind(x.JO),s=t.filebrowser.ajax.url||t.uploader.url,r=t.image.useImageEditor;return e.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t${o("image")}\n\t\t\t\t\t\t${o("crop")}\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
`)}function gt(e){const t=e.o,i=e.i18n.bind(e),o=x.JO.get.bind(x.JO);return e.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t${o("lock")}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t`)}n.D.prototype.iframeBaseUrl="",n.D.prototype.iframeTitle="Jodit Editor",n.D.prototype.iframeDoctype="",n.D.prototype.iframeDefaultSrc="about:blank",n.D.prototype.iframeStyle='html{margin:0;padding:0;min-height: 100%;}body{box-sizing:border-box;font-size:13px;line-height:1.6;padding:10px;margin:0;background:transparent;color:#000;position:relative;z-index:2;user-select:auto;margin:0px;overflow:auto;outline:none;}table{width:100%;border:none;border-collapse:collapse;empty-cells: show;max-width: 100%;}th,td{padding: 2px 5px;border:1px solid #ccc;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}p{margin-top:0;}.jodit_editor .jodit_iframe_wrapper{display: block;clear: both;user-select: none;position: relative;}.jodit_editor .jodit_iframe_wrapper:after {position:absolute;content:"";z-index:1;top:0;left:0;right: 0;bottom: 0;cursor: pointer;display: block;background: rgba(0, 0, 0, 0);} .jodit_disabled{user-select: none;-o-user-select: none;-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none}',n.D.prototype.iframeCSSLinks=[],n.D.prototype.editHTMLDocumentMode=!1,n.D.prototype.image={dialogWidth:600,openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editBorderRadius:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0};const vt=e=>(e=(0,c.trim)(e),/^[0-9]+$/.test(e)?e+"px":e),bt=e=>/^[-+]?[0-9.]+px$/.test(""+e)?parseFloat(""+e):e;class yt extends O{constructor(){super(...arguments),this.state={image:new Image,get ratio(){return this.image.naturalWidth/this.image.naturalHeight||1},sizeIsLocked:!0,marginIsLocked:!0}}onChangeMarginIsLocked(){if(!this.form)return;const{marginRight:e,marginBottom:t,marginLeft:i,lockMargin:o}=(0,c.refs)(this.form);[e,t,i].forEach((e=>{(0,c.attr)(e,"disabled",this.state.marginIsLocked||null)})),o.innerHTML=x.JO.get(this.state.marginIsLocked?"lock":"unlock")}onChangeSizeIsLocked(){if(!this.form)return;const{lockSize:e,imageWidth:t}=(0,c.refs)(this.form);e.innerHTML=x.JO.get(this.state.sizeIsLocked?"lock":"unlock"),e.classList.remove("jodit-properties__lock"),e.classList.remove("jodit-properties__unlock"),e.classList.add(this.state.sizeIsLocked?"jodit-properties__lock":"jodit-properties__unlock"),this.j.e.fire(t,"change")}open(){return this.makeForm(),this.j.e.fire("hidePopup"),(0,c.markOwner)(this.j,this.dialog.container),this.state.marginIsLocked=!0,this.state.sizeIsLocked=!0,this.updateValues(),this.dialog.open().setModal(!0).setPosition(),!1}makeForm(){if(this.dialog)return;this.dialog=new q({fullsize:this.j.o.fullsize,globalFullSize:this.j.o.globalFullSize,theme:this.j.o.theme,language:this.j.o.language,minWidth:Math.min(400,screen.width),minHeight:400,buttons:["fullsize","dialog.close"]});const e=this.j,t=e.o,i=e.i18n.bind(e),o={check:(0,m.zx)(e,"ok","Apply"),remove:(0,m.zx)(e,"bin","Delete")};e.e.on(this.dialog,"afterClose",(()=>{this.state.image.parentNode&&t.image.selectImageAfterClose&&e.s.select(this.state.image)})),o.remove.onAction((()=>{e.s.removeNode(this.state.image),this.dialog.close()}));const{dialog:s}=this;s.setHeader(i("Image properties"));const r=(e=>{const{showPreview:t,editSize:i}=e.o.image,o=x.JO.get.bind(x.JO);return e.c.fromHTML(`
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t${o("lock")}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t
`)})(e);this.form=r,s.setContent(r);const{tabsBox:n}=(0,c.refs)(this.form);n&&n.appendChild((0,ot.IL)(e,[{name:"Image",content:ft(e)},{name:"Advanced",content:gt(e)}])),o.check.onAction(this.onApply);const{changeImage:a,editImage:l}=(0,c.refs)(this.form);e.e.on(a,"click",this.openImagePopup),t.image.useImageEditor&&e.e.on(l,"click",this.openImageEditor);const{lockSize:d,lockMargin:h,imageWidth:u,imageHeight:p}=(0,c.refs)(r);d&&e.e.on(d,"click",(()=>{this.state.sizeIsLocked=!this.state.sizeIsLocked})),e.e.on(h,"click",(e=>{this.state.marginIsLocked=!this.state.marginIsLocked,e.preventDefault()}));const f=e=>{if(!(0,c.isNumeric)(u.value)||!(0,c.isNumeric)(p.value))return;const t=parseFloat(u.value),i=parseFloat(p.value);e.target===u?p.value=""+Math.round(t/this.state.ratio):u.value=""+Math.round(i*this.state.ratio)};e.e.on([u,p],"change keydown mousedown paste",(t=>{this.state.sizeIsLocked&&e.async.setTimeout(f.bind(this,t),{timeout:e.defaultTimeout,label:"image-properties-changeSize"})})),s.setFooter([o.remove,o.check]),s.setSize(this.j.o.image.dialogWidth)}updateValues(){const e=this.j.o,{image:t}=this.state,{marginTop:i,marginRight:o,marginBottom:s,marginLeft:r,lockMargin:n,imageSrc:a,id:l,classes:d,align:h,style:u,imageTitle:p,imageAlt:m,borderRadius:f,imageLink:g,imageWidth:v,imageHeight:b,imageLinkOpenInNewTab:y,imageViewSrc:w,lockSize:k}=(0,c.refs)(this.form);(()=>{n.checked=this.state.marginIsLocked,k.checked=this.state.sizeIsLocked})(),a.value=(0,c.attr)(t,"src")||"",w&&(0,c.attr)(w,"src",(0,c.attr)(t,"src")||""),(()=>{p.value=(0,c.attr)(t,"title")||"",m.value=(0,c.attr)(t,"alt")||"";const e=j.i.closest(t,"a",this.j.editor);e?(g.value=(0,c.attr)(e,"href")||"",y.checked="_blank"===(0,c.attr)(e,"target")):(g.value="",y.checked=!1)})(),(()=>{const e=(0,c.attr)(t,"width")||(0,c.css)(t,"width",void 0,!0)||!1,i=(0,c.attr)(t,"height")||(0,c.css)(t,"height",void 0,!0)||!1;v.value=!1!==e?""+bt(e):""+t.offsetWidth,b.value=!1!==i?""+bt(i):""+t.offsetHeight,this.state.sizeIsLocked=(()=>!(!(0,c.isNumeric)(v.value)||!(0,c.isNumeric)(b.value))&&1>Math.abs(parseFloat(v.value)-parseFloat(b.value)*this.state.ratio))()})(),(()=>{if(!e.image.editMargins)return;let n=!0,a=!1;[i,o,s,r].forEach((e=>{const o=(0,c.attr)(e,"data-ref")||"";let s=t.style.getPropertyValue((0,c.kebabCase)(o));if(!s)return a=!0,void(e.value="");/^[0-9]+(px)?$/.test(s)&&(s=parseInt(s,10)),e.value=""+s||"",(a&&e.value||n&&"marginTop"!==o&&e.value!==i.value)&&(n=!1)})),this.state.marginIsLocked=n})(),d.value=((0,c.attr)(t,"class")||"").replace(/jodit_focused_image[\s]*/,""),l.value=(0,c.attr)(t,"id")||"",f.value=""+(parseInt(t.style.borderRadius||"0",10)||"0"),t.style.cssFloat&&-1!==["left","right"].indexOf(t.style.cssFloat.toLowerCase())?h.value=(0,c.css)(t,"float"):"block"===(0,c.css)(t,"display")&&"auto"===t.style.marginLeft&&"auto"===t.style.marginRight&&(h.value="center"),u.value=(0,c.attr)(t,"style")||""}onApply(){const{style:e,imageSrc:t,borderRadius:i,imageTitle:o,imageAlt:s,imageLink:r,imageWidth:n,imageHeight:a,marginTop:l,marginRight:d,marginBottom:h,marginLeft:u,imageLinkOpenInNewTab:p,align:m,classes:f,id:g}=(0,c.refs)(this.form),v=this.j.o,{image:b}=this.state;if(v.image.editStyle&&(0,c.attr)(b,"style",e.value||null),!t.value)return j.i.safeRemove(b),void this.dialog.close();(0,c.attr)(b,"src",t.value),b.style.borderRadius="0"!==i.value&&/^[0-9]+$/.test(i.value)?i.value+"px":"",(0,c.attr)(b,"title",o.value||null),(0,c.attr)(b,"alt",s.value||null);let y=j.i.closest(b,"a",this.j.editor);r.value?(y||(y=j.i.wrap(b,"a",this.j)),(0,c.attr)(y,"href",r.value),(0,c.attr)(y,"target",p.checked?"_blank":null)):y&&y.parentNode&&y.parentNode.replaceChild(b,y),n.value===""+b.offsetWidth&&a.value===""+b.offsetHeight||((0,c.css)(b,{width:(0,c.trim)(n.value)?vt(n.value):null,height:(0,c.trim)(a.value)?vt(a.value):null}),(0,c.attr)(b,"width",null),(0,c.attr)(b,"height",null));const w=[l,d,h,u];v.image.editMargins&&(this.state.marginIsLocked?(0,c.css)(b,"margin",vt(l.value)):w.forEach((e=>{const t=(0,c.attr)(e,"data-ref")||"";(0,c.css)(b,t,vt(e.value))}))),v.image.editClass&&(0,c.attr)(b,"class",f.value||null),v.image.editId&&(0,c.attr)(b,"id",g.value||null),v.image.editAlign&&(m.value?["right","left"].includes(m.value.toLowerCase())?((0,c.css)(b,"float",m.value),(0,c.clearCenterAlign)(b)):(0,c.css)(b,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):((0,c.css)(b,"float")&&-1!==["right","left"].indexOf((""+(0,c.css)(b,"float")).toLowerCase())&&(0,c.css)(b,"float",""),(0,c.clearCenterAlign)(b))),this.j.setEditorValue(),this.dialog.close()}openImageEditor(){const e=(0,c.attr)(this.state.image,"src")||"",t=this.j.c.element("a"),i=()=>{t.host===location.host||H(this.j.i18n("You can only edit your own images. Download this image on the host?"),(e=>{e&&this.j.uploader&&this.j.uploader.uploadRemoteImage(""+t.href,(e=>{B(this.j.i18n("The image has been successfully uploaded to the host!"),(()=>{(0,c.isString)(e.newfilename)&&((0,c.attr)(this.state.image,"src",e.baseurl+e.newfilename),this.updateValues())})).bindDestruct(this.j)}),(e=>{B(this.j.i18n("There was an error loading %s",e.message)).bindDestruct(this.j)}))})).bindDestruct(this.j)};t.href=e,this.j.filebrowser.dataProvider.getPathByUrl(""+t.href).then((i=>{re.call(this.j.filebrowser,t.href,i.name,i.path,i.source,(()=>{const t=(new Date).getTime();(0,c.attr)(this.state.image,"src",e+(-1!==e.indexOf("?")?"":"?")+"&_tmp="+t),this.updateValues()}),(e=>{B(e.message).bindDestruct(this.j)}))})).catch((e=>{B(e.message,i).bindDestruct(this.j)}))}openImagePopup(e){const t=new x.GI(this.j),{changeImage:i}=(0,c.refs)(this.form);t.setZIndex(this.dialog.getZIndex()+1),t.setContent((0,ot.ov)(this.j,{upload:e=>{e.files&&e.files.length&&(0,c.attr)(this.state.image,"src",e.baseurl+e.files[0]),this.updateValues(),t.close()},filebrowser:e=>{e&&(0,c.isArray)(e.files)&&e.files.length&&((0,c.attr)(this.state.image,"src",e.files[0]),t.close(),this.updateValues())}},this.state.image,t.close)).open((()=>(0,c.position)(i))),e.stopPropagation()}afterInit(e){const t=this;e.e.on("afterConstructor changePlace",(()=>{e.e.off(e.editor,".imageproperties").on(e.editor,"dblclick.imageproperties",(i=>{const o=i.target;j.i.isTag(o,"img")&&(e.o.image.openOnDblClick?(t.state.image=o,e.o.readonly||(i.stopImmediatePropagation(),i.preventDefault(),t.open())):(i.stopImmediatePropagation(),e.s.select(o)))}))})).on("openImageProperties.imageproperties",(e=>{this.state.image=e,this.open()}))}beforeDestruct(e){this.dialog&&this.dialog.destruct(),e.e.off(e.editor,".imageproperties").off(".imageproperties")}}function wt(e){e.e.on("change afterInit changePlace",e.async.debounce((()=>{e.editor&&(0,c.$$)("img",e.editor).forEach((t=>{t.__jodit_imageprocessor_binded||(t.__jodit_imageprocessor_binded=!0,t.complete||t.addEventListener("load",(function i(){var o;!e.isInDestruct&&(null===(o=e.e)||void 0===o||o.fire("resize")),t.removeEventListener("load",i)})),e.e.on(t,"mousedown touchstart",(()=>{e.s.select(t)})))}))}),e.defaultTimeout))}function kt(e){e.registerButton({name:"image",group:"media"})}(0,r.__decorate)([(0,S.watch)("state.marginIsLocked")],yt.prototype,"onChangeMarginIsLocked",null),(0,r.__decorate)([(0,S.watch)("state.sizeIsLocked")],yt.prototype,"onChangeSizeIsLocked",null),(0,r.__decorate)([S.autobind],yt.prototype,"onApply",null),(0,r.__decorate)([S.autobind],yt.prototype,"openImageEditor",null),(0,r.__decorate)([S.autobind],yt.prototype,"openImagePopup",null),n.D.prototype.controls.image={popup(e,t,i,o){let s=null;t&&!j.i.isText(t)&&j.i.isHTMLElement(t,e.ew)&&(j.i.isTag(t,"img")||(0,c.$$)("img",t).length)&&(s=j.i.isTag(t,"img")?t:(0,c.$$)("img",t)[0]);const r=e.s.save();return(0,ot.ov)(e,{filebrowser(t){e.s.restore(r),t.files&&t.files.forEach((i=>e.s.insertImage(t.baseurl+i,null,e.o.imageDefaultWidth))),o()},upload:!0,async url(t,i){e.s.restore(r);const n=s||e.createInside.element("img");n.setAttribute("src",t),n.setAttribute("alt",i),s||await e.s.insertImage(n,null,e.o.imageDefaultWidth),o()}},s,o)},tags:["img"],tooltip:"Insert Image"},n.D.prototype.controls.indent={tooltip:"Increase Indent"};const Ct=e=>"rtl"===e?"marginRight":"marginLeft";function St(e){const t=Ct(e.o.direction);e.registerButton({name:"indent",group:"indent"}).registerButton({name:"outdent",group:"indent"});const i=i=>{const o=[];return e.s.eachSelection((s=>{const r=e.s.save();let n=!!s&&j.i.up(s,(t=>j.i.isBlock(t,e.ew)),e.editor);const l=e.o.enter;if(!n&&s&&(n=j.i.wrapInline(s,l!==a.BR?l:a.PARAGRAPH,e)),!n)return e.s.restore(r),!1;const d=-1!==o.indexOf(n);if(n&&n.style&&!d){o.push(n);let s=n.style[t]?parseInt(n.style[t],10):0;s+=e.o.indentMargin*("outdent"===i?-1:1),n.style[t]=s>0?s+"px":"",(0,c.attr)(n,"style")||n.removeAttribute("style")}e.s.restore(r)})),e.setEditorValue(),!1};e.registerCommand("indent",{exec:i,hotkeys:["ctrl+]","cmd+]"]}),e.registerCommand("outdent",{exec:i,hotkeys:["ctrl+[","cmd+["]})}function Et(e){e.registerButton({name:"hr",group:"insert"}),e.registerCommand("insertHorizontalRule",(()=>{const t=e.createInside.element("hr");e.s.insertNode(t,!1,!1);const i=j.i.closest(t.parentElement,(t=>j.i.isBlock(t,e.ew)),e.editor);i&&j.i.isEmpty(i)&&i!==e.editor&&(j.i.after(i,t),j.i.safeRemove(i));let o=j.i.next(t,(t=>j.i.isBlock(t,e.ew)),e.editor,!1);return o||(o=e.createInside.element(e.o.enter),j.i.after(t,o)),e.s.setCursorIn(o),!1}))}n.D.prototype.controls.outdent={isDisabled(e){const t=e.s.current();if(t){const i=j.i.closest(t,(t=>j.i.isBlock(t,e.ew)),e.editor),o=Ct(e.o.direction);if(i&&i.style&&i.style[o])return 0>=parseInt(i.style[o],10)}return!0},tooltip:"Decrease Indent"},n.D.prototype.indentMargin=10,n.D.prototype.controls.hr={command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},n.D.prototype.toolbarInline=!0,n.D.prototype.toolbarInlineForSelection=!1,n.D.prototype.toolbarInlineDisableFor=[],n.D.prototype.toolbarInlineDisabledButtons=["source"],n.D.prototype.popup={a:i(62).Z,img:i(63).Z,cells:i(64).Z,jodit:[{name:"bin",tooltip:"Delete",exec(e,t){t&&e.s.removeNode(t)}}],"jodit-media":[{name:"bin",tooltip:"Delete",exec(e,t){t&&e.s.removeNode(t)}}],selection:["bold","underline","italic","ul","ol","\n","outdent","indent","fontsize","brush","cut","\n","paragraph","link","align","dots"]};class It extends O{constructor(){super(...arguments),this.type=null,this.popup=new p.G(this.jodit),this.toolbar=D(this.jodit,this.popup),this.snapRange=null}onClick(e){const t=e.target,i=(0,c.keys)(this.j.o.popup,!1),o=j.i.isTag(t,"img")?t:j.i.closest(t,i,this.j.editor);o&&this.canShowPopupForType(o.nodeName.toLowerCase())&&this.showPopup((()=>(0,c.position)(o,this.j)),o.nodeName.toLowerCase(),o)}showPopup(e,t,i){if(t=t.toLowerCase(),!this.canShowPopupForType(t))return!1;if(this.type!==t||i!==this.previousTarget){this.previousTarget=i;const e=this.j.o.popup[t];let o;o=(0,c.isFunction)(e)?e(this.j,i,this.popup.close):e,(0,c.isArray)(o)&&(this.toolbar.build(o,i),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,o=this.toolbar.container),this.popup.setContent(o),this.type=t}return this.popup.open(e),!0}hidePopup(e){e&&e!==this.type||this.popup.close()}canShowPopupForType(e){const t=this.j.o.popup[e.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!t||this.isExcludedTarget(e))}isExcludedTarget(e){return(0,c.splitArray)(this.j.o.toolbarInlineDisableFor).map((e=>e.toLowerCase())).includes(e.toLowerCase())}afterInit(e){this.j.e.on("getDiffButtons.mobile",(t=>{if(this.toolbar===t){const t=this.toolbar.getButtonsNames();return(0,c.toArray)(e.registeredButtons).filter((e=>!this.j.o.toolbarInlineDisabledButtons.includes(e.name))).filter((e=>{const i=(0,c.isString)(e)?e:e.name;return i&&"|"!==i&&"\n"!==i&&!t.includes(i)}))}})).on("hidePopup",this.hidePopup).on("showPopup",((e,t,i)=>{this.showPopup(t,i||((0,c.isString)(e)?e:e.nodeName),(0,c.isString)(e)?void 0:e)})).on("click",this.onClick).on("mousedown keydown",this.onSelectionStart).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd)}onSelectionStart(){this.snapRange=this.j.s.range.cloneRange()}onSelectionEnd(e){if(e&&e.target&&x.u1.closestElement(e.target,p.G))return;const{snapRange:t}=this,{range:i}=this.j.s;t&&!i.collapsed&&i.startContainer===t.startContainer&&i.startOffset===t.startOffset&&i.endContainer===t.endContainer&&i.endOffset===t.endOffset||this.onSelectionChange()}onSelectionChange(){if(!this.j.o.toolbarInlineForSelection)return;const e="selection",t=this.j.s.sel,i=this.j.s.range;(null==t?void 0:t.isCollapsed)||this.isSelectedTarget(i)||this.tableModule.getAllSelectedCells().length?this.type===e&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((()=>i.getBoundingClientRect()),e)}isSelectedTarget(e){const t=e.startContainer;return j.i.isElement(t)&&t===e.endContainer&&j.i.isTag(t.childNodes[e.startOffset],(0,c.keys)(this.j.o.popup,!1))&&e.startOffset===e.endOffset-1}get tableModule(){return this.j.getInstance("Table",this.j.o)}beforeDestruct(e){e.e.off("showPopup").off("click",this.onClick).off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd)}}(0,r.__decorate)([S.autobind],It.prototype,"onClick",null),(0,r.__decorate)([(0,S.wait)((e=>!e.j.isLocked))],It.prototype,"showPopup",null),(0,r.__decorate)([S.autobind],It.prototype,"hidePopup",null),(0,r.__decorate)([S.autobind],It.prototype,"onSelectionStart",null),(0,r.__decorate)([S.autobind],It.prototype,"onSelectionEnd",null),(0,r.__decorate)([(0,S.debounce)((e=>e.defaultTimeout))],It.prototype,"onSelectionChange",null),n.D.prototype.controls.align={name:"left",tooltip:"Align",update(e){const t=e.j,i=e.control,o=t.s.current();if(o){const s=j.i.closest(o,(e=>j.i.isBlock(e,t.ew)),t.editor)||t.editor;let r=""+(0,c.css)(s,"text-align");i.defaultValue&&-1!==i.defaultValue.indexOf(r)&&(r="left"),i.data&&i.data.currentValue!==r&&i.list&&-1!==i.list.indexOf(r)&&(t.o.textIcons?e.state.text=r:e.state.icon.name=r,i.data.currentValue=r)}},isActive(e,t){const i=e.s.current();if(i&&t.defaultValue){const o=j.i.closest(i,(t=>j.i.isBlock(t,e.ew)),e.editor)||e.editor;return-1===t.defaultValue.indexOf(""+(0,c.css)(o,"text-align"))}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},n.D.prototype.controls.center={command:"justifyCenter",css:{"text-align":"center"},tooltip:"Align Center"},n.D.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},n.D.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},n.D.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"};const jt=(e,t,i)=>{if(j.i.isNode(t,i.ew)&&j.i.isElement(t))switch(((e,t)=>{j.i.each(e,(e=>{j.i.isHTMLElement(e,t.ew)&&e.style.textAlign&&(e.style.textAlign="",e.style.cssText.trim().length||e.removeAttribute("style"))}))})(t,i),e.toLowerCase()){case"justifyfull":t.style.textAlign="justify";break;case"justifyright":t.style.textAlign="right";break;case"justifyleft":t.style.textAlign="left";break;case"justifycenter":t.style.textAlign="center"}};function xt(e){e.registerButton({name:"align",group:"indent"});const t=t=>(e.s.focus(),e.s.eachSelection((i=>{if(!i)return;let o=j.i.up(i,(t=>j.i.isBlock(t,e.ew)),e.editor);o||(o=j.i.wrapInline(i,e.o.enterBlock,e)),jt(t,o,e)})),!1);e.registerCommand("justifyfull",t),e.registerCommand("justifyright",t),e.registerCommand("justifyleft",t),e.registerCommand("justifycenter",t)}n.D.prototype.limitWords=!1,n.D.prototype.limitChars=!1,n.D.prototype.limitHTML=!1;class _t extends O{afterInit(e){const{limitWords:t,limitChars:i}=e.o;if(e&&(t||i)){let t=null;e.e.off(".limit").on("beforePaste.limit",(()=>{t=e.observer.snapshot.make()})).on("keydown.limit keyup.limit beforeEnter.limit beforePaste.limit",this.checkPreventKeyPressOrPaste).on("change.limit",this.checkPreventChanging).on("afterPaste.limit",(()=>{if(this.shouldPreventInsertHTML()&&t)return e.observer.snapshot.restore(t),!1}))}}shouldPreventInsertHTML(e=null,t=""){if(e&&a.COMMAND_KEYS.includes(e.key))return!1;const{jodit:i}=this,{limitWords:o,limitChars:s}=i.o,r=this.splitWords(t||(i.o.limitHTML?i.value:i.text));return!(!o||o>r.length)||!!s&&r.join("").length>=s}checkPreventKeyPressOrPaste(e){if(this.shouldPreventInsertHTML(e))return!1}checkPreventChanging(e,t){const{jodit:i}=this,{limitWords:o,limitChars:s}=i.o,r=i.o.limitHTML?e:(0,c.stripTags)(e),n=this.splitWords(r);(o&&n.length>o||s&&n.join("").length>s)&&(i.value=t)}splitWords(e){return e.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((e=>e.length))}beforeDestruct(e){e.e.off(".limit")}}(0,r.__decorate)([S.autobind],_t.prototype,"checkPreventKeyPressOrPaste",null),(0,r.__decorate)([S.autobind],_t.prototype,"checkPreventChanging",null);var zt=i(40);n.D.prototype.link={formTemplate(e){const{openInNewTabCheckbox:t,noFollowCheckbox:i,modeClassName:o,selectSizeClassName:s,selectMultipleClassName:r,selectOptionsClassName:n}=e.o.link;return new zt.x4(e,[new zt.eC(e,[new zt.u3(e,{name:"url",type:"text",ref:"url_input",label:"URL",placeholder:"http://",required:!0})]),new zt.eC(e,[new zt.u3(e,{name:"content",ref:"content_input",label:"Text"})],{ref:"content_input_box"}),o?new zt.eC(e,["input"===o?new zt.u3(e,{name:"className",ref:"className_input",label:"Class name"}):"select"===o?new zt.Cj(e,{name:"className",ref:"className_select",label:"Class name",size:s,multiple:r,options:n}):null]):null,t?new zt.mA(e,{name:"target",ref:"target_checkbox",label:"Open in new tab"}):null,i?new zt.mA(e,{name:"nofollow",ref:"nofollow_checkbox",label:"No follow"}):null,new zt.eC(e,[new m.y3(e,{name:"unlink",status:"default",text:"Unlink"}),new m.y3(e,{name:"insert",type:"submit",status:"primary",text:"Insert"})],{align:"full"})])},followOnDblClick:!1,processVideoLink:!0,processPastedLink:!0,noFollowCheckbox:!0,openInNewTabCheckbox:!0,modeClassName:"input",selectMultipleClassName:!0,selectSizeClassName:3,selectOptionsClassName:[],hotkeys:["ctrl+k","cmd+k"]},n.D.prototype.controls.unlink={exec(e,t){const i=j.i.closest(t,"a",e.editor);i&&j.i.unwrap(i),e.setEditorValue(),e.e.fire("hidePopup")},tooltip:"Unlink"},n.D.prototype.controls.link={isActive(e){const t=e.s.current();return!(!t||!j.i.closest(t,"a",e.editor))},popup:(e,t,i,o)=>e.e.fire("generateLinkForm.link",t,o),tags:["a"],tooltip:"Insert link"};class Tt extends O{constructor(){super(...arguments),this.buttons=[{name:"link",group:"insert"}]}afterInit(e){e.o.link.followOnDblClick&&e.e.on("dblclick.link",this.onDblClickOnLink),e.o.link.processPastedLink&&e.e.on("processPaste.link",this.onProcessPasteLink),e.e.on("generateLinkForm.link",this.generateForm),e.registerCommand("openLinkDialog",{exec:()=>{const t=new q({resizable:!1}),i=this.generateForm(e.s.current(),(()=>{t.close()}));i.container.classList.add("jodit-dialog_alert"),t.setContent(i),t.open(),e.async.requestIdleCallback((()=>{const{url_input:e}=(0,c.refs)(i.container);null==e||e.focus()}))},hotkeys:e.o.link.hotkeys})}onDblClickOnLink(e){if(!j.i.isTag(e.target,"a"))return;const t=(0,c.attr)(e.target,"href");t&&(location.href=t,e.preventDefault())}onProcessPasteLink(e,t){const{jodit:i}=this;if((0,c.isURL)(t)){if(i.o.link.processVideoLink){const e=(0,c.convertMediaUrlToVideoEmbed)(t);if(e!==t)return i.createInside.fromHTML(e)}const e=i.createInside.element("a");return e.setAttribute("href",t),e.textContent=t,i.e.stopPropagation("processPaste"),e}}generateForm(e,t){const{jodit:i}=this,o=i.i18n.bind(i),{openInNewTabCheckbox:s,noFollowCheckbox:r,formTemplate:n,formClassName:a,modeClassName:l}=i.o.link,d=n(i),h=(0,c.isString)(d)?i.c.fromHTML(d,{target_checkbox_box:s,nofollow_checkbox_box:r}):d,u=j.i.isElement(h)?h:h.container,p=(0,c.refs)(u),{insert:m,unlink:f,content_input_box:g}=p,{target_checkbox:v,nofollow_checkbox:b,url_input:y}=p,w=j.i.isImage(e,i.ew);let{content_input:k}=p;const{className_input:C}=p,{className_select:S}=p;let E;k||(k=i.c.element("input",{type:"hidden",ref:"content_input"})),a&&u.classList.add(a),w&&j.i.hide(g);const I=()=>E?E.innerText:(0,c.stripTags)(i.s.range.cloneContents(),i.ed);if(E=!(!e||!j.i.closest(e,"a",i.editor))&&j.i.closest(e,"a",i.editor),!w&&e&&(k.value=I()),E){if(y.value=(0,c.attr)(E,"href")||"",l)switch(l){case"input":C&&(C.value=(0,c.attr)(E,"class")||"");break;case"select":if(S){for(let e=0;S.selectedOptions.length>e;e++){const t=S.options.item(e);t&&(t.selected=!1)}((0,c.attr)(E,"class")||"").split(" ").forEach((e=>{if(e)for(let t=0;S.options.length>t;t++){const i=S.options.item(t);(null==i?void 0:i.value)&&i.value===e&&(i.selected=!0)}}))}}s&&v&&(v.checked="_blank"===(0,c.attr)(E,"target")),r&&b&&(b.checked="nofollow"===(0,c.attr)(E,"rel")),m.textContent=o("Update")}else j.i.hide(f);const x=i.observer.snapshot.make();f&&i.e.on(f,"click",(e=>{i.observer.snapshot.restore(x),E&&j.i.unwrap(E),i.setEditorValue(),t(),e.preventDefault()}));const _=()=>{if(!y.value.trim().length)return y.focus(),y.classList.add("jodit_error"),!1;let e;i.observer.snapshot.restore(x);const o=I()!==k.value.trim();if(E)e=[E];else if(i.s.isCollapsed()){const t=i.createInside.element("a");i.s.insertNode(t),e=[t]}else e=i.s.wrapInTag("a");return e.forEach((e=>{var t;if((0,c.attr)(e,"href",y.value),l&&(null!=C?C:S))if("input"===l)""===C.value&&e.hasAttribute("class")&&(0,c.attr)(e,"class",null),""!==C.value&&(0,c.attr)(e,"class",C.value);else if("select"===l){e.hasAttribute("class")&&(0,c.attr)(e,"class",null);for(let i=0;S.selectedOptions.length>i;i++){const o=null===(t=S.selectedOptions.item(i))||void 0===t?void 0:t.value;o&&e.classList.add(o)}}w||(k.value.trim().length?o&&(e.textContent=k.value):e.textContent=y.value),s&&v&&(0,c.attr)(e,"target",v.checked?"_blank":null),r&&b&&(0,c.attr)(e,"rel",b.checked?"nofollow":null)})),i.setEditorValue(),t(),!1};return j.i.isElement(h)?i.e.on(h,"submit",(e=>(e.preventDefault(),e.stopImmediatePropagation(),_(),!1))):h.onSubmit(_),h}beforeDestruct(e){e.e.off("generateLinkForm.link",this.generateForm).off("dblclick.link",this.onDblClickOnLink).off("processPaste.link",this.onProcessPasteLink)}}function Lt(e){const t="jodit_fake_wrapper",{mediaFakeTag:i,mediaBlocks:o,mediaInFakeBlock:s}=e.options;s&&e.e.on("afterGetValueFromEditor",(e=>{const o=RegExp(`<${i}[^>]+data-${t}[^>]+>(.+?)`,"ig");o.test(e.value)&&(e.value=e.value.replace(o,"$1"))})).on("change afterInit afterSetMode changePlace",e.async.debounce((()=>{e.isDestructed||e.getMode()===a.MODE_SOURCE||(0,c.$$)(o.join(","),e.editor).forEach((o=>{(0,c.dataBind)(o,t)||((0,c.dataBind)(o,t,!0),(o=>{if(o.parentNode&&(0,c.attr)(o.parentNode,"data-jodit_iframe_wrapper"))o=o.parentNode;else{const s=e.createInside.fromHTML(`<${i} data-jodit-temp="1" contenteditable="false" draggable="true" data-${t}="1">`);s.style.display="inline-block"===o.style.display?"inline-block":"block",s.style.width=o.offsetWidth+"px",s.style.height=o.offsetHeight+"px",o.parentNode&&o.parentNode.insertBefore(s,o),s.appendChild(o),o=s}e.e.off(o,"mousedown.select touchstart.select").on(o,"mousedown.select touchstart.select",(()=>{e.s.setCursorAfter(o)}))})(o))}))}),e.defaultTimeout))}function At(e){e.registerButton({name:"video",group:"media"})}function Dt(e){e.registerButton({name:"file",group:"media"})}function Mt(e){let t=0,i=(0,c.splitArray)(e.o.buttons);e.e.on("touchend",(i=>{if(i.changedTouches&&i.changedTouches.length){const o=(new Date).getTime();o-t>e.o.mobileTapTimeout&&(t=o,e.s.insertCursorAtPoint(i.changedTouches[0].clientX,i.changedTouches[0].clientY))}})).on("getDiffButtons.mobile",(t=>{if(t===e.toolbar){const t=(0,c.splitArray)(e.o.buttons),o=(0,P.q)(i);return t.reduce(((e,t)=>((0,P.A)(t)?e.push({...t,buttons:t.buttons.filter((e=>!o.has(e)))}):o.has(t)||e.push(t),e)),[])}})),e.o.toolbarAdaptive&&e.e.on("resize afterInit recalcAdaptive changePlace afterAddPlace",(()=>{if(!e.o.toolbar)return;const t=e.container.offsetWidth,o=(0,c.splitArray)(e.o.sizeLG>t?e.o.sizeMD>t?e.o.sizeSM>t?e.o.buttonsXS:e.o.buttonsSM:e.o.buttonsMD:e.o.buttons);""+o!=""+i&&(i=o,e.e.fire("closeAllPopups"),e.toolbar.setRemoveButtons(e.o.removeButtons).build(i.concat(e.o.extraButtons)))})).on(e.ow,"load",(()=>e.e.fire("recalcAdaptive")))}(0,r.__decorate)([S.autobind],Tt.prototype,"onDblClickOnLink",null),(0,r.__decorate)([S.autobind],Tt.prototype,"onProcessPasteLink",null),(0,r.__decorate)([S.autobind],Tt.prototype,"generateForm",null),n.D.prototype.mediaFakeTag="jodit-media",n.D.prototype.mediaInFakeBlock=!0,n.D.prototype.mediaBlocks=["video","audio"],n.D.prototype.controls.video={popup(e,t,i,o){const s=new zt.x4(e,[new zt.eC(e,[new zt.u3(e,{name:"url",required:!0,label:"URL",placeholder:"https://",validators:["url"]})]),new zt.eC(e,[(0,m.zx)(e,"","Insert","primary").onAction((()=>s.submit()))])]),r=new zt.x4(e,[new zt.eC(e,[new zt.GJ(e,{name:"code",required:!0,label:"Embed code"})]),new zt.eC(e,[(0,m.zx)(e,"","Insert","primary").onAction((()=>r.submit()))])]),n=[],a=e.s.save(),l=t=>{e.s.restore(a),e.s.insertHTML(t),o()};return n.push({icon:"link",name:"Link",content:s.container},{icon:"source",name:"Code",content:r.container}),s.onSubmit((e=>{l((0,c.convertMediaUrlToVideoEmbed)(e.url))})),r.onSubmit((e=>{l(e.code)})),(0,ot.IL)(e,n)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"},n.D.prototype.controls.file={popup(e,t,i,o){const s=(t,i="")=>{e.s.insertNode(e.createInside.fromHTML(`${i||t}`))};let r=null;return t&&(j.i.isTag(t,"a")||j.i.closest(t,"a",e.editor))&&(r=j.i.isTag(t,"a")?t:j.i.closest(t,"a",e.editor)),(0,ot.ov)(e,{filebrowser(e){e.files&&e.files.forEach((t=>s(e.baseurl+t))),o()},upload:!0,url(e,t){r?(r.setAttribute("href",e),r.setAttribute("title",t)):s(e,t),o()}},r,o,!1)},tags:["a"],tooltip:"Insert file"},n.D.prototype.mobileTapTimeout=300,n.D.prototype.toolbarAdaptive=!0,n.D.prototype.controls.dots={mode:a.MODE_SOURCE+a.MODE_WYSIWYG,popup(e,t,i,o,s){let r=i.data;return void 0===r&&(r={toolbar:D(e),rebuild(){var t;if(s){const i=e.e.fire("getDiffButtons.mobile",s.closest(x.bz));if(i&&r){r.toolbar.build((0,c.splitArray)(i));const o=(null===(t=e.toolbar.firstButton)||void 0===t?void 0:t.container.offsetWidth)||36;r.toolbar.container.style.width=3*(o+4)+"px"}}}},i.data=r),r.rebuild(),r.toolbar},tooltip:"Show all"};const Pt=(e,t,{control:i})=>{const o="button"+i.command,s=i.args&&i.args[0]||(0,c.dataBind)(e,o);(0,c.dataBind)(e,o,s),e.execCommand(i.command,!1,s)};function Rt(e){const t=e=>/insert(un)?orderedlist/i.test(e),i=()=>j.i.up(e.s.current(),(e=>e&&/^UL|OL$/i.test(e.nodeName)),e.editor),o=(e,t)=>{"default"!==t&&t?e.style.setProperty("list-style-type",t):e.style.removeProperty("list-style-type")};e.e.on("beforeCommand",((e,s,r)=>{if(t(e)&&r){const t=i();if(t&&!((e,t)=>{const i=e.style.listStyleType;return i===t||!i&&"default"===t})(t,r)&&(j.i.isTag(t,"ul")&&/unordered/i.test(e)||j.i.isTag(t,"ol")&&!/unordered/i.test(e)))return o(t,r),!1}})).on("afterCommand",((s,r,n)=>{if(t(s)){const t=i();t&&(o(t,n),e.createInside.applyCreateAttributes(t),t.querySelectorAll("li").forEach((t=>{e.createInside.applyCreateAttributes(t)})));const s=[],r=e=>{j.i.isTag(e,["p","h1","h2","h3","h4","h5","h6"])&&s.push(e)};if(t&&(r(t.parentNode),t.querySelectorAll("li").forEach((e=>r(e.firstChild))),s.length)){const i=e.s.save();(0,c.toArray)(t.childNodes).forEach((e=>{j.i.isTag(e.lastChild,"br")&&j.i.safeRemove(e.lastChild)})),s.forEach((e=>j.i.unwrap(e))),e.s.restore(i)}e.setEditorValue()}}))}n.D.prototype.controls.ul={command:"insertUnorderedList",tags:["ul"],tooltip:"Insert Unordered List",list:{default:"Default",circle:"Circle",disc:"Dot",square:"Quadrate"},exec:Pt},n.D.prototype.controls.ol={command:"insertOrderedList",tags:["ol"],tooltip:"Insert Ordered List",list:{default:"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},exec:Pt},n.D.prototype.showPlaceholder=!0,n.D.prototype.useInputsPlaceholder=!0,n.D.prototype.placeholder="Type something";class qt extends O{constructor(){super(...arguments),this.addNativeListeners=()=>{this.j.e.off(this.j.editor,"input.placeholder keydown.placeholder").on(this.j.editor,"input.placeholder keydown.placeholder",this.toggle)},this.addEvents=()=>{const e=this.j;e.o.useInputsPlaceholder&&e.element.hasAttribute("placeholder")&&(this.placeholderElm.innerHTML=(0,c.attr)(e.element,"placeholder")||""),e.e.fire("placeholder",this.placeholderElm.innerHTML),e.e.off(".placeholder").on("changePlace.placeholder",this.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",this.toggle).on(window,"load",this.toggle),this.addNativeListeners(),this.toggle()}}afterInit(e){e.o.showPlaceholder&&(this.placeholderElm=e.c.fromHTML(``),"rtl"===e.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),e.e.on("readonly",(e=>{e?this.hide():this.toggle()})).on("changePlace",this.addEvents),this.addEvents())}show(){const e=this.j;if(e.o.readonly)return;let t=0,i=0;const o=e.s.current(),s=o&&j.i.closest(o,(t=>j.i.isBlock(t,e.ew)),e.editor)||e.editor,r=e.ew.getComputedStyle(s);if(e.workplace.appendChild(this.placeholderElm),j.i.isElement(e.editor.firstChild)){const o=e.ew.getComputedStyle(e.editor.firstChild);t=parseInt(o.getPropertyValue("margin-top"),10),i=parseInt(o.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(o.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=o.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(r.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=r.getPropertyValue("line-height");(0,c.css)(this.placeholderElm,{display:"block",textAlign:r.getPropertyValue("text-align"),marginTop:Math.max(parseInt(r.getPropertyValue("margin-top"),10),t),marginLeft:Math.max(parseInt(r.getPropertyValue("margin-left"),10),i)})}hide(){j.i.safeRemove(this.placeholderElm)}toggle(){const e=this.j;e.editor&&!e.isInDestruct&&(e.getRealMode()===a.MODE_WYSIWYG&&(e=>{if(!e.firstChild)return!0;const t=e.firstChild;if(a.MAY_BE_REMOVED_WITH_KEY.test(t.nodeName)||/^(TABLE)$/i.test(t.nodeName))return!1;const i=j.i.next(t,(e=>e&&!j.i.isEmptyTextNode(e)),e);return j.i.isText(t)&&!i?j.i.isEmptyTextNode(t):!i&&j.i.each(t,(e=>!j.i.isTag(e,["ul","li","ol"])&&(j.i.isEmpty(e)||j.i.isTag(e,"br"))))})(e.editor)?this.show():this.hide())}beforeDestruct(e){this.hide(),e.e.off(".placeholder").off(window,"load",this.toggle)}}(0,r.__decorate)([(0,S.debounce)((e=>e.defaultTimeout/10),!0)],qt.prototype,"toggle",null),n.D.prototype.controls.redo={mode:a.MODE_SPLIT,isDisabled:e=>!e.observer.stack.canRedo(),tooltip:"Redo"},n.D.prototype.controls.undo={mode:a.MODE_SPLIT,isDisabled:e=>!e.observer.stack.canUndo(),tooltip:"Undo"};class Bt extends O{constructor(){super(...arguments),this.buttons=[{name:"undo",group:"history"},{name:"redo",group:"history"}]}beforeDestruct(){}afterInit(e){const t=t=>(e.observer[t](),!1);e.registerCommand("redo",{exec:t,hotkeys:["ctrl+y","ctrl+shift+z","cmd+y","cmd+shift+z"]}),e.registerCommand("undo",{exec:t,hotkeys:["ctrl+z","cmd+z"]})}}n.D.prototype.useIframeResizer=!0,n.D.prototype.useTableResizer=!0,n.D.prototype.useImageResizer=!0,n.D.prototype.resizer={showSize:!0,hideSizeTimeout:1e3,min_width:10,min_height:10};const Nt="__jodit-resizer_binded";class Ht extends O{constructor(){super(...arguments),this.LOCK_KEY="resizer",this.element=null,this.isResized=!1,this.isShown=!1,this.start_x=0,this.start_y=0,this.width=0,this.height=0,this.ratio=0,this.rect=this.j.c.fromHTML('
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t100x100\n\t\t\t
'),this.sizeViewer=this.rect.getElementsByTagName("span")[0],this.onResize=e=>{if(this.isResized){const t=e.clientX-this.start_x,i=e.clientY-this.start_y;if(!this.element)return;const o=this.handle.className;let s=0,r=0;j.i.isTag(this.element,"img")?(t?(s=this.width+(o.match(/left/)?-1:1)*t,r=Math.round(s/this.ratio)):(r=this.height+(o.match(/top/)?-1:1)*i,s=Math.round(r*this.ratio)),s>(0,c.innerWidth)(this.j.editor,this.j.ow)&&(s=(0,c.innerWidth)(this.j.editor,this.j.ow),r=Math.round(s/this.ratio))):(s=this.width+(o.match(/left/)?-1:1)*t,r=this.height+(o.match(/top/)?-1:1)*i),s>this.j.o.resizer.min_width&&(0,c.css)(this.element,"width",this.rect.parentNode.offsetWidth>s?s:"100%"),r>this.j.o.resizer.min_height&&(0,c.css)(this.element,"height",r),this.updateSize(),this.showSizeViewer(this.element.offsetWidth,this.element.offsetHeight),e.stopImmediatePropagation()}},this.onClickOutside=e=>{this.isShown&&(this.isResized?(this.j.unlock(),this.isResized=!1,this.j.setEditorValue(),e.stopImmediatePropagation(),this.j.e.off(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)):this.hide())},this.onClickElement=e=>{this.element===e&&this.isShown||(this.element=e,this.show(),j.i.isTag(this.element,"img")&&!this.element.complete&&this.j.e.on(this.element,"load",this.updateSize))},this.updateSize=()=>{if(!this.isInDestruct&&this.isShown&&this.element&&this.rect){const e=(0,c.offset)(this.rect.parentNode||this.j.od.documentElement,this.j,this.j.od,!0),t=(0,c.offset)(this.element,this.j,this.j.ed),i=parseInt(this.rect.style.left||"0",10),o=this.rect.offsetWidth,s=this.rect.offsetHeight,r=t.top-1-e.top,n=t.left-1-e.left;parseInt(this.rect.style.top||"0",10)===r&&i===n&&o===this.element.offsetWidth&&s===this.element.offsetHeight||((0,c.css)(this.rect,{top:r,left:n,width:this.element.offsetWidth,height:this.element.offsetHeight}),this.j.events&&(this.j.e.fire(this.element,"changesize"),isNaN(i)||this.j.e.fire("resize")))}},this.hideSizeViewer=()=>{this.sizeViewer.style.opacity="0"}}afterInit(e){(0,c.$$)("i",this.rect).forEach((t=>{e.e.on(t,"mousedown.resizer touchstart.resizer",this.onClickHandle.bind(this,t))})),C.TB.on("hideHelpers",this.hide),e.e.on("readonly",(e=>{e&&this.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(e=>{const t=/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>.*?<\/iframe>.*?)<\/jodit>/gi;t.test(e.value)&&(e.value=e.value.replace(t,"$1"))})).on("hideResizer",this.hide).on("change afterInit afterSetMode",e.async.debounce(this.onChangeEditor.bind(this),e.defaultTimeout)),this.addEventListeners(),this.onChangeEditor()}addEventListeners(){const e=this.j;e.e.off(e.editor,".resizer").off(e.ow,".resizer").on(e.editor,"keydown.resizer",(e=>{this.isShown&&e.key===a.KEY_DELETE&&this.element&&!j.i.isTag(this.element,"table")&&this.onDelete(e)})).on(e.ow,"resize.resizer",this.updateSize).on(e.ow,"mouseup.resizer keydown.resizer touchend.resizer",this.onClickOutside).on([e.ow,e.editor],"scroll.resizer",(()=>{this.isShown&&!this.isResized&&this.hide()}))}onClickHandle(e,t){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=e,t.preventDefault(),t.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResized=!0,this.start_x=t.clientX,this.start_y=t.clientY,this.j.e.fire("hidePopup"),this.j.lock(this.LOCK_KEY),this.j.e.on(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)}onDelete(e){this.element&&("JODIT"!==this.element.tagName?this.j.s.select(this.element):(j.i.safeRemove(this.element),this.hide(),e.preventDefault()))}onChangeEditor(){const e=this.j;this.isShown&&(this.element&&this.element.parentNode?this.updateSize():this.hide()),e.isDestructed||(0,c.$$)("img, table, iframe",e.editor).forEach((t=>{e.getMode()!==a.MODE_SOURCE&&!t[Nt]&&(j.i.isTag(t,"iframe")&&e.o.useIframeResizer||j.i.isTag(t,"img")&&e.o.useImageResizer||j.i.isTag(t,"table")&&e.o.useTableResizer)&&(t[Nt]=!0,this.bind(t))}))}bind(e){let t;if(j.i.isTag(e,"iframe")){const i=e;(0,c.attr)(e.parentNode,"-jodit_iframe_wrapper")?e=e.parentNode:(t=this.j.createInside.fromHTML(''),(0,c.css)(t,{display:"inline-block"===e.style.display?"inline-block":"block",width:e.offsetWidth,height:e.offsetHeight}),e.parentNode&&e.parentNode.insertBefore(t,e),t.appendChild(e),e=t),this.j.e.off(e,"mousedown.select touchstart.select").on(e,"mousedown.select touchstart.select",(()=>{this.j.s.select(e)})).off(e,"changesize").on(e,"changesize",(()=>{i.setAttribute("width",e.offsetWidth+"px"),i.setAttribute("height",e.offsetHeight+"px")}))}this.j.e.on(e,"dragstart",this.hide).on(e,"mousedown",(t=>{a.IS_IE&&j.i.isTag(e,"img")&&t.preventDefault()})).on(e,"click",(()=>this.onClickElement(e)))}showSizeViewer(e,t){this.j.o.resizer.showSize&&(this.sizeViewer.offsetWidth>e||this.sizeViewer.offsetHeight>t?this.hideSizeViewer():(this.sizeViewer.style.opacity="1",this.sizeViewer.textContent=`${e} x ${t}`,this.j.async.setTimeout(this.hideSizeViewer,{timeout:this.j.o.resizer.hideSizeTimeout,label:"hideSizeViewer"})))}show(){this.j.o.readonly||this.isShown||(this.isShown=!0,this.rect.parentNode||((0,c.markOwner)(this.j,this.rect),this.j.workplace.appendChild(this.rect)),this.j.isFullSize&&(this.rect.style.zIndex=""+(0,c.css)(this.j.container,"zIndex")),this.updateSize())}hide(){this.isResized=!1,this.isShown=!1,this.element=null,j.i.safeRemove(this.rect)}beforeDestruct(e){this.hide(),C.TB.off("hideHelpers",this.hide),e.e.off(this.j.ow,".resizer").off(".resizer")}}(0,r.__decorate)([S.autobind],Ht.prototype,"hide",null),n.D.prototype.useSearch=!0,n.D.prototype.controls.find={tooltip:"Find",icon:"search",exec(e,t,{control:i}){switch(i.args&&i.args[0]){case"findPrevious":e.e.fire("searchPrevious");break;case"findNext":e.e.fire("searchNext");break;case"replace":e.execCommand("openReplaceDialog");break;default:e.execCommand("openSearchDialog")}},list:{search:"Find",findNext:"Find Next",findPrevious:"Find Previous",replace:"Replace"},childTemplate:(e,t,i)=>i};class Ot extends O{constructor(){super(...arguments),this.buttons=[{name:"find",group:"search"}],this.template=``,this.isOpened=!1,this.selInfo=null,this.current=null,this.eachMap=(e,t,i)=>{j.i.findWithCurrent(e,(e=>!(!e||!t(e))),this.j.editor,i?"nextSibling":"previousSibling",i?"firstChild":"lastChild")},this.updateCounters=()=>{if(!this.isOpened)return;this.counterBox.style.display=this.queryInput.value.length?"inline-block":"none";const e=this.calcCounts(this.queryInput.value,this.j.s.range);this.counterBox.textContent=e.join("/")},this.calcCounts=(e,t=!1)=>{const i=[];let o=0,s=0,r=!1,n=this.j.editor.firstChild;for(;n&&e.length;)if(r=this.find(n,e,!0,0,r||this.j.ed.createRange()),r){if(this.boundAlreadyWas(r,i))break;i.push(r),n=r.startContainer,s+=1,t&&this.boundAlreadyWas(t,[r])&&(o=s)}else n=null;return[o,s]},this.findAndReplace=(e,t)=>{const i=this.find(e,t,!0,0,this.j.s.range);if(i&&i.startContainer&&i.endContainer){const e=this.j.ed.createRange();try{if(i&&i.startContainer&&i.endContainer){e.setStart(i.startContainer,i.startOffset),e.setEnd(i.endContainer,i.endOffset),e.deleteContents();const t=this.j.createInside.text(this.replaceInput.value);e.insertNode(t),this.j.s.select(t),this.tryScrollToElement(t)}}catch(e){}return!0}return!1},this.findAndSelect=(e,t,i)=>{const o=this.find(e,t,i,0,this.j.s.range);if(o&&o.startContainer&&o.endContainer){const e=this.j.ed.createRange();try{e.setStart(o.startContainer,o.startOffset),e.setEnd(o.endContainer,o.endOffset),this.j.s.selectRange(e)}catch(e){}return this.tryScrollToElement(o.startContainer),this.current=o.startContainer,this.updateCounters(),!0}return!1},this.find=(e,t,i,o,s)=>{if(e&&t.length){let r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null};if(this.eachMap(e,(e=>{if(j.i.isText(e)&&null!=e.nodeValue&&e.nodeValue.length){let a=e.nodeValue;i||e!==s.startContainer?i&&e===s.endContainer&&(a=o?a.substr(0,s.startOffset):a.substr(s.endOffset)):a=o?a.substr(s.endOffset):a.substr(0,s.startOffset);const l=i?r+a:a+r,d=Ot.findSomePartOfString(t,l,i);if(!1!==d){let s=Ot.findSomePartOfString(t,a,i);!0===s?s=(0,c.trim)(t):!1===s&&(s=Ot.findSomePartOfString(a,t,i),!0===s&&(s=(0,c.trim)(a)));let h=Ot.getSomePartOfStringIndex(t,a,i)||0;if((i&&!o||!i&&o)&&e.nodeValue.length-a.length>0&&(h+=e.nodeValue.length-a.length),null==n.startContainer&&(n.startContainer=e,n.startOffset=h),!0===d)return n.endContainer=e,n.endOffset=h,n.endOffset+=s.length,!0;r=l}else r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null}}else j.i.isBlock(e,this.j.ew)&&""!==r&&(r=i?r+" ":" "+r);return!1}),i),n.startContainer&&n.endContainer)return n;if(!o)return this.current=i?this.j.editor.firstChild:this.j.editor.lastChild,this.find(this.current,t,i,o+1,s)}return!1},this.open=(e=!1)=>{this.isOpened||(this.searchBox.classList.add("jodit-search_active"),this.isOpened=!0),this.calcSticky(this.j.e.fire("getStickyState.sticky")||!1),this.j.e.fire("hidePopup"),this.searchBox.classList.toggle("jodit-search_replace",e),this.current=this.j.s.current(),this.selInfo=this.j.s.save();const t=""+(this.j.s.sel||"");t&&(this.queryInput.value=t),this.updateCounters(),t?this.queryInput.select():this.queryInput.focus()},this.close=()=>{this.isOpened&&(this.selInfo&&(this.j.s.restore(this.selInfo),this.selInfo=null),this.searchBox.classList.remove("jodit-search_active"),this.isOpened=!1)}}static getSomePartOfStringIndex(e,t,i=!0){return this.findSomePartOfString(e,t,i,!0)}static findSomePartOfString(e,t,i=!0,o=!1){e=(0,c.trim)(e.toLowerCase().replace(a.SPACE_REG_EXP()," ")),t=t.toLowerCase();let s=i?0:t.length-1,r=i?0:e.length-1,n=0,l=null;const d=i?1:-1,h=[];for(;void 0!==t[s];s+=d){const c=e[r]===t[s];if(c||null!=l&&a.SPACE_REG_EXP().test(t[s])?(null!=l&&i||(l=s),h.push(t[s]),c&&(n+=1,r+=d)):(l=null,h.length=0,n=0,r=i?0:e.length-1),n===e.length)return!o||l}return o?null!=l&&l:!!h.length&&(i?h.join(""):h.reverse().join(""))}boundAlreadyWas(e,t){return t.some((t=>t.startContainer===e.startContainer&&t.endContainer===e.endContainer&&t.startOffset===e.startOffset&&t.endOffset===e.endOffset),!1)}tryScrollToElement(e){let t=j.i.closest(e,j.i.isElement,this.j.editor);t||(t=j.i.prev(e,j.i.isElement,this.j.editor)),t&&t!==this.j.editor&&t.scrollIntoView()}afterInit(e){if(e.o.useSearch){const t=this;t.searchBox=e.c.fromHTML(t.template);const{query:i,replace:o,cancel:s,next:r,prev:n,replaceBtn:l,counterBox:d}=(0,c.refs)(t.searchBox);t.queryInput=i,t.replaceInput=o,t.closeButton=s,t.nextButton=r,t.prevButton=n,t.replaceButton=l,t.counterBox=d;const h=()=>{e.workplace.appendChild(this.searchBox),e.e.off(this.j.container,"keydown.search").on(this.j.container,"keydown.search",(i=>{if(e.getRealMode()===a.MODE_WYSIWYG)switch(i.key){case a.KEY_ESC:this.close();break;case a.KEY_F3:t.queryInput.value&&(e.e.fire(i.shiftKey?"searchPrevious":"searchNext"),i.preventDefault())}}))};h(),e.e.on("changePlace",h).on(t.closeButton,"click",this.close).on(t.queryInput,"mousedown",(()=>{e.s.isFocused()&&(e.s.removeMarkers(),t.selInfo=e.s.save())})).on(t.replaceButton,"click",(i=>{t.findAndReplace(e.s.current()||e.editor.firstChild,t.queryInput.value),this.updateCounters(),i.preventDefault(),i.stopImmediatePropagation()})).on([t.nextButton,t.prevButton],"click",(function(i){e.e.fire(t.nextButton===this?"searchNext":"searchPrevious"),i.preventDefault(),i.stopImmediatePropagation()})).on(this.queryInput,"keydown",this.j.async.debounce((t=>{switch(t.key){case a.KEY_ENTER:t.preventDefault(),t.stopImmediatePropagation(),e.e.fire("searchNext")&&this.close();break;default:this.updateCounters()}}),this.j.defaultTimeout)).on("beforeSetMode.search",(()=>{this.close()})).on("keydown.search mousedown.search",(()=>{this.selInfo&&(e.s.removeMarkers(),this.selInfo=null),this.isOpened&&(this.current=this.j.s.current(),this.updateCounters())})).on("searchNext.search searchPrevious.search",(()=>t.isOpened?t.findAndSelect(e.s.current()||e.editor.firstChild,t.queryInput.value,"searchNext"===e.e.current):t.open())).on("search.search",((t,i=!0)=>{e.execCommand("search",t,i)})).on("toggleSticky.search",this.calcSticky),e.registerCommand("search",{exec:(i,o,s=!0)=>(t.findAndSelect(e.s.current()||e.editor.firstChild,o||"",s),!1)}).registerCommand("openSearchDialog",{exec:()=>(t.open(),!1),hotkeys:["ctrl+f","cmd+f"]}).registerCommand("openReplaceDialog",{exec:()=>(e.o.readonly||t.open(!0),!1),hotkeys:["ctrl+h","cmd+h"]})}}beforeDestruct(e){var t;j.i.safeRemove(this.searchBox),null===(t=e.events)||void 0===t||t.off(".search")}calcSticky(e){if(this.isOpened)if(this.searchBox.classList.toggle("jodit-search_sticky",e),e){const e=(0,c.position)(this.j.toolbarContainer);(0,c.css)(this.searchBox,{top:e.top+e.height,left:e.left+e.width})}else(0,c.css)(this.searchBox,{top:null,left:null})}}(0,r.__decorate)([S.autobind],Ot.prototype,"calcSticky",null),n.D.prototype.width="auto",n.D.prototype.minWidth=200,n.D.prototype.maxWidth="100%",n.D.prototype.allowResizeX=!1,n.D.prototype.allowResizeY=!0,n.D.prototype.height="auto",n.D.prototype.minHeight=200,n.D.prototype.maxHeight="auto",n.D.prototype.saveHeightInStorage=!1;let Ft=class extends O{constructor(){super(...arguments),this.isResized=!1,this.start={x:0,y:0,w:0,h:0},this.handle=this.j.c.div("jodit-editor__resize",'')}afterInit(e){"auto"!==e.o.height&&(e.o.allowResizeX||e.o.allowResizeY)&&(e.e.on("toggleFullSize.resizeHandler",(()=>{this.handle.style.display=e.isFullSize?"none":"block"})).on(this.handle,"mousedown touchstart",this.onHandleResizeStart).on(e.ow,"mouseup touchsend",this.onHandleResizeEnd),e.container.appendChild(this.handle))}onHandleResizeStart(e){this.isResized=!0,this.start.x=e.clientX,this.start.y=e.clientY,this.start.w=this.j.container.offsetWidth,this.start.h=this.j.container.offsetHeight,this.j.lock(),this.j.e.on(this.j.ow,"mousemove touchmove",this.onHandleResize),e.preventDefault()}onHandleResize(e){this.isResized&&(this.j.o.allowResizeY&&this.j.e.fire("setHeight",this.start.h+e.clientY-this.start.y),this.j.o.allowResizeX&&this.j.e.fire("setWidth",this.start.w+e.clientX-this.start.x),this.j.e.fire("resize"))}onHandleResizeEnd(){this.isResized&&(this.isResized=!1,this.j.e.off(this.j.ow,"mousemove touchmove",this.onHandleResize),this.j.unlock())}beforeDestruct(e){j.i.safeRemove(this.handle),this.j.e.off(this.j.ow,"mouseup touchsend",this.onHandleResizeEnd)}};Ft.requires=["size"],Ft=(0,r.__decorate)([S.autobind],Ft);let Wt=class extends O{constructor(){super(...arguments),this.resizeWorkspaces=this.j.async.debounce(this.resizeWorkspaceImd,this.j.defaultTimeout,!0)}afterInit(e){e.e.on("setHeight.size",this.setHeight).on("setWidth.size",this.setWidth).on("afterInit.size changePlace.size",this.initialize,void 0,!0).on(e.ow,"load.size",this.resizeWorkspaces).on("afterInit.size resize.size afterUpdateToolbar.size scroll.size afterResize.size toggleFullSize.size",this.resizeWorkspaces),this.initialize()}initialize(){const{j:e}=this;if(e.o.inline)return;let{height:t}=e.o;if(e.o.saveHeightInStorage&&"auto"!==t){const i=e.storage.get("height");i&&(t=i)}(0,c.css)(e.editor,{minHeight:"100%"}),(0,c.css)(e.container,{minHeight:e.o.minHeight,maxHeight:e.o.maxHeight,minWidth:e.o.minWidth,maxWidth:e.o.maxWidth}),this.setHeight(t),this.setWidth(e.o.width)}setHeight(e){if((0,c.isNumber)(e)){const{minHeight:t,maxHeight:i}=this.j.o;(0,c.isNumber)(t)&&t>e&&(e=t),(0,c.isNumber)(i)&&e>i&&(e=i)}(0,c.css)(this.j.container,"height",e),this.j.o.saveHeightInStorage&&this.j.storage.set("height",e),this.resizeWorkspaceImd()}setWidth(e){if((0,c.isNumber)(e)){const{minWidth:t,maxWidth:i}=this.j.o;(0,c.isNumber)(t)&&t>e&&(e=t),(0,c.isNumber)(i)&&e>i&&(e=i)}(0,c.css)(this.j.container,"width",e),this.resizeWorkspaceImd()}getNotWorkHeight(){var e,t;return((null===(e=this.j.toolbarContainer)||void 0===e?void 0:e.offsetHeight)||0)+((null===(t=this.j.statusbar)||void 0===t?void 0:t.getHeight())||0)+2}resizeWorkspaceImd(){if(!this.j||this.j.isDestructed||!this.j.o||this.j.o.inline)return;if(!this.j.container||!this.j.container.parentNode)return;const e=((0,c.css)(this.j.container,"minHeight")||0)-this.getNotWorkHeight();if((0,c.isNumber)(e)&&e>0&&([this.j.workplace,this.j.iframe,this.j.editor].map((t=>{t&&(0,c.css)(t,"minHeight",e)})),this.j.e.fire("setMinHeight",e)),(0,c.isNumber)(this.j.o.maxHeight)){const e=this.j.o.maxHeight-this.getNotWorkHeight();[this.j.workplace,this.j.iframe,this.j.editor].map((t=>{t&&(0,c.css)(t,"maxHeight",e)})),this.j.e.fire("setMaxHeight",e)}this.j.container&&(0,c.css)(this.j.workplace,"height","auto"!==this.j.o.height||this.j.isFullSize?this.j.container.offsetHeight-this.getNotWorkHeight():"auto")}beforeDestruct(e){this.j.e.off(this.j.ow,"load.size",this.resizeWorkspaces).off(".size")}};Wt=(0,r.__decorate)([S.autobind],Wt),n.D.prototype.beautifyHTML=!a.IS_IE,n.D.prototype.sourceEditor="ace",n.D.prototype.sourceEditorNativeOptions={showGutter:!0,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},n.D.prototype.sourceEditorCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"],n.D.prototype.beautifyHTMLCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js","https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify-html.min.js"],n.D.prototype.controls.source={mode:a.MODE_SPLIT,exec(e){e.toggleMode()},isActive:e=>e.getRealMode()===a.MODE_SOURCE,tooltip:"Change mode"};class Vt{constructor(e,t,i,o){this.jodit=e,this.container=t,this.toWYSIWYG=i,this.fromWYSIWYG=o,this.className="",this.isReady=!1}get j(){return this.jodit}onReady(){this.replaceUndoManager(),this.isReady=!0,this.j.e.fire(this,"ready")}onReadyAlways(e){var t;this.isReady?e():null===(t=this.j.events)||void 0===t||t.on(this,"ready",e)}}class Ut extends Vt{constructor(){super(...arguments),this.autosize=this.j.async.debounce((()=>{this.instance.style.height="auto",this.instance.style.height=this.instance.scrollHeight+"px"}),this.j.defaultTimeout)}init(e){this.instance=e.c.element("textarea",{class:"jodit-source__mirror"}),this.container.appendChild(this.instance),e.e.on(this.instance,"mousedown keydown touchstart input",e.async.debounce(this.toWYSIWYG,e.defaultTimeout)).on("setMinHeight.source",(e=>{(0,c.css)(this.instance,"minHeight",e)})).on(this.instance,"change keydown mousedown touchstart input",this.autosize).on("afterSetMode.source",this.autosize).on(this.instance,"mousedown focus",(t=>{e.e.fire(t.type,t)})),this.autosize(),this.onReady()}destruct(){j.i.safeRemove(this.instance)}getValue(){return this.instance.value}setValue(e){this.instance.value=e}insertRaw(e){const t=this.getValue();if(0>this.getSelectionStart())this.setValue(t+e);else{const i=this.getSelectionStart(),o=this.getSelectionEnd();this.setValue(t.substring(0,i)+e+t.substring(o,t.length))}}getSelectionStart(){return this.instance.selectionStart}getSelectionEnd(){return this.instance.selectionEnd}setSelectionRange(e,t=e){this.instance.setSelectionRange(e,t)}focus(){this.instance.focus()}setPlaceHolder(e){this.instance.setAttribute("placeholder",e)}setReadOnly(e){e?this.instance.setAttribute("readonly","true"):this.instance.removeAttribute("readonly")}selectAll(){this.instance.select()}replaceUndoManager(){const{observer:e}=this.jodit;this.j.e.on(this.instance,"keydown",(t=>{if((t.ctrlKey||t.metaKey)&&"z"===t.key)return t.shiftKey?e.redo():e.undo(),this.setSelectionRange(this.getValue().length),!1}))}}class Yt extends Vt{constructor(){super(...arguments),this.className="jodit_ace_editor",this.proxyOnFocus=e=>{this.j.e.fire("focus",e)},this.proxyOnMouseDown=e=>{this.j.e.fire("mousedown",e)}}aceExists(){return void 0!==this.j.ow.ace}getLastColumnIndex(e){return this.instance.session.getLine(e).length}getLastColumnIndices(){const e=this.instance.session.getLength(),t=[];let i=0;for(let o=0;e>o;o++)i+=this.getLastColumnIndex(o),o>0&&(i+=1),t[o]=i;return t}getRowColumnIndices(e){const t=this.getLastColumnIndices();if(t[0]>=e)return{row:0,column:e};let i=1;for(let o=1;t.length>o;o++)e>t[o]&&(i=o+1);return{row:i,column:e-t[i-1]-1}}setSelectionRangeIndices(e,t){const i=this.getRowColumnIndices(e),o=this.getRowColumnIndices(t);this.instance.getSelection().setSelectionRange({start:i,end:o})}getIndexByRowColumn(e,t){return this.getLastColumnIndices()[e]-this.getLastColumnIndex(e)+t}init(e){const t=()=>{if(void 0!==this.instance||!this.aceExists())return;const t=this.j.c.div("jodit-source__mirror-fake");this.container.appendChild(t),this.instance=e.ow.ace.edit(t),this.instance.setTheme(e.o.sourceEditorNativeOptions.theme),this.instance.renderer.setShowGutter(e.o.sourceEditorNativeOptions.showGutter),this.instance.getSession().setMode(e.o.sourceEditorNativeOptions.mode),this.instance.setHighlightActiveLine(e.o.sourceEditorNativeOptions.highlightActiveLine),this.instance.getSession().setUseWrapMode(!0),this.instance.setOption("indentedSoftWrap",!1),this.instance.setOption("wrap",e.o.sourceEditorNativeOptions.wrap),this.instance.getSession().setUseWorker(!1),this.instance.$blockScrolling=1/0,this.instance.on("change",this.toWYSIWYG),this.instance.on("focus",this.proxyOnFocus),this.instance.on("mousedown",this.proxyOnMouseDown),e.getRealMode()!==a.MODE_WYSIWYG&&this.setValue(this.getValue());const i=this.j.async.debounce((()=>{e.isInDestruct||(this.instance.setOption("maxLines","auto"!==e.o.height?e.workplace.offsetHeight/this.instance.renderer.lineHeight:1/0),this.instance.resize())}),2*this.j.defaultTimeout);e.e.on("afterResize afterSetMode",i),i(),this.onReady()};e.e.on("afterSetMode",(()=>{e.getRealMode()!==a.MODE_SOURCE&&e.getMode()!==a.MODE_SPLIT||(this.fromWYSIWYG(),t())})),t(),this.aceExists()||(0,c.loadNext)(e,e.o.sourceEditorCDNUrlsJS).then((()=>{e.isInDestruct||t()}))}destruct(){var e,t;this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),null===(t=null===(e=this.j)||void 0===e?void 0:e.events)||void 0===t||t.off("aceInited.source")}setValue(e){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const t=this.j.e.fire("beautifyHTML",e);(0,c.isString)(t)&&(e=t)}this.instance.setValue(e),this.instance.clearSelection()}getValue(){return this.instance.getValue()}setReadOnly(e){this.instance.setReadOnly(e)}focus(){this.instance.focus()}getSelectionStart(){const e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.start.row,e.start.column)}getSelectionEnd(){const e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.end.row,e.end.column)}selectAll(){this.instance.selection.selectAll()}insertRaw(e){const t=this.instance.selection.getCursor(),i=this.instance.session.insert(t,e);this.instance.selection.setRange({start:t,end:i},!1)}setSelectionRange(e,t){this.setSelectionRangeIndices(e,t)}setPlaceHolder(e){}replaceUndoManager(){const{observer:e}=this.jodit;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec(){e.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec(){e.redo()}})}}function $t(e,t,i,o,s){let r;switch(e){case"ace":if(!t.o.shadowRoot){r=new Yt(t,i,o,s);break}default:r=new Ut(t,i,o,s)}return r.init(t),r.onReadyAlways((()=>{r.setReadOnly(t.o.readonly)})),r}class Kt extends O{constructor(){super(...arguments),this.buttons=[{name:"source",group:"source"}],this.__lock=!1,this.__oldMirrorValue="",this.tempMarkerStart="{start-jodit-selection}",this.tempMarkerStartReg=/{start-jodit-selection}/g,this.tempMarkerEnd="{end-jodit-selection}",this.tempMarkerEndReg=/{end-jodit-selection}/g,this.selInfo=[],this.insertHTML=e=>{var t;null===(t=this.sourceEditor)||void 0===t||t.insertRaw(e),this.toWYSIWYG()},this.fromWYSIWYG=(e=!1)=>{if(!this.__lock||!0===e){this.__lock=!0;const e=this.j.getEditorValue(!1);e!==this.getMirrorValue()&&this.setMirrorValue(e),this.__lock=!1}},this.toWYSIWYG=()=>{if(this.__lock)return;const e=this.getMirrorValue();e!==this.__oldMirrorValue&&(this.__lock=!0,this.j.setEditorValue(e),this.__lock=!1,this.__oldMirrorValue=e)},this.getNormalPosition=(e,t)=>{let i=e;for(;i>0;){if(i--,"<"===t[i]&&void 0!==t[i+1]&&t[i+1].match(/[\w/]+/i))return i;if(">"===t[i])return e}return e},this.__clear=e=>e.replace(a.INVISIBLE_SPACE_REG_EXP(),""),this.selectAll=()=>{var e;null===(e=this.sourceEditor)||void 0===e||e.selectAll()},this.onSelectAll=e=>{if("selectall"===e.toLowerCase()&&this.j.getRealMode()===a.MODE_SOURCE)return this.selectAll(),!1},this.getSelectionStart=()=>{var e,t;return null!==(t=null===(e=this.sourceEditor)||void 0===e?void 0:e.getSelectionStart())&&void 0!==t?t:0},this.getSelectionEnd=()=>{var e,t;return null!==(t=null===(e=this.sourceEditor)||void 0===e?void 0:e.getSelectionEnd())&&void 0!==t?t:0},this.saveSelection=()=>{if(this.j.getRealMode()===a.MODE_WYSIWYG)this.selInfo=this.j.s.save()||[],this.j.setEditorValue(),this.fromWYSIWYG(!0);else{if(this.selInfo.length=0,this.j.o.editHTMLDocumentMode)return;const e=this.getMirrorValue();if(this.getSelectionStart()===this.getSelectionEnd()){const t=this.j.s.marker(!0);this.selInfo[0]={startId:t.id,collapsed:!0,startMarker:t.outerHTML};const i=this.getNormalPosition(this.getSelectionStart(),this.getMirrorValue());this.setMirrorValue(e.substr(0,i)+this.__clear(this.selInfo[0].startMarker)+e.substr(i))}else{const t=this.j.s.marker(!0),i=this.j.s.marker(!1);this.selInfo[0]={startId:t.id,endId:i.id,collapsed:!1,startMarker:this.__clear(t.outerHTML),endMarker:this.__clear(i.outerHTML)};const o=this.getNormalPosition(this.getSelectionStart(),e),s=this.getNormalPosition(this.getSelectionEnd(),e);this.setMirrorValue(e.substr(0,o)+this.selInfo[0].startMarker+e.substr(o,s-o)+this.selInfo[0].endMarker+e.substr(s))}this.toWYSIWYG()}},this.removeSelection=()=>{if(!this.selInfo.length)return;if(this.j.getRealMode()===a.MODE_WYSIWYG)return this.__lock=!0,this.j.s.restore(this.selInfo),void(this.__lock=!1);let e=this.getMirrorValue(),t=0,i=0;try{if(this.selInfo[0].startMarker&&(e=e.replace(/]+data-jodit-selection_marker="start"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerStart)),this.selInfo[0].endMarker&&(e=e.replace(/]+data-jodit-selection_marker="end"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerEnd)),!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const t=this.j.e.fire("beautifyHTML",e);(0,c.isString)(t)&&(e=t)}t=e.indexOf(this.tempMarkerStart),i=t,e=e.replace(this.tempMarkerStartReg,""),this.selInfo[0].collapsed&&-1!==t||(i=e.indexOf(this.tempMarkerEnd),-1===t&&(t=i)),e=e.replace(this.tempMarkerEndReg,"")}finally{e=e.replace(this.tempMarkerEndReg,"").replace(this.tempMarkerStartReg,"")}this.setMirrorValue(e),this.setMirrorSelectionRange(t,i),this.toWYSIWYG(),this.setFocusToMirror()},this.setMirrorSelectionRange=(e,t)=>{var i;null===(i=this.sourceEditor)||void 0===i||i.setSelectionRange(e,t)},this.onReadonlyReact=()=>{var e;null===(e=this.sourceEditor)||void 0===e||e.setReadOnly(this.j.o.readonly)}}getMirrorValue(){var e;return(null===(e=this.sourceEditor)||void 0===e?void 0:e.getValue())||""}setMirrorValue(e){var t;null===(t=this.sourceEditor)||void 0===t||t.setValue(e)}setFocusToMirror(){var e;null===(e=this.sourceEditor)||void 0===e||e.focus()}initSourceEditor(e){var t;if("area"!==e.o.sourceEditor){const t=$t(e.o.sourceEditor,e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG);t.onReadyAlways((()=>{var i,o;null===(i=this.sourceEditor)||void 0===i||i.destruct(),this.sourceEditor=t,this.fromWYSIWYG(!0),null===(o=e.events)||void 0===o||o.fire("sourceEditorReady",e)}))}else null===(t=this.sourceEditor)||void 0===t||t.onReadyAlways((()=>{var t;this.fromWYSIWYG(!0),null===(t=e.events)||void 0===t||t.fire("sourceEditorReady",e)}))}afterInit(e){if(this.mirrorContainer=e.c.div("jodit-source"),e.workplace.appendChild(this.mirrorContainer),e.e.on("afterAddPlace changePlace afterInit",(()=>{e.workplace.appendChild(this.mirrorContainer)})),this.sourceEditor=$t("area",e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG),(()=>{e.e.off("beforeSetMode.source afterSetMode.source").on("beforeSetMode.source",this.saveSelection).on("afterSetMode.source",this.removeSelection)})(),this.onReadonlyReact(),e.e.on("insertHTML.source",(t=>{if(!e.o.readonly&&!this.j.isEditorMode())return this.insertHTML(t),!1})).on("readonly.source",this.onReadonlyReact).on("placeholder.source",(e=>{var t;null===(t=this.sourceEditor)||void 0===t||t.setPlaceHolder(e)})).on("beforeCommand.source",this.onSelectAll).on("change.source",this.fromWYSIWYG),e.e.on("beautifyHTML",(e=>e)),e.o.beautifyHTML){const t=()=>{var t,i;const o=e.ow.html_beautify;return!(!o||e.isInDestruct||(null===(i=null===(t=e.events)||void 0===t?void 0:t.off("beautifyHTML"))||void 0===i||i.on("beautifyHTML",(e=>o(e))),0))};t()||(0,c.loadNext)(e,e.o.beautifyHTMLCDNUrlsJS).then(t)}this.fromWYSIWYG(),this.initSourceEditor(e)}beforeDestruct(e){this.sourceEditor&&(this.sourceEditor.destruct(),delete this.sourceEditor),j.i.safeRemove(this.mirrorContainer)}}n.D.prototype.showCharsCounter=!0,n.D.prototype.countHTMLChars=!1,n.D.prototype.showWordsCounter=!0;class Gt extends O{constructor(){super(...arguments),this.charCounter=null,this.wordCounter=null,this.reInit=()=>{this.j.o.showCharsCounter&&this.charCounter&&this.j.statusbar.append(this.charCounter,!0),this.j.o.showWordsCounter&&this.wordCounter&&this.j.statusbar.append(this.wordCounter,!0),this.j.e.off("change keyup",this.calc).on("change keyup",this.calc),this.calc()},this.calc=this.j.async.throttle((()=>{const e=this.j.text;if(this.j.o.showCharsCounter&&this.charCounter){const t=this.j.o.countHTMLChars?this.j.value:e.replace((0,a.SPACE_REG_EXP)(),"");this.charCounter.textContent=this.j.i18n("Chars: %d",t.length)}this.j.o.showWordsCounter&&this.wordCounter&&(this.wordCounter.textContent=this.j.i18n("Words: %d",e.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((e=>e.length)).length))}),this.j.defaultTimeout)}afterInit(){this.charCounter=this.j.c.span(),this.wordCounter=this.j.c.span(),this.j.e.on("afterInit changePlace afterAddPlace",this.reInit),this.reInit()}beforeDestruct(){j.i.safeRemove(this.charCounter),j.i.safeRemove(this.wordCounter),this.j.e.off("afterInit changePlace afterAddPlace",this.reInit),this.charCounter=null,this.wordCounter=null}}n.D.prototype.toolbarSticky=!0,n.D.prototype.toolbarDisableStickyForMobile=!0,n.D.prototype.toolbarStickyOffset=0;class Jt extends O{constructor(){super(...arguments),this.isToolbarSticked=!1,this.createDummy=e=>{a.IS_IE&&!this.dummyBox&&(this.dummyBox=this.j.c.div(),this.dummyBox.classList.add("jodit_sticky-dummy_toolbar"),this.j.container.insertBefore(this.dummyBox,e))},this.addSticky=e=>{this.isToolbarSticked||(this.createDummy(e),this.j.container.classList.add("jodit_sticky"),this.isToolbarSticked=!0),(0,c.css)(e,{top:this.j.o.toolbarStickyOffset||null,width:this.j.container.offsetWidth-2}),a.IS_IE&&this.dummyBox&&(0,c.css)(this.dummyBox,{height:e.offsetHeight})},this.removeSticky=e=>{this.isToolbarSticked&&((0,c.css)(e,{width:"",top:""}),this.j.container.classList.remove("jodit_sticky"),this.isToolbarSticked=!1)}}afterInit(e){e.e.on(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).on("getStickyState.sticky",(()=>this.isToolbarSticked))}onScroll(){const{jodit:e}=this,t=e.ow.pageYOffset||e.od.documentElement&&e.od.documentElement.scrollTop||0,i=(0,c.offset)(e.container,e,e.od,!0),o=e.getMode()===a.MODE_WYSIWYG&&t+e.o.toolbarStickyOffset>i.top&&i.top+i.height>t+e.o.toolbarStickyOffset&&!(e.o.toolbarDisableStickyForMobile&&this.isMobile());if(e.o.toolbarSticky&&!0===e.o.toolbar&&this.isToolbarSticked!==o){const t=e.toolbarContainer;t&&(o?this.addSticky(t):this.removeSticky(t)),e.e.fire("toggleSticky",o)}}isMobile(){return this.j&&this.j.options&&this.j.container&&this.j.o.sizeSM>=this.j.container.offsetWidth}beforeDestruct(e){this.dummyBox&&j.i.safeRemove(this.dummyBox),e.e.off(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).off(".sticky")}}(0,r.__decorate)([(0,S.throttle)()],Jt.prototype,"onScroll",null),n.D.prototype.usePopupForSpecialCharacters=!1,n.D.prototype.specialCharacters=["!",""","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","»","¬","®","¯","°","²","³","´","µ","¶","·","¸","¹","º","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"],n.D.prototype.controls.symbol={icon:"omega",hotkeys:["ctrl+shift+i","cmd+shift+i"],tooltip:"Insert Special Character",popup(e,t,i,o){const s=e.e.fire("generateSpecialCharactersTable.symbols");if(s){if(e.o.usePopupForSpecialCharacters){const t=e.c.div();return t.classList.add("jodit-symbols"),t.appendChild(s),e.e.on(s,"close_dialog",o),t}{B(s,e.i18n("Select Special Character"),void 0,"jodit-symbols").bindDestruct(e);const t=s.querySelector("a");t&&t.focus()}}}};class Xt extends O{constructor(){super(...arguments),this.buttons=[{name:"symbol",group:"insert"}],this.countInRow=17}afterInit(e){e.e.on("generateSpecialCharactersTable.symbols",(()=>{const t=e.c.fromHTML('
'),i=t.querySelector(".jodit-symbols__preview"),o=t.querySelector("table").tBodies[0],s=[];for(let t=0;e.o.specialCharacters.length>t;){const i=e.c.element("tr");for(let o=0;this.countInRow>o&&e.o.specialCharacters.length>t;o+=1,t+=1){const r=e.c.element("td"),n=e.c.fromHTML(`${e.o.specialCharacters[t]}`);s.push(n),r.appendChild(n),i.appendChild(r)}o.appendChild(i)}const r=this;return e.e.on(s,"focus",(function(){i.innerHTML=this.innerHTML})).on(s,"mousedown",(function(t){j.i.isTag(this,"a")&&(e.s.focus(),e.s.insertHTML(this.innerHTML),e.e.fire(this,"close_dialog"),t&&t.preventDefault(),t&&t.stopImmediatePropagation())})).on(s,"mouseenter",(function(){j.i.isTag(this,"a")&&this.focus()})).on(s,"keydown",(t=>{const i=t.target;if(j.i.isTag(i,"a")){const o=parseInt((0,Re.Lj)(i,"-index")||"0",10),n=parseInt((0,Re.Lj)(i,"data-index-j")||"0",10);let l;switch(t.key){case a.KEY_UP:case a.KEY_DOWN:l=t.key===a.KEY_UP?o-r.countInRow:o+r.countInRow,void 0===s[l]&&(l=t.key===a.KEY_UP?Math.floor(s.length/r.countInRow)*r.countInRow+n:n,l>s.length-1&&(l-=r.countInRow)),s[l]&&s[l].focus();break;case a.KEY_RIGHT:case a.KEY_LEFT:l=t.key===a.KEY_LEFT?o-1:o+1,void 0===s[l]&&(l=t.key===a.KEY_LEFT?s.length-1:0),s[l]&&s[l].focus();break;case a.KEY_ENTER:e.e.fire(i,"mousedown"),t.stopImmediatePropagation(),t.preventDefault()}}})),t}))}beforeDestruct(e){e.e.off("generateSpecialCharactersTable.symbols")}}n.D.prototype.table={allowCellSelection:!0,selectionCellStyle:"border: 1px double #1e88e5 !important;",allowCellResize:!0,useExtraClassesOptions:!1},n.D.prototype.controls.table={data:{cols:10,rows:10,classList:{"table table-bordered":"Bootstrap Bordered","table table-striped":"Bootstrap Striped","table table-dark":"Bootstrap Dark"}},popup(e,t,i,o,s){const r=i.data&&i.data.rows?i.data.rows:10,n=i.data&&i.data.cols?i.data.cols:10,a=e.c.fromHTML('
'+(()=>{if(!e.o.table.useExtraClassesOptions)return"";const t=[];if(i.data){const e=i.data.classList;Object.keys(e).forEach((i=>{t.push(``)}))}return t.join("")})()+'
'),l=a.querySelectorAll("span")[0],d=a.querySelectorAll("span")[1],h=a.querySelector(".jodit-form__container"),u=a.querySelector(".jodit-form__options"),p=[],m=r*n;for(let t=0;m>t;t+=1)p[t]||p.push(e.c.element("span",{dataIndex:t}));if(e.e.on(h,"mousemove",((e,t)=>{const i=e.target;if(!j.i.isTag(i,"span"))return;const o=void 0===t||isNaN(t)?parseInt((0,Re.Lj)(i,"-index")||"0",10):t||0,s=Math.ceil((o+1)/n),r=o%n+1;for(let e=0;p.length>e;e+=1)p[e].className=e%n+1>r||Math.ceil((e+1)/n)>s?"":"jodit_hovered";d.textContent=""+r,l.textContent=""+s})).on(h,"touchstart mousedown",(t=>{const i=t.target;if(t.preventDefault(),t.stopImmediatePropagation(),!j.i.isTag(i,"span"))return;const s=parseInt((0,Re.Lj)(i,"-index")||"0",10),r=Math.ceil((s+1)/n),a=s%n+1,l=e.createInside,d=l.element("tbody"),h=l.element("table");h.appendChild(d),h.style.width="100%";let p,m,f=null;for(let e=1;r>=e;e+=1){p=l.element("tr");for(let e=1;a>=e;e+=1)m=l.element("td"),f||(f=m),m.appendChild(l.element("br")),p.appendChild(l.text("\n")),p.appendChild(l.text("\t")),p.appendChild(m);d.appendChild(l.text("\n")),d.appendChild(p)}const g=e.s.current();if(g&&e.s.isCollapsed()){const t=j.i.closest(g,(t=>j.i.isBlock(t,e.ew)),e.editor);t&&t!==e.editor&&!t.nodeName.match(/^TD|TH|TBODY|TABLE|THEADER|TFOOTER$/)&&e.s.setCursorAfter(t)}(0,c.$$)("input[type=checkbox]:checked",u).forEach((e=>{e.value.split(/[\s]+/).forEach((e=>{h.classList.add(e)}))})),e.s.insertNode(l.text("\n")),e.s.insertNode(h,!1),f&&(e.s.setCursorIn(f),(0,c.scrollIntoViewIfNeeded)(f,e.editor,e.ed)),o()})),s&&s.parentElement){for(let t=0;r>t;t+=1){const i=e.c.div();for(let e=0;n>e;e+=1)i.appendChild(p[t*n+e]);h.appendChild(i)}p[0]&&(p[0].className="hovered")}return a},tooltip:"Insert table"};const Zt="table_processor_observer-resize";class Qt extends O{constructor(){super(...arguments),this.selectMode=!1,this.resizeDelta=0,this.createResizeHandle=()=>{this.resizeHandler||(this.resizeHandler=this.j.c.div("jodit-table-resizer"),this.j.e.on(this.resizeHandler,"mousedown.table touchstart.table",this.onHandleMouseDown).on(this.resizeHandler,"mouseenter.table",(()=>{this.j.async.clearTimeout(this.hideTimeout)})))},this.hideTimeout=0,this.drag=!1,this.minX=0,this.maxX=0,this.startX=0}get module(){return this.j.getInstance("Table",this.j.o)}get isRTL(){return"rtl"===this.j.o.direction}showResizeHandle(){this.j.async.clearTimeout(this.hideTimeout),this.j.workplace.appendChild(this.resizeHandler)}hideResizeHandle(){this.hideTimeout=this.j.async.setTimeout((()=>{j.i.safeRemove(this.resizeHandler)}),{timeout:this.j.defaultTimeout,label:"hideResizer"})}onHandleMouseDown(e){if(this.j.isLocked)return;this.drag=!0,this.j.e.on(this.j.ow,"mouseup.resize-cells touchend.resize-cells",this.onMouseUp).on(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.startX=e.clientX,this.j.lock(Zt),this.resizeHandler.classList.add("jodit-table-resizer_moved");let t,i=this.workTable.getBoundingClientRect();if(this.minX=0,this.maxX=1e6,null!=this.wholeTable)i=this.workTable.parentNode.getBoundingClientRect(),this.minX=i.left,this.maxX=this.minX+i.width;else{const e=Ce.formalCoordinate(this.workTable,this.workCell,!0);Ce.formalMatrix(this.workTable,((i,o,s)=>{e[1]===s&&(t=i.getBoundingClientRect(),this.minX=Math.max(t.left+a.NEARBY/2,this.minX)),e[1]+(this.isRTL?-1:1)===s&&(t=i.getBoundingClientRect(),this.maxX=Math.min(t.left+t.width-a.NEARBY/2,this.maxX))}))}return!1}onMouseMove(e){if(!this.drag)return;this.j.e.fire("closeAllPopups");let t=e.clientX;const i=(0,c.offset)(this.resizeHandler.parentNode||this.j.od.documentElement,this.j,this.j.od,!0);this.minX>t&&(t=this.minX),t>this.maxX&&(t=this.maxX),this.resizeDelta=t-this.startX+(this.j.o.iframe?i.left:0),this.resizeHandler.style.left=t-(this.j.o.iframe?0:i.left)+"px";const o=this.j.s.sel;o&&o.removeAllRanges()}onMouseUp(e){(this.selectMode||this.drag)&&(this.selectMode=!1,this.j.unlock()),this.resizeHandler&&this.drag&&(this.drag=!1,this.j.e.off(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.resizeHandler.classList.remove("jodit-table-resizer_moved"),this.startX!==e.clientX&&(null==this.wholeTable?this.resizeColumns():this.resizeTable()),this.j.setEditorValue(),this.j.s.focus())}resizeColumns(){const e=this.resizeDelta,t=[];Ce.setColumnWidthByDelta(this.workTable,Ce.formalCoordinate(this.workTable,this.workCell,!0)[1],e,!0,t);const i=(0,c.call)(this.isRTL?j.i.prev:j.i.next,this.workCell,(e=>j.i.isCell(e,this.j.ew)),this.workCell.parentNode);Ce.setColumnWidthByDelta(this.workTable,Ce.formalCoordinate(this.workTable,i)[1],-e,!1,t)}resizeTable(){const e=this.resizeDelta*(this.isRTL?-1:1),t=this.workTable.offsetWidth,i=(0,c.getContentWidth)(this.workTable.parentNode,this.j.ew),o=!this.wholeTable;if(this.isRTL?!o:o)this.workTable.style.width=(t+e)/i*100+"%";else{const o=this.isRTL?"marginRight":"marginLeft",s=parseInt(this.j.ew.getComputedStyle(this.workTable)[o]||"0",10);this.workTable.style.width=(t-e)/i*100+"%",this.workTable.style[o]=(s+e)/i*100+"%"}}setWorkCell(e,t=null){this.wholeTable=t,this.workCell=e,this.workTable=j.i.up(e,(e=>j.i.isTag(e,"table")),this.j.editor)}calcHandlePosition(e,t,i=0,o=0){const s=(0,c.offset)(t,this.j,this.j.ed);if(i>a.NEARBY&&s.width-a.NEARBY>i)return void this.hideResizeHandle();const r=(0,c.offset)(this.j.workplace,this.j,this.j.od,!0),n=(0,c.offset)(e,this.j,this.j.ed);if(this.resizeHandler.style.left=(i>a.NEARBY?s.left+s.width:s.left)-r.left+o+"px",Object.assign(this.resizeHandler.style,{height:n.height+"px",top:n.top-r.top+"px"}),this.showResizeHandle(),i>a.NEARBY){const e=(0,c.call)(this.isRTL?j.i.prev:j.i.next,t,(e=>j.i.isCell(e,this.j.ew)),t.parentNode);this.setWorkCell(t,!!e&&null)}else{const e=(0,c.call)(this.isRTL?j.i.next:j.i.prev,t,(e=>j.i.isCell(e,this.j.ew)),t.parentNode);this.setWorkCell(e||t,!e||null)}}afterInit(e){e.o.table.allowCellResize&&e.e.off(this.j.ow,".resize-cells").off(".resize-cells").on("change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells",(()=>{(0,c.$$)("table",e.editor).forEach(this.observe)})).on(this.j.ow,"scroll.resize-cells",(()=>{if(!this.drag)return;const t=j.i.up(this.workCell,(e=>j.i.isTag(e,"table")),e.editor);if(t){const e=t.getBoundingClientRect();this.resizeHandler.style.top=e.top+"px"}})).on("beforeSetMode.resize-cells",(()=>{this.module.getAllSelectedCells().forEach((t=>{this.module.removeSelection(t),Ce.normalizeTable(j.i.closest(t,"table",e.editor))}))}))}observe(e){(0,c.dataBind)(e,Zt)||((0,c.dataBind)(e,Zt,!0),this.j.e.on(e,"mouseleave.resize-cells",(e=>{this.resizeHandler&&this.resizeHandler!==e.relatedTarget&&this.hideResizeHandle()})).on(e,"mousemove.resize-cells touchmove.resize-cells",(t=>{if(this.j.isLocked)return;const i=j.i.up(t.target,(e=>j.i.isCell(e,this.j.ew)),e);i&&this.calcHandlePosition(e,i,t.offsetX)})),this.createResizeHandle())}beforeDestruct(e){e.events&&(e.e.off(this.j.ow,".resize-cells"),e.e.off(".resize-cells"))}}(0,r.__decorate)([S.autobind],Qt.prototype,"onHandleMouseDown",null),(0,r.__decorate)([S.autobind],Qt.prototype,"onMouseMove",null),(0,r.__decorate)([S.autobind],Qt.prototype,"onMouseUp",null),(0,r.__decorate)([S.autobind],Qt.prototype,"observe",null);const ei="table_processor_observer";class ti extends O{constructor(){super(...arguments),this.selectedCell=null}get module(){return this.j.getInstance("Table",this.j.o)}afterInit(e){e.o.table.allowCellSelection&&e.e.on(this.j.ow,"click.select-cells",this.onRemoveSelection).on("keydown.select-cells",(e=>{e.key===a.KEY_TAB&&this.unselectCells()})).on("beforeCommand.select-cells",this.onExecCommand).on("afterCommand.select-cells",this.onAfterCommand).on("change afterCommand afterSetMode click afterInit".split(" ").map((e=>e+".select-cells")).join(" "),(()=>{(0,c.$$)("table",e.editor).forEach(this.observe)}))}observe(e){(0,c.dataBind)(e,ei)||(this.onRemoveSelection(),(0,c.dataBind)(e,ei,!0),this.j.e.on(e,"mousedown.select-cells touchstart.select-cells",this.onStartSelection.bind(this,e)))}onStartSelection(e,t){if(this.j.o.readonly)return;this.unselectCells();const i=j.i.closest(t.target,["td","th"],e);i&&(i.firstChild||i.appendChild(this.j.createInside.element("br")),this.selectedCell=i,this.module.addSelection(i),this.j.e.on(e,"mousemove.select-cells touchmove.select-cells",this.onMove.bind(this,e)).on(e,"mouseup.select-cells touchend.select-cells",this.onStopSelection.bind(this,e)),this.j.e.fire("showPopup",e,(()=>(0,c.position)(i,this.j)),"cells"))}onMove(e,t){if(this.j.o.readonly)return;if(this.j.isLockedNotBy(ei))return;const i=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(!i)return;const o=j.i.closest(i,["td","th"],e);if(!o||!this.selectedCell)return;o!==this.selectedCell&&this.j.lock(ei),this.unselectCells(e);const s=Ce.getSelectedBound(e,[o,this.selectedCell]),r=Ce.formalMatrix(e);for(let e=s[0][0];s[1][0]>=e;e+=1)for(let t=s[0][1];s[1][1]>=t;t+=1)this.module.addSelection(r[e][t]);this.j.e.fire("hidePopup"),t.stopPropagation(),(()=>{const e=this.j.createInside.fromHTML('
 
');o.appendChild(e),this.j.async.setTimeout((()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}),this.j.defaultTimeout/5)})()}onRemoveSelection(e){var t;if(!(null===(t=null==e?void 0:e.buffer)||void 0===t?void 0:t.actionTrigger)&&!this.selectedCell&&this.module.getAllSelectedCells().length)return this.j.unlock(),this.unselectCells(),void this.j.e.fire("hidePopup","cells");this.selectedCell=null}onStopSelection(e,t){if(!this.selectedCell)return;this.j.unlock();const i=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(!i)return;const o=j.i.closest(i,["td","th"],e);if(!o)return;const s=j.i.closest(o,"table",e);if(s&&s!==e)return;const r=Ce.getSelectedBound(e,[o,this.selectedCell]),n=Ce.formalMatrix(e),a=n[r[1][0]][r[1][1]],l=n[r[0][0]][r[0][1]];this.j.e.fire("showPopup",e,(()=>{const e=(0,c.position)(l,this.j),t=(0,c.position)(a,this.j);return{left:e.left,top:e.top,width:t.left-e.left+t.width,height:t.top-e.top+t.height}}),"cells"),(0,c.$$)("table",this.j.editor).forEach((e=>{this.j.e.off(e,"mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells")}))}unselectCells(e,t){const i=this.module,o=i.getAllSelectedCells();o.length&&o.forEach((e=>{t&&t===e||i.removeSelection(e)}))}onExecCommand(e){if(/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(e)){e=e.replace("table","");const t=this.module.getAllSelectedCells();if(t.length){const i=t.shift();if(!i)return;const o=j.i.closest(i,"table",this.j.editor);if(!o)return;switch(e){case"splitv":Ce.splitVertical(o,this.j);break;case"splitg":Ce.splitHorizontal(o,this.j);break;case"merge":Ce.mergeSelected(o,this.j);break;case"empty":t.forEach((e=>e.innerHTML=""));break;case"bin":j.i.safeRemove(o);break;case"binrow":Ce.removeRow(o,i.parentNode.rowIndex);break;case"bincolumn":Ce.removeColumn(o,i.cellIndex);break;case"addcolumnafter":case"addcolumnbefore":Ce.appendColumn(o,i.cellIndex,"addcolumnafter"===e,this.j.createInside);break;case"addrowafter":case"addrowbefore":Ce.appendRow(o,i.parentNode,"addrowafter"===e,this.j.createInside)}}return!1}}onAfterCommand(e){/^justify/.test(e)&&this.module.getAllSelectedCells().forEach((t=>jt(e,t,this.j)))}beforeDestruct(e){this.onRemoveSelection(),e.e.off(".select-cells")}}function ii(e){e.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(t=>{let i,o;if(t.key!==a.KEY_TAB&&t.key!==a.KEY_LEFT&&t.key!==a.KEY_RIGHT&&t.key!==a.KEY_UP&&t.key!==a.KEY_DOWN)return;{if(i=e.s.current(),o=j.i.up(i,(e=>e&&e.nodeName&&/^td|th$/i.test(e.nodeName)),e.editor),!o)return;const s=e.s.range;if(t.key!==a.KEY_TAB&&i!==o&&((t.key===a.KEY_LEFT||t.key===a.KEY_UP)&&(j.i.prev(i,(e=>t.key===a.KEY_UP?j.i.isTag(e,"br"):!!e),o)||t.key!==a.KEY_UP&&j.i.isText(i)&&0!==s.startOffset)||(t.key===a.KEY_RIGHT||t.key===a.KEY_DOWN)&&(j.i.next(i,(e=>t.key===a.KEY_DOWN?j.i.isTag(e,"br"):!!e),o)||t.key!==a.KEY_DOWN&&j.i.isText(i)&&i.nodeValue&&s.startOffset!==i.nodeValue.length)))return}const s=j.i.up(o,(e=>e&&/^table$/i.test(e.nodeName)),e.editor);let r=null;switch(t.key){case a.KEY_TAB:case a.KEY_LEFT:{const i=t.key===a.KEY_LEFT||t.shiftKey?"prev":"next";r=j.i[i](o,(e=>e&&/^td|th$/i.test(e.tagName)),s),r||(Ce.appendRow(s,"next"!==i&&s.querySelector("tr"),"next"===i,e.createInside),r=j.i[i](o,(t=>t&&j.i.isCell(t,e.ew)),s));break}case a.KEY_UP:case a.KEY_DOWN:{let e=0,i=0;const n=Ce.formalMatrix(s,((t,s,r)=>{t===o&&(e=s,i=r)}));t.key===a.KEY_UP?void 0!==n[e-1]&&(r=n[e-1][i]):void 0!==n[e+1]&&(r=n[e+1][i])}}if(r){if(r.firstChild)t.key===a.KEY_TAB?e.s.select(r,!0):e.s.setCursorIn(r,t.key===a.KEY_RIGHT||t.key===a.KEY_DOWN);else{const t=e.createInside.element("br");r.appendChild(t),e.s.setCursorBefore(t)}return!1}}))}function oi(e){e.registerButton({name:"table",group:"insert"})}(0,r.__decorate)([S.autobind],ti.prototype,"observe",null),(0,r.__decorate)([S.autobind],ti.prototype,"onRemoveSelection",null),(0,r.__decorate)([S.autobind],ti.prototype,"onStopSelection",null),(0,r.__decorate)([S.autobind],ti.prototype,"onExecCommand",null),(0,r.__decorate)([S.autobind],ti.prototype,"onAfterCommand",null);class si extends O{constructor(){super(...arguments),this.isOpened=!1,this.delayShowTimeout=0}afterInit(e){this.container=e.c.div("jodit-tooltip"),(0,C.ZO)(this.j,si).appendChild(this.container);let t=0;e.e.off(".tooltip").on("showTooltip.tooltip",((i,o)=>{e.async.clearTimeout(t),this.open(i,o)})).on("delayShowTooltip.tooltip",this.delayOpen).on("escape.tooltip",this.close).on("hideTooltip.tooltip change.tooltip scroll.tooltip changePlace.tooltip hidePopup.tooltip closeAllPopups.tooltip",(()=>{this.j.async.clearTimeout(this.delayShowTimeout),t=e.async.setTimeout(this.close,this.j.defaultTimeout)}))}delayOpen(e,t){const i=this.j.o.showTooltipDelay||this.j.defaultTimeout;this.j.async.clearTimeout(this.delayShowTimeout),this.delayShowTimeout=this.j.async.setTimeout((()=>this.open(e,t)),{timeout:i,label:"tooltip"})}open(e,t){this.container.classList.add("jodit-tooltip_visible"),this.container.innerHTML=t,this.isOpened=!0,this.setPosition(e)}setPosition(e){const t=e();(0,c.css)(this.container,{left:t.x,top:t.y})}close(){this.j.async.clearTimeout(this.delayShowTimeout),this.isOpened&&(this.isOpened=!1,this.container.classList.remove("jodit-tooltip_visible"),(0,c.css)(this.container,{left:-5e3}))}beforeDestruct(e){null==e||e.e.off(".tooltip"),this.close(),j.i.safeRemove(this.container)}}function ri(e){e.registerButton({name:"preview"})}function ni(e){e.registerButton({name:"print"})}(0,r.__decorate)([S.autobind],si.prototype,"delayOpen",null),(0,r.__decorate)([S.autobind],si.prototype,"close",null),n.D.prototype.controls.preview={icon:"eye",exec(e){const t=e.getInstance("Dialog",{language:e.o.language,theme:e.o.theme}),i=e.c.div();if((0,c.css)(i,{padding:16}),e.iframe){const o=e.create.element("iframe");(0,c.css)(o,{minWidth:800,minHeight:600,border:0}),i.appendChild(o),t.open(i,e.i18n("Preview"));const s=o.contentWindow;s&&(e.e.fire("generateDocumentStructure.iframe",s.document,e),s.document.body.innerHTML=e.value)}else(0,c.css)(i,{minWidth:1024,minHeight:600,border:0}),i.innerHTML=e.value,t.open(i,e.i18n("Preview"));t.setModal(!0)},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Preview"},n.D.prototype.controls.print={exec(e){const t=e.create.element("iframe");Object.assign(t.style,{position:"fixed",right:0,bottom:0,width:0,height:0,border:0}),(0,C.ZO)(e,n.D).appendChild(t);const i=()=>{e.e.off(e.ow,"mousemove",i),j.i.safeRemove(t)},o=t.contentWindow;o&&(e.e.on(o,"onbeforeunload onafterprint",i).on(e.ow,"mousemove",i),e.o.iframe?(e.e.fire("generateDocumentStructure.iframe",o.document,e),o.document.body.innerHTML=e.value):(o.document.write(''+e.value+""),o.document.close()),o.focus(),o.print())},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Print"},n.D.prototype.showXPathInStatusbar=!0;class ai extends O{constructor(){super(...arguments),this.onContext=(e,t)=>(this.menu||(this.menu=new g(this.j)),this.menu.show(t.clientX,t.clientY,[{icon:"bin",title:e===this.j.editor?"Clear":"Remove",exec:()=>{e!==this.j.editor?j.i.safeRemove(e):this.j.value="",this.j.setEditorValue()}},{icon:"select-all",title:"Select",exec:()=>{this.j.s.select(e)}}]),!1),this.onSelectPath=(e,t)=>{this.j.s.focus();const i=(0,c.attr)(t.target,"-path")||"/";if("/"===i)return this.j.execCommand("selectall"),!1;try{const e=this.j.ed.evaluate(i,this.j.editor,null,XPathResult.ANY_TYPE,null).iterateNext();if(e)return this.j.s.select(e),!1}catch(e){}return this.j.s.select(e),!1},this.tpl=(e,t,i,o)=>{const s=this.j.c.fromHTML(`${(0,c.trim)(i)}`),r=s.firstChild;return this.j.e.on(r,"click",this.onSelectPath.bind(this,e)).on(r,"contextmenu",this.onContext.bind(this,e)),s},this.removeSelectAll=()=>{this.selectAllButton&&(this.selectAllButton.destruct(),delete this.selectAllButton)},this.appendSelectAll=()=>{this.removeSelectAll(),this.selectAllButton=M(this.j,{name:"selectall",...this.j.o.controls.selectall}),this.selectAllButton.state.size="tiny",this.container&&this.container.insertBefore(this.selectAllButton.container,this.container.firstChild)},this.calcPathImd=()=>{if(this.isDestructed)return;const e=this.j.s.current();if(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),e){let t,i,o;j.i.up(e,(e=>{e&&this.j.editor!==e&&!j.i.isText(e)&&(t=e.nodeName.toLowerCase(),i=(0,c.getXPathByElement)(e,this.j.editor).replace(/^\//,""),o=this.tpl(e,i,t,this.j.i18n("Select %s",t)),this.container&&this.container.insertBefore(o,this.container.firstChild))}),this.j.editor)}this.appendSelectAll()},this.calcPath=this.j.async.debounce(this.calcPathImd,2*this.j.defaultTimeout)}afterInit(){this.j.o.showXPathInStatusbar&&(this.container=this.j.c.div("jodit-xpath"),this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath",this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath",(()=>{this.j.o.showXPathInStatusbar&&this.container&&(this.j.statusbar.append(this.container),this.j.getRealMode()===a.MODE_WYSIWYG?this.calcPath():(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),this.appendSelectAll()))})),this.calcPath())}beforeDestruct(){this.j&&this.j.events&&this.j.e.off(".xpath"),this.removeSelectAll(),this.menu&&this.menu.destruct(),j.i.safeRemove(this.container),delete this.menu,delete this.container}}var li=i(65),ci=i(66),di=i(67),hi=i(68),ui=i(69),pi=i(70),mi=i(71),fi=i(72),gi=i(73),vi=i(74),bi=i(75),yi=i(76),wi=i(77),ki=i(78),Ci=i(79),Si=i(80),Ei=i(81),Ii=i(82),ji=i(83),xi=i(84),_i=i(85),zi=i(86),Ti=i(87),Li=i(88),Ai=i(89),Di=i(90),Mi=i(91),Pi=i(92),Ri=i(93),qi=i(94),Bi=i(95),Ni=i(96),Hi=i(97),Oi=i(98),Fi=i(99),Wi=i(100),Vi=i(101),Ui=i(102),Yi=i(103),$i=i(104),Ki=i(105),Gi=i(106),Ji=i(107),Xi=i(108),Zi=i(109),Qi=i(110),eo=i(111),to=i(112),io=i(113),oo=i(114),so=i(115),ro=i(116),no=i(117),ao=i(118),lo=i(119),co=i(120),ho=i(121),uo=i(122),po=i(123),mo=i(124),fo=i(125),go=i(126),vo=i(127),bo=i(128),yo=i(129),wo=i(130),ko=i(131),Co=i(132),So=i(133),Eo=i(134),Io=i(135),jo=i(136),xo=i(137),_o=i(138),zo=i(139),To=i(140),Lo=i(141),Ao=i(142),Do=i(143),Mo=i(144),Po=i(145);Object.keys(a).forEach((e=>{Jodit[e]=a[e]}));const Ro=e=>"__esModule"!==e;Object.keys(s).filter(Ro).forEach((e=>{x.JO.set(e.replace("_","-"),s[e])})),Object.keys(e).filter(Ro).forEach((t=>{Jodit.modules[t]=e[t]})),Object.keys(S).filter(Ro).forEach((e=>{Jodit.decorators[e]=S[e]})),["Confirm","Alert","Prompt"].forEach((t=>{Jodit[t]=e[t]})),Object.keys(t).filter(Ro).forEach((e=>{Jodit.plugins.add(e,t[e])})),Object.keys(Te).filter(Ro).forEach((e=>{Jodit.lang[e]=Te[e]}));const qo=Jodit})(),o})()})); \ No newline at end of file +((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}})(self,(function(){return(()=>{var e=[,(e,t,i)=>{"use strict";i.d(t,{D:()=>s});var o=i(2);class s{constructor(){this.namespace="",this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window:null,this.shadowRoot=null,this.zIndex=0,this.readonly=!1,this.disabled=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots","selectall"],this.toolbarButtonSize="middle",this.allowTabNavigation=!1,this.inline=!1,this.theme="default",this.saveModeInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n=!1,this.tabIndex=-1,this.toolbar=!0,this.statusbar=!0,this.showTooltip=!0,this.showTooltipDelay=1e3,this.useNativeTooltip=!1,this.enter=o.PARAGRAPH,this.enterBlock="br"!==this.enter?this.enter:o.PARAGRAPH,this.defaultMode=o.MODE_WYSIWYG,this.useSplitMode=!1,this.colors={greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]},this.colorPickerDefaultTab="background",this.imageDefaultWidth=300,this.removeButtons=[],this.disablePlugins=[],this.extraPlugins=[],this.extraButtons=[],this.extraIcons={},this.createAttributes={},this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=[{group:"source",buttons:[]},{group:"font-style",buttons:[]},{group:"script",buttons:[]},{group:"list",buttons:["ul","ol"]},{group:"indent",buttons:[]},{group:"font",buttons:[]},{group:"color",buttons:[]},{group:"media",buttons:[]},"\n",{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}],this.buttonsMD=["source","|","bold","italic","|","ul","ol","eraser","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","\n","undo","redo","|","hr","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","eraser","|","fontsize","brush","paragraph","|","image","table","\n","link","|","align","|","undo","redo","|","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","eraser","\n","align","|","undo","redo","|","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!0}static get defaultOptions(){return s.__defaultOptions||(s.__defaultOptions=new s),s.__defaultOptions}}s.prototype.controls={}},(e,t,i)=>{"use strict";i.r(t),i.d(t,{INVISIBLE_SPACE:()=>o,NBSP_SPACE:()=>s,INVISIBLE_SPACE_REG_EXP:()=>r,INVISIBLE_SPACE_REG_EXP_END:()=>n,INVISIBLE_SPACE_REG_EXP_START:()=>a,SPACE_REG_EXP:()=>l,SPACE_REG_EXP_START:()=>c,SPACE_REG_EXP_END:()=>d,IS_BLOCK:()=>h,IS_INLINE:()=>u,INSEPARABLE_TAGS:()=>p,MAY_BE_REMOVED_WITH_KEY:()=>m,KEY_BACKSPACE:()=>f,KEY_TAB:()=>g,KEY_ENTER:()=>v,KEY_ESC:()=>b,KEY_LEFT:()=>y,KEY_UP:()=>w,KEY_RIGHT:()=>k,KEY_DOWN:()=>C,KEY_SPACE:()=>S,KEY_DELETE:()=>E,KEY_F3:()=>j,NEARBY:()=>I,ACCURACY:()=>_,COMMAND_KEYS:()=>x,BR:()=>z,PARAGRAPH:()=>T,MODE_WYSIWYG:()=>L,MODE_SOURCE:()=>A,MODE_SPLIT:()=>D,IS_IE:()=>M,TEXT_PLAIN:()=>P,TEXT_HTML:()=>R,MARKER_CLASS:()=>q,EMULATE_DBLCLICK_TIMEOUT:()=>B,INSERT_AS_HTML:()=>N,INSERT_CLEAR_HTML:()=>H,INSERT_AS_TEXT:()=>O,INSERT_ONLY_TEXT:()=>F,SAFE_COUNT_CHANGE_CALL:()=>W,IS_MAC:()=>V,KEY_ALIASES:()=>U,BASE_PATH:()=>Y});const o="\ufeff",s=" ",r=()=>/[\uFEFF]/g,n=()=>/[\uFEFF]+$/g,a=()=>/^[\uFEFF]+/g,l=()=>/[\s\n\t\r\uFEFF\u200b]+/g,c=()=>/^[\s\n\t\r\uFEFF\u200b]+/g,d=()=>/[\s\n\t\r\uFEFF\u200b]+$/g,h=/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i,u=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i,p=["img","br","video","iframe","script","input","textarea","hr","link","jodit","jodit-media"],m=RegExp(`^${p.join("|")}$`,"i"),f="Backspace",g="Tab",v="Enter",b="Escape",y="ArrowLeft",w="ArrowUp",k="ArrowRight",C="ArrowDown",S="Space",E="Delete",j="F3",I=5,_=10,x=[f,E,w,C,k,y,v,b,j,g],z="br",T="p",L=1,A=2,D=3,M="undefined"!=typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),P=M?"text":"text/plain",R=M?"html":"text/html",q="jodit-selection_marker",B=300,N="insert_as_html",H="insert_clear_html",O="insert_as_text",F="insert_only_text",W=10,V="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),U={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:V?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Y=(()=>{if("undefined"==typeof document)return"";const e=document.currentScript,t=e=>e.replace(/\/[^/]+.js$/,"/");if(e)return t(e.src);const i=document.querySelectorAll("script[src]");return i&&i.length?t(i[i.length-1].src):window.location.href})()},(e,t,i)=>{"use strict";i.d(t,{DG:()=>s,ng:()=>c,P5:()=>p,rO:()=>o});const o="JoditEventDefaultNamespace";class s{constructor(){this.__store={}}get(e,t){if(void 0!==this.__store[t])return this.__store[t][e]}indexOf(e,t,i){const o=this.get(e,t);if(o)for(let e=0;o.length>e;e+=1)if(o[e].originalCallback===i)return e;return!1}namespaces(e=!1){const t=Object.keys(this.__store);return e?t.filter((e=>e!==o)):t}events(e){return this.__store[e]?Object.keys(this.__store[e]):[]}set(e,t,i,o=!1){void 0===this.__store[t]&&(this.__store[t]={}),void 0===this.__store[t][e]&&(this.__store[t][e]=[]),o?this.__store[t][e].unshift(i):this.__store[t][e].push(i)}clear(){this.__store={}}}var r=i(5),n=i(6),a=i(7),l=i(4);class c{constructor(e){this.__key="__JoditEventsNativeNamespaces",this.doc=document,this.prepareEvent=e=>{e.cancelBubble||(e.type.match(/^touch/)&&e.changedTouches&&e.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach((t=>{Object.defineProperty(e,t,{value:e.changedTouches[0][t],configurable:!0,enumerable:!0})})),e.originalEvent||(e.originalEvent=e),"paste"===e.type&&void 0===e.clipboardData&&this.doc.defaultView.clipboardData&&Object.defineProperty(e,"clipboardData",{get:()=>this.doc.defaultView.clipboardData,configurable:!0,enumerable:!0}))},this.currents=[],this.__stopped=[],this.isDestructed=!1,e&&(this.doc=e),this.__key+=(new Date).getTime()}eachEvent(e,t){e.split(/[\s,]+/).forEach((e=>{const i=e.split(".");t.call(this,i[0],i[1]||o)}))}getStore(e){if(!e)throw(0,l.vU)("Need subject");if(void 0===e[this.__key]){const t=new s;Object.defineProperty(e,this.__key,{enumerable:!1,configurable:!0,value:t})}return e[this.__key]}clearStore(e){void 0!==e[this.__key]&&delete e[this.__key]}triggerNativeEvent(e,t){const i=this.doc.createEvent("HTMLEvents");"string"==typeof t?i.initEvent(t,!0,!0):(i.initEvent(t.type,t.bubbles,t.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach((e=>{Object.defineProperty(i,e,{value:t[e],enumerable:!0})})),Object.defineProperty(i,"originalEvent",{value:t,enumerable:!0})),e.dispatchEvent(i)}get current(){return this.currents[this.currents.length-1]}on(e,t,i,o=!1){const s=(0,r.H)(e)?this:e,c=(0,r.H)(t)?t:e;let d=i;void 0===d&&(0,n.m)(t)&&(d=t);const h=this.getStore(s);if(!(0,r.H)(c)||""===c)throw(0,l.vU)("Need events names");if(!(0,n.m)(d))throw(0,l.vU)("Need event handler");if((0,a.k)(s))return s.forEach((e=>{this.on(e,c,d,o)})),this;const u=(0,n.m)(s.addEventListener),p=this;let m=function(e,...t){return d&&d.call(this,e,...t)};return u&&(m=function(e){if(p.prepareEvent(e),d&&!1===d.call(this,e))return e.preventDefault(),e.stopImmediatePropagation(),!1}),this.eachEvent(c,((e,t)=>{if(""===e)throw(0,l.vU)("Need event name");if(!1===h.indexOf(e,t,d)&&(h.set(e,t,{event:e,originalCallback:d,syntheticCallback:m},o),u)){const t=!!["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"].includes(e)&&{passive:!0};s.addEventListener(e,m,t)}})),this}one(e,t,i,o=!1){const s=(0,r.H)(e)?this:e,a=(0,r.H)(t)?t:e;let l=i;void 0===l&&(0,n.m)(t)&&(l=t);const c=(...e)=>{this.off(s,a,c),l(...e)};return this.on(s,a,c,o),this}off(e,t,i){const s=(0,r.H)(e)?this:e,a=(0,r.H)(t)?t:e,l=this.getStore(s);let c=i;if(!(0,r.H)(a)||!a)return l.namespaces().forEach((e=>{this.off(s,"."+e)})),this.clearStore(s),this;void 0===c&&(0,n.m)(t)&&(c=t);const d=(0,n.m)(s.removeEventListener),h=e=>{d&&s.removeEventListener(e.event,e.syntheticCallback,!1)},u=(e,t)=>{if(""!==e){const i=l.get(e,t);if(i&&i.length)if((0,n.m)(c)){const o=l.indexOf(e,t,c);!1!==o&&(h(i[o]),i.splice(o,1))}else i.forEach(h),i.length=0}else l.events(t).forEach((e=>{""!==e&&u(e,t)}))};return this.eachEvent(a,((e,t)=>{t===o?l.namespaces().forEach((t=>{u(e,t)})):u(e,t)})),this}stopPropagation(e,t){const i=(0,r.H)(e)?this:e,s=(0,r.H)(e)?e:t;if("string"!=typeof s)throw(0,l.vU)("Need event names");const n=this.getStore(i);this.eachEvent(s,((e,t)=>{const s=n.get(e,t);s&&this.__stopped.push(s),t===o&&n.namespaces(!0).forEach((t=>this.stopPropagation(i,e+"."+t)))}))}removeStop(e){if(e){const t=this.__stopped.indexOf(e);-1!==t&&this.__stopped.splice(0,t+1)}}isStopped(e){return void 0!==e&&-1!==this.__stopped.indexOf(e)}fire(e,t,...i){let s,a;const c=(0,r.H)(e)?this:e,d=(0,r.H)(e)?e:t,h=(0,r.H)(e)?[t,...i]:i,u=(0,n.m)(c.dispatchEvent);if(!u&&!(0,r.H)(d))throw(0,l.vU)("Need events names");const p=this.getStore(c);return!(0,r.H)(d)&&u?this.triggerNativeEvent(c,t):this.eachEvent(d,((e,t)=>{if(u)this.triggerNativeEvent(c,e);else{const i=p.get(e,t);if(i)try{[...i].every((t=>!this.isStopped(i)&&(this.currents.push(e),a=t.syntheticCallback.apply(c,h),this.currents.pop(),void 0!==a&&(s=a),!0)))}finally{this.removeStop(i)}t!==o||u||p.namespaces().filter((e=>e!==t)).forEach((t=>{const i=this.fire.call(this,c,e+"."+t,...h);void 0!==i&&(s=i)}))}})),s}destruct(){this.isDestructed&&(this.isDestructed=!0,this.off(this),this.getStore(this).clear(),delete this[this.__key])}}var d=i(36),h=i(8),u=i(33);class p{constructor(e,t=[],i={}){this.__lockEvent={},this.__data=e,this.__prefix=t,this.__onEvents=i,Object.keys(e).forEach((t=>{const i=this.__prefix.concat(t).filter((e=>e.length));Object.defineProperty(this,t,{set:o=>{var s;const r=e[t];if(!(0,h.isFastEqual)(r,o)){this.fire(["beforeChange","beforeChange."+i.join(".")],t,o),(0,h.isPlainObject)(o)&&(o=new p(o,i,this.__onEvents)),e[t]=o;const n=[];this.fire(["change",...i.reduce(((e,t)=>(n.push(t),e.push("change."+n.join(".")),e)),[])],i.join("."),r,(null===(s=o)||void 0===s?void 0:s.valueOf)?o.valueOf():o)}},get:()=>e[t],enumerable:!0,configurable:!0}),(0,h.isPlainObject)(e[t])&&(e[t]=new p(e[t],i,this.__onEvents))}))}valueOf(){return this.__data}toString(){return JSON.stringify(this.valueOf())}on(e,t){return(0,h.isArray)(e)?(e.map((e=>this.on(e,t))),this):(this.__onEvents[e]||(this.__onEvents[e]=[]),this.__onEvents[e].push(t),this)}fire(e,...t){if((0,h.isArray)(e))e.map((e=>this.fire(e,...t)));else try{!this.__lockEvent[e]&&this.__onEvents[e]&&(this.__lockEvent[e]=!0,this.__onEvents[e].forEach((e=>e.call(this,...t))))}finally{this.__lockEvent[e]=!1}}static create(e,t=[]){return e instanceof p?e:new p(e,t)}}(0,d.__decorate)([u.nonenumerable],p.prototype,"__data",void 0),(0,d.__decorate)([u.nonenumerable],p.prototype,"__prefix",void 0),(0,d.__decorate)([u.nonenumerable],p.prototype,"__onEvents",void 0),(0,d.__decorate)([u.nonenumerable],p.prototype,"__lockEvent",void 0)},(e,t,i)=>{"use strict";i.d(t,{RI:()=>r,dt:()=>n,vU:()=>a});const o={},s=o.toString,r=o.hasOwnProperty;["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment","DOMStringList","HTMLCollection"].forEach((e=>{o["[object "+e+"]"]=e.toLowerCase()}));const n=e=>null===e?"null":"object"==typeof e||"function"==typeof e?o[s.call(e)]||"object":typeof e;function a(e){return new TypeError(e)}},(e,t,i)=>{"use strict";function o(e){return"string"==typeof e}i.d(t,{H:()=>o})},(e,t,i)=>{"use strict";function o(e){return"function"==typeof e}i.d(t,{m:()=>o})},(e,t,i)=>{"use strict";function o(e){return Array.isArray(e)}i.d(t,{k:()=>o})},(e,t,i)=>{"use strict";i.r(t),i.d(t,{$$:()=>_,ConfigFlatten:()=>w,ConfigProto:()=>y,LimitedStack:()=>o.lI,appendScript:()=>Y,appendScriptAsync:()=>$,appendStyleAsync:()=>K,applyStyles:()=>D,asArray:()=>r,attr:()=>o.Lj,browser:()=>J,buildQuery:()=>re,call:()=>o.RE,callPromise:()=>o.C6,camelCase:()=>E.eV,cleanFromWord:()=>M,clearCenterAlign:()=>Q.b,clearTimeout:()=>h,cns:()=>o.H5,colorToHex:()=>v.h,completeUrl:()=>W,convertMediaUrlToVideoEmbed:()=>Z,css:()=>Q.i,cssPath:()=>T,ctrlKey:()=>ee,dataBind:()=>te.q,defaultLanguage:()=>ie.X,each:()=>oe,error:()=>S.vU,fastClone:()=>f,get:()=>o.U2,getClassName:()=>o.gj,getContentWidth:()=>N,getXPathByElement:()=>x,hasBrowserColorPicker:()=>g.EO,hasContainer:()=>g.Zt,hasOwn:()=>S.RI,htmlspecialchars:()=>P,humanSizeToBytes:()=>se,i18n:()=>E.ag,inView:()=>ne,innerWidth:()=>H,isArray:()=>g.kJ,isAtom:()=>p,isBoolean:()=>g.jn,isDestructable:()=>g.Z$,isEqual:()=>g.Xy,isFastEqual:()=>g.LP,isFunction:()=>g.mf,isHTML:()=>g.FP,isHtmlFromWord:()=>g.I4,isInitable:()=>g.Gu,isInt:()=>g.GN,isJoditObject:()=>g.Zu,isLicense:()=>g.A1,isNativeFunction:()=>g.QC,isNumber:()=>g.hj,isNumeric:()=>g.kE,isPlainObject:()=>g.PO,isPromise:()=>g.tI,isString:()=>g.HD,isURL:()=>g.PX,isValidName:()=>g.r1,isViewObject:()=>g.f2,isVoid:()=>g.nj,isWindow:()=>g.FJ,kebabCase:()=>E.GL,keepNames:()=>o.kc,keys:()=>o.XP,loadImage:()=>o.po,loadNext:()=>G,markAsAtomic:()=>m,markDeprecated:()=>o.Q8,markOwner:()=>o.MN,memorizeExec:()=>o.u3,nl2br:()=>q,normalizeColor:()=>B.ut,normalizeCssValue:()=>B.Zh,normalizeKeyAliases:()=>B.T2,normalizeLicense:()=>B.Pd,normalizeNode:()=>B.Tz,normalizePath:()=>B.AH,normalizeRelativePath:()=>B.Jf,normalizeSize:()=>B.aC,normalizeUrl:()=>B.D5,offset:()=>O,parseQuery:()=>X,position:()=>F,refs:()=>z,reset:()=>o.mc,resolveElement:()=>L,scrollIntoViewIfNeeded:()=>ae,set:()=>o.t8,setTimeout:()=>d,splitArray:()=>a,sprintf:()=>E.gB,stringify:()=>E.Pz,stripTags:()=>R,toArray:()=>c,trim:()=>E.fy,trimInv:()=>E.as,type:()=>S.dt,ucfirst:()=>E.Ps,val:()=>le});var o=i(9),s=i(7);const r=e=>(0,s.k)(e)?e:[e];var n=i(5);function a(e){return(0,n.H)(e)?e.split(/[,\s]+/):e}var l=i(19);const c=(...e)=>{var t;return((0,l.Q)(Array.from)?Array.from:null!==(t=(0,o.mc)("Array.from"))&&void 0!==t?t:Array.from).apply(Array,e)};function d(e,t,...i){return t?window.setTimeout(e,t,...i):(e.call(null,...i),0)}function h(e){window.clearTimeout(e)}var u=i(16);function p(e){return e&&e.isAtom}function m(e){return Object.defineProperty(e,"isAtom",{enumerable:!1,value:!0,configurable:!1}),e}function f(e){return JSON.parse((0,u.P)(e))}var g=i(15),v=i(21),b=i(1);function y(e,t,i=0){if(Object.getPrototypeOf(e)!==Object.prototype)return e;const o=b.D.defaultOptions;if((0,g.HD)(e.preset)){if(void 0!==o.presets[e.preset]){const t=o.presets[e.preset];Object.keys(t).forEach((i=>{(0,g.nj)(e[i])&&(e[i]=t[i])}))}delete e.preset}const s={};return Object.keys(e).forEach((o=>{const r=e[o],n=t?t[o]:null;s[o]=(0,g.PO)(r)&&(0,g.PO)(n)&&!p(r)?y(r,n,i+1):0!==i&&(0,g.kJ)(r)&&!p(r)&&(0,g.kJ)(n)?[...r,...n.slice(r.length)]:r})),Object.setPrototypeOf(s,t),s}function w(e){return(0,o.XP)(e,!1).reduce(((t,i)=>(t[i]=e[i],t)),{})}var k=i(14),C=i(2),S=i(4),E=i(22),j=i(24);let I=1;function _(e,t){let i;if(!/:scope/.test(e)||!C.IS_IE||t&&t.nodeType===Node.DOCUMENT_NODE)i=t.querySelectorAll(e);else{const o=t.id,s=o||"_selector_id_"+(Math.random()+"").slice(2)+(I++,I);e=e.replace(/:scope/g,"#"+s),!o&&t.setAttribute("id",s),i=t.parentNode.querySelectorAll(e),o||t.removeAttribute("id")}return[].slice.call(i)}const x=(e,t)=>{if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";if(!e.parentNode||t===e)return"";if(e.id)return"//*[@id='"+e.id+"']";const i=[].filter.call(e.parentNode.childNodes,(t=>t.nodeName===e.nodeName));return x(e.parentNode,t)+"/"+e.nodeName.toLowerCase()+(i.length>1?"["+(c(i).indexOf(e)+1)+"]":"")},z=e=>(e instanceof j.u1&&(e=e.container),_("[ref],[data-ref]",e).reduce(((e,t)=>{const i=(0,o.Lj)(t,"-ref");return i&&(0,g.HD)(i)&&(e[(0,E.eV)(i)]=t,e[i]=t),e}),{})),T=e=>{if(!k.i.isElement(e))return null;const t=[];let i=e;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let e=i.nodeName.toLowerCase();if(i.id){e+="#"+i.id,t.unshift(e);break}{let t=i,o=1;do{t=t.previousElementSibling,t&&t.nodeName.toLowerCase()===e&&o++}while(t);e+=":nth-of-type("+o+")"}t.unshift(e),i=i.parentNode}return t.join(" > ")};function L(e,t){let i=e;if((0,g.HD)(e))try{i=t.querySelector(e)}catch(t){throw(0,S.vU)('String "'+e+'" should be valid HTML selector')}if(!i||"object"!=typeof i||!k.i.isElement(i)||!i.cloneNode)throw(0,S.vU)('Element "'+e+'" should be string or HTMLElement instance');return i}function A(e){return e.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";]+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,((e,t,i)=>{switch(i.toLowerCase()){case"pt":return(1.328*parseFloat(t)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(t)).toFixed(0)+"px"}return e}))}function D(e){if(-1===e.indexOf("")+7);const t=document.createElement("iframe");t.style.display="none",document.body.appendChild(t);let i="",o=[],s=[];try{const r=t.contentDocument||(t.contentWindow?t.contentWindow.document:null);if(r){r.open(),r.write(e),r.close(),r.styleSheets.length&&(s=r.styleSheets[r.styleSheets.length-1].cssRules);for(let e=0;s.length>e;e+=1)""!==s[e].selectorText&&(o=_(s[e].selectorText,r.body),o.forEach((t=>{t.style.cssText=A(s[e].style.cssText+";"+t.style.cssText)})));k.i.each(r.body,(e=>{if(k.i.isElement(e)){const t=e,i=t.style.cssText;i&&(t.style.cssText=A(i)),t.hasAttribute("lang")&&t.removeAttribute("lang")}})),i=r.firstChild?(0,E.fy)(r.body.innerHTML):""}}catch(e){}finally{k.i.safeRemove(t)}return i&&(e=i),(0,E.fy)(e.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(//i);-1!==t&&(e=e.substr(t+20));const i=e.search(//i);return-1!==i&&(e=e.substr(0,i)),e})(i)),t.s.insertHTML(i)}const Ke="clipboard";class Ge{constructor(){this.buttons=[{name:"cut",group:"clipboard"},{name:"copy",group:"clipboard"},{name:"paste",group:"clipboard"},{name:"selectall",group:"clipboard"}]}init(e){var t;null===(t=this.buttons)||void 0===t||t.forEach((t=>e.registerButton(t))),e.e.off("copy.clipboard cut.clipboard").on("copy.clipboard cut.clipboard",(t=>{var i;const o=e.s.html,s=Ye(t)||Ye(e.ew)||Ye(t.originalEvent);s&&(s.setData(a.TEXT_PLAIN,(0,c.stripTags)(o)),s.setData(a.TEXT_HTML,o)),e.buffer.set(Ke,o),e.e.fire("pasteStack",{html:o,action:e.o.defaultActionOnPaste}),"cut"===t.type&&(e.s.remove(),e.s.focus()),t.preventDefault(),null===(i=null==e?void 0:e.events)||void 0===i||i.fire("afterCopy",o)}))}destruct(e){var t,i;null===(t=null==e?void 0:e.buffer)||void 0===t||t.set(Ke,""),null===(i=null==e?void 0:e.events)||void 0===i||i.off(".clipboard")}}n.D.prototype.askBeforePasteHTML=!0,n.D.prototype.processPasteHTML=!0,n.D.prototype.askBeforePasteFromWord=!0,n.D.prototype.processPasteFromWord=!0,n.D.prototype.nl2brInPlainText=!0,n.D.prototype.defaultActionOnPaste=a.INSERT_AS_HTML,n.D.prototype.defaultActionOnPasteFromWord=null,n.D.prototype.draggableTags=["img","a","jodit-media","jodit"],n.D.prototype.controls.cut={command:"cut",isDisabled:e=>e.s.isCollapsed(),tooltip:"Cut selection"},n.D.prototype.controls.copy={command:"copy",isDisabled:e=>e.s.isCollapsed(),tooltip:"Copy selection"};const Je="pasteStorage";n.D.prototype.controls.paste={tooltip:"Paste from clipboard",async exec(e,t,{control:i}){if(i.name===Je)return void e.execCommand("showPasteStorage");e.s.focus();let o="",s=!0;if(navigator.clipboard){try{const e=await navigator.clipboard.read();if(e&&e.length){const t=await e[0].getType(a.TEXT_PLAIN);o=await new Response(t).text()}s=!1}catch(e){}if(s)try{o=await navigator.clipboard.readText(),s=!1}catch(e){}}s&&(o=e.buffer.get(Ke)||"",s=0===o.length);const r=e.value;s?(e.ed.execCommand("paste"),s=r===e.value,!s&&e.e.fire("afterPaste")):o.length?($e(null,e,o),e.e.fire("afterPaste")):s&&B(e.i18n("Your browser doesn't support direct access to the clipboard."),(()=>{e.s.focus()})).bindDestruct(e)},list:{[Je]:"Paste Storage"},isChildDisabled(e){return 2>e.e.fire("pasteStorageList")}},n.D.prototype.controls.selectall={icon:"select-all",command:"selectall",tooltip:"Select all"};class Xe extends O{constructor(){super(...arguments),this.pasteStack=new c.LimitedStack(20)}afterInit(e){e.e.on("paste.paste",this.onPaste).on("pasteStack.paste",(e=>this.pasteStack.push(e))),e.o.nl2brInPlainText&&this.j.e.on("processPaste.paste",this.onProcessPasteReplaceNl2Br)}onPaste(e){try{if(!1===this.j.e.fire("beforePaste",e)||!1===this.customPasteProcess(e))return e.preventDefault(),!1;this.defaultPasteProcess(e)}finally{this.j.e.fire("afterPaste",e)}}customPasteProcess(e){if(!this.j.o.processPasteHTML)return;const t=Ye(e),i=[null==t?void 0:t.getData(a.TEXT_HTML),null==t?void 0:t.getData(a.TEXT_PLAIN)];for(const t of i)if((0,c.isHTML)(t)&&(this.processWordHTML(e,t)||this.processHTML(e,t)))return!1}defaultPasteProcess(e){const t=Ye(e);let i=(null==t?void 0:t.getData(a.TEXT_HTML))||(null==t?void 0:t.getData(a.TEXT_PLAIN));if(t&&i&&""!==(0,c.trim)(i)){const o=this.j.e.fire("processPaste",e,i,(e=>{const t=e.types;let i="";if((0,c.isArray)(t)||"domstringlist"===(0,c.type)(t))for(let e=0;t.length>e;e+=1)i+=t[e]+";";else i=(t||a.TEXT_PLAIN)+";";return i})(t));void 0!==o&&(i=o),((0,c.isString)(i)||I.i.isNode(i,this.j.ew))&&this.insertByType(e,i,this.j.o.defaultActionOnPaste),e.preventDefault(),e.stopPropagation()}}processWordHTML(e,t){return!(!this.j.o.processPasteFromWord||!(0,c.isHtmlFromWord)(t)||(this.j.o.askBeforePasteFromWord?this.askInsertTypeDialog("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","Word Paste Detected",(i=>{this.insertFromWordByType(e,t,i)})):this.insertFromWordByType(e,t,this.j.o.defaultActionOnPasteFromWord||this.j.o.defaultActionOnPaste),0))}processHTML(e,t){if(this.j.o.askBeforePasteHTML){const i=this.pasteStack.find((e=>e.html===t));return i?(this.insertByType(e,t,i.action||this.j.o.defaultActionOnPaste),!0):(this.askInsertTypeDialog("Your code is similar to HTML. Keep as HTML?","Paste as HTML",(i=>{this.insertByType(e,t,i)}),"Insert as Text"),!0)}return!1}insertFromWordByType(e,t,i){var o;switch(i){case a.INSERT_AS_HTML:if(t=(0,c.applyStyles)(t),this.j.o.beautifyHTML){const e=null===(o=this.j.events)||void 0===o?void 0:o.fire("beautifyHTML",t);(0,c.isString)(e)&&(t=e)}break;case a.INSERT_AS_TEXT:t=(0,c.cleanFromWord)(t);break;case a.INSERT_ONLY_TEXT:t=(0,c.stripTags)((0,c.cleanFromWord)(t))}$e(e,this.j,t)}insertByType(e,t,i){if(this.pasteStack.push({html:t,action:i}),(0,c.isString)(t))switch(this.j.buffer.set(Ke,t),i){case a.INSERT_CLEAR_HTML:t=(0,c.cleanFromWord)(t);break;case a.INSERT_ONLY_TEXT:t=(0,c.stripTags)(t);break;case a.INSERT_AS_TEXT:t=(0,c.htmlspecialchars)(t)}$e(e,this.j,t)}askInsertTypeDialog(e,t,i,o="Clean",s="Insert only Text"){var r,n,l,d;if(!1===(null===(n=null===(r=this.j)||void 0===r?void 0:r.e)||void 0===n?void 0:n.fire("beforeOpenPasteDialog",e,t,i,o,s)))return;const h=H(`
${this.j.i18n(e)}
`,this.j.i18n(t));h.bindDestruct(this.j),(0,c.markOwner)(this.j,h.container);const u=(0,m.zx)(this.j,{text:"Keep",name:"keep",status:"primary",tabIndex:0}),p=(0,m.zx)(this.j,{text:o,tabIndex:0}),f=(0,m.zx)(this.j,{text:s,tabIndex:0}),g=(0,m.zx)(this.j,{text:"Cancel",tabIndex:0});return u.onAction((()=>{h.close(),i&&i(a.INSERT_AS_HTML)})),p.onAction((()=>{h.close(),i&&i(a.INSERT_AS_TEXT)})),f.onAction((()=>{h.close(),i&&i(a.INSERT_ONLY_TEXT)})),g.onAction((()=>{h.close()})),h.setFooter([u,p,s?f:"",g]),u.focus(),null===(d=null===(l=this.j)||void 0===l?void 0:l.e)||void 0===d||d.fire("afterOpenPasteDialog",h,e,t,i,o,s),h}onProcessPasteReplaceNl2Br(e,t,i){if(i===a.TEXT_PLAIN+";"&&!(0,c.isHTML)(t))return(0,c.nl2br)(t)}useFakeDivBox(e){const t=this.j.c.div("",{tabindex:-1,contenteditable:!0,style:{left:-9999,top:0,width:0,height:"100%",lineHeight:"140%",overflow:"hidden",position:"fixed",zIndex:2147483647,wordBreak:"break-all"}});this.j.container.appendChild(t);const i=this.j.s.save();t.focus();let o=0;const s=()=>{I.i.safeRemove(t),this.j.selection&&this.j.s.restore(i)},r=()=>{if(o+=1,t.childNodes&&t.childNodes.length>0){const i=t.innerHTML;return s(),void this.processHTML(e,i)}5>o?this.j.async.setTimeout(r,20):s()};r()}beforeDestruct(e){e.e.off("paste.paste",this.onPaste)}}(0,r.__decorate)([S.autobind],Xe.prototype,"onPaste",null),(0,r.__decorate)([S.autobind],Xe.prototype,"onProcessPasteReplaceNl2Br",null);class Ze extends O{constructor(){super(...arguments),this.currentIndex=0,this.list=[],this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.paste=()=>{if(this.j.s.focus(),this.j.s.insertHTML(this.list[this.currentIndex]),0!==this.currentIndex){const e=this.list[0];this.list[0]=this.list[this.currentIndex],this.list[this.currentIndex]=e}this.dialog&&this.dialog.close(),this.j.setEditorValue(),this.j.e.fire("afterPaste")},this.onKeyDown=e=>{let t=this.currentIndex;-1!==[a.KEY_UP,a.KEY_DOWN,a.KEY_ENTER].indexOf(e.key)&&(e.key===a.KEY_UP&&(0===t?t=this.list.length-1:t-=1),e.key===a.KEY_DOWN&&(t===this.list.length-1?t=0:t+=1),e.key!==a.KEY_ENTER?(t!==this.currentIndex&&this.selectIndex(t),e.stopImmediatePropagation(),e.preventDefault()):this.paste())},this.selectIndex=e=>{this.listBox&&(0,c.toArray)(this.listBox.childNodes).forEach(((t,i)=>{t.classList.remove("jodit_active"),e===i&&this.previewBox&&(t.classList.add("jodit_active"),this.previewBox.innerHTML=this.list[e],t.focus())})),this.currentIndex=e},this.showDialog=()=>{2>this.list.length||(this.dialog||this.createDialog(),this.listBox&&(this.listBox.innerHTML=""),this.previewBox&&(this.previewBox.innerHTML=""),this.list.forEach(((e,t)=>{const i=this.j.c.element("a");i.textContent=t+1+". "+e.replace((0,a.SPACE_REG_EXP)(),""),this.j.e.on(i,"keydown",this.onKeyDown),(0,c.attr)(i,"href","javascript:void(0)"),(0,c.attr)(i,"data-index",""+t),(0,c.attr)(i,"tab-index","-1"),this.listBox&&this.listBox.appendChild(i)})),this.dialog&&this.dialog.open(),this.j.async.setTimeout((()=>{this.selectIndex(0)}),100))}}createDialog(){this.dialog=new q({language:this.j.o.language});const e=this.j.c.fromHTML(''+this.j.i18n("Paste")+"");this.j.e.on(e,"click",this.paste);const t=this.j.c.fromHTML(''+this.j.i18n("Cancel")+"");this.j.e.on(t,"click",this.dialog.close),this.container=this.j.c.div(),this.container.classList.add("jodit-paste-storage"),this.listBox=this.j.c.div(),this.previewBox=this.j.c.div(),this.container.appendChild(this.listBox),this.container.appendChild(this.previewBox),this.dialog.setHeader(this.j.i18n("Choose Content to Paste")),this.dialog.setContent(this.container),this.dialog.setFooter([e,t]),this.j.e.on(this.listBox,"click dblclick",(e=>{const t=e.target;return I.i.isTag(t,"a")&&t.hasAttribute("data-index")&&this.selectIndex(parseInt((0,c.attr)(t,"-index")||"0",10)),"dblclick"===e.type&&this.paste(),!1}))}afterInit(){this.j.e.off("afterCopy.paste-storage").on("pasteStorageList.paste-storage",(()=>this.list.length)).on("afterCopy.paste-storage",(e=>{-1!==this.list.indexOf(e)&&this.list.splice(this.list.indexOf(e),1),this.list.unshift(e),this.list.length>5&&(this.list.length=5)})),this.j.registerCommand("showPasteStorage",{exec:this.showDialog,hotkeys:["ctrl+shift+v","cmd+shift+v"]})}beforeDestruct(){this.dialog&&this.dialog.destruct(),this.j.e.off(".paste-storage"),I.i.safeRemove(this.previewBox),I.i.safeRemove(this.listBox),I.i.safeRemove(this.container),this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.list=[]}}const Qe="copyformat",et=["fontWeight","fontStyle","fontSize","color","margin","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textDecorationLine","fontFamily"],tt=(e,t,i,o)=>{let s=(0,c.css)(i,t);return s===o[t]&&(s=i.parentNode&&i!==e.editor&&i.parentNode!==e.editor?tt(e,t,i.parentNode,o):void 0),s};function it(e){e.registerButton({name:"copyformat",group:"clipboard"})}n.D.prototype.controls.copyformat={exec(e,t,{button:i}){if(t){if(e.buffer.exists(Qe))e.buffer.delete(Qe),e.e.off(e.editor,"mouseup.copyformat");else{const i={},o=I.i.up(t,(e=>e&&!I.i.isText(e)),e.editor)||e.editor,s=e.createInside.span();e.editor.appendChild(s),et.forEach((e=>{i[e]=(0,c.css)(s,e)})),s!==e.editor&&I.i.safeRemove(s);const r=((e,t,i)=>{const o={};return t&&et.forEach((s=>{o[s]=tt(e,s,t,i),s.match(/border(Style|Color)/)&&!o.borderWidth&&(o[s]=void 0)})),o})(e,o,i),n=()=>{e.buffer.delete(Qe);const t=e.s.current();t&&(I.i.isTag(t,"img")?(0,c.css)(t,r):e.s.applyStyle(r)),e.e.off(e.editor,"mouseup.copyformat")};e.e.on(e.editor,"mouseup.copyformat",n),e.buffer.set(Qe,!0)}i.update()}},isActive:e=>e.buffer.exists(Qe),tooltip:"Paint format"};var ot=i(61);function st(e){e.registerButton({name:"brush",group:"color"});const t=(t,i,o)=>{const s=(0,c.normalizeColor)(o);switch(t){case"background":e.s.applyStyle({backgroundColor:s||""});break;case"forecolor":e.s.applyStyle({color:s||""})}return e.setEditorValue(),!1};e.registerCommand("forecolor",t).registerCommand("background",t)}n.D.prototype.controls.brush={update(e){const t=(0,c.dataBind)(e,"color"),i=e.j,o=(t,o)=>{o&&o!==""+(0,c.css)(i.editor,t)&&(e.state.icon.fill=o)};if(t){const i=(0,c.dataBind)(e,"color");return void o("color"===i?i:"background-color",t)}const s=i.s.current();if(s&&!e.state.disabled){const e=I.i.closest(s,(e=>I.i.isBlock(e,i.ew)||e&&I.i.isElement(e)),i.editor)||i.editor;o("color",""+(0,c.css)(e,"color")),o("background-color",""+(0,c.css)(e,"background-color"))}e.state.icon.fill="",e.state.activated=!1},popup(e,t,i,o,s){let r="",n="",a=[],l=null;return t&&t!==e.editor&&I.i.isNode(t,e.ew)&&(I.i.isElement(t)&&e.s.isCollapsed()&&!I.i.isTag(t,["br","hr"])&&(l=t),I.i.up(t,(t=>{if(I.i.isHTMLElement(t,e.ew)){const e=(0,c.css)(t,"color",void 0,!0),i=(0,c.css)(t,"background-color",void 0,!0);if(e)return r=""+e,!0;if(i)return n=""+i,!0}}),e.editor)),a=[{name:"Background",content:(0,ot.YW)(e,(t=>{l?l.style.backgroundColor=t:e.execCommand("background",!1,t),(0,c.dataBind)(s,"color",t),(0,c.dataBind)(s,"color-mode","background"),o()}),n)},{name:"Text",content:(0,ot.YW)(e,(t=>{l?l.style.color=t:e.execCommand("forecolor",!1,t),(0,c.dataBind)(s,"color",t),(0,c.dataBind)(s,"color-mode","color"),o()}),r)}],"background"!==e.o.colorPickerDefaultTab&&(a=a.reverse()),(0,ot.IL)(e,a,l)},exec(e,t,{button:i}){const o=(0,c.dataBind)(i,"color-mode"),s=(0,c.dataBind)(i,"color");if(!o)return!1;if(t&&t!==e.editor&&I.i.isNode(t,e.ew)&&I.i.isElement(t))switch(o){case"color":t.style.color=s;break;case"background":t.style.backgroundColor=s}else e.execCommand("background"===o?o:"forecolor",!1,s)},tooltip:"Fill color or set the text color"};class rt extends O{constructor(){super(...arguments),this.isFragmentFromEditor=!1,this.isCopyMode=!1,this.startDragPoint={x:0,y:0},this.draggable=null,this.bufferRange=null,this.getText=e=>{const t=Ye(e);return t?t.getData(a.TEXT_HTML)||t.getData(a.TEXT_PLAIN):null}}afterInit(){this.j.e.on([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}onDragStart(e){let t=e.target;if(this.onDragEnd(),this.isFragmentFromEditor=I.i.isOrContains(this.j.editor,t,!0),this.isCopyMode=!this.isFragmentFromEditor||(0,c.ctrlKey)(e),this.isFragmentFromEditor){const e=this.j.s.sel,t=e&&e.rangeCount?e.getRangeAt(0):null;t&&(this.bufferRange=t.cloneRange())}else this.bufferRange=null;this.startDragPoint.x=e.clientX,this.startDragPoint.y=e.clientY,I.i.isElement(t)&&t.classList.contains("jodit-filebrowser__files-item")&&(t=t.querySelector("img")),I.i.isTag(t,"img")&&(this.draggable=t.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",t)),this.addDragListeners()}addDragListeners(){this.j.e.on("dragover",this.onDrag).on("drop.DragAndDrop",this.onDrop).on(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}removeDragListeners(){this.j.e.off("dragover",this.onDrag).off("drop.DragAndDrop",this.onDrop).off(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)}onDrag(e){this.draggable&&(this.j.e.fire("hidePopup"),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),e.preventDefault(),e.stopPropagation())}onDragEnd(){this.draggable&&(I.i.safeRemove(this.draggable),this.draggable=null),this.isCopyMode=!1,this.removeDragListeners()}onDrop(e){if(!e.dataTransfer||!e.dataTransfer.files||!e.dataTransfer.files.length){if(!this.isFragmentFromEditor&&!this.draggable)return this.j.e.fire("paste",e),e.preventDefault(),e.stopPropagation(),!1;const t=this.j.s.sel,i=this.bufferRange||(t&&t.rangeCount?t.getRangeAt(0):null);let o=null;if(!this.draggable&&i)o=this.isCopyMode?i.cloneContents():i.extractContents();else if(this.draggable)if(this.isCopyMode){const[e,t]="1"===(0,c.attr)(this.draggable,"-is-file")?["a","href"]:["img","src"];o=this.j.createInside.element(e),o.setAttribute(t,(0,c.attr)(this.draggable,"data-src")||(0,c.attr)(this.draggable,"src")||""),"a"===e&&(o.textContent=(0,c.attr)(o,t)||"")}else o=(0,c.dataBind)(this.draggable,"target");else this.getText(e)&&(o=this.j.createInside.fromHTML(this.getText(e)));t&&t.removeAllRanges(),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),o&&(this.j.s.insertNode(o,!1,!1),i&&o.firstChild&&o.lastChild&&(i.setStartBefore(o.firstChild),i.setEndAfter(o.lastChild),this.j.s.selectRange(i),this.j.e.fire("synchro")),I.i.isTag(o,"img")&&this.j.events&&this.j.e.fire("afterInsertImage",o)),e.preventDefault(),e.stopPropagation()}this.isFragmentFromEditor=!1,this.removeDragListeners()}beforeDestruct(){this.onDragEnd(),this.j.e.off(window,".DragAndDrop").off(".DragAndDrop").off([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)}}(0,r.__decorate)([S.autobind],rt.prototype,"onDragStart",null),(0,r.__decorate)([(0,S.throttle)((e=>e.j.defaultTimeout/10))],rt.prototype,"onDrag",null),(0,r.__decorate)([S.autobind],rt.prototype,"onDragEnd",null),(0,r.__decorate)([S.autobind],rt.prototype,"onDrop",null);class nt extends O{constructor(){super(...arguments),this.dragList=[],this.draggable=null,this.wasMoved=!1,this.isCopyMode=!1,this.diffStep=10,this.startX=0,this.startY=0}afterInit(){this.dragList=this.j.o.draggableTags?(0,c.splitArray)(this.j.o.draggableTags).filter(Boolean).map((e=>e.toLowerCase())):[],this.dragList.length&&this.j.e.on("mousedown touchstart dragstart",this.onDragStart)}onDragStart(e){if("dragstart"===e.type&&this.draggable)return!1;const t=e.target;if(!this.dragList.length||!t)return;const i=e=>e&&this.dragList.includes(e.nodeName.toLowerCase()),o=I.i.furthest(t,i,this.j.editor)||(i(t)?t:null);o&&(this.startX=e.clientX,this.startY=e.clientY,this.isCopyMode=(0,c.ctrlKey)(e),this.onDragEnd(),this.draggable=o.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",o),this.addDragListeners())}onDrag(e){var t,i;if(!this.draggable)return;const o=e.clientY;if(Math.sqrt(Math.pow(e.clientX-this.startX,2)+Math.pow(o-this.startY,2))>=this.diffStep){if(this.wasMoved=!0,this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){const o=(0,c.dataBind)(this.draggable,"target");(0,c.css)(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",opacity:.7,display:"inline-block",left:e.clientX,top:e.clientY,width:null!==(t=null==o?void 0:o.offsetWidth)&&void 0!==t?t:100,height:null!==(i=null==o?void 0:o.offsetHeight)&&void 0!==i?i:100}),(0,C.ZO)(this.j,nt).appendChild(this.draggable)}(0,c.css)(this.draggable,{left:e.clientX,top:e.clientY}),this.j.s.insertCursorAtPoint(e.clientX,e.clientY)}}onDragEnd(){this.isInDestruct||this.draggable&&(I.i.safeRemove(this.draggable),this.draggable=null,this.wasMoved=!1,this.removeDragListeners())}onDrop(){if(!this.draggable||!this.wasMoved)return void this.onDragEnd();let e=(0,c.dataBind)(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(e=e.cloneNode(!0));const{parentElement:t}=e;this.j.s.insertNode(e,!0,!1),t&&I.i.isEmpty(t)&&I.i.safeRemove(t),I.i.isTag(e,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",e),this.j.e.fire("synchro")}addDragListeners(){this.j.e.on(this.j.editor,"mousemove touchmove",this.onDrag).on("mouseup touchend",this.onDrop).on([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}removeDragListeners(){this.j.e.off(this.j.editor,"mousemove touchmove",this.onDrag).off("mouseup touchend",this.onDrop).off([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)}beforeDestruct(){this.onDragEnd(),this.j.e.off("mousedown touchstart dragstart",this.onDragStart),this.removeDragListeners()}}(0,r.__decorate)([S.autobind],nt.prototype,"onDragStart",null),(0,r.__decorate)([(0,S.throttle)((e=>e.j.defaultTimeout/10))],nt.prototype,"onDrag",null),(0,r.__decorate)([S.autobind],nt.prototype,"onDragEnd",null),(0,r.__decorate)([S.autobind],nt.prototype,"onDrop",null);const at=(e,t,i,o)=>{var s;const r=e.createInside.element(i),n=e.createInside.element("br");r.appendChild(n),o&&o.cssText&&r.setAttribute("style",o.cssText),e.s.insertNode(r,!1,!1),e.s.setCursorBefore(n);const a=e.s.createRange();return a.setStartBefore("br"!==i.toLowerCase()?n:r),a.collapse(!0),e.s.selectRange(a),I.i.safeRemove(t),(0,c.scrollIntoViewIfNeeded)(r,e.editor,e.ed),null===(s=e.events)||void 0===s||s.fire("synchro"),r};class lt extends O{constructor(){super(...arguments),this.brMode=!1,this.defaultTag=a.PARAGRAPH}afterInit(e){this.defaultTag=e.o.enter.toLowerCase(),this.brMode=this.defaultTag===a.BR.toLowerCase(),e.o.enterBlock||(e.o.enterBlock=this.brMode?a.PARAGRAPH:this.defaultTag),e.e.off(".enter").on("keydown.enter",(t=>{if(t.key===a.KEY_ENTER){const i=e.e.fire("beforeEnter",t);return void 0!==i?i:(e.s.isCollapsed()||e.execCommand("Delete"),e.s.focus(),this.onEnter(t),!1)}}))}onEnter(e){const t=this.j,i=t.selection,o=this.defaultTag;let s=i.current(!1);s&&s!==t.editor||(s=t.createInside.text(a.INVISIBLE_SPACE),i.insertNode(s),i.select(s));let r=this.getBlockWrapper(s);const n=I.i.isTag(r,"li");if((!n||e.shiftKey)&&!this.checkBR(s,e.shiftKey))return!1;if(r||this.hasPreviousBlock(s)||(r=this.wrapText(s)),!r||r===s)return at(t,null,n?"li":o),!1;if(!this.checkUnsplittableBox(r))return!1;if(n&&I.i.isEmpty(r))return this.enterInsideEmptyLIelement(r),!1;const l=r.tagName.toLowerCase()===this.defaultTag||n,c=i.cursorOnTheRight(r),d=i.cursorOnTheLeft(r);if(!l&&(c||d)){let e=null;return e=c?i.setCursorAfter(r):i.setCursorBefore(r),at(t,e,this.defaultTag),void(d&&!c&&i.setCursorIn(r,!0))}i.splitSelection(r)}getBlockWrapper(e,t=a.IS_BLOCK){let i=e;const o=this.j.editor;do{if(!i||i===o)break;if(t.test(i.nodeName))return I.i.isTag(i,"li")?i:this.getBlockWrapper(i.parentNode,/^li$/i)||i;i=i.parentNode}while(i&&i!==o);return null}checkBR(e,t){const i=I.i.closest(e,["pre","blockquote"],this.j.editor);if(this.brMode||t&&!i||!t&&i){const e=this.j.createInside.element("br");return this.j.s.insertNode(e,!0),(0,c.scrollIntoViewIfNeeded)(e,this.j.editor,this.j.ed),!1}return!0}wrapText(e){let t=e;I.i.up(t,(e=>{e&&e.hasChildNodes()&&e!==this.j.editor&&(t=e)}),this.j.editor);const i=I.i.wrapInline(t,this.j.o.enter,this.j);if(I.i.isEmpty(i)){const e=this.j.createInside.element("br");i.appendChild(e),this.j.s.setCursorBefore(e)}return i}hasPreviousBlock(e){const t=this.j;return!!I.i.prev(e,(e=>I.i.isBlock(e,t.ew)||I.i.isImage(e,t.ew)),t.editor)}checkUnsplittableBox(e){const t=this.j,i=t.selection;if(!I.i.canSplitBlock(e,t.ew)){const e=t.createInside.element("br");return i.insertNode(e,!1),i.setCursorAfter(e),!1}return!0}enterInsideEmptyLIelement(e){let t=null;const i=I.i.closest(e,["ol","ul"],this.j.editor);if(i){if(I.i.prev(e,(e=>I.i.isTag(e,"li")),i))if(I.i.next(e,(e=>I.i.isTag(e,"li")),i)){const o=this.j.s.createRange();o.setStartBefore(i),o.setEndAfter(e);const s=o.extractContents();i.parentNode&&i.parentNode.insertBefore(s,i),t=this.j.s.setCursorBefore(i)}else t=this.j.s.setCursorAfter(i);else t=this.j.s.setCursorBefore(i);I.i.safeRemove(e),at(this.j,t,this.defaultTag),(0,c.$$)("li",i).length||I.i.safeRemove(i)}}beforeDestruct(e){e.e.off("keydown.enter")}}function ct(e){if(e.o.showMessageErrors){let t;const i=e.c.div("jodit_error_box_for_messages"),o=()=>{t=5,(0,c.toArray)(i.childNodes).forEach((o=>{(0,c.css)(i,"bottom",t+"px"),t+=o.offsetWidth+e.o.showMessageErrorOffsetPx}))};e.e.on("beforeDestruct",(()=>{I.i.safeRemove(i)})).on("errorMessage",((t,s,r)=>{e.workplace.appendChild(i);const n=e.c.div("active "+(s||""),t);i.appendChild(n),o(),e.async.setTimeout((()=>{n.classList.remove("active"),e.async.setTimeout((()=>{I.i.safeRemove(n),o()}),300)}),r||e.o.showMessageErrorTime)}))}}function dt(e){e.registerButton({name:"font",group:"font"}).registerButton({name:"fontsize",group:"font"});const t=(t,i,o)=>{switch(t){case"fontsize":e.s.applyStyle({fontSize:(0,c.normalizeSize)(o)});break;case"fontname":e.s.applyStyle({fontFamily:o})}return e.e.fire("synchro"),!1};e.registerCommand("fontsize",t).registerCommand("fontname",t)}function ht(e){e.registerButton({name:"paragraph",group:"font"}),e.registerCommand("formatblock",((t,i,o)=>(e.s.applyStyle(void 0,{element:o}),e.setEditorValue(),!1)))}function ut(e){e.registerButton({name:"fullsize"});let t=!1,i=0,o=0,s=!1;const r=()=>{e.events&&(t?(i=(0,c.css)(e.container,"height",void 0,!0),o=(0,c.css)(e.container,"width",void 0,!0),(0,c.css)(e.container,{height:e.ow.innerHeight,width:e.ow.innerWidth}),s=!0):s&&(0,c.css)(e.container,{height:i||"auto",width:o||"auto"}))},n=i=>{var o;if(e.container){if(void 0===i&&(i=!e.container.classList.contains("jodit_fullsize")),e.setMod("fullsize",i),e.o.fullsize=i,t=i,e.container.classList.toggle("jodit_fullsize",i),e.toolbar&&((0,c.isJoditObject)(e)&&e.toolbarContainer.appendChild(e.toolbar.container),(0,c.css)(e.toolbar.container,"width","auto")),e.o.globalFullSize){let t=e.container.parentNode;for(;t&&t.nodeType!==Node.DOCUMENT_NODE;)t.classList.toggle("jodit_fullsize-box_true",i),t=t.parentNode;r()}null===(o=e.events)||void 0===o||o.fire("afterResize")}};e.o.globalFullSize&&e.e.on(e.ow,"resize",r),e.e.on("afterInit afterOpen",(()=>{var t;e.toggleFullSize(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.fullsize)})).on("toggleFullSize",n).on("beforeDestruct",(()=>{t&&n(!1)})).on("beforeDestruct",(()=>{e.events&&e.e.off(e.ow,"resize",r)}))}n.D.prototype.showMessageErrors=!0,n.D.prototype.showMessageErrorTime=3e3,n.D.prototype.showMessageErrorOffsetPx=3,n.D.prototype.defaultFontSizePoints="px",n.D.prototype.controls.fontsize={command:"fontSize",data:{cssRule:"font-size"},list:["8","9","10","11","12","14","16","18","24","30","36","48","60","72","96"],exec:(e,t,{control:i})=>(0,c.memorizeExec)(e,t,{control:i},(t=>{var o;return"fontsize"===(null===(o=i.command)||void 0===o?void 0:o.toLowerCase())?`${t}${e.o.defaultFontSizePoints}`:t})),childTemplate:(e,t,i)=>`${i}${e.o.defaultFontSizePoints}`,tooltip:"Font size",isChildActive(e,t){var i,o;const s=e.s.current(),r=(null===(i=t.data)||void 0===i?void 0:i.cssRule)||"font-size",n=(null===(o=t.data)||void 0===o?void 0:o.normalize)||(t=>/pt$/i.test(t)&&"pt"===e.o.defaultFontSizePoints?t.replace(/pt$/i,""):t);if(s){const i=I.i.closest(s,(t=>I.i.isBlock(t,e.ew)||t&&I.i.isElement(t)),e.editor)||e.editor,o=(0,c.css)(i,r);return!(!o||!t.args||n(""+t.args[0])!==n(""+o))}return!1}},n.D.prototype.controls.font={...n.D.prototype.controls.fontsize,command:"fontname",list:{"":"Default","Helvetica,sans-serif":"Helvetica","Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","'Times New Roman',Times,serif":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},childTemplate:(e,t,i)=>`${i}`,data:{cssRule:"font-family",normalize:e=>e.toLowerCase().replace(/['"]+/g,"").replace(/[^a-z0-9]+/g,",")},tooltip:"Font family"},n.D.prototype.controls.paragraph={command:"formatBlock",update(e){const t=e.j,i=e.control,o=t.s.current();if(o&&t.o.textIcons){const s=(I.i.closest(o,(e=>I.i.isBlock(e,t.ew)),t.editor)||t.editor).nodeName.toLowerCase(),r=i.list;e&&i.data&&i.data.currentValue!==s&&r&&r[s]&&(t.o.textIcons?e.state.text=s:e.state.icon.name=s,i.data.currentValue=s)}return!1},exec:c.memorizeExec,data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote"},isChildActive(e,t){const i=e.s.current();if(i){const o=I.i.closest(i,(t=>I.i.isBlock(t,e.ew)),e.editor);return!(!o||o===e.editor||void 0===t.args||o.nodeName.toLowerCase()!==t.args[0])}return!1},isActive(e,t){const i=e.s.current();if(i){const o=I.i.closest(i,(t=>I.i.isBlock(t,e.ew)),e.editor);return!(!o||o===e.editor||void 0===t.list||I.i.isTag(o,"p")||void 0===t.list[o.nodeName.toLowerCase()])}return!1},childTemplate:(e,t,i)=>`<${t} style="margin:0;padding:0">${e.i18n(i)}`,tooltip:"Insert format block"},n.D.prototype.fullsize=!1,n.D.prototype.globalFullSize=!0,n.D.prototype.controls.fullsize={exec(e){e.toggleFullSize()},update(e){const t=e.j,i=t.isFullSize?"shrink":"fullsize";e.state.activated=t.isFullSize,t.o.textIcons?e.state.text=i:e.state.icon.name=i},tooltip:"Open editor in fullsize",mode:a.MODE_SOURCE+a.MODE_WYSIWYG},n.D.prototype.commandToHotkeys={removeFormat:["ctrl+shift+m","cmd+shift+m"],insertOrderedList:["ctrl+shift+7","cmd+shift+7"],insertUnorderedList:["ctrl+shift+8, cmd+shift+8"],selectall:["ctrl+a","cmd+a"]};class pt extends O{constructor(){super(...arguments),this.onKeyPress=e=>{const t=this.specialKeys[e.which],i=(e.key||String.fromCharCode(e.which)).toLowerCase(),o=[t||i];return["alt","ctrl","shift","meta"].forEach((i=>{e[i+"Key"]&&t!==i&&o.push(i)})),(0,c.normalizeKeyAliases)(o.join("+"))},this.specialKeys={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",91:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}}afterInit(e){(0,c.keys)(e.o.commandToHotkeys,!1).forEach((t=>{const i=e.o.commandToHotkeys[t];i&&((0,c.isArray)(i)||(0,c.isString)(i))&&e.registerHotkeyToCommand(i,t)}));let t=!1;e.e.off(".hotkeys").on([e.ow,e.ew],"keydown.hotkeys",(e=>{if(e.key===a.KEY_ESC)return this.j.e.fire("escape",e)})).on("keydown.hotkeys",(i=>{const o=this.onKeyPress(i),s={shouldStop:!0};if(!1===this.j.e.fire(o+".hotkey",i.type,s)){if(s.shouldStop)return t=!0,e.e.stopPropagation("keydown"),!1;i.preventDefault()}}),void 0,!0).on("keyup.hotkeys",(()=>{if(t)return t=!1,e.e.stopPropagation("keyup"),!1}),void 0,!0)}beforeDestruct(e){e.events&&e.e.off(".hotkeys")}}function mt(e){const t=e.options;e.e.on("afterSetMode",(()=>{e.isEditorMode()&&e.s.focus()})).on("generateDocumentStructure.iframe",((e,i)=>{const o=e||i.iframe.contentWindow.document;if(o.open(),o.write(t.iframeDoctype+``+`${t.iframeTitle}`+(t.iframeBaseUrl?``:"")+''),o.close(),t.iframeCSSLinks&&t.iframeCSSLinks.forEach((e=>{const t=o.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),o.head&&o.head.appendChild(t)})),t.iframeStyle){const e=o.createElement("style");e.innerHTML=t.iframeStyle,o.head&&o.head.appendChild(e)}})).on("createEditor",(()=>{if(!t.iframe)return;const i=e.c.element("iframe");i.style.display="block",i.src="about:blank",i.className="jodit-wysiwyg_iframe",i.setAttribute("allowtransparency","true"),i.setAttribute("tabindex",""+t.tabIndex),i.setAttribute("frameborder","0"),e.workplace.appendChild(i),e.iframe=i;const o=e.e.fire("generateDocumentStructure.iframe",null,e);return(0,c.callPromise)(o,(()=>{if(!e.iframe)return;const i=e.iframe.contentWindow.document;e.editorWindow=e.iframe.contentWindow;const o=()=>{(0,c.attr)(i.body,"contenteditable",e.getMode()!==a.MODE_SOURCE&&!e.getReadOnly()||null)},s=e=>{const t=//im,i="{%%BODY%%}",o=t.exec(e);return o&&(e=e.replace(t,i).replace(/]*?)>(.*?)<\/span>/gim,"").replace(/<span([^&]*?)>(.*?)<\/span>/gim,"").replace(i,o[0].replace(/(]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im,"$1").replace(/(]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5").replace(/(<[^<]+?)\sclass="[\s]*"/gim,"$1").replace(/(<[^<]+?)\sstyle="[\s;]*"/gim,"$1").replace(/(<[^<]+?)\sdir="[\s]*"/gim,"$1")),e};if(t.editHTMLDocumentMode){const t=e.element.tagName;if("TEXTAREA"!==t&&"INPUT"!==t)throw(0,c.error)("If enable `editHTMLDocumentMode` - source element should be INPUT or TEXTAREA");e.e.on("beforeGetNativeEditorValue",(()=>s(e.o.iframeDoctype+i.documentElement.outerHTML))).on("beforeSetNativeEditorValue",(t=>!e.isLocked&&(/<(html|body)/i.test(t)?s(i.documentElement.outerHTML)!==s(t)&&(i.open(),i.write(e.o.iframeDoctype+s(t)),i.close(),e.editor=i.body,o(),e.e.fire("prepareWYSIWYGEditor")):i.body.innerHTML=t,!0)))}if(e.editor=i.body,e.e.on("afterSetMode afterInit afterAddPlace",o),"auto"===t.height){i.documentElement&&(i.documentElement.style.overflowY="hidden");const o=e.async.throttle((()=>{e.editor&&e.iframe&&"auto"===t.height&&(0,c.css)(e.iframe,"height",e.editor.offsetHeight)}),e.defaultTimeout/2);e.e.on("change afterInit afterSetMode resize",o).on([e.iframe,e.ew,i.documentElement],"load",o).on(i,"readystatechange DOMContentLoaded",o)}return i.documentElement&&e.e.on(i.documentElement,"mousedown touchend",(()=>{e.s.isFocused()||(e.s.focus(),e.editor===i.body&&e.s.setCursorIn(i.body))})).on(e.ew,"mousedown touchstart keydown keyup touchend click mouseup mousemove scroll",(t=>{var i;null===(i=e.events)||void 0===i||i.fire(e.ow,t)})),!1}))}))}function ft(e){const t=e.o,i=e.i18n.bind(e),o=_.JO.get.bind(_.JO),s=t.filebrowser.ajax.url||t.uploader.url,r=t.image.useImageEditor;return e.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t${o("image")}\n\t\t\t\t\t\t${o("crop")}\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
`)}function gt(e){const t=e.o,i=e.i18n.bind(e),o=_.JO.get.bind(_.JO);return e.c.fromHTML(`
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t${o("lock")}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t`)}n.D.prototype.iframeBaseUrl="",n.D.prototype.iframeTitle="Jodit Editor",n.D.prototype.iframeDoctype="",n.D.prototype.iframeDefaultSrc="about:blank",n.D.prototype.iframeStyle='html{margin:0;padding:0;min-height: 100%;}body{box-sizing:border-box;font-size:13px;line-height:1.6;padding:10px;margin:0;background:transparent;color:#000;position:relative;z-index:2;user-select:auto;margin:0px;overflow:auto;outline:none;}table{width:100%;border:none;border-collapse:collapse;empty-cells: show;max-width: 100%;}th,td{padding: 2px 5px;border:1px solid #ccc;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}p{margin-top:0;}.jodit_editor .jodit_iframe_wrapper{display: block;clear: both;user-select: none;position: relative;}.jodit_editor .jodit_iframe_wrapper:after {position:absolute;content:"";z-index:1;top:0;left:0;right: 0;bottom: 0;cursor: pointer;display: block;background: rgba(0, 0, 0, 0);} .jodit_disabled{user-select: none;-o-user-select: none;-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none}',n.D.prototype.iframeCSSLinks=[],n.D.prototype.editHTMLDocumentMode=!1,n.D.prototype.image={dialogWidth:600,openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editBorderRadius:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0};const vt=e=>(e=(0,c.trim)(e),/^[0-9]+$/.test(e)?e+"px":e),bt=e=>/^[-+]?[0-9.]+px$/.test(""+e)?parseFloat(""+e):e;class yt extends O{constructor(){super(...arguments),this.state={image:new Image,get ratio(){return this.image.naturalWidth/this.image.naturalHeight||1},sizeIsLocked:!0,marginIsLocked:!0}}onChangeMarginIsLocked(){if(!this.form)return;const{marginRight:e,marginBottom:t,marginLeft:i,lockMargin:o}=(0,c.refs)(this.form);[e,t,i].forEach((e=>{(0,c.attr)(e,"disabled",this.state.marginIsLocked||null)})),o.innerHTML=_.JO.get(this.state.marginIsLocked?"lock":"unlock")}onChangeSizeIsLocked(){if(!this.form)return;const{lockSize:e,imageWidth:t}=(0,c.refs)(this.form);e.innerHTML=_.JO.get(this.state.sizeIsLocked?"lock":"unlock"),e.classList.remove("jodit-properties__lock"),e.classList.remove("jodit-properties__unlock"),e.classList.add(this.state.sizeIsLocked?"jodit-properties__lock":"jodit-properties__unlock"),this.j.e.fire(t,"change")}open(){return this.makeForm(),this.j.e.fire("hidePopup"),(0,c.markOwner)(this.j,this.dialog.container),this.state.marginIsLocked=!0,this.state.sizeIsLocked=!0,this.updateValues(),this.dialog.open().setModal(!0).setPosition(),!1}makeForm(){if(this.dialog)return;this.dialog=new q({fullsize:this.j.o.fullsize,globalFullSize:this.j.o.globalFullSize,theme:this.j.o.theme,language:this.j.o.language,minWidth:Math.min(400,screen.width),minHeight:400,buttons:["fullsize","dialog.close"]});const e=this.j,t=e.o,i=e.i18n.bind(e),o={check:(0,m.zx)(e,"ok","Apply"),remove:(0,m.zx)(e,"bin","Delete")};e.e.on(this.dialog,"afterClose",(()=>{this.state.image.parentNode&&t.image.selectImageAfterClose&&e.s.select(this.state.image)})),o.remove.onAction((()=>{e.s.removeNode(this.state.image),this.dialog.close()}));const{dialog:s}=this;s.setHeader(i("Image properties"));const r=(e=>{const{showPreview:t,editSize:i}=e.o.image,o=_.JO.get.bind(_.JO);return e.c.fromHTML(`
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t${o("lock")}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t
`)})(e);this.form=r,s.setContent(r);const{tabsBox:n}=(0,c.refs)(this.form);n&&n.appendChild((0,ot.IL)(e,[{name:"Image",content:ft(e)},{name:"Advanced",content:gt(e)}])),o.check.onAction(this.onApply);const{changeImage:a,editImage:l}=(0,c.refs)(this.form);e.e.on(a,"click",this.openImagePopup),t.image.useImageEditor&&e.e.on(l,"click",this.openImageEditor);const{lockSize:d,lockMargin:h,imageWidth:u,imageHeight:p}=(0,c.refs)(r);d&&e.e.on(d,"click",(()=>{this.state.sizeIsLocked=!this.state.sizeIsLocked})),e.e.on(h,"click",(e=>{this.state.marginIsLocked=!this.state.marginIsLocked,e.preventDefault()}));const f=e=>{if(!(0,c.isNumeric)(u.value)||!(0,c.isNumeric)(p.value))return;const t=parseFloat(u.value),i=parseFloat(p.value);e.target===u?p.value=""+Math.round(t/this.state.ratio):u.value=""+Math.round(i*this.state.ratio)};e.e.on([u,p],"change keydown mousedown paste",(t=>{this.state.sizeIsLocked&&e.async.setTimeout(f.bind(this,t),{timeout:e.defaultTimeout,label:"image-properties-changeSize"})})),s.setFooter([o.remove,o.check]),s.setSize(this.j.o.image.dialogWidth)}updateValues(){const e=this.j.o,{image:t}=this.state,{marginTop:i,marginRight:o,marginBottom:s,marginLeft:r,lockMargin:n,imageSrc:a,id:l,classes:d,align:h,style:u,imageTitle:p,imageAlt:m,borderRadius:f,imageLink:g,imageWidth:v,imageHeight:b,imageLinkOpenInNewTab:y,imageViewSrc:w,lockSize:k}=(0,c.refs)(this.form);(()=>{n.checked=this.state.marginIsLocked,k.checked=this.state.sizeIsLocked})(),a.value=(0,c.attr)(t,"src")||"",w&&(0,c.attr)(w,"src",(0,c.attr)(t,"src")||""),(()=>{p.value=(0,c.attr)(t,"title")||"",m.value=(0,c.attr)(t,"alt")||"";const e=I.i.closest(t,"a",this.j.editor);e?(g.value=(0,c.attr)(e,"href")||"",y.checked="_blank"===(0,c.attr)(e,"target")):(g.value="",y.checked=!1)})(),(()=>{const e=(0,c.attr)(t,"width")||(0,c.css)(t,"width",void 0,!0)||!1,i=(0,c.attr)(t,"height")||(0,c.css)(t,"height",void 0,!0)||!1;v.value=!1!==e?""+bt(e):""+t.offsetWidth,b.value=!1!==i?""+bt(i):""+t.offsetHeight,this.state.sizeIsLocked=(()=>!(!(0,c.isNumeric)(v.value)||!(0,c.isNumeric)(b.value))&&1>Math.abs(parseFloat(v.value)-parseFloat(b.value)*this.state.ratio))()})(),(()=>{if(!e.image.editMargins)return;let n=!0,a=!1;[i,o,s,r].forEach((e=>{const o=(0,c.attr)(e,"data-ref")||"";let s=t.style.getPropertyValue((0,c.kebabCase)(o));if(!s)return a=!0,void(e.value="");/^[0-9]+(px)?$/.test(s)&&(s=parseInt(s,10)),e.value=""+s||"",(a&&e.value||n&&"marginTop"!==o&&e.value!==i.value)&&(n=!1)})),this.state.marginIsLocked=n})(),d.value=((0,c.attr)(t,"class")||"").replace(/jodit_focused_image[\s]*/,""),l.value=(0,c.attr)(t,"id")||"",f.value=""+(parseInt(t.style.borderRadius||"0",10)||"0"),t.style.cssFloat&&-1!==["left","right"].indexOf(t.style.cssFloat.toLowerCase())?h.value=(0,c.css)(t,"float"):"block"===(0,c.css)(t,"display")&&"auto"===t.style.marginLeft&&"auto"===t.style.marginRight&&(h.value="center"),u.value=(0,c.attr)(t,"style")||""}onApply(){const{style:e,imageSrc:t,borderRadius:i,imageTitle:o,imageAlt:s,imageLink:r,imageWidth:n,imageHeight:a,marginTop:l,marginRight:d,marginBottom:h,marginLeft:u,imageLinkOpenInNewTab:p,align:m,classes:f,id:g}=(0,c.refs)(this.form),v=this.j.o,{image:b}=this.state;if(v.image.editStyle&&(0,c.attr)(b,"style",e.value||null),!t.value)return I.i.safeRemove(b),void this.dialog.close();(0,c.attr)(b,"src",t.value),b.style.borderRadius="0"!==i.value&&/^[0-9]+$/.test(i.value)?i.value+"px":"",(0,c.attr)(b,"title",o.value||null),(0,c.attr)(b,"alt",s.value||null);let y=I.i.closest(b,"a",this.j.editor);r.value?(y||(y=I.i.wrap(b,"a",this.j)),(0,c.attr)(y,"href",r.value),(0,c.attr)(y,"target",p.checked?"_blank":null)):y&&y.parentNode&&y.parentNode.replaceChild(b,y),n.value===""+b.offsetWidth&&a.value===""+b.offsetHeight||((0,c.css)(b,{width:(0,c.trim)(n.value)?vt(n.value):null,height:(0,c.trim)(a.value)?vt(a.value):null}),(0,c.attr)(b,"width",null),(0,c.attr)(b,"height",null));const w=[l,d,h,u];v.image.editMargins&&(this.state.marginIsLocked?(0,c.css)(b,"margin",vt(l.value)):w.forEach((e=>{const t=(0,c.attr)(e,"data-ref")||"";(0,c.css)(b,t,vt(e.value))}))),v.image.editClass&&(0,c.attr)(b,"class",f.value||null),v.image.editId&&(0,c.attr)(b,"id",g.value||null),v.image.editAlign&&(m.value?["right","left"].includes(m.value.toLowerCase())?((0,c.css)(b,"float",m.value),(0,c.clearCenterAlign)(b)):(0,c.css)(b,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):((0,c.css)(b,"float")&&-1!==["right","left"].indexOf((""+(0,c.css)(b,"float")).toLowerCase())&&(0,c.css)(b,"float",""),(0,c.clearCenterAlign)(b))),this.j.setEditorValue(),this.dialog.close()}openImageEditor(){const e=(0,c.attr)(this.state.image,"src")||"",t=this.j.c.element("a"),i=()=>{t.host===location.host||H(this.j.i18n("You can only edit your own images. Download this image on the host?"),(e=>{e&&this.j.uploader&&this.j.uploader.uploadRemoteImage(""+t.href,(e=>{B(this.j.i18n("The image has been successfully uploaded to the host!"),(()=>{(0,c.isString)(e.newfilename)&&((0,c.attr)(this.state.image,"src",e.baseurl+e.newfilename),this.updateValues())})).bindDestruct(this.j)}),(e=>{B(this.j.i18n("There was an error loading %s",e.message)).bindDestruct(this.j)}))})).bindDestruct(this.j)};t.href=e,this.j.filebrowser.dataProvider.getPathByUrl(""+t.href).then((i=>{re.call(this.j.filebrowser,t.href,i.name,i.path,i.source,(()=>{const t=(new Date).getTime();(0,c.attr)(this.state.image,"src",e+(-1!==e.indexOf("?")?"":"?")+"&_tmp="+t),this.updateValues()}),(e=>{B(e.message).bindDestruct(this.j)}))})).catch((e=>{B(e.message,i).bindDestruct(this.j)}))}openImagePopup(e){const t=new _.GI(this.j),{changeImage:i}=(0,c.refs)(this.form);t.setZIndex(this.dialog.getZIndex()+1),t.setContent((0,ot.ov)(this.j,{upload:e=>{e.files&&e.files.length&&(0,c.attr)(this.state.image,"src",e.baseurl+e.files[0]),this.updateValues(),t.close()},filebrowser:e=>{e&&(0,c.isArray)(e.files)&&e.files.length&&((0,c.attr)(this.state.image,"src",e.files[0]),t.close(),this.updateValues())}},this.state.image,t.close)).open((()=>(0,c.position)(i))),e.stopPropagation()}afterInit(e){const t=this;e.e.on("afterConstructor changePlace",(()=>{e.e.off(e.editor,".imageproperties").on(e.editor,"dblclick.imageproperties",(i=>{const o=i.target;I.i.isTag(o,"img")&&(e.o.image.openOnDblClick?(t.state.image=o,e.o.readonly||(i.stopImmediatePropagation(),i.preventDefault(),t.open())):(i.stopImmediatePropagation(),e.s.select(o)))}))})).on("openImageProperties.imageproperties",(e=>{this.state.image=e,this.open()}))}beforeDestruct(e){this.dialog&&this.dialog.destruct(),e.e.off(e.editor,".imageproperties").off(".imageproperties")}}function wt(e){e.e.on("change afterInit changePlace",e.async.debounce((()=>{e.editor&&(0,c.$$)("img",e.editor).forEach((t=>{t.__jodit_imageprocessor_binded||(t.__jodit_imageprocessor_binded=!0,t.complete||t.addEventListener("load",(function i(){var o;!e.isInDestruct&&(null===(o=e.e)||void 0===o||o.fire("resize")),t.removeEventListener("load",i)})),e.e.on(t,"mousedown touchstart",(()=>{e.s.select(t)})))}))}),e.defaultTimeout))}function kt(e){e.registerButton({name:"image",group:"media"})}(0,r.__decorate)([(0,S.watch)("state.marginIsLocked")],yt.prototype,"onChangeMarginIsLocked",null),(0,r.__decorate)([(0,S.watch)("state.sizeIsLocked")],yt.prototype,"onChangeSizeIsLocked",null),(0,r.__decorate)([S.autobind],yt.prototype,"onApply",null),(0,r.__decorate)([S.autobind],yt.prototype,"openImageEditor",null),(0,r.__decorate)([S.autobind],yt.prototype,"openImagePopup",null),n.D.prototype.controls.image={popup(e,t,i,o){let s=null;t&&!I.i.isText(t)&&I.i.isHTMLElement(t,e.ew)&&(I.i.isTag(t,"img")||(0,c.$$)("img",t).length)&&(s=I.i.isTag(t,"img")?t:(0,c.$$)("img",t)[0]);const r=e.s.save();return(0,ot.ov)(e,{filebrowser(t){e.s.restore(r),t.files&&t.files.forEach((i=>e.s.insertImage(t.baseurl+i,null,e.o.imageDefaultWidth))),o()},upload:!0,async url(t,i){e.s.restore(r);const n=s||e.createInside.element("img");n.setAttribute("src",t),n.setAttribute("alt",i),s||await e.s.insertImage(n,null,e.o.imageDefaultWidth),o()}},s,o)},tags:["img"],tooltip:"Insert Image"},n.D.prototype.controls.indent={tooltip:"Increase Indent"};const Ct=e=>"rtl"===e?"marginRight":"marginLeft";function St(e){const t=Ct(e.o.direction);e.registerButton({name:"indent",group:"indent"}).registerButton({name:"outdent",group:"indent"});const i=i=>{const o=[];return e.s.eachSelection((s=>{const r=e.s.save();let n=!!s&&I.i.up(s,(t=>I.i.isBlock(t,e.ew)),e.editor);const l=e.o.enter;if(!n&&s&&(n=I.i.wrapInline(s,l!==a.BR?l:a.PARAGRAPH,e)),!n)return e.s.restore(r),!1;const d=-1!==o.indexOf(n);if(n&&n.style&&!d){o.push(n);let s=n.style[t]?parseInt(n.style[t],10):0;s+=e.o.indentMargin*("outdent"===i?-1:1),n.style[t]=s>0?s+"px":"",(0,c.attr)(n,"style")||n.removeAttribute("style")}e.s.restore(r)})),e.setEditorValue(),!1};e.registerCommand("indent",{exec:i,hotkeys:["ctrl+]","cmd+]"]}),e.registerCommand("outdent",{exec:i,hotkeys:["ctrl+[","cmd+["]})}function Et(e){e.registerButton({name:"hr",group:"insert"}),e.registerCommand("insertHorizontalRule",(()=>{const t=e.createInside.element("hr");e.s.insertNode(t,!1,!1);const i=I.i.closest(t.parentElement,(t=>I.i.isBlock(t,e.ew)),e.editor);i&&I.i.isEmpty(i)&&i!==e.editor&&(I.i.after(i,t),I.i.safeRemove(i));let o=I.i.next(t,(t=>I.i.isBlock(t,e.ew)),e.editor,!1);return o||(o=e.createInside.element(e.o.enter),I.i.after(t,o)),e.s.setCursorIn(o),!1}))}n.D.prototype.controls.outdent={isDisabled(e){const t=e.s.current();if(t){const i=I.i.closest(t,(t=>I.i.isBlock(t,e.ew)),e.editor),o=Ct(e.o.direction);if(i&&i.style&&i.style[o])return 0>=parseInt(i.style[o],10)}return!0},tooltip:"Decrease Indent"},n.D.prototype.indentMargin=10,n.D.prototype.controls.hr={command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},n.D.prototype.toolbarInline=!0,n.D.prototype.toolbarInlineForSelection=!1,n.D.prototype.toolbarInlineDisableFor=[],n.D.prototype.toolbarInlineDisabledButtons=["source"],n.D.prototype.popup={a:i(62).Z,img:i(63).Z,cells:i(64).Z,jodit:[{name:"bin",tooltip:"Delete",exec(e,t){t&&e.s.removeNode(t)}}],"jodit-media":[{name:"bin",tooltip:"Delete",exec(e,t){t&&e.s.removeNode(t)}}],selection:["bold","underline","italic","ul","ol","\n","outdent","indent","fontsize","brush","cut","\n","paragraph","link","align","dots"]};class jt extends O{constructor(){super(...arguments),this.requires=["select"],this.type=null,this.popup=new p.G(this.jodit,!1),this.toolbar=D(this.jodit,this.popup),this.snapRange=null,this.elmsList=(0,c.keys)(this.j.o.popup,!1).filter((e=>!this.isExcludedTarget(e)))}onClick(e){const t=this.elmsList,i=I.i.isTag(e,"img")?e:I.i.closest(e,t,this.j.editor);if(i&&this.canShowPopupForType(i.nodeName.toLowerCase()))return this.showPopup((()=>(0,c.position)(i,this.j)),i.nodeName.toLowerCase(),i),!1}showPopup(e,t,i){if(t=t.toLowerCase(),!this.canShowPopupForType(t))return!1;if(this.type!==t||i!==this.previousTarget){this.previousTarget=i;const e=this.j.o.popup[t];let o;o=(0,c.isFunction)(e)?e(this.j,i,this.popup.close):e,(0,c.isArray)(o)&&(this.toolbar.build(o,i),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,o=this.toolbar.container),this.popup.setContent(o),this.type=t}return this.popup.open(e),!0}hidePopup(e){(0,c.isString)(e)&&e!==this.type||this.popup.close()}onOutsideClick(e){this.popup.close()}canShowPopupForType(e){const t=this.j.o.popup[e.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!t||this.isExcludedTarget(e))}isExcludedTarget(e){return(0,c.splitArray)(this.j.o.toolbarInlineDisableFor).map((e=>e.toLowerCase())).includes(e.toLowerCase())}afterInit(e){this.j.e.on("getDiffButtons.mobile",(t=>{if(this.toolbar===t){const t=this.toolbar.getButtonsNames();return(0,c.toArray)(e.registeredButtons).filter((e=>!this.j.o.toolbarInlineDisabledButtons.includes(e.name))).filter((e=>{const i=(0,c.isString)(e)?e:e.name;return i&&"|"!==i&&"\n"!==i&&!t.includes(i)}))}})).on("hidePopup",this.hidePopup).on("showPopup",((e,t,i)=>{this.showPopup(t,i||((0,c.isString)(e)?e:e.nodeName),(0,c.isString)(e)?void 0:e)})).on("mousedown keydown",this.onSelectionStart).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.addListenersForElements()}onSelectionStart(){this.snapRange=this.j.s.range.cloneRange()}onSelectionEnd(e){if(e&&e.target&&_.u1.closestElement(e.target,p.G))return;const{snapRange:t}=this,{range:i}=this.j.s;t&&!i.collapsed&&i.startContainer===t.startContainer&&i.startOffset===t.startOffset&&i.endContainer===t.endContainer&&i.endOffset===t.endOffset||this.onSelectionChange()}onSelectionChange(){if(!this.j.o.toolbarInlineForSelection)return;const e="selection",t=this.j.s.sel,i=this.j.s.range;(null==t?void 0:t.isCollapsed)||this.isSelectedTarget(i)||this.tableModule.getAllSelectedCells().length?this.type===e&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((()=>i.getBoundingClientRect()),e)}isSelectedTarget(e){const t=e.startContainer;return I.i.isElement(t)&&t===e.endContainer&&I.i.isTag(t.childNodes[e.startOffset],(0,c.keys)(this.j.o.popup,!1))&&e.startOffset===e.endOffset-1}get tableModule(){return this.j.getInstance("Table",this.j.o)}beforeDestruct(e){e.e.off("showPopup").off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.removeListenersForElements()}addListenersForElements(){this.j.e.on(this.elmsList.map((e=>(0,c.camelCase)("click_"+e))).join(" "),this.onClick)}removeListenersForElements(){this.j.e.off(this.elmsList.map((e=>(0,c.camelCase)("click_"+e))).join(" "),this.onClick)}}(0,r.__decorate)([S.autobind],jt.prototype,"onClick",null),(0,r.__decorate)([(0,S.wait)((e=>!e.j.isLocked))],jt.prototype,"showPopup",null),(0,r.__decorate)([(0,S.watch)(":clickEditor"),S.autobind],jt.prototype,"hidePopup",null),(0,r.__decorate)([(0,S.watch)(":outsideClick")],jt.prototype,"onOutsideClick",null),(0,r.__decorate)([S.autobind],jt.prototype,"onSelectionStart",null),(0,r.__decorate)([S.autobind],jt.prototype,"onSelectionEnd",null),(0,r.__decorate)([(0,S.debounce)((e=>e.defaultTimeout))],jt.prototype,"onSelectionChange",null),n.D.prototype.controls.align={name:"left",tooltip:"Align",update(e){const t=e.j,i=e.control,o=t.s.current();if(o){const s=I.i.closest(o,(e=>I.i.isBlock(e,t.ew)),t.editor)||t.editor;let r=""+(0,c.css)(s,"text-align");i.defaultValue&&-1!==i.defaultValue.indexOf(r)&&(r="left"),i.data&&i.data.currentValue!==r&&i.list&&-1!==i.list.indexOf(r)&&(t.o.textIcons?e.state.text=r:e.state.icon.name=r,i.data.currentValue=r)}},isActive(e,t){const i=e.s.current();if(i&&t.defaultValue){const o=I.i.closest(i,(t=>I.i.isBlock(t,e.ew)),e.editor)||e.editor;return-1===t.defaultValue.indexOf(""+(0,c.css)(o,"text-align"))}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},n.D.prototype.controls.center={command:"justifyCenter",css:{"text-align":"center"},tooltip:"Align Center"},n.D.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},n.D.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},n.D.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"};const It=(e,t,i)=>{if(I.i.isNode(t,i.ew)&&I.i.isElement(t))switch(((e,t)=>{I.i.each(e,(e=>{I.i.isHTMLElement(e,t.ew)&&e.style.textAlign&&(e.style.textAlign="",e.style.cssText.trim().length||e.removeAttribute("style"))}))})(t,i),e.toLowerCase()){case"justifyfull":t.style.textAlign="justify";break;case"justifyright":t.style.textAlign="right";break;case"justifyleft":t.style.textAlign="left";break;case"justifycenter":t.style.textAlign="center"}};function _t(e){e.registerButton({name:"align",group:"indent"});const t=t=>(e.s.focus(),e.s.eachSelection((i=>{if(!i)return;let o=I.i.up(i,(t=>I.i.isBlock(t,e.ew)),e.editor);o||(o=I.i.wrapInline(i,e.o.enterBlock,e)),It(t,o,e)})),!1);e.registerCommand("justifyfull",t),e.registerCommand("justifyright",t),e.registerCommand("justifyleft",t),e.registerCommand("justifycenter",t)}n.D.prototype.limitWords=!1,n.D.prototype.limitChars=!1,n.D.prototype.limitHTML=!1;class xt extends O{afterInit(e){const{limitWords:t,limitChars:i}=e.o;if(e&&(t||i)){let t=null;e.e.off(".limit").on("beforePaste.limit",(()=>{t=e.observer.snapshot.make()})).on("keydown.limit keyup.limit beforeEnter.limit beforePaste.limit",this.checkPreventKeyPressOrPaste).on("change.limit",this.checkPreventChanging).on("afterPaste.limit",(()=>{if(this.shouldPreventInsertHTML()&&t)return e.observer.snapshot.restore(t),!1}))}}shouldPreventInsertHTML(e=null,t=""){if(e&&a.COMMAND_KEYS.includes(e.key))return!1;const{jodit:i}=this,{limitWords:o,limitChars:s}=i.o,r=this.splitWords(t||(i.o.limitHTML?i.value:i.text));return!(!o||o>r.length)||!!s&&r.join("").length>=s}checkPreventKeyPressOrPaste(e){if(this.shouldPreventInsertHTML(e))return!1}checkPreventChanging(e,t){const{jodit:i}=this,{limitWords:o,limitChars:s}=i.o,r=i.o.limitHTML?e:(0,c.stripTags)(e),n=this.splitWords(r);(o&&n.length>o||s&&n.join("").length>s)&&(i.value=t)}splitWords(e){return e.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((e=>e.length))}beforeDestruct(e){e.e.off(".limit")}}(0,r.__decorate)([S.autobind],xt.prototype,"checkPreventKeyPressOrPaste",null),(0,r.__decorate)([S.autobind],xt.prototype,"checkPreventChanging",null);var zt=i(40);n.D.prototype.link={formTemplate(e){const{openInNewTabCheckbox:t,noFollowCheckbox:i,modeClassName:o,selectSizeClassName:s,selectMultipleClassName:r,selectOptionsClassName:n}=e.o.link;return new zt.x4(e,[new zt.eC(e,[new zt.u3(e,{name:"url",type:"text",ref:"url_input",label:"URL",placeholder:"http://",required:!0})]),new zt.eC(e,[new zt.u3(e,{name:"content",ref:"content_input",label:"Text"})],{ref:"content_input_box"}),o?new zt.eC(e,["input"===o?new zt.u3(e,{name:"className",ref:"className_input",label:"Class name"}):"select"===o?new zt.Cj(e,{name:"className",ref:"className_select",label:"Class name",size:s,multiple:r,options:n}):null]):null,t?new zt.mA(e,{name:"target",ref:"target_checkbox",label:"Open in new tab"}):null,i?new zt.mA(e,{name:"nofollow",ref:"nofollow_checkbox",label:"No follow"}):null,new zt.eC(e,[new m.y3(e,{name:"unlink",status:"default",text:"Unlink"}),new m.y3(e,{name:"insert",type:"submit",status:"primary",text:"Insert"})],{align:"full"})])},followOnDblClick:!1,processVideoLink:!0,processPastedLink:!0,noFollowCheckbox:!0,openInNewTabCheckbox:!0,modeClassName:"input",selectMultipleClassName:!0,selectSizeClassName:3,selectOptionsClassName:[],hotkeys:["ctrl+k","cmd+k"]},n.D.prototype.controls.unlink={exec(e,t){const i=I.i.closest(t,"a",e.editor);i&&I.i.unwrap(i),e.setEditorValue(),e.e.fire("hidePopup")},tooltip:"Unlink"},n.D.prototype.controls.link={isActive(e){const t=e.s.current();return!(!t||!I.i.closest(t,"a",e.editor))},popup:(e,t,i,o)=>e.e.fire("generateLinkForm.link",t,o),tags:["a"],tooltip:"Insert link"};class Tt extends O{constructor(){super(...arguments),this.buttons=[{name:"link",group:"insert"}]}afterInit(e){e.o.link.followOnDblClick&&e.e.on("dblclick.link",this.onDblClickOnLink),e.o.link.processPastedLink&&e.e.on("processPaste.link",this.onProcessPasteLink),e.e.on("generateLinkForm.link",this.generateForm),e.registerCommand("openLinkDialog",{exec:()=>{const t=new q({resizable:!1}),i=this.generateForm(e.s.current(),(()=>{t.close()}));i.container.classList.add("jodit-dialog_alert"),t.setContent(i),t.open(),e.async.requestIdleCallback((()=>{const{url_input:e}=(0,c.refs)(i.container);null==e||e.focus()}))},hotkeys:e.o.link.hotkeys})}onDblClickOnLink(e){if(!I.i.isTag(e.target,"a"))return;const t=(0,c.attr)(e.target,"href");t&&(location.href=t,e.preventDefault())}onProcessPasteLink(e,t){const{jodit:i}=this;if((0,c.isURL)(t)){if(i.o.link.processVideoLink){const e=(0,c.convertMediaUrlToVideoEmbed)(t);if(e!==t)return i.createInside.fromHTML(e)}const e=i.createInside.element("a");return e.setAttribute("href",t),e.textContent=t,i.e.stopPropagation("processPaste"),e}}generateForm(e,t){const{jodit:i}=this,o=i.i18n.bind(i),{openInNewTabCheckbox:s,noFollowCheckbox:r,formTemplate:n,formClassName:a,modeClassName:l}=i.o.link,d=n(i),h=(0,c.isString)(d)?i.c.fromHTML(d,{target_checkbox_box:s,nofollow_checkbox_box:r}):d,u=I.i.isElement(h)?h:h.container,p=(0,c.refs)(u),{insert:m,unlink:f,content_input_box:g}=p,{target_checkbox:v,nofollow_checkbox:b,url_input:y}=p,w=I.i.isImage(e,i.ew);let{content_input:k}=p;const{className_input:C}=p,{className_select:S}=p;let E;k||(k=i.c.element("input",{type:"hidden",ref:"content_input"})),a&&u.classList.add(a),w&&I.i.hide(g);const j=()=>E?E.innerText:(0,c.stripTags)(i.s.range.cloneContents(),i.ed);if(E=!(!e||!I.i.closest(e,"a",i.editor))&&I.i.closest(e,"a",i.editor),!w&&e&&(k.value=j()),E){if(y.value=(0,c.attr)(E,"href")||"",l)switch(l){case"input":C&&(C.value=(0,c.attr)(E,"class")||"");break;case"select":if(S){for(let e=0;S.selectedOptions.length>e;e++){const t=S.options.item(e);t&&(t.selected=!1)}((0,c.attr)(E,"class")||"").split(" ").forEach((e=>{if(e)for(let t=0;S.options.length>t;t++){const i=S.options.item(t);(null==i?void 0:i.value)&&i.value===e&&(i.selected=!0)}}))}}s&&v&&(v.checked="_blank"===(0,c.attr)(E,"target")),r&&b&&(b.checked="nofollow"===(0,c.attr)(E,"rel")),m.textContent=o("Update")}else I.i.hide(f);const _=i.observer.snapshot.make();f&&i.e.on(f,"click",(e=>{i.observer.snapshot.restore(_),E&&I.i.unwrap(E),i.setEditorValue(),t(),e.preventDefault()}));const x=()=>{if(!y.value.trim().length)return y.focus(),y.classList.add("jodit_error"),!1;let e;i.observer.snapshot.restore(_);const o=j()!==k.value.trim();if(E)e=[E];else if(i.s.isCollapsed()){const t=i.createInside.element("a");i.s.insertNode(t),e=[t]}else{const t=i.s.current();e=I.i.isTag(t,["img"])?[I.i.wrap(t,"a",i)]:i.s.wrapInTag("a")}return e.forEach((e=>{var t;if((0,c.attr)(e,"href",y.value),l&&(null!=C?C:S))if("input"===l)""===C.value&&e.hasAttribute("class")&&(0,c.attr)(e,"class",null),""!==C.value&&(0,c.attr)(e,"class",C.value);else if("select"===l){e.hasAttribute("class")&&(0,c.attr)(e,"class",null);for(let i=0;S.selectedOptions.length>i;i++){const o=null===(t=S.selectedOptions.item(i))||void 0===t?void 0:t.value;o&&e.classList.add(o)}}w||(k.value.trim().length?o&&(e.textContent=k.value):e.textContent=y.value),s&&v&&(0,c.attr)(e,"target",v.checked?"_blank":null),r&&b&&(0,c.attr)(e,"rel",b.checked?"nofollow":null)})),i.setEditorValue(),t(),!1};return I.i.isElement(h)?i.e.on(h,"submit",(e=>(e.preventDefault(),e.stopImmediatePropagation(),x(),!1))):h.onSubmit(x),h}beforeDestruct(e){e.e.off("generateLinkForm.link",this.generateForm).off("dblclick.link",this.onDblClickOnLink).off("processPaste.link",this.onProcessPasteLink)}}function Lt(e){const t="jodit_fake_wrapper",{mediaFakeTag:i,mediaBlocks:o,mediaInFakeBlock:s}=e.options;s&&e.e.on("afterGetValueFromEditor",(e=>{const o=RegExp(`<${i}[^>]+data-${t}[^>]+>(.+?)`,"ig");o.test(e.value)&&(e.value=e.value.replace(o,"$1"))})).on("change afterInit afterSetMode changePlace",e.async.debounce((()=>{e.isDestructed||e.getMode()===a.MODE_SOURCE||(0,c.$$)(o.join(","),e.editor).forEach((o=>{(0,c.dataBind)(o,t)||((0,c.dataBind)(o,t,!0),(o=>{if(o.parentNode&&(0,c.attr)(o.parentNode,"data-jodit_iframe_wrapper"))o=o.parentNode;else{const s=e.createInside.fromHTML(`<${i} data-jodit-temp="1" contenteditable="false" draggable="true" data-${t}="1">`);s.style.display="inline-block"===o.style.display?"inline-block":"block",s.style.width=o.offsetWidth+"px",s.style.height=o.offsetHeight+"px",o.parentNode&&o.parentNode.insertBefore(s,o),s.appendChild(o),o=s}e.e.off(o,"mousedown.select touchstart.select").on(o,"mousedown.select touchstart.select",(()=>{e.s.setCursorAfter(o)}))})(o))}))}),e.defaultTimeout))}function At(e){e.registerButton({name:"video",group:"media"})}function Dt(e){e.registerButton({name:"file",group:"media"})}function Mt(e){let t=0,i=(0,c.splitArray)(e.o.buttons);e.e.on("touchend",(i=>{if(i.changedTouches&&i.changedTouches.length){const o=(new Date).getTime();o-t>e.o.mobileTapTimeout&&(t=o,e.s.insertCursorAtPoint(i.changedTouches[0].clientX,i.changedTouches[0].clientY))}})).on("getDiffButtons.mobile",(t=>{if(t===e.toolbar){const t=(0,c.splitArray)(e.o.buttons),o=(0,P.q)(i);return t.reduce(((e,t)=>((0,P.A)(t)?e.push({...t,buttons:t.buttons.filter((e=>!o.has(e)))}):o.has(t)||e.push(t),e)),[])}})),e.o.toolbarAdaptive&&e.e.on("resize afterInit recalcAdaptive changePlace afterAddPlace",(()=>{if(!e.o.toolbar)return;const t=e.container.offsetWidth,o=(0,c.splitArray)(e.o.sizeLG>t?e.o.sizeMD>t?e.o.sizeSM>t?e.o.buttonsXS:e.o.buttonsSM:e.o.buttonsMD:e.o.buttons);""+o!=""+i&&(i=o,e.e.fire("closeAllPopups"),e.toolbar.setRemoveButtons(e.o.removeButtons).build(i.concat(e.o.extraButtons)))})).on(e.ow,"load",(()=>e.e.fire("recalcAdaptive")))}(0,r.__decorate)([S.autobind],Tt.prototype,"onDblClickOnLink",null),(0,r.__decorate)([S.autobind],Tt.prototype,"onProcessPasteLink",null),(0,r.__decorate)([S.autobind],Tt.prototype,"generateForm",null),n.D.prototype.mediaFakeTag="jodit-media",n.D.prototype.mediaInFakeBlock=!0,n.D.prototype.mediaBlocks=["video","audio"],n.D.prototype.controls.video={popup(e,t,i,o){const s=new zt.x4(e,[new zt.eC(e,[new zt.u3(e,{name:"url",required:!0,label:"URL",placeholder:"https://",validators:["url"]})]),new zt.eC(e,[(0,m.zx)(e,"","Insert","primary").onAction((()=>s.submit()))])]),r=new zt.x4(e,[new zt.eC(e,[new zt.GJ(e,{name:"code",required:!0,label:"Embed code"})]),new zt.eC(e,[(0,m.zx)(e,"","Insert","primary").onAction((()=>r.submit()))])]),n=[],a=e.s.save(),l=t=>{e.s.restore(a),e.s.insertHTML(t),o()};return n.push({icon:"link",name:"Link",content:s.container},{icon:"source",name:"Code",content:r.container}),s.onSubmit((e=>{l((0,c.convertMediaUrlToVideoEmbed)(e.url))})),r.onSubmit((e=>{l(e.code)})),(0,ot.IL)(e,n)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"},n.D.prototype.controls.file={popup(e,t,i,o){const s=(t,i="")=>{e.s.insertNode(e.createInside.fromHTML(`${i||t}`))};let r=null;return t&&(I.i.isTag(t,"a")||I.i.closest(t,"a",e.editor))&&(r=I.i.isTag(t,"a")?t:I.i.closest(t,"a",e.editor)),(0,ot.ov)(e,{filebrowser(e){e.files&&e.files.forEach((t=>s(e.baseurl+t))),o()},upload:!0,url(e,t){r?(r.setAttribute("href",e),r.setAttribute("title",t)):s(e,t),o()}},r,o,!1)},tags:["a"],tooltip:"Insert file"},n.D.prototype.mobileTapTimeout=300,n.D.prototype.toolbarAdaptive=!0,n.D.prototype.controls.dots={mode:a.MODE_SOURCE+a.MODE_WYSIWYG,popup(e,t,i,o,s){let r=i.data;return void 0===r&&(r={toolbar:D(e),rebuild(){var t;if(s){const i=e.e.fire("getDiffButtons.mobile",s.closest(_.bz));if(i&&r){r.toolbar.build((0,c.splitArray)(i));const o=(null===(t=e.toolbar.firstButton)||void 0===t?void 0:t.container.offsetWidth)||36;r.toolbar.container.style.width=3*(o+4)+"px"}}}},i.data=r),r.rebuild(),r.toolbar},tooltip:"Show all"};const Pt=(e,t,{control:i})=>{const o="button"+i.command,s=i.args&&i.args[0]||(0,c.dataBind)(e,o);(0,c.dataBind)(e,o,s),e.execCommand(i.command,!1,s)};function Rt(e){const t=e=>/insert(un)?orderedlist/i.test(e),i=()=>I.i.up(e.s.current(),(e=>e&&/^UL|OL$/i.test(e.nodeName)),e.editor),o=(e,t)=>{"default"!==t&&t?e.style.setProperty("list-style-type",t):e.style.removeProperty("list-style-type")};e.e.on("beforeCommand",((e,s,r)=>{if(t(e)&&r){const t=i();if(t&&!((e,t)=>{const i=e.style.listStyleType;return i===t||!i&&"default"===t})(t,r)&&(I.i.isTag(t,"ul")&&/unordered/i.test(e)||I.i.isTag(t,"ol")&&!/unordered/i.test(e)))return o(t,r),!1}})).on("afterCommand",((s,r,n)=>{if(t(s)){const t=i();t&&(o(t,n),e.createInside.applyCreateAttributes(t),t.querySelectorAll("li").forEach((t=>{e.createInside.applyCreateAttributes(t)})));const s=[],r=e=>{I.i.isTag(e,["p","h1","h2","h3","h4","h5","h6"])&&s.push(e)};if(t&&(r(t.parentNode),t.querySelectorAll("li").forEach((e=>r(e.firstChild))),s.length)){const i=e.s.save();(0,c.toArray)(t.childNodes).forEach((e=>{I.i.isTag(e.lastChild,"br")&&I.i.safeRemove(e.lastChild)})),s.forEach((e=>I.i.unwrap(e))),e.s.restore(i)}e.setEditorValue()}}))}n.D.prototype.controls.ul={command:"insertUnorderedList",tags:["ul"],tooltip:"Insert Unordered List",list:{default:"Default",circle:"Circle",disc:"Dot",square:"Quadrate"},exec:Pt},n.D.prototype.controls.ol={command:"insertOrderedList",tags:["ol"],tooltip:"Insert Ordered List",list:{default:"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},exec:Pt},n.D.prototype.showPlaceholder=!0,n.D.prototype.useInputsPlaceholder=!0,n.D.prototype.placeholder="Type something";class qt extends O{constructor(){super(...arguments),this.addNativeListeners=()=>{this.j.e.off(this.j.editor,"input.placeholder keydown.placeholder").on(this.j.editor,"input.placeholder keydown.placeholder",this.toggle)},this.addEvents=()=>{const e=this.j;e.o.useInputsPlaceholder&&e.element.hasAttribute("placeholder")&&(this.placeholderElm.innerHTML=(0,c.attr)(e.element,"placeholder")||""),e.e.fire("placeholder",this.placeholderElm.innerHTML),e.e.off(".placeholder").on("changePlace.placeholder",this.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",this.toggle).on(window,"load",this.toggle),this.addNativeListeners(),this.toggle()}}afterInit(e){e.o.showPlaceholder&&(this.placeholderElm=e.c.fromHTML(``),"rtl"===e.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),e.e.on("readonly",(e=>{e?this.hide():this.toggle()})).on("changePlace",this.addEvents),this.addEvents())}show(){const e=this.j;if(e.o.readonly)return;let t=0,i=0;const o=e.s.current(),s=o&&I.i.closest(o,(t=>I.i.isBlock(t,e.ew)),e.editor)||e.editor,r=e.ew.getComputedStyle(s);if(e.workplace.appendChild(this.placeholderElm),I.i.isElement(e.editor.firstChild)){const o=e.ew.getComputedStyle(e.editor.firstChild);t=parseInt(o.getPropertyValue("margin-top"),10),i=parseInt(o.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(o.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=o.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(r.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=r.getPropertyValue("line-height");(0,c.css)(this.placeholderElm,{display:"block",textAlign:r.getPropertyValue("text-align"),marginTop:Math.max(parseInt(r.getPropertyValue("margin-top"),10),t),marginLeft:Math.max(parseInt(r.getPropertyValue("margin-left"),10),i)})}hide(){I.i.safeRemove(this.placeholderElm)}toggle(){const e=this.j;e.editor&&!e.isInDestruct&&(e.getRealMode()===a.MODE_WYSIWYG&&(e=>{if(!e.firstChild)return!0;const t=e.firstChild;if(a.MAY_BE_REMOVED_WITH_KEY.test(t.nodeName)||/^(TABLE)$/i.test(t.nodeName))return!1;const i=I.i.next(t,(e=>e&&!I.i.isEmptyTextNode(e)),e);return I.i.isText(t)&&!i?I.i.isEmptyTextNode(t):!i&&I.i.each(t,(e=>!I.i.isTag(e,["ul","li","ol"])&&(I.i.isEmpty(e)||I.i.isTag(e,"br"))))})(e.editor)?this.show():this.hide())}beforeDestruct(e){this.hide(),e.e.off(".placeholder").off(window,"load",this.toggle)}}(0,r.__decorate)([(0,S.debounce)((e=>e.defaultTimeout/10),!0)],qt.prototype,"toggle",null),n.D.prototype.controls.redo={mode:a.MODE_SPLIT,isDisabled:e=>!e.observer.stack.canRedo(),tooltip:"Redo"},n.D.prototype.controls.undo={mode:a.MODE_SPLIT,isDisabled:e=>!e.observer.stack.canUndo(),tooltip:"Undo"};class Bt extends O{constructor(){super(...arguments),this.buttons=[{name:"undo",group:"history"},{name:"redo",group:"history"}]}beforeDestruct(){}afterInit(e){const t=t=>(e.observer[t](),!1);e.registerCommand("redo",{exec:t,hotkeys:["ctrl+y","ctrl+shift+z","cmd+y","cmd+shift+z"]}),e.registerCommand("undo",{exec:t,hotkeys:["ctrl+z","cmd+z"]})}}n.D.prototype.useIframeResizer=!0,n.D.prototype.useTableResizer=!0,n.D.prototype.useImageResizer=!0,n.D.prototype.resizer={showSize:!0,hideSizeTimeout:1e3,min_width:10,min_height:10};const Nt="__jodit-resizer_binded";class Ht extends O{constructor(){super(...arguments),this.LOCK_KEY="resizer",this.element=null,this.isResized=!1,this.isShown=!1,this.start_x=0,this.start_y=0,this.width=0,this.height=0,this.ratio=0,this.rect=this.j.c.fromHTML('
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t100x100\n\t\t\t
'),this.sizeViewer=this.rect.getElementsByTagName("span")[0],this.onResize=e=>{if(this.isResized){const t=e.clientX-this.start_x,i=e.clientY-this.start_y;if(!this.element)return;const o=this.handle.className;let s=0,r=0;I.i.isTag(this.element,"img")?(t?(s=this.width+(o.match(/left/)?-1:1)*t,r=Math.round(s/this.ratio)):(r=this.height+(o.match(/top/)?-1:1)*i,s=Math.round(r*this.ratio)),s>(0,c.innerWidth)(this.j.editor,this.j.ow)&&(s=(0,c.innerWidth)(this.j.editor,this.j.ow),r=Math.round(s/this.ratio))):(s=this.width+(o.match(/left/)?-1:1)*t,r=this.height+(o.match(/top/)?-1:1)*i),s>this.j.o.resizer.min_width&&(0,c.css)(this.element,"width",this.rect.parentNode.offsetWidth>s?s:"100%"),r>this.j.o.resizer.min_height&&(0,c.css)(this.element,"height",r),this.updateSize(),this.showSizeViewer(this.element.offsetWidth,this.element.offsetHeight),e.stopImmediatePropagation()}},this.onClickOutside=e=>{this.isShown&&(this.isResized?(this.j.unlock(),this.isResized=!1,this.j.setEditorValue(),e.stopImmediatePropagation(),this.j.e.off(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)):this.hide())},this.onClickElement=(e,t)=>{this.element===e&&this.isShown||(this.element=e,this.show(),I.i.isTag(this.element,"img")&&!this.element.complete&&this.j.e.on(this.element,"load",this.updateSize))},this.updateSize=()=>{if(!this.isInDestruct&&this.isShown&&this.element&&this.rect){const e=(0,c.offset)(this.rect.parentNode||this.j.od.documentElement,this.j,this.j.od,!0),t=(0,c.offset)(this.element,this.j,this.j.ed),i=parseInt(this.rect.style.left||"0",10),o=this.rect.offsetWidth,s=this.rect.offsetHeight,r=t.top-1-e.top,n=t.left-1-e.left;parseInt(this.rect.style.top||"0",10)===r&&i===n&&o===this.element.offsetWidth&&s===this.element.offsetHeight||((0,c.css)(this.rect,{top:r,left:n,width:this.element.offsetWidth,height:this.element.offsetHeight}),this.j.events&&(this.j.e.fire(this.element,"changesize"),isNaN(i)||this.j.e.fire("resize")))}},this.hideSizeViewer=()=>{this.sizeViewer.style.opacity="0"}}afterInit(e){(0,c.$$)("i",this.rect).forEach((t=>{e.e.on(t,"mousedown.resizer touchstart.resizer",this.onClickHandle.bind(this,t))})),C.TB.on("hideHelpers",this.hide),e.e.on("readonly",(e=>{e&&this.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(e=>{const t=/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>.*?<\/iframe>.*?)<\/jodit>/gi;t.test(e.value)&&(e.value=e.value.replace(t,"$1"))})).on("hideResizer",this.hide).on("change afterInit afterSetMode",this.onChangeEditor),this.addEventListeners(),this.onChangeEditor()}addEventListeners(){const e=this.j;e.e.off(e.editor,".resizer").off(e.ow,".resizer").on(e.editor,"keydown.resizer",(e=>{this.isShown&&e.key===a.KEY_DELETE&&this.element&&!I.i.isTag(this.element,"table")&&this.onDelete(e)})).on(e.ow,"resize.resizer",this.updateSize).on(e.ow,"mouseup.resizer keydown.resizer touchend.resizer",this.onClickOutside).on([e.ow,e.editor],"scroll.resizer",(()=>{this.isShown&&!this.isResized&&this.hide()}))}onClickHandle(e,t){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=e,t.preventDefault(),t.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResized=!0,this.start_x=t.clientX,this.start_y=t.clientY,this.j.e.fire("hidePopup"),this.j.lock(this.LOCK_KEY),this.j.e.on(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)}onDelete(e){this.element&&("JODIT"!==this.element.tagName?this.j.s.select(this.element):(I.i.safeRemove(this.element),this.hide(),e.preventDefault()))}onChangeEditor(){const e=this.j;this.isShown&&(this.element&&this.element.parentNode?this.updateSize():this.hide()),e.isDestructed||(0,c.$$)("img, table, iframe",e.editor).forEach((t=>{e.getMode()!==a.MODE_SOURCE&&!t[Nt]&&(I.i.isTag(t,"iframe")&&e.o.useIframeResizer||I.i.isTag(t,"img")&&e.o.useImageResizer||I.i.isTag(t,"table")&&e.o.useTableResizer)&&(t[Nt]=!0,this.bind(t))}))}bind(e){let t;if(I.i.isTag(e,"iframe")){const i=e;(0,c.attr)(e.parentNode,"-jodit_iframe_wrapper")?e=e.parentNode:(t=this.j.createInside.fromHTML(''),(0,c.css)(t,{display:"inline-block"===e.style.display?"inline-block":"block",width:e.offsetWidth,height:e.offsetHeight}),e.parentNode&&e.parentNode.insertBefore(t,e),t.appendChild(e),e=t),this.j.e.off(e,"mousedown.select touchstart.select").on(e,"mousedown.select touchstart.select",(()=>{this.j.s.select(e)})).off(e,"changesize").on(e,"changesize",(()=>{i.setAttribute("width",e.offsetWidth+"px"),i.setAttribute("height",e.offsetHeight+"px")}))}this.j.e.on(e,"dragstart",this.hide).on(e,"mousedown",(t=>{a.IS_IE&&I.i.isTag(e,"img")&&t.preventDefault()})).on(e,"click",(t=>this.onClickElement(e,t)))}showSizeViewer(e,t){this.j.o.resizer.showSize&&(this.sizeViewer.offsetWidth>e||this.sizeViewer.offsetHeight>t?this.hideSizeViewer():(this.sizeViewer.style.opacity="1",this.sizeViewer.textContent=`${e} x ${t}`,this.j.async.setTimeout(this.hideSizeViewer,{timeout:this.j.o.resizer.hideSizeTimeout,label:"hideSizeViewer"})))}show(){this.j.o.readonly||this.isShown||(this.isShown=!0,this.rect.parentNode||((0,c.markOwner)(this.j,this.rect),this.j.workplace.appendChild(this.rect)),this.j.isFullSize&&(this.rect.style.zIndex=""+(0,c.css)(this.j.container,"zIndex")),this.updateSize())}hide(){this.isResized=!1,this.isShown=!1,this.element=null,I.i.safeRemove(this.rect)}beforeDestruct(e){this.hide(),C.TB.off("hideHelpers",this.hide),e.e.off(this.j.ow,".resizer").off(".resizer")}}(0,r.__decorate)([(0,S.debounce)()],Ht.prototype,"onChangeEditor",null),(0,r.__decorate)([S.autobind],Ht.prototype,"hide",null),n.D.prototype.useSearch=!0,n.D.prototype.controls.find={tooltip:"Find",icon:"search",exec(e,t,{control:i}){switch(i.args&&i.args[0]){case"findPrevious":e.e.fire("searchPrevious");break;case"findNext":e.e.fire("searchNext");break;case"replace":e.execCommand("openReplaceDialog");break;default:e.execCommand("openSearchDialog")}},list:{search:"Find",findNext:"Find Next",findPrevious:"Find Previous",replace:"Replace"},childTemplate:(e,t,i)=>i};class Ot extends O{constructor(){super(...arguments),this.buttons=[{name:"find",group:"search"}],this.template=``,this.isOpened=!1,this.selInfo=null,this.current=null,this.eachMap=(e,t,i)=>{I.i.findWithCurrent(e,(e=>!(!e||!t(e))),this.j.editor,i?"nextSibling":"previousSibling",i?"firstChild":"lastChild")},this.updateCounters=()=>{if(!this.isOpened)return;this.counterBox.style.display=this.queryInput.value.length?"inline-block":"none";const e=this.calcCounts(this.queryInput.value,this.j.s.range);this.counterBox.textContent=e.join("/")},this.calcCounts=(e,t=!1)=>{const i=[];let o=0,s=0,r=!1,n=this.j.editor.firstChild;for(;n&&e.length;)if(r=this.find(n,e,!0,0,r||this.j.ed.createRange()),r){if(this.boundAlreadyWas(r,i))break;i.push(r),n=r.startContainer,s+=1,t&&this.boundAlreadyWas(t,[r])&&(o=s)}else n=null;return[o,s]},this.findAndReplace=(e,t)=>{const i=this.find(e,t,!0,0,this.j.s.range);if(i&&i.startContainer&&i.endContainer){const e=this.j.ed.createRange();try{if(i&&i.startContainer&&i.endContainer){e.setStart(i.startContainer,i.startOffset),e.setEnd(i.endContainer,i.endOffset),e.deleteContents();const t=this.j.createInside.text(this.replaceInput.value);e.insertNode(t),this.j.s.select(t),this.tryScrollToElement(t)}}catch(e){}return!0}return!1},this.findAndSelect=(e,t,i)=>{const o=this.find(e,t,i,0,this.j.s.range);if(o&&o.startContainer&&o.endContainer){const e=this.j.ed.createRange();try{e.setStart(o.startContainer,o.startOffset),e.setEnd(o.endContainer,o.endOffset),this.j.s.selectRange(e)}catch(e){}return this.tryScrollToElement(o.startContainer),this.current=o.startContainer,this.updateCounters(),!0}return!1},this.find=(e,t,i,o,s)=>{if(e&&t.length){let r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null};if(this.eachMap(e,(e=>{if(I.i.isText(e)&&null!=e.nodeValue&&e.nodeValue.length){let a=e.nodeValue;i||e!==s.startContainer?i&&e===s.endContainer&&(a=o?a.substr(0,s.startOffset):a.substr(s.endOffset)):a=o?a.substr(s.endOffset):a.substr(0,s.startOffset);const l=i?r+a:a+r,d=Ot.findSomePartOfString(t,l,i);if(!1!==d){let s=Ot.findSomePartOfString(t,a,i);!0===s?s=(0,c.trim)(t):!1===s&&(s=Ot.findSomePartOfString(a,t,i),!0===s&&(s=(0,c.trim)(a)));let h=Ot.getSomePartOfStringIndex(t,a,i)||0;if((i&&!o||!i&&o)&&e.nodeValue.length-a.length>0&&(h+=e.nodeValue.length-a.length),null==n.startContainer&&(n.startContainer=e,n.startOffset=h),!0===d)return n.endContainer=e,n.endOffset=h,n.endOffset+=s.length,!0;r=l}else r="",n={startContainer:null,startOffset:null,endContainer:null,endOffset:null}}else I.i.isBlock(e,this.j.ew)&&""!==r&&(r=i?r+" ":" "+r);return!1}),i),n.startContainer&&n.endContainer)return n;if(!o)return this.current=i?this.j.editor.firstChild:this.j.editor.lastChild,this.find(this.current,t,i,o+1,s)}return!1},this.open=(e=!1)=>{this.isOpened||(this.searchBox.classList.add("jodit-search_active"),this.isOpened=!0),this.calcSticky(this.j.e.fire("getStickyState.sticky")||!1),this.j.e.fire("hidePopup"),this.searchBox.classList.toggle("jodit-search_replace",e),this.current=this.j.s.current(),this.selInfo=this.j.s.save();const t=""+(this.j.s.sel||"");t&&(this.queryInput.value=t),this.updateCounters(),t?this.queryInput.select():this.queryInput.focus()},this.close=()=>{this.isOpened&&(this.selInfo&&(this.j.s.restore(this.selInfo),this.selInfo=null),this.searchBox.classList.remove("jodit-search_active"),this.isOpened=!1)}}static getSomePartOfStringIndex(e,t,i=!0){return this.findSomePartOfString(e,t,i,!0)}static findSomePartOfString(e,t,i=!0,o=!1){e=(0,c.trim)(e.toLowerCase().replace(a.SPACE_REG_EXP()," ")),t=t.toLowerCase();let s=i?0:t.length-1,r=i?0:e.length-1,n=0,l=null;const d=i?1:-1,h=[];for(;void 0!==t[s];s+=d){const c=e[r]===t[s];if(c||null!=l&&a.SPACE_REG_EXP().test(t[s])?(null!=l&&i||(l=s),h.push(t[s]),c&&(n+=1,r+=d)):(l=null,h.length=0,n=0,r=i?0:e.length-1),n===e.length)return!o||l}return o?null!=l&&l:!!h.length&&(i?h.join(""):h.reverse().join(""))}boundAlreadyWas(e,t){return t.some((t=>t.startContainer===e.startContainer&&t.endContainer===e.endContainer&&t.startOffset===e.startOffset&&t.endOffset===e.endOffset),!1)}tryScrollToElement(e){let t=I.i.closest(e,I.i.isElement,this.j.editor);t||(t=I.i.prev(e,I.i.isElement,this.j.editor)),t&&t!==this.j.editor&&t.scrollIntoView()}afterInit(e){if(e.o.useSearch){const t=this;t.searchBox=e.c.fromHTML(t.template);const{query:i,replace:o,cancel:s,next:r,prev:n,replaceBtn:l,counterBox:d}=(0,c.refs)(t.searchBox);t.queryInput=i,t.replaceInput=o,t.closeButton=s,t.nextButton=r,t.prevButton=n,t.replaceButton=l,t.counterBox=d;const h=()=>{e.workplace.appendChild(this.searchBox),e.e.off(this.j.container,"keydown.search").on(this.j.container,"keydown.search",(i=>{if(e.getRealMode()===a.MODE_WYSIWYG)switch(i.key){case a.KEY_ESC:this.close();break;case a.KEY_F3:t.queryInput.value&&(e.e.fire(i.shiftKey?"searchPrevious":"searchNext"),i.preventDefault())}}))};h(),e.e.on("changePlace",h).on(t.closeButton,"click",this.close).on(t.queryInput,"mousedown",(()=>{e.s.isFocused()&&(e.s.removeMarkers(),t.selInfo=e.s.save())})).on(t.replaceButton,"click",(i=>{t.findAndReplace(e.s.current()||e.editor.firstChild,t.queryInput.value),this.updateCounters(),i.preventDefault(),i.stopImmediatePropagation()})).on([t.nextButton,t.prevButton],"click",(function(i){e.e.fire(t.nextButton===this?"searchNext":"searchPrevious"),i.preventDefault(),i.stopImmediatePropagation()})).on(this.queryInput,"keydown",this.j.async.debounce((t=>{switch(t.key){case a.KEY_ENTER:t.preventDefault(),t.stopImmediatePropagation(),e.e.fire("searchNext")&&this.close();break;default:this.updateCounters()}}),this.j.defaultTimeout)).on("beforeSetMode.search",(()=>{this.close()})).on("keydown.search mousedown.search",(()=>{this.selInfo&&(e.s.removeMarkers(),this.selInfo=null),this.isOpened&&(this.current=this.j.s.current(),this.updateCounters())})).on("searchNext.search searchPrevious.search",(()=>t.isOpened?t.findAndSelect(e.s.current()||e.editor.firstChild,t.queryInput.value,"searchNext"===e.e.current):t.open())).on("search.search",((t,i=!0)=>{e.execCommand("search",t,i)})).on("toggleSticky.search",this.calcSticky),e.registerCommand("search",{exec:(i,o,s=!0)=>(t.findAndSelect(e.s.current()||e.editor.firstChild,o||"",s),!1)}).registerCommand("openSearchDialog",{exec:()=>(t.open(),!1),hotkeys:["ctrl+f","cmd+f"]}).registerCommand("openReplaceDialog",{exec:()=>(e.o.readonly||t.open(!0),!1),hotkeys:["ctrl+h","cmd+h"]})}}beforeDestruct(e){var t;I.i.safeRemove(this.searchBox),null===(t=e.events)||void 0===t||t.off(".search")}calcSticky(e){if(this.isOpened)if(this.searchBox.classList.toggle("jodit-search_sticky",e),e){const e=(0,c.position)(this.j.toolbarContainer);(0,c.css)(this.searchBox,{top:e.top+e.height,left:e.left+e.width})}else(0,c.css)(this.searchBox,{top:null,left:null})}}(0,r.__decorate)([S.autobind],Ot.prototype,"calcSticky",null);class Ft extends O{constructor(){super(...arguments),this.proxyEventsList=["click","mousedown","touchstart","mouseup","touchend"]}afterInit(e){this.proxyEventsList.forEach((t=>{e.e.on(t+".inline-popup",this.onStartSelection)}))}beforeDestruct(e){this.proxyEventsList.forEach((t=>{e.e.on(t+".inline-popup",this.onStartSelection)}))}onStartSelection(e){const{j:t}=this;let i,o=e.target;for(;void 0===i&&o&&o!==t.editor;)i=t.e.fire((0,c.camelCase)(e.type+"_"+o.nodeName.toLowerCase()),o,e),o=o.parentElement;"click"===e.type&&void 0===i&&o===t.editor&&t.e.fire(e.type+"Editor",o,e)}onOutsideClick(e){const t=e.target;I.i.up(t,(e=>e===this.j.editor))||_.u1.closestElement(t,_.GI)||this.j.e.fire("outsideClick",e)}}(0,r.__decorate)([S.autobind],Ft.prototype,"onStartSelection",null),(0,r.__decorate)([(0,S.watch)("ow:click")],Ft.prototype,"onOutsideClick",null),n.D.prototype.width="auto",n.D.prototype.minWidth=200,n.D.prototype.maxWidth="100%",n.D.prototype.allowResizeX=!1,n.D.prototype.allowResizeY=!0,n.D.prototype.height="auto",n.D.prototype.minHeight=200,n.D.prototype.maxHeight="auto",n.D.prototype.saveHeightInStorage=!1;let Wt=class extends O{constructor(){super(...arguments),this.isResized=!1,this.start={x:0,y:0,w:0,h:0},this.handle=this.j.c.div("jodit-editor__resize",'')}afterInit(e){"auto"!==e.o.height&&(e.o.allowResizeX||e.o.allowResizeY)&&(e.e.on("toggleFullSize.resizeHandler",(()=>{this.handle.style.display=e.isFullSize?"none":"block"})).on(this.handle,"mousedown touchstart",this.onHandleResizeStart).on(e.ow,"mouseup touchsend",this.onHandleResizeEnd),e.container.appendChild(this.handle))}onHandleResizeStart(e){this.isResized=!0,this.start.x=e.clientX,this.start.y=e.clientY,this.start.w=this.j.container.offsetWidth,this.start.h=this.j.container.offsetHeight,this.j.lock(),this.j.e.on(this.j.ow,"mousemove touchmove",this.onHandleResize),e.preventDefault()}onHandleResize(e){this.isResized&&(this.j.o.allowResizeY&&this.j.e.fire("setHeight",this.start.h+e.clientY-this.start.y),this.j.o.allowResizeX&&this.j.e.fire("setWidth",this.start.w+e.clientX-this.start.x),this.j.e.fire("resize"))}onHandleResizeEnd(){this.isResized&&(this.isResized=!1,this.j.e.off(this.j.ow,"mousemove touchmove",this.onHandleResize),this.j.unlock())}beforeDestruct(e){I.i.safeRemove(this.handle),this.j.e.off(this.j.ow,"mouseup touchsend",this.onHandleResizeEnd)}};Wt.requires=["size"],Wt=(0,r.__decorate)([S.autobind],Wt);let Vt=class extends O{constructor(){super(...arguments),this.resizeWorkspaces=this.j.async.debounce(this.resizeWorkspaceImd,this.j.defaultTimeout,!0)}afterInit(e){e.e.on("setHeight.size",this.setHeight).on("setWidth.size",this.setWidth).on("afterInit.size changePlace.size",this.initialize,void 0,!0).on(e.ow,"load.size",this.resizeWorkspaces).on("afterInit.size resize.size afterUpdateToolbar.size scroll.size afterResize.size toggleFullSize.size",this.resizeWorkspaces),this.initialize()}initialize(){const{j:e}=this;if(e.o.inline)return;let{height:t}=e.o;if(e.o.saveHeightInStorage&&"auto"!==t){const i=e.storage.get("height");i&&(t=i)}(0,c.css)(e.editor,{minHeight:"100%"}),(0,c.css)(e.container,{minHeight:e.o.minHeight,maxHeight:e.o.maxHeight,minWidth:e.o.minWidth,maxWidth:e.o.maxWidth}),this.setHeight(t),this.setWidth(e.o.width)}setHeight(e){if((0,c.isNumber)(e)){const{minHeight:t,maxHeight:i}=this.j.o;(0,c.isNumber)(t)&&t>e&&(e=t),(0,c.isNumber)(i)&&e>i&&(e=i)}(0,c.css)(this.j.container,"height",e),this.j.o.saveHeightInStorage&&this.j.storage.set("height",e),this.resizeWorkspaceImd()}setWidth(e){if((0,c.isNumber)(e)){const{minWidth:t,maxWidth:i}=this.j.o;(0,c.isNumber)(t)&&t>e&&(e=t),(0,c.isNumber)(i)&&e>i&&(e=i)}(0,c.css)(this.j.container,"width",e),this.resizeWorkspaceImd()}getNotWorkHeight(){var e,t;return((null===(e=this.j.toolbarContainer)||void 0===e?void 0:e.offsetHeight)||0)+((null===(t=this.j.statusbar)||void 0===t?void 0:t.getHeight())||0)+2}resizeWorkspaceImd(){if(!this.j||this.j.isDestructed||!this.j.o||this.j.o.inline)return;if(!this.j.container||!this.j.container.parentNode)return;const e=((0,c.css)(this.j.container,"minHeight")||0)-this.getNotWorkHeight();if((0,c.isNumber)(e)&&e>0&&([this.j.workplace,this.j.iframe,this.j.editor].map((t=>{t&&(0,c.css)(t,"minHeight",e)})),this.j.e.fire("setMinHeight",e)),(0,c.isNumber)(this.j.o.maxHeight)){const e=this.j.o.maxHeight-this.getNotWorkHeight();[this.j.workplace,this.j.iframe,this.j.editor].map((t=>{t&&(0,c.css)(t,"maxHeight",e)})),this.j.e.fire("setMaxHeight",e)}this.j.container&&(0,c.css)(this.j.workplace,"height","auto"!==this.j.o.height||this.j.isFullSize?this.j.container.offsetHeight-this.getNotWorkHeight():"auto")}beforeDestruct(e){this.j.e.off(this.j.ow,"load.size",this.resizeWorkspaces).off(".size")}};Vt=(0,r.__decorate)([S.autobind],Vt),n.D.prototype.beautifyHTML=!a.IS_IE,n.D.prototype.sourceEditor="ace",n.D.prototype.sourceEditorNativeOptions={showGutter:!0,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},n.D.prototype.sourceEditorCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"],n.D.prototype.beautifyHTMLCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js","https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify-html.min.js"],n.D.prototype.controls.source={mode:a.MODE_SPLIT,exec(e){e.toggleMode()},isActive:e=>e.getRealMode()===a.MODE_SOURCE,tooltip:"Change mode"};class Ut{constructor(e,t,i,o){this.jodit=e,this.container=t,this.toWYSIWYG=i,this.fromWYSIWYG=o,this.className="",this.isReady=!1}get j(){return this.jodit}onReady(){this.replaceUndoManager(),this.isReady=!0,this.j.e.fire(this,"ready")}onReadyAlways(e){var t;this.isReady?e():null===(t=this.j.events)||void 0===t||t.on(this,"ready",e)}}class Yt extends Ut{constructor(){super(...arguments),this.autosize=this.j.async.debounce((()=>{this.instance.style.height="auto",this.instance.style.height=this.instance.scrollHeight+"px"}),this.j.defaultTimeout)}init(e){this.instance=e.c.element("textarea",{class:"jodit-source__mirror"}),this.container.appendChild(this.instance),e.e.on(this.instance,"mousedown keydown touchstart input",e.async.debounce(this.toWYSIWYG,e.defaultTimeout)).on("setMinHeight.source",(e=>{(0,c.css)(this.instance,"minHeight",e)})).on(this.instance,"change keydown mousedown touchstart input",this.autosize).on("afterSetMode.source",this.autosize).on(this.instance,"mousedown focus",(t=>{e.e.fire(t.type,t)})),this.autosize(),this.onReady()}destruct(){I.i.safeRemove(this.instance)}getValue(){return this.instance.value}setValue(e){this.instance.value=e}insertRaw(e){const t=this.getValue();if(0>this.getSelectionStart())this.setValue(t+e);else{const i=this.getSelectionStart(),o=this.getSelectionEnd();this.setValue(t.substring(0,i)+e+t.substring(o,t.length))}}getSelectionStart(){return this.instance.selectionStart}getSelectionEnd(){return this.instance.selectionEnd}setSelectionRange(e,t=e){this.instance.setSelectionRange(e,t)}focus(){this.instance.focus()}setPlaceHolder(e){this.instance.setAttribute("placeholder",e)}setReadOnly(e){e?this.instance.setAttribute("readonly","true"):this.instance.removeAttribute("readonly")}selectAll(){this.instance.select()}replaceUndoManager(){const{observer:e}=this.jodit;this.j.e.on(this.instance,"keydown",(t=>{if((t.ctrlKey||t.metaKey)&&"z"===t.key)return t.shiftKey?e.redo():e.undo(),this.setSelectionRange(this.getValue().length),!1}))}}class $t extends Ut{constructor(){super(...arguments),this.className="jodit_ace_editor",this.proxyOnFocus=e=>{this.j.e.fire("focus",e)},this.proxyOnMouseDown=e=>{this.j.e.fire("mousedown",e)}}aceExists(){return void 0!==this.j.ow.ace}getLastColumnIndex(e){return this.instance.session.getLine(e).length}getLastColumnIndices(){const e=this.instance.session.getLength(),t=[];let i=0;for(let o=0;e>o;o++)i+=this.getLastColumnIndex(o),o>0&&(i+=1),t[o]=i;return t}getRowColumnIndices(e){const t=this.getLastColumnIndices();if(t[0]>=e)return{row:0,column:e};let i=1;for(let o=1;t.length>o;o++)e>t[o]&&(i=o+1);return{row:i,column:e-t[i-1]-1}}setSelectionRangeIndices(e,t){const i=this.getRowColumnIndices(e),o=this.getRowColumnIndices(t);this.instance.getSelection().setSelectionRange({start:i,end:o})}getIndexByRowColumn(e,t){return this.getLastColumnIndices()[e]-this.getLastColumnIndex(e)+t}init(e){const t=()=>{if(void 0!==this.instance||!this.aceExists())return;const t=this.j.c.div("jodit-source__mirror-fake");this.container.appendChild(t),this.instance=e.ow.ace.edit(t),this.instance.setTheme(e.o.sourceEditorNativeOptions.theme),this.instance.renderer.setShowGutter(e.o.sourceEditorNativeOptions.showGutter),this.instance.getSession().setMode(e.o.sourceEditorNativeOptions.mode),this.instance.setHighlightActiveLine(e.o.sourceEditorNativeOptions.highlightActiveLine),this.instance.getSession().setUseWrapMode(!0),this.instance.setOption("indentedSoftWrap",!1),this.instance.setOption("wrap",e.o.sourceEditorNativeOptions.wrap),this.instance.getSession().setUseWorker(!1),this.instance.$blockScrolling=1/0,this.instance.on("change",this.toWYSIWYG),this.instance.on("focus",this.proxyOnFocus),this.instance.on("mousedown",this.proxyOnMouseDown),e.getRealMode()!==a.MODE_WYSIWYG&&this.setValue(this.getValue());const i=this.j.async.debounce((()=>{e.isInDestruct||(this.instance.setOption("maxLines","auto"!==e.o.height?e.workplace.offsetHeight/this.instance.renderer.lineHeight:1/0),this.instance.resize())}),2*this.j.defaultTimeout);e.e.on("afterResize afterSetMode",i),i(),this.onReady()};e.e.on("afterSetMode",(()=>{e.getRealMode()!==a.MODE_SOURCE&&e.getMode()!==a.MODE_SPLIT||(this.fromWYSIWYG(),t())})),t(),this.aceExists()||(0,c.loadNext)(e,e.o.sourceEditorCDNUrlsJS).then((()=>{e.isInDestruct||t()}))}destruct(){var e,t;this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),null===(t=null===(e=this.j)||void 0===e?void 0:e.events)||void 0===t||t.off("aceInited.source")}setValue(e){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const t=this.j.e.fire("beautifyHTML",e);(0,c.isString)(t)&&(e=t)}this.instance.setValue(e),this.instance.clearSelection()}getValue(){return this.instance.getValue()}setReadOnly(e){this.instance.setReadOnly(e)}focus(){this.instance.focus()}getSelectionStart(){const e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.start.row,e.start.column)}getSelectionEnd(){const e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.end.row,e.end.column)}selectAll(){this.instance.selection.selectAll()}insertRaw(e){const t=this.instance.selection.getCursor(),i=this.instance.session.insert(t,e);this.instance.selection.setRange({start:t,end:i},!1)}setSelectionRange(e,t){this.setSelectionRangeIndices(e,t)}setPlaceHolder(e){}replaceUndoManager(){const{observer:e}=this.jodit;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec(){e.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec(){e.redo()}})}}function Kt(e,t,i,o,s){let r;switch(e){case"ace":if(!t.o.shadowRoot){r=new $t(t,i,o,s);break}default:r=new Yt(t,i,o,s)}return r.init(t),r.onReadyAlways((()=>{r.setReadOnly(t.o.readonly)})),r}class Gt extends O{constructor(){super(...arguments),this.buttons=[{name:"source",group:"source"}],this.__lock=!1,this.__oldMirrorValue="",this.tempMarkerStart="{start-jodit-selection}",this.tempMarkerStartReg=/{start-jodit-selection}/g,this.tempMarkerEnd="{end-jodit-selection}",this.tempMarkerEndReg=/{end-jodit-selection}/g,this.selInfo=[],this.insertHTML=e=>{var t;null===(t=this.sourceEditor)||void 0===t||t.insertRaw(e),this.toWYSIWYG()},this.fromWYSIWYG=(e=!1)=>{if(!this.__lock||!0===e){this.__lock=!0;const e=this.j.getEditorValue(!1);e!==this.getMirrorValue()&&this.setMirrorValue(e),this.__lock=!1}},this.toWYSIWYG=()=>{if(this.__lock)return;const e=this.getMirrorValue();e!==this.__oldMirrorValue&&(this.__lock=!0,this.j.setEditorValue(e),this.__lock=!1,this.__oldMirrorValue=e)},this.getNormalPosition=(e,t)=>{let i=e;for(;i>0;){if(i--,"<"===t[i]&&void 0!==t[i+1]&&t[i+1].match(/[\w/]+/i))return i;if(">"===t[i])return e}return e},this.__clear=e=>e.replace(a.INVISIBLE_SPACE_REG_EXP(),""),this.selectAll=()=>{var e;null===(e=this.sourceEditor)||void 0===e||e.selectAll()},this.onSelectAll=e=>{if("selectall"===e.toLowerCase()&&this.j.getRealMode()===a.MODE_SOURCE)return this.selectAll(),!1},this.getSelectionStart=()=>{var e,t;return null!==(t=null===(e=this.sourceEditor)||void 0===e?void 0:e.getSelectionStart())&&void 0!==t?t:0},this.getSelectionEnd=()=>{var e,t;return null!==(t=null===(e=this.sourceEditor)||void 0===e?void 0:e.getSelectionEnd())&&void 0!==t?t:0},this.saveSelection=()=>{if(this.j.getRealMode()===a.MODE_WYSIWYG)this.selInfo=this.j.s.save()||[],this.j.setEditorValue(),this.fromWYSIWYG(!0);else{if(this.selInfo.length=0,this.j.o.editHTMLDocumentMode)return;const e=this.getMirrorValue();if(this.getSelectionStart()===this.getSelectionEnd()){const t=this.j.s.marker(!0);this.selInfo[0]={startId:t.id,collapsed:!0,startMarker:t.outerHTML};const i=this.getNormalPosition(this.getSelectionStart(),this.getMirrorValue());this.setMirrorValue(e.substr(0,i)+this.__clear(this.selInfo[0].startMarker)+e.substr(i))}else{const t=this.j.s.marker(!0),i=this.j.s.marker(!1);this.selInfo[0]={startId:t.id,endId:i.id,collapsed:!1,startMarker:this.__clear(t.outerHTML),endMarker:this.__clear(i.outerHTML)};const o=this.getNormalPosition(this.getSelectionStart(),e),s=this.getNormalPosition(this.getSelectionEnd(),e);this.setMirrorValue(e.substr(0,o)+this.selInfo[0].startMarker+e.substr(o,s-o)+this.selInfo[0].endMarker+e.substr(s))}this.toWYSIWYG()}},this.removeSelection=()=>{if(!this.selInfo.length)return;if(this.j.getRealMode()===a.MODE_WYSIWYG)return this.__lock=!0,this.j.s.restore(this.selInfo),void(this.__lock=!1);let e=this.getMirrorValue(),t=0,i=0;try{if(this.selInfo[0].startMarker&&(e=e.replace(/]+data-jodit-selection_marker="start"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerStart)),this.selInfo[0].endMarker&&(e=e.replace(/]+data-jodit-selection_marker="end"[^>]*>[<>]*?<\/span>/gim,this.tempMarkerEnd)),!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const t=this.j.e.fire("beautifyHTML",e);(0,c.isString)(t)&&(e=t)}t=e.indexOf(this.tempMarkerStart),i=t,e=e.replace(this.tempMarkerStartReg,""),this.selInfo[0].collapsed&&-1!==t||(i=e.indexOf(this.tempMarkerEnd),-1===t&&(t=i)),e=e.replace(this.tempMarkerEndReg,"")}finally{e=e.replace(this.tempMarkerEndReg,"").replace(this.tempMarkerStartReg,"")}this.setMirrorValue(e),this.setMirrorSelectionRange(t,i),this.toWYSIWYG(),this.setFocusToMirror()},this.setMirrorSelectionRange=(e,t)=>{var i;null===(i=this.sourceEditor)||void 0===i||i.setSelectionRange(e,t)},this.onReadonlyReact=()=>{var e;null===(e=this.sourceEditor)||void 0===e||e.setReadOnly(this.j.o.readonly)}}getMirrorValue(){var e;return(null===(e=this.sourceEditor)||void 0===e?void 0:e.getValue())||""}setMirrorValue(e){var t;null===(t=this.sourceEditor)||void 0===t||t.setValue(e)}setFocusToMirror(){var e;null===(e=this.sourceEditor)||void 0===e||e.focus()}initSourceEditor(e){var t;if("area"!==e.o.sourceEditor){const t=Kt(e.o.sourceEditor,e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG);t.onReadyAlways((()=>{var i,o;null===(i=this.sourceEditor)||void 0===i||i.destruct(),this.sourceEditor=t,this.fromWYSIWYG(!0),null===(o=e.events)||void 0===o||o.fire("sourceEditorReady",e)}))}else null===(t=this.sourceEditor)||void 0===t||t.onReadyAlways((()=>{var t;this.fromWYSIWYG(!0),null===(t=e.events)||void 0===t||t.fire("sourceEditorReady",e)}))}afterInit(e){if(this.mirrorContainer=e.c.div("jodit-source"),e.workplace.appendChild(this.mirrorContainer),e.e.on("afterAddPlace changePlace afterInit",(()=>{e.workplace.appendChild(this.mirrorContainer)})),this.sourceEditor=Kt("area",e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG),(()=>{e.e.off("beforeSetMode.source afterSetMode.source").on("beforeSetMode.source",this.saveSelection).on("afterSetMode.source",this.removeSelection)})(),this.onReadonlyReact(),e.e.on("insertHTML.source",(t=>{if(!e.o.readonly&&!this.j.isEditorMode())return this.insertHTML(t),!1})).on("readonly.source",this.onReadonlyReact).on("placeholder.source",(e=>{var t;null===(t=this.sourceEditor)||void 0===t||t.setPlaceHolder(e)})).on("beforeCommand.source",this.onSelectAll).on("change.source",this.fromWYSIWYG),e.e.on("beautifyHTML",(e=>e)),e.o.beautifyHTML){const t=()=>{var t,i;const o=e.ow.html_beautify;return!(!o||e.isInDestruct||(null===(i=null===(t=e.events)||void 0===t?void 0:t.off("beautifyHTML"))||void 0===i||i.on("beautifyHTML",(e=>o(e))),0))};t()||(0,c.loadNext)(e,e.o.beautifyHTMLCDNUrlsJS).then(t)}this.fromWYSIWYG(),this.initSourceEditor(e)}beforeDestruct(e){this.sourceEditor&&(this.sourceEditor.destruct(),delete this.sourceEditor),I.i.safeRemove(this.mirrorContainer)}}n.D.prototype.showCharsCounter=!0,n.D.prototype.countHTMLChars=!1,n.D.prototype.showWordsCounter=!0;class Jt extends O{constructor(){super(...arguments),this.charCounter=null,this.wordCounter=null,this.reInit=()=>{this.j.o.showCharsCounter&&this.charCounter&&this.j.statusbar.append(this.charCounter,!0),this.j.o.showWordsCounter&&this.wordCounter&&this.j.statusbar.append(this.wordCounter,!0),this.j.e.off("change keyup",this.calc).on("change keyup",this.calc),this.calc()},this.calc=this.j.async.throttle((()=>{const e=this.j.text;if(this.j.o.showCharsCounter&&this.charCounter){const t=this.j.o.countHTMLChars?this.j.value:e.replace((0,a.SPACE_REG_EXP)(),"");this.charCounter.textContent=this.j.i18n("Chars: %d",t.length)}this.j.o.showWordsCounter&&this.wordCounter&&(this.wordCounter.textContent=this.j.i18n("Words: %d",e.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"").split((0,a.SPACE_REG_EXP)()).filter((e=>e.length)).length))}),this.j.defaultTimeout)}afterInit(){this.charCounter=this.j.c.span(),this.wordCounter=this.j.c.span(),this.j.e.on("afterInit changePlace afterAddPlace",this.reInit),this.reInit()}beforeDestruct(){I.i.safeRemove(this.charCounter),I.i.safeRemove(this.wordCounter),this.j.e.off("afterInit changePlace afterAddPlace",this.reInit),this.charCounter=null,this.wordCounter=null}}n.D.prototype.toolbarSticky=!0,n.D.prototype.toolbarDisableStickyForMobile=!0,n.D.prototype.toolbarStickyOffset=0;class Xt extends O{constructor(){super(...arguments),this.isToolbarSticked=!1,this.createDummy=e=>{a.IS_IE&&!this.dummyBox&&(this.dummyBox=this.j.c.div(),this.dummyBox.classList.add("jodit_sticky-dummy_toolbar"),this.j.container.insertBefore(this.dummyBox,e))},this.addSticky=e=>{this.isToolbarSticked||(this.createDummy(e),this.j.container.classList.add("jodit_sticky"),this.isToolbarSticked=!0),(0,c.css)(e,{top:this.j.o.toolbarStickyOffset||null,width:this.j.container.offsetWidth-2}),a.IS_IE&&this.dummyBox&&(0,c.css)(this.dummyBox,{height:e.offsetHeight})},this.removeSticky=e=>{this.isToolbarSticked&&((0,c.css)(e,{width:"",top:""}),this.j.container.classList.remove("jodit_sticky"),this.isToolbarSticked=!1)}}afterInit(e){e.e.on(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).on("getStickyState.sticky",(()=>this.isToolbarSticked))}onScroll(){const{jodit:e}=this,t=e.ow.pageYOffset||e.od.documentElement&&e.od.documentElement.scrollTop||0,i=(0,c.offset)(e.container,e,e.od,!0),o=e.getMode()===a.MODE_WYSIWYG&&t+e.o.toolbarStickyOffset>i.top&&i.top+i.height>t+e.o.toolbarStickyOffset&&!(e.o.toolbarDisableStickyForMobile&&this.isMobile());if(e.o.toolbarSticky&&!0===e.o.toolbar&&this.isToolbarSticked!==o){const t=e.toolbarContainer;t&&(o?this.addSticky(t):this.removeSticky(t)),e.e.fire("toggleSticky",o)}}isMobile(){return this.j&&this.j.options&&this.j.container&&this.j.o.sizeSM>=this.j.container.offsetWidth}beforeDestruct(e){this.dummyBox&&I.i.safeRemove(this.dummyBox),e.e.off(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).off(".sticky")}}(0,r.__decorate)([(0,S.throttle)()],Xt.prototype,"onScroll",null),n.D.prototype.usePopupForSpecialCharacters=!1,n.D.prototype.specialCharacters=["!",""","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","»","¬","®","¯","°","²","³","´","µ","¶","·","¸","¹","º","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"],n.D.prototype.controls.symbol={icon:"omega",hotkeys:["ctrl+shift+i","cmd+shift+i"],tooltip:"Insert Special Character",popup(e,t,i,o){const s=e.e.fire("generateSpecialCharactersTable.symbols");if(s){if(e.o.usePopupForSpecialCharacters){const t=e.c.div();return t.classList.add("jodit-symbols"),t.appendChild(s),e.e.on(s,"close_dialog",o),t}{B(s,e.i18n("Select Special Character"),void 0,"jodit-symbols").bindDestruct(e);const t=s.querySelector("a");t&&t.focus()}}}};class Zt extends O{constructor(){super(...arguments),this.buttons=[{name:"symbol",group:"insert"}],this.countInRow=17}afterInit(e){e.e.on("generateSpecialCharactersTable.symbols",(()=>{const t=e.c.fromHTML('
'),i=t.querySelector(".jodit-symbols__preview"),o=t.querySelector("table").tBodies[0],s=[];for(let t=0;e.o.specialCharacters.length>t;){const i=e.c.element("tr");for(let o=0;this.countInRow>o&&e.o.specialCharacters.length>t;o+=1,t+=1){const r=e.c.element("td"),n=e.c.fromHTML(`${e.o.specialCharacters[t]}`);s.push(n),r.appendChild(n),i.appendChild(r)}o.appendChild(i)}const r=this;return e.e.on(s,"focus",(function(){i.innerHTML=this.innerHTML})).on(s,"mousedown",(function(t){I.i.isTag(this,"a")&&(e.s.focus(),e.s.insertHTML(this.innerHTML),e.e.fire(this,"close_dialog"),t&&t.preventDefault(),t&&t.stopImmediatePropagation())})).on(s,"mouseenter",(function(){I.i.isTag(this,"a")&&this.focus()})).on(s,"keydown",(t=>{const i=t.target;if(I.i.isTag(i,"a")){const o=parseInt((0,Re.Lj)(i,"-index")||"0",10),n=parseInt((0,Re.Lj)(i,"data-index-j")||"0",10);let l;switch(t.key){case a.KEY_UP:case a.KEY_DOWN:l=t.key===a.KEY_UP?o-r.countInRow:o+r.countInRow,void 0===s[l]&&(l=t.key===a.KEY_UP?Math.floor(s.length/r.countInRow)*r.countInRow+n:n,l>s.length-1&&(l-=r.countInRow)),s[l]&&s[l].focus();break;case a.KEY_RIGHT:case a.KEY_LEFT:l=t.key===a.KEY_LEFT?o-1:o+1,void 0===s[l]&&(l=t.key===a.KEY_LEFT?s.length-1:0),s[l]&&s[l].focus();break;case a.KEY_ENTER:e.e.fire(i,"mousedown"),t.stopImmediatePropagation(),t.preventDefault()}}})),t}))}beforeDestruct(e){e.e.off("generateSpecialCharactersTable.symbols")}}n.D.prototype.table={allowCellSelection:!0,selectionCellStyle:"border: 1px double #1e88e5 !important;",allowCellResize:!0,useExtraClassesOptions:!1},n.D.prototype.controls.table={data:{cols:10,rows:10,classList:{"table table-bordered":"Bootstrap Bordered","table table-striped":"Bootstrap Striped","table table-dark":"Bootstrap Dark"}},popup(e,t,i,o,s){const r=i.data&&i.data.rows?i.data.rows:10,n=i.data&&i.data.cols?i.data.cols:10,a=e.c.fromHTML('
'+(()=>{if(!e.o.table.useExtraClassesOptions)return"";const t=[];if(i.data){const e=i.data.classList;Object.keys(e).forEach((i=>{t.push(``)}))}return t.join("")})()+'
'),l=a.querySelectorAll("span")[0],d=a.querySelectorAll("span")[1],h=a.querySelector(".jodit-form__container"),u=a.querySelector(".jodit-form__options"),p=[],m=r*n;for(let t=0;m>t;t+=1)p[t]||p.push(e.c.element("span",{dataIndex:t}));if(e.e.on(h,"mousemove",((e,t)=>{const i=e.target;if(!I.i.isTag(i,"span"))return;const o=void 0===t||isNaN(t)?parseInt((0,Re.Lj)(i,"-index")||"0",10):t||0,s=Math.ceil((o+1)/n),r=o%n+1;for(let e=0;p.length>e;e+=1)p[e].className=e%n+1>r||Math.ceil((e+1)/n)>s?"":"jodit_hovered";d.textContent=""+r,l.textContent=""+s})).on(h,"touchstart mousedown",(t=>{const i=t.target;if(t.preventDefault(),t.stopImmediatePropagation(),!I.i.isTag(i,"span"))return;const s=parseInt((0,Re.Lj)(i,"-index")||"0",10),r=Math.ceil((s+1)/n),a=s%n+1,l=e.createInside,d=l.element("tbody"),h=l.element("table");h.appendChild(d),h.style.width="100%";let p,m,f=null;for(let e=1;r>=e;e+=1){p=l.element("tr");for(let e=1;a>=e;e+=1)m=l.element("td"),f||(f=m),m.appendChild(l.element("br")),p.appendChild(l.text("\n")),p.appendChild(l.text("\t")),p.appendChild(m);d.appendChild(l.text("\n")),d.appendChild(p)}const g=e.s.current();if(g&&e.s.isCollapsed()){const t=I.i.closest(g,(t=>I.i.isBlock(t,e.ew)),e.editor);t&&t!==e.editor&&!t.nodeName.match(/^TD|TH|TBODY|TABLE|THEADER|TFOOTER$/)&&e.s.setCursorAfter(t)}(0,c.$$)("input[type=checkbox]:checked",u).forEach((e=>{e.value.split(/[\s]+/).forEach((e=>{h.classList.add(e)}))})),e.s.insertNode(l.text("\n")),e.s.insertNode(h,!1),f&&(e.s.setCursorIn(f),(0,c.scrollIntoViewIfNeeded)(f,e.editor,e.ed)),o()})),s&&s.parentElement){for(let t=0;r>t;t+=1){const i=e.c.div();for(let e=0;n>e;e+=1)i.appendChild(p[t*n+e]);h.appendChild(i)}p[0]&&(p[0].className="hovered")}return a},tooltip:"Insert table"};const Qt="table_processor_observer-resize";class ei extends O{constructor(){super(...arguments),this.selectMode=!1,this.resizeDelta=0,this.createResizeHandle=()=>{this.resizeHandler||(this.resizeHandler=this.j.c.div("jodit-table-resizer"),this.j.e.on(this.resizeHandler,"mousedown.table touchstart.table",this.onHandleMouseDown).on(this.resizeHandler,"mouseenter.table",(()=>{this.j.async.clearTimeout(this.hideTimeout)})))},this.hideTimeout=0,this.drag=!1,this.minX=0,this.maxX=0,this.startX=0}get module(){return this.j.getInstance("Table",this.j.o)}get isRTL(){return"rtl"===this.j.o.direction}showResizeHandle(){this.j.async.clearTimeout(this.hideTimeout),this.j.workplace.appendChild(this.resizeHandler)}hideResizeHandle(){this.hideTimeout=this.j.async.setTimeout((()=>{I.i.safeRemove(this.resizeHandler)}),{timeout:this.j.defaultTimeout,label:"hideResizer"})}onHandleMouseDown(e){if(this.j.isLocked)return;this.drag=!0,this.j.e.on(this.j.ow,"mouseup.resize-cells touchend.resize-cells",this.onMouseUp).on(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.startX=e.clientX,this.j.lock(Qt),this.resizeHandler.classList.add("jodit-table-resizer_moved");let t,i=this.workTable.getBoundingClientRect();if(this.minX=0,this.maxX=1e6,null!=this.wholeTable)i=this.workTable.parentNode.getBoundingClientRect(),this.minX=i.left,this.maxX=this.minX+i.width;else{const e=Ce.formalCoordinate(this.workTable,this.workCell,!0);Ce.formalMatrix(this.workTable,((i,o,s)=>{e[1]===s&&(t=i.getBoundingClientRect(),this.minX=Math.max(t.left+a.NEARBY/2,this.minX)),e[1]+(this.isRTL?-1:1)===s&&(t=i.getBoundingClientRect(),this.maxX=Math.min(t.left+t.width-a.NEARBY/2,this.maxX))}))}return!1}onMouseMove(e){if(!this.drag)return;this.j.e.fire("closeAllPopups");let t=e.clientX;const i=(0,c.offset)(this.resizeHandler.parentNode||this.j.od.documentElement,this.j,this.j.od,!0);this.minX>t&&(t=this.minX),t>this.maxX&&(t=this.maxX),this.resizeDelta=t-this.startX+(this.j.o.iframe?i.left:0),this.resizeHandler.style.left=t-(this.j.o.iframe?0:i.left)+"px";const o=this.j.s.sel;o&&o.removeAllRanges()}onMouseUp(e){(this.selectMode||this.drag)&&(this.selectMode=!1,this.j.unlock()),this.resizeHandler&&this.drag&&(this.drag=!1,this.j.e.off(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.resizeHandler.classList.remove("jodit-table-resizer_moved"),this.startX!==e.clientX&&(null==this.wholeTable?this.resizeColumns():this.resizeTable()),this.j.setEditorValue(),this.j.s.focus())}resizeColumns(){const e=this.resizeDelta,t=[];Ce.setColumnWidthByDelta(this.workTable,Ce.formalCoordinate(this.workTable,this.workCell,!0)[1],e,!0,t);const i=(0,c.call)(this.isRTL?I.i.prev:I.i.next,this.workCell,(e=>I.i.isCell(e,this.j.ew)),this.workCell.parentNode);Ce.setColumnWidthByDelta(this.workTable,Ce.formalCoordinate(this.workTable,i)[1],-e,!1,t)}resizeTable(){const e=this.resizeDelta*(this.isRTL?-1:1),t=this.workTable.offsetWidth,i=(0,c.getContentWidth)(this.workTable.parentNode,this.j.ew),o=!this.wholeTable;if(this.isRTL?!o:o)this.workTable.style.width=(t+e)/i*100+"%";else{const o=this.isRTL?"marginRight":"marginLeft",s=parseInt(this.j.ew.getComputedStyle(this.workTable)[o]||"0",10);this.workTable.style.width=(t-e)/i*100+"%",this.workTable.style[o]=(s+e)/i*100+"%"}}setWorkCell(e,t=null){this.wholeTable=t,this.workCell=e,this.workTable=I.i.up(e,(e=>I.i.isTag(e,"table")),this.j.editor)}calcHandlePosition(e,t,i=0,o=0){const s=(0,c.offset)(t,this.j,this.j.ed);if(i>a.NEARBY&&s.width-a.NEARBY>i)return void this.hideResizeHandle();const r=(0,c.offset)(this.j.workplace,this.j,this.j.od,!0),n=(0,c.offset)(e,this.j,this.j.ed);if(this.resizeHandler.style.left=(i>a.NEARBY?s.left+s.width:s.left)-r.left+o+"px",Object.assign(this.resizeHandler.style,{height:n.height+"px",top:n.top-r.top+"px"}),this.showResizeHandle(),i>a.NEARBY){const e=(0,c.call)(this.isRTL?I.i.prev:I.i.next,t,(e=>I.i.isCell(e,this.j.ew)),t.parentNode);this.setWorkCell(t,!!e&&null)}else{const e=(0,c.call)(this.isRTL?I.i.next:I.i.prev,t,(e=>I.i.isCell(e,this.j.ew)),t.parentNode);this.setWorkCell(e||t,!e||null)}}afterInit(e){e.o.table.allowCellResize&&e.e.off(this.j.ow,".resize-cells").off(".resize-cells").on("change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells",(()=>{(0,c.$$)("table",e.editor).forEach(this.observe)})).on(this.j.ow,"scroll.resize-cells",(()=>{if(!this.drag)return;const t=I.i.up(this.workCell,(e=>I.i.isTag(e,"table")),e.editor);if(t){const e=t.getBoundingClientRect();this.resizeHandler.style.top=e.top+"px"}})).on("beforeSetMode.resize-cells",(()=>{this.module.getAllSelectedCells().forEach((t=>{this.module.removeSelection(t),Ce.normalizeTable(I.i.closest(t,"table",e.editor))}))}))}observe(e){(0,c.dataBind)(e,Qt)||((0,c.dataBind)(e,Qt,!0),this.j.e.on(e,"mouseleave.resize-cells",(e=>{this.resizeHandler&&this.resizeHandler!==e.relatedTarget&&this.hideResizeHandle()})).on(e,"mousemove.resize-cells touchmove.resize-cells",(t=>{if(this.j.isLocked)return;const i=I.i.up(t.target,(e=>I.i.isCell(e,this.j.ew)),e);i&&this.calcHandlePosition(e,i,t.offsetX)})),this.createResizeHandle())}beforeDestruct(e){e.events&&(e.e.off(this.j.ow,".resize-cells"),e.e.off(".resize-cells"))}}(0,r.__decorate)([S.autobind],ei.prototype,"onHandleMouseDown",null),(0,r.__decorate)([S.autobind],ei.prototype,"onMouseMove",null),(0,r.__decorate)([S.autobind],ei.prototype,"onMouseUp",null),(0,r.__decorate)([S.autobind],ei.prototype,"observe",null);const ti="table_processor_observer";class ii extends O{constructor(){super(...arguments),this.requires=["select"],this.selectedCell=null}get module(){return this.j.getInstance("Table",this.j.o)}afterInit(e){e.o.table.allowCellSelection&&e.e.on("keydown.select-cells",(e=>{e.key===a.KEY_TAB&&this.unselectCells()})).on("beforeCommand.select-cells",this.onExecCommand).on("afterCommand.select-cells",this.onAfterCommand).on(["clickEditor","mousedownTd","mousedownTh","touchstartTd","touchstartTh"].map((e=>e+".select-cells")).join(" "),this.onStartSelection).on("clickTr",(()=>{if(this.module.getAllSelectedCells().length)return!1}))}onStartSelection(e){if(this.j.o.readonly)return;if(this.unselectCells(),e===this.j.editor)return;const t=I.i.closest(e,"table",this.j.editor);return e&&t?(e.firstChild||e.appendChild(this.j.createInside.element("br")),this.selectedCell=e,this.module.addSelection(e),this.j.e.on(t,"mousemove.select-cells touchmove.select-cells",this.onMove.bind(this,t)).on(t,"mouseup.select-cells touchend.select-cells",this.onStopSelection.bind(this,t)),!1):void 0}onOutsideClick(e){this.unselectCells()}onMove(e,t){if(this.j.o.readonly)return;if(this.j.isLockedNotBy(ti))return;const i=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(!i)return;const o=I.i.closest(i,["td","th"],e);if(!o||!this.selectedCell)return;o!==this.selectedCell&&this.j.lock(ti),this.unselectCells(e);const s=Ce.getSelectedBound(e,[o,this.selectedCell]),r=Ce.formalMatrix(e);for(let e=s[0][0];s[1][0]>=e;e+=1)for(let t=s[0][1];s[1][1]>=t;t+=1)this.module.addSelection(r[e][t]);this.j.e.fire("hidePopup"),t.stopPropagation(),(()=>{const e=this.j.createInside.fromHTML('
 
');o.appendChild(e),this.j.async.setTimeout((()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}),this.j.defaultTimeout/5)})()}onRemoveSelection(e){var t;if(!(null===(t=null==e?void 0:e.buffer)||void 0===t?void 0:t.actionTrigger)&&!this.selectedCell&&this.module.getAllSelectedCells().length)return this.j.unlock(),this.unselectCells(),void this.j.e.fire("hidePopup","cells");this.selectedCell=null}onStopSelection(e,t){if(!this.selectedCell)return;this.j.unlock();const i=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(!i)return;const o=I.i.closest(i,["td","th"],e);if(!o)return;const s=I.i.closest(o,"table",e);if(s&&s!==e)return;const r=Ce.getSelectedBound(e,[o,this.selectedCell]),n=Ce.formalMatrix(e),a=n[r[1][0]][r[1][1]],l=n[r[0][0]][r[0][1]];this.j.e.fire("showPopup",e,(()=>{const e=(0,c.position)(l,this.j),t=(0,c.position)(a,this.j);return{left:e.left,top:e.top,width:t.left-e.left+t.width,height:t.top-e.top+t.height}}),"cells"),(0,c.$$)("table",this.j.editor).forEach((e=>{this.j.e.off(e,"mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells")}))}unselectCells(e,t){const i=this.module,o=i.getAllSelectedCells();o.length&&o.forEach((e=>{t&&t===e||i.removeSelection(e)}))}onExecCommand(e){if(/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(e)){e=e.replace("table","");const t=this.module.getAllSelectedCells();if(t.length){const[i]=t;if(!i)return;const o=I.i.closest(i,"table",this.j.editor);if(!o)return;switch(e){case"splitv":Ce.splitVertical(o,this.j);break;case"splitg":Ce.splitHorizontal(o,this.j);break;case"merge":Ce.mergeSelected(o,this.j);break;case"empty":t.forEach((e=>I.i.detach(e)));break;case"bin":I.i.safeRemove(o);break;case"binrow":Ce.removeRow(o,i.parentNode.rowIndex);break;case"bincolumn":Ce.removeColumn(o,i.cellIndex);break;case"addcolumnafter":case"addcolumnbefore":Ce.appendColumn(o,i.cellIndex,"addcolumnafter"===e,this.j.createInside);break;case"addrowafter":case"addrowbefore":Ce.appendRow(o,i.parentNode,"addrowafter"===e,this.j.createInside)}}return!1}}onAfterCommand(e){/^justify/.test(e)&&this.module.getAllSelectedCells().forEach((t=>It(e,t,this.j)))}beforeDestruct(e){this.onRemoveSelection(),e.e.off(".select-cells")}}function oi(e){e.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(t=>{let i,o;if(t.key!==a.KEY_TAB&&t.key!==a.KEY_LEFT&&t.key!==a.KEY_RIGHT&&t.key!==a.KEY_UP&&t.key!==a.KEY_DOWN)return;{if(i=e.s.current(),o=I.i.up(i,(e=>e&&e.nodeName&&/^td|th$/i.test(e.nodeName)),e.editor),!o)return;const s=e.s.range;if(t.key!==a.KEY_TAB&&i!==o&&((t.key===a.KEY_LEFT||t.key===a.KEY_UP)&&(I.i.prev(i,(e=>t.key===a.KEY_UP?I.i.isTag(e,"br"):!!e),o)||t.key!==a.KEY_UP&&I.i.isText(i)&&0!==s.startOffset)||(t.key===a.KEY_RIGHT||t.key===a.KEY_DOWN)&&(I.i.next(i,(e=>t.key===a.KEY_DOWN?I.i.isTag(e,"br"):!!e),o)||t.key!==a.KEY_DOWN&&I.i.isText(i)&&i.nodeValue&&s.startOffset!==i.nodeValue.length)))return}const s=I.i.up(o,(e=>e&&/^table$/i.test(e.nodeName)),e.editor);let r=null;switch(t.key){case a.KEY_TAB:case a.KEY_LEFT:{const i=t.key===a.KEY_LEFT||t.shiftKey?"prev":"next";r=I.i[i](o,(e=>e&&/^td|th$/i.test(e.tagName)),s),r||(Ce.appendRow(s,"next"!==i&&s.querySelector("tr"),"next"===i,e.createInside),r=I.i[i](o,(t=>t&&I.i.isCell(t,e.ew)),s));break}case a.KEY_UP:case a.KEY_DOWN:{let e=0,i=0;const n=Ce.formalMatrix(s,((t,s,r)=>{t===o&&(e=s,i=r)}));t.key===a.KEY_UP?void 0!==n[e-1]&&(r=n[e-1][i]):void 0!==n[e+1]&&(r=n[e+1][i])}}if(r){if(r.firstChild)t.key===a.KEY_TAB?e.s.select(r,!0):e.s.setCursorIn(r,t.key===a.KEY_RIGHT||t.key===a.KEY_DOWN);else{const t=e.createInside.element("br");r.appendChild(t),e.s.setCursorBefore(t)}return!1}}))}function si(e){e.registerButton({name:"table",group:"insert"})}(0,r.__decorate)([S.autobind],ii.prototype,"onStartSelection",null),(0,r.__decorate)([(0,S.watch)(":outsideClick")],ii.prototype,"onOutsideClick",null),(0,r.__decorate)([S.autobind],ii.prototype,"onRemoveSelection",null),(0,r.__decorate)([S.autobind],ii.prototype,"onStopSelection",null),(0,r.__decorate)([S.autobind],ii.prototype,"onExecCommand",null),(0,r.__decorate)([S.autobind],ii.prototype,"onAfterCommand",null);class ri extends O{constructor(){super(...arguments),this.isOpened=!1,this.delayShowTimeout=0}afterInit(e){this.container=e.c.div("jodit-tooltip"),(0,C.ZO)(this.j,ri).appendChild(this.container);let t=0;e.e.off(".tooltip").on("showTooltip.tooltip",((i,o)=>{e.async.clearTimeout(t),this.open(i,o)})).on("delayShowTooltip.tooltip",this.delayOpen).on("escape.tooltip",this.close).on("hideTooltip.tooltip change.tooltip scroll.tooltip changePlace.tooltip hidePopup.tooltip closeAllPopups.tooltip",(()=>{this.j.async.clearTimeout(this.delayShowTimeout),t=e.async.setTimeout(this.close,this.j.defaultTimeout)}))}delayOpen(e,t){const i=this.j.o.showTooltipDelay||this.j.defaultTimeout;this.j.async.clearTimeout(this.delayShowTimeout),this.delayShowTimeout=this.j.async.setTimeout((()=>this.open(e,t)),{timeout:i,label:"tooltip"})}open(e,t){this.container.classList.add("jodit-tooltip_visible"),this.container.innerHTML=t,this.isOpened=!0,this.setPosition(e)}setPosition(e){const t=e();(0,c.css)(this.container,{left:t.x,top:t.y})}close(){this.j.async.clearTimeout(this.delayShowTimeout),this.isOpened&&(this.isOpened=!1,this.container.classList.remove("jodit-tooltip_visible"),(0,c.css)(this.container,{left:-5e3}))}beforeDestruct(e){null==e||e.e.off(".tooltip"),this.close(),I.i.safeRemove(this.container)}}function ni(e){e.registerButton({name:"preview"})}function ai(e){e.registerButton({name:"print"})}(0,r.__decorate)([S.autobind],ri.prototype,"delayOpen",null),(0,r.__decorate)([S.autobind],ri.prototype,"close",null),n.D.prototype.controls.preview={icon:"eye",exec(e){const t=e.getInstance("Dialog",{language:e.o.language,theme:e.o.theme}),i=e.c.div();if((0,c.css)(i,{padding:16}),e.iframe){const o=e.create.element("iframe");(0,c.css)(o,{minWidth:800,minHeight:600,border:0}),i.appendChild(o),t.open(i,e.i18n("Preview"));const s=o.contentWindow;s&&(e.e.fire("generateDocumentStructure.iframe",s.document,e),s.document.body.innerHTML=e.value)}else(0,c.css)(i,{minWidth:1024,minHeight:600,border:0}),i.innerHTML=e.value,t.open(i,e.i18n("Preview"));t.setModal(!0)},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Preview"},n.D.prototype.controls.print={exec(e){const t=e.create.element("iframe");Object.assign(t.style,{position:"fixed",right:0,bottom:0,width:0,height:0,border:0}),(0,C.ZO)(e,n.D).appendChild(t);const i=()=>{e.e.off(e.ow,"mousemove",i),I.i.safeRemove(t)},o=t.contentWindow;o&&(e.e.on(o,"onbeforeunload onafterprint",i).on(e.ow,"mousemove",i),e.o.iframe?(e.e.fire("generateDocumentStructure.iframe",o.document,e),o.document.body.innerHTML=e.value):(o.document.write(''+e.value+""),o.document.close()),o.focus(),o.print())},mode:a.MODE_SOURCE+a.MODE_WYSIWYG,tooltip:"Print"},n.D.prototype.showXPathInStatusbar=!0;class li extends O{constructor(){super(...arguments),this.onContext=(e,t)=>(this.menu||(this.menu=new g(this.j)),this.menu.show(t.clientX,t.clientY,[{icon:"bin",title:e===this.j.editor?"Clear":"Remove",exec:()=>{e!==this.j.editor?I.i.safeRemove(e):this.j.value="",this.j.setEditorValue()}},{icon:"select-all",title:"Select",exec:()=>{this.j.s.select(e)}}]),!1),this.onSelectPath=(e,t)=>{this.j.s.focus();const i=(0,c.attr)(t.target,"-path")||"/";if("/"===i)return this.j.execCommand("selectall"),!1;try{const e=this.j.ed.evaluate(i,this.j.editor,null,XPathResult.ANY_TYPE,null).iterateNext();if(e)return this.j.s.select(e),!1}catch(e){}return this.j.s.select(e),!1},this.tpl=(e,t,i,o)=>{const s=this.j.c.fromHTML(`${(0,c.trim)(i)}`),r=s.firstChild;return this.j.e.on(r,"click",this.onSelectPath.bind(this,e)).on(r,"contextmenu",this.onContext.bind(this,e)),s},this.removeSelectAll=()=>{this.selectAllButton&&(this.selectAllButton.destruct(),delete this.selectAllButton)},this.appendSelectAll=()=>{this.removeSelectAll(),this.selectAllButton=M(this.j,{name:"selectall",...this.j.o.controls.selectall}),this.selectAllButton.state.size="tiny",this.container&&this.container.insertBefore(this.selectAllButton.container,this.container.firstChild)},this.calcPathImd=()=>{if(this.isDestructed)return;const e=this.j.s.current();if(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),e){let t,i,o;I.i.up(e,(e=>{e&&this.j.editor!==e&&!I.i.isText(e)&&(t=e.nodeName.toLowerCase(),i=(0,c.getXPathByElement)(e,this.j.editor).replace(/^\//,""),o=this.tpl(e,i,t,this.j.i18n("Select %s",t)),this.container&&this.container.insertBefore(o,this.container.firstChild))}),this.j.editor)}this.appendSelectAll()},this.calcPath=this.j.async.debounce(this.calcPathImd,2*this.j.defaultTimeout)}afterInit(){this.j.o.showXPathInStatusbar&&(this.container=this.j.c.div("jodit-xpath"),this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath",this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath",(()=>{this.j.o.showXPathInStatusbar&&this.container&&(this.j.statusbar.append(this.container),this.j.getRealMode()===a.MODE_WYSIWYG?this.calcPath():(this.container&&(this.container.innerHTML=a.INVISIBLE_SPACE),this.appendSelectAll()))})),this.calcPath())}beforeDestruct(){this.j&&this.j.events&&this.j.e.off(".xpath"),this.removeSelectAll(),this.menu&&this.menu.destruct(),I.i.safeRemove(this.container),delete this.menu,delete this.container}}var ci=i(65),di=i(66),hi=i(67),ui=i(68),pi=i(69),mi=i(70),fi=i(71),gi=i(72),vi=i(73),bi=i(74),yi=i(75),wi=i(76),ki=i(77),Ci=i(78),Si=i(79),Ei=i(80),ji=i(81),Ii=i(82),_i=i(83),xi=i(84),zi=i(85),Ti=i(86),Li=i(87),Ai=i(88),Di=i(89),Mi=i(90),Pi=i(91),Ri=i(92),qi=i(93),Bi=i(94),Ni=i(95),Hi=i(96),Oi=i(97),Fi=i(98),Wi=i(99),Vi=i(100),Ui=i(101),Yi=i(102),$i=i(103),Ki=i(104),Gi=i(105),Ji=i(106),Xi=i(107),Zi=i(108),Qi=i(109),eo=i(110),to=i(111),io=i(112),oo=i(113),so=i(114),ro=i(115),no=i(116),ao=i(117),lo=i(118),co=i(119),ho=i(120),uo=i(121),po=i(122),mo=i(123),fo=i(124),go=i(125),vo=i(126),bo=i(127),yo=i(128),wo=i(129),ko=i(130),Co=i(131),So=i(132),Eo=i(133),jo=i(134),Io=i(135),_o=i(136),xo=i(137),zo=i(138),To=i(139),Lo=i(140),Ao=i(141),Do=i(142),Mo=i(143),Po=i(144),Ro=i(145);Object.keys(a).forEach((e=>{Jodit[e]=a[e]}));const qo=e=>"__esModule"!==e;Object.keys(s).filter(qo).forEach((e=>{_.JO.set(e.replace("_","-"),s[e])})),Object.keys(e).filter(qo).forEach((t=>{Jodit.modules[t]=e[t]})),Object.keys(S).filter(qo).forEach((e=>{Jodit.decorators[e]=S[e]})),["Confirm","Alert","Prompt"].forEach((t=>{Jodit[t]=e[t]})),Object.keys(t).filter(qo).forEach((e=>{Jodit.plugins.add(e,t[e])})),Object.keys(Te).filter(qo).forEach((e=>{Jodit.lang[e]=Te[e]}));const Bo=Jodit})(),o})()})); \ No newline at end of file diff --git a/build/jodit.js b/build/jodit.js index 868ebfc50..ae6baa91c 100644 --- a/build/jodit.js +++ b/build/jodit.js @@ -1,7 +1,7 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ @@ -1720,6 +1720,7 @@ var Jodit = (function (_super) { delete global_1.instances[this.id]; _super.prototype.destruct.call(this); }; + Jodit.fatMode = false; Jodit.plugins = global_1.pluginSystem; Jodit.modules = global_1.modules; Jodit.ns = global_1.modules; @@ -2097,6 +2098,7 @@ exports.Config = void 0; var consts = __webpack_require__(9); var Config = (function () { function Config() { + this.namespace = ''; this.iframe = false; this.license = ''; this.preset = 'custom'; @@ -7329,7 +7331,7 @@ function persistent(target, propertyKey) { target.hookStatus(component_1.STATUSES.ready, function (component) { var jodit = helpers_1.isViewObject(component) ? component - : component.jodit, storageKey = component.componentName + "_prop_" + propertyKey, initialValue = component[propertyKey]; + : component.jodit, storageKey = "" + jodit.options.namespace + component.componentName + "_prop_" + propertyKey, initialValue = component[propertyKey]; Object.defineProperty(component, propertyKey, { get: function () { var _a; @@ -7433,8 +7435,8 @@ function watch(observeFields, context) { }; helpers_1.splitArray(observeFields).forEach(function (field) { if (/:/.test(field)) { - var _a = field.split(':'), objectPath = _a[0], eventName = _a[1]; - var view = helpers_1.isViewObject(component) + var _a = field.split(':'), objectPath = _a[0], eventName_1 = _a[1]; + var view_1 = helpers_1.isViewObject(component) ? component : component.jodit; if (objectPath.length) { @@ -7443,9 +7445,14 @@ function watch(observeFields, context) { if (helpers_1.isFunction(context)) { context = context(component); } - view.events - .on(context || component, eventName, callback) - .on(eventName, callback); + view_1.events + .on(context || component, eventName_1, callback) + .on(eventName_1, callback); + view_1.hookStatus('beforeDestruct', function () { + view_1.events + .off(context || component, eventName_1, callback) + .off(eventName_1, callback); + }); return; } var parts = field.split('.'), key = parts[0]; @@ -7895,8 +7902,10 @@ var element_1 = __webpack_require__(76); var decorators_1 = __webpack_require__(99); var Popup = (function (_super) { tslib_1.__extends(Popup, _super); - function Popup(jodit) { + function Popup(jodit, smart) { + if (smart === void 0) { smart = true; } var _this = _super.call(this, jodit) || this; + _this.smart = smart; _this.isOpened = false; _this.strategy = 'leftBottom'; _this.viewBound = function () { return ({ @@ -8073,26 +8082,32 @@ var Popup = (function (_super) { Popup.prototype.addGlobalListeners = function () { var up = this.updatePosition, ow = this.ow; global_1.eventEmitter.on('closeAllPopups', this.close); + if (this.smart) { + this.j.e + .on('escape', this.close) + .on('mousedown touchstart', this.closeOnOutsideClick) + .on(ow, 'mousedown touchstart', this.closeOnOutsideClick); + } this.j.e .on('closeAllPopups', this.close) - .on('escape', this.close) .on('resize', up) .on(this.container, 'scroll mousewheel', up) - .on('mousedown touchstart', this.closeOnOutsideClick) - .on(ow, 'mousedown touchstart', this.closeOnOutsideClick) .on(ow, 'scroll', up) .on(ow, 'resize', up); }; Popup.prototype.removeGlobalListeners = function () { var up = this.updatePosition, ow = this.ow; global_1.eventEmitter.off('closeAllPopups', this.close); + if (this.smart) { + this.j.e + .off('escape', this.close) + .off('mousedown touchstart', this.closeOnOutsideClick) + .off(ow, 'mousedown touchstart', this.closeOnOutsideClick); + } this.j.e .off('closeAllPopups', this.close) - .off('escape', this.close) .off('resize', up) .off(this.container, 'scroll mousewheel', up) - .off('mousedown touchstart', this.closeOnOutsideClick) - .off(ow, 'mousedown touchstart', this.closeOnOutsideClick) .off(ow, 'scroll', up) .off(ow, 'resize', up); }; @@ -10163,6 +10178,7 @@ var global_1 = __webpack_require__(30); var decorators_1 = __webpack_require__(99); var view_1 = __webpack_require__(167); config_1.Config.prototype.dialog = { + namespace: '', extraButtons: [], resizable: true, draggable: true, @@ -10744,7 +10760,7 @@ var View = (function (_super) { _this.isView = true; _this.mods = {}; _this.components = new Set(); - _this.version = "3.6.2"; + _this.version = "3.6.3"; _this.async = new async_1.Async(); _this.buffer = storage_1.Storage.makeStorage(); _this.storage = storage_1.Storage.makeStorage(true, _this.componentName); @@ -10886,7 +10902,10 @@ var View = (function (_super) { configurable: true }); View.prototype.getVersion = function () { - return this.version; + return "3.6.3"; + }; + View.getVersion = function () { + return "3.6.3"; }; View.prototype.initOptions = function (options) { this.options = helpers_1.ConfigProto(options || {}, helpers_1.ConfigProto(this.options || {}, View.defaultOptions)); @@ -10947,6 +10966,7 @@ exports.View = View; View.defaultOptions = { extraButtons: [], textIcons: false, + namespace: '', removeButtons: [], zIndex: 100002, defaultTimeout: 100, @@ -12454,6 +12474,7 @@ var helpers_1 = __webpack_require__(19); var consts_1 = __webpack_require__(188); var ui_1 = __webpack_require__(75); config_1.Config.prototype.filebrowser = { + namespace: '', extraButtons: [], filter: function (item, search) { search = search.toLowerCase(); @@ -21491,7 +21512,7 @@ module.exports = { * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.xpath = exports.tooltip = exports.symbols = exports.sticky = exports.stat = exports.source = exports.resizeHandler = exports.size = exports.search = exports.resizer = exports.redoUndo = exports.placeholder = exports.orderedList = exports.mobile = exports.link = exports.limit = exports.justify = exports.inlinePopup = exports.hr = exports.indent = exports.iframe = exports.hotkeys = exports.fullsize = exports.formatBlock = exports.font = exports.errorMessages = exports.enter = exports.DragAndDropElement = exports.DragAndDrop = exports.color = exports.pasteStorage = exports.paste = exports.clipboard = exports.copyFormat = exports.WrapTextNodes = exports.cleanHtml = exports.bold = exports.Delete = exports.classSpan = exports.autofocus = exports.about = exports.addNewLine = void 0; +exports.xpath = exports.tooltip = exports.symbols = exports.sticky = exports.stat = exports.source = exports.resizeHandler = exports.size = exports.select = exports.search = exports.resizer = exports.redoUndo = exports.placeholder = exports.orderedList = exports.mobile = exports.link = exports.limit = exports.justify = exports.inlinePopup = exports.hr = exports.indent = exports.iframe = exports.hotkeys = exports.fullsize = exports.formatBlock = exports.font = exports.errorMessages = exports.enter = exports.DragAndDropElement = exports.DragAndDrop = exports.color = exports.pasteStorage = exports.paste = exports.clipboard = exports.copyFormat = exports.WrapTextNodes = exports.cleanHtml = exports.bold = exports.Delete = exports.classSpan = exports.autofocus = exports.about = exports.addNewLine = void 0; var tslib_1 = __webpack_require__(7); var add_new_line_1 = __webpack_require__(234); Object.defineProperty(exports, "addNewLine", ({ enumerable: true, get: function () { return add_new_line_1.addNewLine; } })); @@ -21560,22 +21581,24 @@ var resizer_1 = __webpack_require__(304); Object.defineProperty(exports, "resizer", ({ enumerable: true, get: function () { return resizer_1.resizer; } })); var search_1 = __webpack_require__(306); Object.defineProperty(exports, "search", ({ enumerable: true, get: function () { return search_1.search; } })); -var size_1 = __webpack_require__(308); +var select_1 = __webpack_require__(308); +Object.defineProperty(exports, "select", ({ enumerable: true, get: function () { return select_1.select; } })); +var size_1 = __webpack_require__(309); Object.defineProperty(exports, "size", ({ enumerable: true, get: function () { return size_1.size; } })); Object.defineProperty(exports, "resizeHandler", ({ enumerable: true, get: function () { return size_1.resizeHandler; } })); -var source_1 = __webpack_require__(313); +var source_1 = __webpack_require__(314); Object.defineProperty(exports, "source", ({ enumerable: true, get: function () { return source_1.source; } })); -var stat_1 = __webpack_require__(322); +var stat_1 = __webpack_require__(323); Object.defineProperty(exports, "stat", ({ enumerable: true, get: function () { return stat_1.stat; } })); -var sticky_1 = __webpack_require__(323); +var sticky_1 = __webpack_require__(324); Object.defineProperty(exports, "sticky", ({ enumerable: true, get: function () { return sticky_1.sticky; } })); -var symbols_1 = __webpack_require__(325); +var symbols_1 = __webpack_require__(326); Object.defineProperty(exports, "symbols", ({ enumerable: true, get: function () { return symbols_1.symbols; } })); -tslib_1.__exportStar(__webpack_require__(328), exports); -var tooltip_1 = __webpack_require__(335); +tslib_1.__exportStar(__webpack_require__(329), exports); +var tooltip_1 = __webpack_require__(336); Object.defineProperty(exports, "tooltip", ({ enumerable: true, get: function () { return tooltip_1.tooltip; } })); -tslib_1.__exportStar(__webpack_require__(337), exports); -var xpath_1 = __webpack_require__(340); +tslib_1.__exportStar(__webpack_require__(338), exports); +var xpath_1 = __webpack_require__(341); Object.defineProperty(exports, "xpath", ({ enumerable: true, get: function () { return xpath_1.xpath; } })); @@ -24686,6 +24709,7 @@ var DragAndDropElement = (function (_super) { pointerEvents: 'none', pointer: 'drag', position: 'fixed', + opacity: 0.7, display: 'inline-block', left: event.clientX, top: event.clientY, @@ -26684,19 +26708,22 @@ var inlinePopup = (function (_super) { tslib_1.__extends(inlinePopup, _super); function inlinePopup() { var _this = _super !== null && _super.apply(this, arguments) || this; + _this.requires = ['select']; _this.type = null; - _this.popup = new popup_1.Popup(_this.jodit); + _this.popup = new popup_1.Popup(_this.jodit, false); _this.toolbar = factory_1.makeCollection(_this.jodit, _this.popup); _this.snapRange = null; + _this.elmsList = helpers_1.keys(_this.j.o.popup, false).filter(function (s) { return !_this.isExcludedTarget(s); }); return _this; } - inlinePopup.prototype.onClick = function (e) { + inlinePopup.prototype.onClick = function (node) { var _this = this; - var node = e.target, elements = helpers_1.keys(this.j.o.popup, false), target = modules_1.Dom.isTag(node, 'img') + var elements = this.elmsList, target = modules_1.Dom.isTag(node, 'img') ? node : modules_1.Dom.closest(node, elements, this.j.editor); if (target && this.canShowPopupForType(target.nodeName.toLowerCase())) { this.showPopup(function () { return helpers_1.position(target, _this.j); }, target.nodeName.toLowerCase(), target); + return false; } }; inlinePopup.prototype.showPopup = function (rect, type, target) { @@ -26726,10 +26753,13 @@ var inlinePopup = (function (_super) { return true; }; inlinePopup.prototype.hidePopup = function (type) { - if (!type || type === this.type) { + if (!helpers_1.isString(type) || type === this.type) { this.popup.close(); } }; + inlinePopup.prototype.onOutsideClick = function (e) { + this.popup.close(); + }; inlinePopup.prototype.canShowPopupForType = function (type) { var data = this.j.o.popup[type.toLowerCase()]; if (this.j.o.readonly || !this.j.o.toolbarInline || !data) { @@ -26765,9 +26795,9 @@ var inlinePopup = (function (_super) { .on('showPopup', function (elm, rect, type) { _this.showPopup(rect, type || (helpers_1.isString(elm) ? elm : elm.nodeName), helpers_1.isString(elm) ? undefined : elm); }) - .on('click', this.onClick) .on('mousedown keydown', this.onSelectionStart) .on([this.j.ew, this.j.ow], 'mouseup keyup', this.onSelectionEnd); + this.addListenersForElements(); }; inlinePopup.prototype.onSelectionStart = function () { this.snapRange = this.j.s.range.cloneRange(); @@ -26824,8 +26854,14 @@ var inlinePopup = (function (_super) { inlinePopup.prototype.beforeDestruct = function (jodit) { jodit.e .off('showPopup') - .off('click', this.onClick) .off([this.j.ew, this.j.ow], 'mouseup keyup', this.onSelectionEnd); + this.removeListenersForElements(); + }; + inlinePopup.prototype.addListenersForElements = function () { + this.j.e.on(this.elmsList.map(function (e) { return helpers_1.camelCase("click_" + e); }).join(' '), this.onClick); + }; + inlinePopup.prototype.removeListenersForElements = function () { + this.j.e.off(this.elmsList.map(function (e) { return helpers_1.camelCase("click_" + e); }).join(' '), this.onClick); }; tslib_1.__decorate([ decorators_1.autobind @@ -26834,8 +26870,12 @@ var inlinePopup = (function (_super) { decorators_1.wait(function (ctx) { return !ctx.j.isLocked; }) ], inlinePopup.prototype, "showPopup", null); tslib_1.__decorate([ + decorators_1.watch(':clickEditor'), decorators_1.autobind ], inlinePopup.prototype, "hidePopup", null); + tslib_1.__decorate([ + decorators_1.watch(':outsideClick') + ], inlinePopup.prototype, "onOutsideClick", null); tslib_1.__decorate([ decorators_1.autobind ], inlinePopup.prototype, "onSelectionStart", null); @@ -27669,7 +27709,13 @@ var link = (function (_super) { var textWasChanged = getSelectionText() !== content_input.value.trim(); if (!link) { if (!jodit.s.isCollapsed()) { - links = jodit.s.wrapInTag('a'); + var node = jodit.s.current(); + if (dom_1.Dom.isTag(node, ['img'])) { + links = [dom_1.Dom.wrap(node, 'a', jodit)]; + } + else { + links = jodit.s.wrapInTag('a'); + } } else { var a = jodit.createInside.element('a'); @@ -28674,7 +28720,7 @@ var resizer = (function (_super) { } } }; - _this.onClickElement = function (element) { + _this.onClickElement = function (element, e) { if (_this.element !== element || !_this.isShown) { _this.element = element; _this.show(); @@ -28735,7 +28781,7 @@ var resizer = (function (_super) { } }) .on('hideResizer', this.hide) - .on('change afterInit afterSetMode', editor.async.debounce(this.onChangeEditor.bind(this), editor.defaultTimeout)); + .on('change afterInit afterSetMode', this.onChangeEditor); this.addEventListeners(); this.onChangeEditor(); }; @@ -28867,7 +28913,9 @@ var resizer = (function (_super) { event.preventDefault(); } }) - .on(element, 'click', function () { return _this.onClickElement(element); }); + .on(element, 'click', function (e) { + return _this.onClickElement(element, e); + }); }; resizer.prototype.showSizeViewer = function (w, h) { if (!this.j.o.resizer.showSize) { @@ -28910,6 +28958,9 @@ var resizer = (function (_super) { global_1.eventEmitter.off('hideHelpers', this.hide); jodit.e.off(this.j.ow, '.resizer').off('.resizer'); }; + tslib_1.__decorate([ + decorators_1.debounce() + ], resizer.prototype, "onChangeEditor", null); tslib_1.__decorate([ decorators_1.autobind ], resizer.prototype, "hide", null); @@ -29422,10 +29473,63 @@ __webpack_require__.r(__webpack_exports__); * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.select = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(309); -tslib_1.__exportStar(__webpack_require__(310), exports); -tslib_1.__exportStar(__webpack_require__(311), exports); +var plugin_1 = __webpack_require__(183); +var decorators_1 = __webpack_require__(99); +var helpers_1 = __webpack_require__(19); +var dom_1 = __webpack_require__(32); +var ui_1 = __webpack_require__(75); +var select = (function (_super) { + tslib_1.__extends(select, _super); + function select() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.proxyEventsList = ['click', 'mousedown', 'touchstart', 'mouseup', 'touchend']; + return _this; + } + select.prototype.afterInit = function (jodit) { + var _this = this; + this.proxyEventsList.forEach(function (eventName) { + jodit.e.on(eventName + '.inline-popup', _this.onStartSelection); + }); + }; + select.prototype.beforeDestruct = function (jodit) { + var _this = this; + this.proxyEventsList.forEach(function (eventName) { + jodit.e.on(eventName + '.inline-popup', _this.onStartSelection); + }); + }; + select.prototype.onStartSelection = function (e) { + var j = this.j; + var result, target = e.target; + while (result === undefined && target && target !== j.editor) { + result = j.e.fire(helpers_1.camelCase(e.type + '_' + target.nodeName.toLowerCase()), target, e); + target = target.parentElement; + } + if (e.type === 'click' && result === undefined && target === j.editor) { + j.e.fire(e.type + 'Editor', target, e); + } + }; + select.prototype.onOutsideClick = function (e) { + var _this = this; + var node = e.target; + if (dom_1.Dom.up(node, function (elm) { return elm === _this.j.editor; })) { + return; + } + var box = ui_1.UIElement.closestElement(node, ui_1.Popup); + if (!box) { + this.j.e.fire('outsideClick', e); + } + }; + tslib_1.__decorate([ + decorators_1.autobind + ], select.prototype, "onStartSelection", null); + tslib_1.__decorate([ + decorators_1.watch('ow:click') + ], select.prototype, "onOutsideClick", null); + return select; +}(plugin_1.Plugin)); +exports.select = select; /***/ }), @@ -29434,6 +29538,24 @@ tslib_1.__exportStar(__webpack_require__(311), exports); "use strict"; +/*! + * Jodit Editor (https://xdsoft.net/jodit/) + * Released under MIT see LICENSE.txt in the project root for license information. + * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +var tslib_1 = __webpack_require__(7); +__webpack_require__(310); +tslib_1.__exportStar(__webpack_require__(311), exports); +tslib_1.__exportStar(__webpack_require__(312), exports); + + +/***/ }), +/* 310 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + Object.defineProperty(exports, "__esModule", ({ value: true })); var config_1 = __webpack_require__(8); config_1.Config.prototype.width = 'auto'; @@ -29448,7 +29570,7 @@ config_1.Config.prototype.saveHeightInStorage = false; /***/ }), -/* 310 */ +/* 311 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -29536,7 +29658,7 @@ exports.resizeHandler = resizeHandler; /***/ }), -/* 311 */ +/* 312 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -29549,7 +29671,7 @@ exports.resizeHandler = resizeHandler; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.size = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(312); +__webpack_require__(313); var helpers_1 = __webpack_require__(19); var plugin_1 = __webpack_require__(183); var decorators_1 = __webpack_require__(99); @@ -29671,7 +29793,7 @@ exports.size = size; /***/ }), -/* 312 */ +/* 313 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -29680,7 +29802,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 313 */ +/* 314 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -29692,12 +29814,12 @@ __webpack_require__.r(__webpack_exports__); */ Object.defineProperty(exports, "__esModule", ({ value: true })); var tslib_1 = __webpack_require__(7); -__webpack_require__(314); -tslib_1.__exportStar(__webpack_require__(315), exports); +__webpack_require__(315); +tslib_1.__exportStar(__webpack_require__(316), exports); /***/ }), -/* 314 */ +/* 315 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -29740,7 +29862,7 @@ config_1.Config.prototype.controls.source = { /***/ }), -/* 315 */ +/* 316 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -29753,13 +29875,13 @@ config_1.Config.prototype.controls.source = { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.source = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(316); +__webpack_require__(317); var consts = __webpack_require__(9); var constants_1 = __webpack_require__(9); var plugin_1 = __webpack_require__(183); var dom_1 = __webpack_require__(32); var helpers_1 = __webpack_require__(19); -var factory_1 = __webpack_require__(317); +var factory_1 = __webpack_require__(318); var source = (function (_super) { tslib_1.__extends(source, _super); function source() { @@ -30038,7 +30160,7 @@ exports.source = source; /***/ }), -/* 316 */ +/* 317 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -30047,7 +30169,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 317 */ +/* 318 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30059,7 +30181,7 @@ __webpack_require__.r(__webpack_exports__); */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createSourceEditor = void 0; -var engines_1 = __webpack_require__(318); +var engines_1 = __webpack_require__(319); function createSourceEditor(type, editor, container, toWYSIWYG, fromWYSIWYG) { var sourceEditor; switch (type) { @@ -30081,7 +30203,7 @@ exports.createSourceEditor = createSourceEditor; /***/ }), -/* 318 */ +/* 319 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30093,12 +30215,12 @@ exports.createSourceEditor = createSourceEditor; */ Object.defineProperty(exports, "__esModule", ({ value: true })); var tslib_1 = __webpack_require__(7); -tslib_1.__exportStar(__webpack_require__(319), exports); -tslib_1.__exportStar(__webpack_require__(321), exports); +tslib_1.__exportStar(__webpack_require__(320), exports); +tslib_1.__exportStar(__webpack_require__(322), exports); /***/ }), -/* 319 */ +/* 320 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30113,7 +30235,7 @@ exports.TextAreaEditor = void 0; var tslib_1 = __webpack_require__(7); var helpers_1 = __webpack_require__(19); var modules_1 = __webpack_require__(10); -var sourceEditor_1 = __webpack_require__(320); +var sourceEditor_1 = __webpack_require__(321); var TextAreaEditor = (function (_super) { tslib_1.__extends(TextAreaEditor, _super); function TextAreaEditor() { @@ -30213,7 +30335,7 @@ exports.TextAreaEditor = TextAreaEditor; /***/ }), -/* 320 */ +/* 321 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -30261,7 +30383,7 @@ exports.SourceEditor = SourceEditor; /***/ }), -/* 321 */ +/* 322 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30276,7 +30398,7 @@ exports.AceEditor = void 0; var tslib_1 = __webpack_require__(7); var constants = __webpack_require__(9); var helpers_1 = __webpack_require__(19); -var sourceEditor_1 = __webpack_require__(320); +var sourceEditor_1 = __webpack_require__(321); var AceEditor = (function (_super) { tslib_1.__extends(AceEditor, _super); function AceEditor() { @@ -30469,7 +30591,7 @@ exports.AceEditor = AceEditor; /***/ }), -/* 322 */ +/* 323 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30541,7 +30663,7 @@ exports.stat = stat; /***/ }), -/* 323 */ +/* 324 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30554,7 +30676,7 @@ exports.stat = stat; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.sticky = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(324); +__webpack_require__(325); var config_1 = __webpack_require__(8); var constants_1 = __webpack_require__(9); var modules_1 = __webpack_require__(10); @@ -30653,7 +30775,7 @@ exports.sticky = sticky; /***/ }), -/* 324 */ +/* 325 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -30662,7 +30784,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 325 */ +/* 326 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -30675,8 +30797,8 @@ __webpack_require__.r(__webpack_exports__); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.symbols = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(326); __webpack_require__(327); +__webpack_require__(328); var constants_1 = __webpack_require__(9); var modules_1 = __webpack_require__(10); var utils_1 = __webpack_require__(20); @@ -30787,7 +30909,7 @@ exports.symbols = symbols; /***/ }), -/* 326 */ +/* 327 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -30796,7 +30918,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 327 */ +/* 328 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31047,7 +31169,7 @@ config_1.Config.prototype.controls.symbol = { /***/ }), -/* 328 */ +/* 329 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31059,15 +31181,15 @@ config_1.Config.prototype.controls.symbol = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); var tslib_1 = __webpack_require__(7); -__webpack_require__(329); -tslib_1.__exportStar(__webpack_require__(330), exports); -tslib_1.__exportStar(__webpack_require__(332), exports); +__webpack_require__(330); +tslib_1.__exportStar(__webpack_require__(331), exports); tslib_1.__exportStar(__webpack_require__(333), exports); tslib_1.__exportStar(__webpack_require__(334), exports); +tslib_1.__exportStar(__webpack_require__(335), exports); /***/ }), -/* 329 */ +/* 330 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31226,7 +31348,7 @@ config_1.Config.prototype.controls.table = { /***/ }), -/* 330 */ +/* 331 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31239,7 +31361,7 @@ config_1.Config.prototype.controls.table = { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resizeCells = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(331); +__webpack_require__(332); var consts = __webpack_require__(9); var modules_1 = __webpack_require__(10); var helpers_1 = __webpack_require__(19); @@ -31512,7 +31634,7 @@ exports.resizeCells = resizeCells; /***/ }), -/* 331 */ +/* 332 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -31521,7 +31643,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 332 */ +/* 333 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31545,6 +31667,7 @@ var selectCells = (function (_super) { tslib_1.__extends(selectCells, _super); function selectCells() { var _this = _super !== null && _super.apply(this, arguments) || this; + _this.requires = ['select']; _this.selectedCell = null; return _this; } @@ -31561,7 +31684,6 @@ var selectCells = (function (_super) { return; } jodit.e - .on(this.j.ow, 'click.select-cells', this.onRemoveSelection) .on('keydown.select-cells', function (event) { if (event.key === constants_1.KEY_TAB) { _this.unselectCells(); @@ -31569,29 +31691,31 @@ var selectCells = (function (_super) { }) .on('beforeCommand.select-cells', this.onExecCommand) .on('afterCommand.select-cells', this.onAfterCommand) - .on('change afterCommand afterSetMode click afterInit' - .split(' ') + .on([ + 'clickEditor', + 'mousedownTd', + 'mousedownTh', + 'touchstartTd', + 'touchstartTh' + ] .map(function (e) { return e + '.select-cells'; }) - .join(' '), function () { - helpers_1.$$('table', jodit.editor).forEach(_this.observe); + .join(' '), this.onStartSelection) + .on('clickTr', function () { + if (_this.module.getAllSelectedCells().length) { + return false; + } }); }; - selectCells.prototype.observe = function (table) { - if (helpers_1.dataBind(table, key)) { - return; - } - this.onRemoveSelection(); - helpers_1.dataBind(table, key, true); - this.j.e.on(table, 'mousedown.select-cells touchstart.select-cells', this.onStartSelection.bind(this, table)); - }; - selectCells.prototype.onStartSelection = function (table, e) { - var _this = this; + selectCells.prototype.onStartSelection = function (cell) { if (this.j.o.readonly) { return; } this.unselectCells(); - var cell = modules_1.Dom.closest(e.target, ['td', 'th'], table); - if (!cell) { + if (cell === this.j.editor) { + return; + } + var table = modules_1.Dom.closest(cell, 'table', this.j.editor); + if (!cell || !table) { return; } if (!cell.firstChild) { @@ -31602,7 +31726,10 @@ var selectCells = (function (_super) { this.j.e .on(table, 'mousemove.select-cells touchmove.select-cells', this.onMove.bind(this, table)) .on(table, 'mouseup.select-cells touchend.select-cells', this.onStopSelection.bind(this, table)); - this.j.e.fire('showPopup', table, function () { return helpers_1.position(cell, _this.j); }, 'cells'); + return false; + }; + selectCells.prototype.onOutsideClick = function (e) { + this.unselectCells(); }; selectCells.prototype.onMove = function (table, e) { var _this = this; @@ -31702,7 +31829,7 @@ var selectCells = (function (_super) { command = command.replace('table', ''); var cells = this.module.getAllSelectedCells(); if (cells.length) { - var cell = cells.shift(); + var cell = cells[0]; if (!cell) { return; } @@ -31721,7 +31848,7 @@ var selectCells = (function (_super) { modules_1.Table.mergeSelected(table, this.j); break; case 'empty': - cells.forEach(function (td) { return (td.innerHTML = ''); }); + cells.forEach(function (td) { return modules_1.Dom.detach(td); }); break; case 'bin': modules_1.Dom.safeRemove(table); @@ -31759,7 +31886,10 @@ var selectCells = (function (_super) { }; tslib_1.__decorate([ decorators_1.autobind - ], selectCells.prototype, "observe", null); + ], selectCells.prototype, "onStartSelection", null); + tslib_1.__decorate([ + decorators_1.watch(':outsideClick') + ], selectCells.prototype, "onOutsideClick", null); tslib_1.__decorate([ decorators_1.autobind ], selectCells.prototype, "onRemoveSelection", null); @@ -31778,7 +31908,7 @@ exports.selectCells = selectCells; /***/ }), -/* 333 */ +/* 334 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31909,7 +32039,7 @@ exports.tableKeyboardNavigation = tableKeyboardNavigation; /***/ }), -/* 334 */ +/* 335 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -31931,7 +32061,7 @@ exports.table = table; /***/ }), -/* 335 */ +/* 336 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -31944,7 +32074,7 @@ exports.table = table; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.tooltip = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(336); +__webpack_require__(337); var helpers_1 = __webpack_require__(19); var plugin_1 = __webpack_require__(183); var dom_1 = __webpack_require__(32); @@ -32025,7 +32155,7 @@ exports.tooltip = tooltip; /***/ }), -/* 336 */ +/* 337 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -32034,7 +32164,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 337 */ +/* 338 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -32046,12 +32176,12 @@ __webpack_require__.r(__webpack_exports__); */ Object.defineProperty(exports, "__esModule", ({ value: true })); var tslib_1 = __webpack_require__(7); -tslib_1.__exportStar(__webpack_require__(338), exports); tslib_1.__exportStar(__webpack_require__(339), exports); +tslib_1.__exportStar(__webpack_require__(340), exports); /***/ }), -/* 338 */ +/* 339 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -32115,7 +32245,7 @@ exports.preview = preview; /***/ }), -/* 339 */ +/* 340 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -32182,7 +32312,7 @@ exports.print = print; /***/ }), -/* 340 */ +/* 341 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -32195,7 +32325,7 @@ exports.print = print; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.xpath = void 0; var tslib_1 = __webpack_require__(7); -__webpack_require__(341); +__webpack_require__(342); var config_1 = __webpack_require__(8); var constants_1 = __webpack_require__(9); var context_menu_1 = __webpack_require__(160); @@ -32343,7 +32473,7 @@ exports.xpath = xpath; /***/ }), -/* 341 */ +/* 342 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -32352,7 +32482,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 342 */ +/* 343 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -32365,652 +32495,652 @@ __webpack_require__.r(__webpack_exports__); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.paragraph = exports.palette = exports.outdent = exports.omega = exports.ol = exports.ok = exports.merge = exports.menu = exports.lock = exports.link = exports.left = exports.justify = exports.italic = exports.info_circle = exports.indent = exports.image = exports.hr = exports.fullsize = exports.fontsize = exports.font = exports.folder = exports.file = exports.eye = exports.eraser = exports.enter = exports.chevron = exports.dots = exports.dedent = exports.cut = exports.crop = exports.copy = exports.copyformat = exports.check_square = exports.check = exports.chain_broken = exports.center = exports.cancel = exports.brush = exports.bold = exports.bin = exports.attachment = exports.arrows_h = exports.arrows_alt = exports.angle_up = exports.angle_right = exports.angle_left = exports.angle_down = exports.addrow = exports.addcolumn = exports.about = void 0; exports.video = exports.valign = exports.upload = exports.update = exports.unlock = exports.unlink = exports.undo = exports.underline = exports.ul = exports.th_list = exports.th = exports.table = exports.superscript = exports.subscript = exports.strikethrough = exports.splitv = exports.splitg = exports.source = exports.shrink = exports.settings = exports.select_all = exports.search = exports.save = exports.right = exports.resizer = exports.resize = exports.redo = exports.print = exports.plus = exports.pencil = exports.paste = void 0; -var about = __webpack_require__(343); +var about = __webpack_require__(344); exports.about = about; -var addcolumn = __webpack_require__(344); +var addcolumn = __webpack_require__(345); exports.addcolumn = addcolumn; -var addrow = __webpack_require__(345); +var addrow = __webpack_require__(346); exports.addrow = addrow; -var angle_down = __webpack_require__(346); +var angle_down = __webpack_require__(347); exports.angle_down = angle_down; -var angle_left = __webpack_require__(347); +var angle_left = __webpack_require__(348); exports.angle_left = angle_left; -var angle_right = __webpack_require__(348); +var angle_right = __webpack_require__(349); exports.angle_right = angle_right; -var angle_up = __webpack_require__(349); +var angle_up = __webpack_require__(350); exports.angle_up = angle_up; -var arrows_alt = __webpack_require__(350); +var arrows_alt = __webpack_require__(351); exports.arrows_alt = arrows_alt; -var arrows_h = __webpack_require__(351); +var arrows_h = __webpack_require__(352); exports.arrows_h = arrows_h; -var attachment = __webpack_require__(352); +var attachment = __webpack_require__(353); exports.attachment = attachment; -var bin = __webpack_require__(353); +var bin = __webpack_require__(354); exports.bin = bin; -var bold = __webpack_require__(354); +var bold = __webpack_require__(355); exports.bold = bold; -var brush = __webpack_require__(355); +var brush = __webpack_require__(356); exports.brush = brush; -var cancel = __webpack_require__(356); +var cancel = __webpack_require__(357); exports.cancel = cancel; -var center = __webpack_require__(357); +var center = __webpack_require__(358); exports.center = center; -var chain_broken = __webpack_require__(358); +var chain_broken = __webpack_require__(359); exports.chain_broken = chain_broken; -var check = __webpack_require__(359); +var check = __webpack_require__(360); exports.check = check; -var check_square = __webpack_require__(360); +var check_square = __webpack_require__(361); exports.check_square = check_square; -var chevron = __webpack_require__(361); +var chevron = __webpack_require__(362); exports.chevron = chevron; -var copyformat = __webpack_require__(362); +var copyformat = __webpack_require__(363); exports.copyformat = copyformat; -var crop = __webpack_require__(363); +var crop = __webpack_require__(364); exports.crop = crop; -var copy = __webpack_require__(364); +var copy = __webpack_require__(365); exports.copy = copy; -var cut = __webpack_require__(365); +var cut = __webpack_require__(366); exports.cut = cut; -var dedent = __webpack_require__(366); +var dedent = __webpack_require__(367); exports.dedent = dedent; -var dots = __webpack_require__(367); +var dots = __webpack_require__(368); exports.dots = dots; -var enter = __webpack_require__(368); +var enter = __webpack_require__(369); exports.enter = enter; -var eraser = __webpack_require__(369); +var eraser = __webpack_require__(370); exports.eraser = eraser; -var eye = __webpack_require__(370); +var eye = __webpack_require__(371); exports.eye = eye; -var file = __webpack_require__(371); +var file = __webpack_require__(372); exports.file = file; -var folder = __webpack_require__(372); +var folder = __webpack_require__(373); exports.folder = folder; -var font = __webpack_require__(373); +var font = __webpack_require__(374); exports.font = font; -var fontsize = __webpack_require__(374); +var fontsize = __webpack_require__(375); exports.fontsize = fontsize; -var fullsize = __webpack_require__(375); +var fullsize = __webpack_require__(376); exports.fullsize = fullsize; -var hr = __webpack_require__(376); +var hr = __webpack_require__(377); exports.hr = hr; -var image = __webpack_require__(377); +var image = __webpack_require__(378); exports.image = image; -var indent = __webpack_require__(378); +var indent = __webpack_require__(379); exports.indent = indent; -var info_circle = __webpack_require__(379); +var info_circle = __webpack_require__(380); exports.info_circle = info_circle; -var italic = __webpack_require__(380); +var italic = __webpack_require__(381); exports.italic = italic; -var justify = __webpack_require__(381); +var justify = __webpack_require__(382); exports.justify = justify; -var left = __webpack_require__(382); +var left = __webpack_require__(383); exports.left = left; -var link = __webpack_require__(383); +var link = __webpack_require__(384); exports.link = link; -var lock = __webpack_require__(384); +var lock = __webpack_require__(385); exports.lock = lock; -var menu = __webpack_require__(385); +var menu = __webpack_require__(386); exports.menu = menu; -var merge = __webpack_require__(386); +var merge = __webpack_require__(387); exports.merge = merge; -var ok = __webpack_require__(387); +var ok = __webpack_require__(388); exports.ok = ok; -var ol = __webpack_require__(388); +var ol = __webpack_require__(389); exports.ol = ol; -var omega = __webpack_require__(389); +var omega = __webpack_require__(390); exports.omega = omega; -var outdent = __webpack_require__(390); +var outdent = __webpack_require__(391); exports.outdent = outdent; -var palette = __webpack_require__(391); +var palette = __webpack_require__(392); exports.palette = palette; -var paragraph = __webpack_require__(392); +var paragraph = __webpack_require__(393); exports.paragraph = paragraph; -var paste = __webpack_require__(393); +var paste = __webpack_require__(394); exports.paste = paste; -var pencil = __webpack_require__(394); +var pencil = __webpack_require__(395); exports.pencil = pencil; -var plus = __webpack_require__(395); +var plus = __webpack_require__(396); exports.plus = plus; -var print = __webpack_require__(396); +var print = __webpack_require__(397); exports.print = print; -var redo = __webpack_require__(397); +var redo = __webpack_require__(398); exports.redo = redo; -var resize = __webpack_require__(398); +var resize = __webpack_require__(399); exports.resize = resize; -var resizer = __webpack_require__(399); +var resizer = __webpack_require__(400); exports.resizer = resizer; -var right = __webpack_require__(400); +var right = __webpack_require__(401); exports.right = right; -var save = __webpack_require__(401); +var save = __webpack_require__(402); exports.save = save; -var search = __webpack_require__(402); +var search = __webpack_require__(403); exports.search = search; -var settings = __webpack_require__(403); +var settings = __webpack_require__(404); exports.settings = settings; -var select_all = __webpack_require__(404); +var select_all = __webpack_require__(405); exports.select_all = select_all; -var shrink = __webpack_require__(405); +var shrink = __webpack_require__(406); exports.shrink = shrink; -var source = __webpack_require__(406); +var source = __webpack_require__(407); exports.source = source; -var splitg = __webpack_require__(407); +var splitg = __webpack_require__(408); exports.splitg = splitg; -var splitv = __webpack_require__(408); +var splitv = __webpack_require__(409); exports.splitv = splitv; -var strikethrough = __webpack_require__(409); +var strikethrough = __webpack_require__(410); exports.strikethrough = strikethrough; -var subscript = __webpack_require__(410); +var subscript = __webpack_require__(411); exports.subscript = subscript; -var superscript = __webpack_require__(411); +var superscript = __webpack_require__(412); exports.superscript = superscript; -var table = __webpack_require__(412); +var table = __webpack_require__(413); exports.table = table; -var th = __webpack_require__(413); +var th = __webpack_require__(414); exports.th = th; -var th_list = __webpack_require__(414); +var th_list = __webpack_require__(415); exports.th_list = th_list; -var ul = __webpack_require__(415); +var ul = __webpack_require__(416); exports.ul = ul; -var underline = __webpack_require__(416); +var underline = __webpack_require__(417); exports.underline = underline; -var undo = __webpack_require__(417); +var undo = __webpack_require__(418); exports.undo = undo; -var unlink = __webpack_require__(418); +var unlink = __webpack_require__(419); exports.unlink = unlink; -var unlock = __webpack_require__(419); +var unlock = __webpack_require__(420); exports.unlock = unlock; -var update = __webpack_require__(420); +var update = __webpack_require__(421); exports.update = update; -var upload = __webpack_require__(421); +var upload = __webpack_require__(422); exports.upload = upload; -var valign = __webpack_require__(422); +var valign = __webpack_require__(423); exports.valign = valign; -var video = __webpack_require__(423); +var video = __webpack_require__(424); exports.video = video; /***/ }), -/* 343 */ +/* 344 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 344 */ +/* 345 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 345 */ +/* 346 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 346 */ +/* 347 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 347 */ +/* 348 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 348 */ +/* 349 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 349 */ +/* 350 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 350 */ +/* 351 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 351 */ +/* 352 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 352 */ +/* 353 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 353 */ +/* 354 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 354 */ +/* 355 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 355 */ +/* 356 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 356 */ +/* 357 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 357 */ +/* 358 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 358 */ +/* 359 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 359 */ +/* 360 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 360 */ +/* 361 */ /***/ ((module) => { module.exports = "" /***/ }), -/* 361 */ +/* 362 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 362 */ +/* 363 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 363 */ +/* 364 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 364 */ +/* 365 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 365 */ +/* 366 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 366 */ +/* 367 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 367 */ +/* 368 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 368 */ +/* 369 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 369 */ +/* 370 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 370 */ +/* 371 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 371 */ +/* 372 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 372 */ +/* 373 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 373 */ +/* 374 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 374 */ +/* 375 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 375 */ +/* 376 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 376 */ +/* 377 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 377 */ +/* 378 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 378 */ +/* 379 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 379 */ +/* 380 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 380 */ +/* 381 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 381 */ +/* 382 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 382 */ +/* 383 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 383 */ +/* 384 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 384 */ +/* 385 */ /***/ ((module) => { module.exports = "" /***/ }), -/* 385 */ +/* 386 */ /***/ ((module) => { module.exports = "" /***/ }), -/* 386 */ +/* 387 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 387 */ +/* 388 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 388 */ +/* 389 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 389 */ +/* 390 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 390 */ +/* 391 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 391 */ +/* 392 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 392 */ +/* 393 */ /***/ ((module) => { module.exports = "" /***/ }), -/* 393 */ +/* 394 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 394 */ +/* 395 */ /***/ ((module) => { module.exports = "" /***/ }), -/* 395 */ +/* 396 */ /***/ ((module) => { module.exports = "" /***/ }), -/* 396 */ +/* 397 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 397 */ +/* 398 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 398 */ +/* 399 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 399 */ +/* 400 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 400 */ +/* 401 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 401 */ +/* 402 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 402 */ +/* 403 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 403 */ +/* 404 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 404 */ +/* 405 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 405 */ +/* 406 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 406 */ +/* 407 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 407 */ +/* 408 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 408 */ +/* 409 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 409 */ +/* 410 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 410 */ +/* 411 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 411 */ +/* 412 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 412 */ +/* 413 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 413 */ +/* 414 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 414 */ +/* 415 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 415 */ +/* 416 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 416 */ +/* 417 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 417 */ +/* 418 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 418 */ +/* 419 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 419 */ +/* 420 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 420 */ +/* 421 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 421 */ +/* 422 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 422 */ +/* 423 */ /***/ ((module) => { module.exports = " " /***/ }), -/* 423 */ +/* 424 */ /***/ ((module) => { module.exports = " " @@ -33089,7 +33219,7 @@ var decorators = __webpack_require__(99); var consts = __webpack_require__(9); var Modules = __webpack_require__(10); var Plugins = __webpack_require__(233); -var Icons = __webpack_require__(342); +var Icons = __webpack_require__(343); Object.keys(consts).forEach(function (key) { jodit_1.Jodit[key] = consts[key]; }); diff --git a/build/jodit.min.css b/build/jodit.min.css index cc1af74d0..5e2614e3b 100644 --- a/build/jodit.min.css +++ b/build/jodit.min.css @@ -1,7 +1,7 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ diff --git a/build/jodit.min.js b/build/jodit.min.js index a8f235139..a755c2406 100644 --- a/build/jodit.min.js +++ b/build/jodit.min.js @@ -1,10 +1,10 @@ /*! * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.6.2 + * Version: v3.6.3 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,(function(){return(()=>{var e=[,(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(3),o(4),Array.from||(Array.from=function(e){if(e instanceof Set){var t=[];return e.forEach((function(e){return t.push(e)})),t}return[].slice.call(e)}),Array.prototype.includes||(Array.prototype.includes=function(e){return this.indexOf(e)>-1}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(e),r=1;arguments.length>r;r++){var n=arguments[r];if(null!=n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=n[i])}return o},writable:!0,configurable:!0}),Array.prototype.find||(Array.prototype.find=function(e){return this.indexOf(e)>-1?e:void 0})},()=>{"use strict";"document"in window.self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(e){if("Element"in e){var t="classList",o=e.Element.prototype,r=Object,n=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},i=Array.prototype.indexOf||function(e){for(var t=0,o=this.length;o>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},s=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return i.call(e,t)},l=function(e){for(var t=n.call(e.getAttribute("class")||""),o=t?t.split(/\s+/):[],r=0,i=o.length;i>r;r++)this.push(o[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=l.prototype=[],u=function(){return new l(this)};if(a.prototype=Error.prototype,c.item=function(e){return this[e]||null},c.contains=function(e){return-1!==s(this,e+="")},c.add=function(){var e,t=arguments,o=0,r=t.length,n=!1;do{-1===s(this,e=t[o]+"")&&(this.push(e),n=!0)}while(++oo;o++)t.call(this,e=arguments[o])}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:o.call(this,e)}}e=null}())},(e,t,o)=>{"use strict";e.exports=o(5).polyfill()},function(e,t,o){"use strict";e.exports=function(){function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,n=void 0,i=void 0,a=function(e,t){f[r]=e,f[r+1]=t,2===(r+=2)&&(i?i(h):b())},s="undefined"!=typeof window?window:void 0,l=s||{},c=l.MutationObserver||l.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(h,1)}}var f=new Array(1e3);function h(){for(var e=0;r>e;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;r=0}var m,v,g,y,b=void 0;function _(e,t){var o=this,r=new this.constructor(C);void 0===r[S]&&M(r);var n=o._state;if(n){var i=arguments[n-1];a((function(){return z(n,r,i,o._result)}))}else P(o,r,e,t);return r}function w(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(C);return E(t,e),t}b=u?function(){return process.nextTick(h)}:c?(v=0,g=new c(h),y=document.createTextNode(""),g.observe(y,{characterData:!0}),function(){y.data=v=++v%2}):d?((m=new MessageChannel).port1.onmessage=h,function(){return m.port2.postMessage(0)}):void 0===s?function(){try{var e=Function("return this")().require("vertx");return void 0!==(n=e.runOnLoop||e.runOnContext)?function(){n(h)}:p()}catch(e){return p()}}():p();var S=Math.random().toString(36).substring(2);function C(){}var k=void 0;function j(t,o,r){o.constructor===t.constructor&&r===_&&o.constructor.resolve===w?function(e,t){1===t._state?x(e,t._result):2===t._state?T(e,t._result):P(t,void 0,(function(t){return E(e,t)}),(function(t){return T(e,t)}))}(t,o):void 0===r?x(t,o):e(r)?function(e,t,o){a((function(e){var r=!1,n=function(o,n,i,a){try{o.call(n,(function(o){r||(r=!0,t!==o?E(e,o):x(e,o))}),(function(t){r||(r=!0,T(e,t))}))}catch(e){return e}}(o,t);!r&&n&&(r=!0,T(e,n))}),e)}(t,o,r):x(t,o)}function E(e,t){if(e===t)T(e,new TypeError("You cannot resolve a promise with itself"));else if(n=typeof(r=t),null===r||"object"!==n&&"function"!==n)x(e,t);else{var o=void 0;try{o=t.then}catch(t){return void T(e,t)}j(e,t,o)}var r,n}function I(e){e._onerror&&e._onerror(e._result),D(e)}function x(e,t){e._state===k&&(e._result=t,e._state=1,0!==e._subscribers.length&&a(D,e))}function T(e,t){e._state===k&&(e._state=2,e._result=t,a(I,e))}function P(e,t,o,r){var n=e._subscribers,i=n.length;e._onerror=null,n[i]=t,n[i+1]=o,n[i+2]=r,0===i&&e._state&&a(D,e)}function D(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var r=void 0,n=void 0,i=e._result,a=0;t.length>a;a+=3)n=t[a+o],(r=t[a])?z(o,r,n,i):n(i);e._subscribers.length=0}}function z(t,o,r,n){var i=e(r),a=void 0,s=void 0,l=!0;if(i){try{a=r(n)}catch(e){l=!1,s=e}if(o===a)return void T(o,new TypeError("A promises callback cannot return that same promise."))}else a=n;o._state!==k||(i&&l?E(o,a):!1===l?T(o,s):1===t?x(o,a):2===t&&T(o,a))}var A=0;function M(e){e[S]=A++,e._state=void 0,e._result=void 0,e._subscribers=[]}var L=function(){function e(e,o){this._instanceConstructor=e,this.promise=new e(C),this.promise[S]||M(this.promise),t(o)?(this.length=o.length,this._remaining=o.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(o),0===this._remaining&&x(this.promise,this._result))):T(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===k&&e.length>t;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var o=this._instanceConstructor,r=o.resolve;if(r===w){var n=void 0,i=void 0,a=!1;try{n=e.then}catch(e){a=!0,i=e}if(n===_&&e._state!==k)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(o===O){var s=new o(C);a?T(s,i):j(s,e,n),this._willSettleAt(s,t)}else this._willSettleAt(new o((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,o){var r=this.promise;r._state===k&&(this._remaining--,2===e?T(r,o):this._result[t]=o),0===this._remaining&&x(r,this._result)},e.prototype._willSettleAt=function(e,t){var o=this;P(e,void 0,(function(e){return o._settledAt(1,t,e)}),(function(e){return o._settledAt(2,t,e)}))},e}(),O=function(){function t(e){this[S]=A++,this._result=this._state=void 0,this._subscribers=[],C!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){E(e,t)}),(function(t){T(e,t)}))}catch(t){T(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var o=this,r=o.constructor;return e(t)?o.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):o.then(t,t)},t}();return O.prototype.then=_,O.all=function(e){return new L(this,e).promise},O.race=function(e){var o=this;return t(e)?new o((function(t,r){for(var n=e.length,i=0;n>i;i++)o.resolve(e[i]).then(t,r)})):new o((function(e,t){return t(new TypeError("You must pass an array to race."))}))},O.resolve=w,O.reject=function(e){var t=new this(C);return T(t,e),t},O._setScheduler=function(e){i=e},O._setAsap=function(e){a=e},O._asap=a,O.polyfill=function(){var e=void 0;if(void 0!==o.g)e=o.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=O},O.Promise=O,O}()},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jodit=void 0;var r=o(7),n=o(8),i=o(9),a=o(10),s=o(19),l=o(168),c=o(165),u=o(30),d=o(99),Jodit=function(e){function Jodit(t,o){var r=e.call(this,o,!0)||this;r.isJodit=!0,r.__defaultStyleDisplayKey="data-jodit-default-style-display",r.__defaultClassesKey="data-jodit-default-classes",r.commands={},r.__selectionLocked=null,r.__wasReadOnly=!1,r.createInside=new a.Create((function(){return r.ed}),r.o.createAttributes),r.editorIsActive=!1,r.__mode=i.MODE_WYSIWYG,r.__callChangeCount=0,r.elementToPlace=new Map;try{s.resolveElement(t,r.o.shadowRoot||r.od)}catch(e){throw r.destruct(),e}r.setStatus(a.STATUSES.beforeInit),r.id=s.attr(s.resolveElement(t,r.o.shadowRoot||r.od),"id")||(new Date).getTime().toString(),u.instances[r.id]=r,r.storage=l.Storage.makeStorage(!0,r.id),r.attachEvents(r.o),r.e.on(r.ow,"resize",(function(){r.e&&r.e.fire("resize")})),r.e.on("prepareWYSIWYGEditor",r.prepareWYSIWYGEditor),r.selection=new a.Select(r);var n=r.beforeInitHook();return s.callPromise(n,(function(){r.e.fire("beforeInit",r);var e=u.pluginSystem.init(r);s.callPromise(e,(function(){r.e.fire("afterPluginSystemInit",r),r.e.on("changePlace",(function(){r.setReadOnly(r.o.readonly),r.setDisabled(r.o.disabled)})),r.places.length=0;var e=r.addPlace(t,o);u.instances[r.id]=r,s.callPromise(e,(function(){r.e&&r.e.fire("afterInit",r),r.afterInitHook(),r.setStatus(a.STATUSES.ready),r.e.fire("afterConstructor",r)}))}))})),r}return r.__extends(Jodit,e),Jodit.prototype.className=function(){return"Jodit"},Object.defineProperty(Jodit.prototype,"text",{get:function(){if(this.editor)return this.editor.innerText||"";var e=this.createInside.div();return e.innerHTML=this.getElementValue(),e.innerText||""},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"value",{get:function(){return this.getEditorValue()},set:function(e){this.setEditorValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"defaultTimeout",{get:function(){return this.options&&this.o.observer?this.o.observer.timeout:n.Config.defaultOptions.observer.timeout},enumerable:!1,configurable:!0}),Jodit.atom=function(e){return s.markAsAtomic(e)},Jodit.make=function(e,t){return new Jodit(e,t)},Object.defineProperty(Jodit,"defaultOptions",{get:function(){return n.Config.defaultOptions},enumerable:!1,configurable:!0}),Jodit.prototype.setPlaceField=function(e,t){this.currentPlace||(this.currentPlace={},this.places=[this.currentPlace]),this.currentPlace[e]=t},Object.defineProperty(Jodit.prototype,"element",{get:function(){return this.currentPlace.element},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"editor",{get:function(){return this.currentPlace.editor},set:function(e){this.setPlaceField("editor",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"container",{get:function(){return this.currentPlace.container},set:function(e){this.setPlaceField("container",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"workplace",{get:function(){return this.currentPlace.workplace},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"statusbar",{get:function(){return this.currentPlace.statusbar},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"iframe",{get:function(){return this.currentPlace.iframe},set:function(e){this.setPlaceField("iframe",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"observer",{get:function(){return this.currentPlace.observer},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"editorWindow",{get:function(){return this.currentPlace.editorWindow},set:function(e){this.setPlaceField("editorWindow",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"ew",{get:function(){return this.editorWindow},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"editorDocument",{get:function(){return this.currentPlace.editorWindow.document},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"ed",{get:function(){return this.editorDocument},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"options",{get:function(){return this.currentPlace.options},set:function(e){this.setPlaceField("options",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"s",{get:function(){return this.selection},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"uploader",{get:function(){return this.getInstance("Uploader",this.o.uploader)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"filebrowser",{get:function(){var e=this,t=s.ConfigProto({defaultTimeout:e.defaultTimeout,uploader:e.o.uploader,language:e.o.language,license:e.o.license,theme:e.o.theme,defaultCallback:function(t){t.files&&t.files.length&&t.files.forEach((function(o,r){var n=t.baseurl+o;t.isImages&&t.isImages[r]?e.s.insertImage(n,null,e.o.imageDefaultWidth):e.s.insertNode(e.createInside.fromHTML(""+n+""))}))}},this.o.filebrowser);return e.getInstance("FileBrowser",t)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"mode",{get:function(){return this.__mode},set:function(e){this.setMode(e)},enumerable:!1,configurable:!0}),Jodit.prototype.getNativeEditorValue=function(){var e=this.e.fire("beforeGetNativeEditorValue");return s.isString(e)?e:this.editor?this.editor.innerHTML:this.getElementValue()},Jodit.prototype.setNativeEditorValue=function(e){this.e.fire("beforeSetNativeEditorValue",e)||this.editor&&(this.editor.innerHTML=e)},Jodit.prototype.getEditorValue=function(e){var t;if(void 0===e&&(e=!0),void 0!==(t=this.e.fire("beforeGetValueFromEditor")))return t;t=this.getNativeEditorValue().replace(i.INVISIBLE_SPACE_REG_EXP(),""),e&&(t=t.replace(/]+id="jodit-selection_marker_[^>]+><\/span>/g,"")),"
"===t&&(t="");var o={value:t};return this.e.fire("afterGetValueFromEditor",o),o.value},Jodit.prototype.setEditorValue=function(e){var t=this.e.fire("beforeSetValueToEditor",e);if(!1!==t)if(s.isString(t)&&(e=t),this.editor){if(!s.isString(e)&&!s.isVoid(e))throw s.error("value must be string");void 0!==e&&this.getNativeEditorValue()!==e&&this.setNativeEditorValue(e),this.e.fire("postProcessSetEditorValue");var o=this.getElementValue(),r=this.getEditorValue();if(o!==r&&i.SAFE_COUNT_CHANGE_CALL>this.__callChangeCount){this.setElementValue(r),this.__callChangeCount+=1;try{this.observer.upTick(),this.e.fire("change",r,o),this.e.fire(this.observer,"change",r,o)}finally{this.__callChangeCount=0}}}else void 0!==e&&this.setElementValue(e)},Jodit.prototype.getElementValue=function(){return void 0!==this.element.value?this.element.value:this.element.innerHTML},Jodit.prototype.setElementValue=function(e){if(!s.isString(e)&&void 0!==e)throw s.error("value must be string");void 0!==e?this.element!==this.container&&(void 0!==this.element.value?this.element.value=e:this.element.innerHTML=e):e=this.getElementValue(),e!==this.getEditorValue()&&this.setEditorValue(e)},Jodit.prototype.registerCommand=function(e,t,o){var r=e.toLowerCase();if(void 0===this.commands[r]&&(this.commands[r]=[]),this.commands[r].push(t),!s.isFunction(t)){var n=this.o.commandToHotkeys[r]||this.o.commandToHotkeys[e]||t.hotkeys;n&&this.registerHotkeyToCommand(n,r,null==o?void 0:o.stopPropagation)}return this},Jodit.prototype.registerHotkeyToCommand=function(e,t,o){var r=this;void 0===o&&(o=!0);var n=s.asArray(e).map(s.normalizeKeyAliases).map((function(e){return e+".hotkey"})).join(" ");this.e.off(n).on(n,(function(e,n){return n.shouldStop=null==o||o,r.execCommand(t)}))},Jodit.prototype.execCommand=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=null),!this.o.readonly||"selectall"===e){var r;if(e=e.toLowerCase(),!1!==(r=this.e.fire("beforeCommand",e,t,o))&&(r=this.execCustomCommands(e,t,o)),!1!==r)if(this.s.focus(),"selectall"===e)this.s.select(this.editor,!0);else try{r=this.ed.execCommand(e,t,o)}catch(e){}return this.e.fire("afterCommand",e,t,o),this.setEditorValue(),r}},Jodit.prototype.execCustomCommands=function(e,t,o){var r,n;if(void 0===t&&(t=!1),void 0===o&&(o=null),e=e.toLowerCase(),void 0!==this.commands[e]){for(var i,a=0;this.commands[e].length>a;a+=1)void 0!==(n=(s.isFunction(r=this.commands[e][a])?r:r.exec).call(this,e,t,o))&&(i=n);return i}},Jodit.prototype.lock=function(t){return void 0===t&&(t="any"),!!e.prototype.lock.call(this,t)&&(this.__selectionLocked=this.s.save(),this.s.clear(),this.editor.classList.add("jodit_disabled"),this.e.fire("lock",!0),!0)},Jodit.prototype.unlock=function(){return!!e.prototype.unlock.call(this)&&(this.editor.classList.remove("jodit_disabled"),this.__selectionLocked&&this.s.restore(this.__selectionLocked),this.e.fire("lock",!1),!0)},Jodit.prototype.getMode=function(){return this.mode},Jodit.prototype.isEditorMode=function(){return this.getRealMode()===i.MODE_WYSIWYG},Jodit.prototype.getRealMode=function(){if(this.getMode()!==i.MODE_SPLIT)return this.getMode();var e=this.od.activeElement;return e&&(e===this.iframe||a.Dom.isOrContains(this.editor,e)||a.Dom.isOrContains(this.toolbar.container,e))?i.MODE_WYSIWYG:i.MODE_SOURCE},Jodit.prototype.setMode=function(e){var t=this,o=this.getMode(),r={mode:parseInt(e.toString(),10)},n=["jodit-wysiwyg_mode","jodit-source__mode","jodit_split_mode"];!1!==this.e.fire("beforeSetMode",r)&&(this.__mode=[i.MODE_SOURCE,i.MODE_WYSIWYG,i.MODE_SPLIT].includes(r.mode)?r.mode:i.MODE_WYSIWYG,this.o.saveModeInStorage&&this.storage.set("jodit_default_mode",this.mode),n.forEach((function(e){t.container.classList.remove(e)})),this.container.classList.add(n[this.mode-1]),o!==this.getMode()&&this.e.fire("afterSetMode"))},Jodit.prototype.toggleMode=function(){var e=this.getMode();[i.MODE_SOURCE,i.MODE_WYSIWYG,this.o.useSplitMode?i.MODE_SPLIT:9].includes(e+1)?e+=1:e=i.MODE_WYSIWYG,this.setMode(e)},Jodit.prototype.setDisabled=function(e){this.o.disabled=e;var t=this.__wasReadOnly;this.setReadOnly(e||t),this.__wasReadOnly=t,this.editor&&(this.editor.setAttribute("aria-disabled",e.toString()),this.container.classList.toggle("jodit_disabled",e),this.e.fire("disabled",e))},Jodit.prototype.getDisabled=function(){return this.o.disabled},Jodit.prototype.setReadOnly=function(e){this.__wasReadOnly!==e&&(this.__wasReadOnly=e,this.o.readonly=e,e?this.editor&&this.editor.removeAttribute("contenteditable"):this.editor&&this.editor.setAttribute("contenteditable","true"),this.e&&this.e.fire("readonly",e))},Jodit.prototype.getReadOnly=function(){return this.o.readonly},Jodit.prototype.beforeInitHook=function(){},Jodit.prototype.afterInitHook=function(){},Jodit.prototype.initOptions=function(e){this.options=s.ConfigProto(e||{},n.Config.defaultOptions)},Jodit.prototype.initOwners=function(){this.editorWindow=this.o.ownerWindow,this.ownerWindow=this.o.ownerWindow},Jodit.prototype.addPlace=function(e,t){var o=this,r=s.resolveElement(e,this.o.shadowRoot||this.od);this.attachEvents(t),r.attributes&&s.toArray(r.attributes).forEach((function(e){var r=e.name,i=e.value;void 0===n.Config.defaultOptions[r]||t&&void 0!==t[r]||(-1!==["readonly","disabled"].indexOf(r)&&(i=""===i||"true"===i),/^[0-9]+(\.)?([0-9]+)?$/.test(i.toString())&&(i=Number(i)),o.options[r]=i)}));var i=this.c.div("jodit-container");i.classList.add("jodit"),i.classList.add("jodit-container"),i.classList.add("jodit_theme_"+(this.o.theme||"default")),i.setAttribute("contenteditable","false");var l=null;this.o.inline&&(-1===["TEXTAREA","INPUT"].indexOf(r.nodeName)&&(i=r,r.setAttribute(this.__defaultClassesKey,r.className.toString()),l=i.innerHTML,i.innerHTML=""),i.classList.add("jodit_inline"),i.classList.add("jodit-container")),r!==i&&(r.style.display&&r.setAttribute(this.__defaultStyleDisplayKey,r.style.display),r.style.display="none");var c=this.c.div("jodit-workplace",{contenteditable:!1});i.appendChild(c);var u=new a.StatusBar(this,i);r.parentNode&&r!==i&&r.parentNode.insertBefore(i,r);var d=this.c.div("jodit-wysiwyg",{contenteditable:!0,"aria-disabled":!1,tabindex:this.o.tabIndex});c.appendChild(d);var p={editor:d,element:r,container:i,workplace:c,statusbar:u,options:this.isReady?s.ConfigProto(t||{},n.Config.defaultOptions):this.options,observer:new a.Observer(this),editorWindow:this.ow};this.elementToPlace.set(d,p),this.setCurrentPlace(p),this.places.push(p),this.setNativeEditorValue(this.getElementValue());var f=this.initEditor(l),h=this.options;return s.callPromise(f,(function(){h.enableDragAndDropFileToEditor&&h.uploader&&(h.uploader.url||h.uploader.insertImageAsBase64URI)&&o.uploader.bind(o.editor),o.elementToPlace.get(o.editor)||o.elementToPlace.set(o.editor,p),o.e.fire("afterAddPlace",p)}))},Jodit.prototype.addDisclaimer=function(e){this.workplace.appendChild(e)},Jodit.prototype.setCurrentPlace=function(e){this.currentPlace!==e&&(this.isEditorMode()||this.setMode(i.MODE_WYSIWYG),this.currentPlace=e,this.buildToolbar(),this.isReady&&this.e.fire("changePlace",e))},Jodit.prototype.initEditor=function(e){var t=this,o=this.createEditor();return s.callPromise(o,(function(){if(!t.isInDestruct){t.element!==t.container?t.setElementValue():null!=e&&t.setEditorValue(e);var o=t.o.defaultMode;if(t.o.saveModeInStorage){var r=t.storage.get("jodit_default_mode");"string"==typeof r&&(o=parseInt(r,10))}t.setMode(o),t.o.readonly&&(t.__wasReadOnly=!1,t.setReadOnly(!0)),t.o.disabled&&t.setDisabled(!0);try{t.ed.execCommand("defaultParagraphSeparator",!1,t.o.enter.toLowerCase())}catch(e){}try{t.ed.execCommand("enableObjectResizing",!1,"false")}catch(e){}try{t.ed.execCommand("enableInlineTableEditing",!1,"false")}catch(e){}}}))},Jodit.prototype.createEditor=function(){var e=this,t=this.editor,o=this.e.fire("createEditor",this);return s.callPromise(o,(function(){if(!e.isInDestruct){if((!1===o||s.isPromise(o))&&a.Dom.safeRemove(t),e.o.editorCssClass&&e.editor.classList.add(e.o.editorCssClass),e.o.style&&s.css(e.editor,e.o.style),e.e.on("synchro",(function(){e.setEditorValue()})).on("focus",(function(){e.editorIsActive=!0})).on("blur",(function(){return e.editorIsActive=!1})),e.prepareWYSIWYGEditor(),e.o.direction){var r="rtl"===e.o.direction.toLowerCase()?"rtl":"ltr";e.container.style.direction=r,e.container.setAttribute("dir",r),e.toolbar.setDirection(r)}e.o.triggerChangeEvent&&e.e.on("change",e.async.debounce((function(){e.e&&e.e.fire(e.element,"change")}),e.defaultTimeout))}}))},Jodit.prototype.attachEvents=function(e){var t=this,o=null==e?void 0:e.events;o&&Object.keys(o).forEach((function(e){return t.e.on(e,o[e])}))},Jodit.prototype.prepareWYSIWYGEditor=function(){var e=this,t=this.editor;if(this.o.spellcheck&&this.editor.setAttribute("spellcheck","true"),this.o.direction){var o="rtl"===this.o.direction.toLowerCase()?"rtl":"ltr";this.editor.style.direction=o,this.editor.setAttribute("dir",o)}this.e.on(t,"mousedown touchstart focus",(function(){var o=e.elementToPlace.get(t);o&&e.setCurrentPlace(o)})).on(t,"compositionend",(function(){e.setEditorValue()})).on(t,"selectionchange selectionstart keydown keyup keypress dblclick mousedown mouseup click copy cut dragstart drop dragover paste resize touchstart touchend focus blur",(function(t){if(!e.o.readonly&&!(t instanceof e.ew.KeyboardEvent&&t.isComposing)&&e.e&&e.e.fire){if(!1===e.e.fire(t.type,t))return!1;e.setEditorValue()}}))},Jodit.prototype.destruct=function(){var t=this;if(!this.isInDestruct&&(this.setStatus(a.STATUSES.beforeDestruct),this.elementToPlace.clear(),this.editor)){var o=this.getEditorValue();this.storage.clear(),this.buffer.clear(),this.commands={},this.__selectionLocked=null,this.e.off(this.ow,"resize"),this.e.off(this.ow),this.e.off(this.od),this.e.off(this.od.body),this.places.forEach((function(e){var r=e.container,n=e.workplace,i=e.statusbar,l=e.element,c=e.iframe,u=e.editor,d=e.observer;if(l!==r)if(l.hasAttribute(t.__defaultStyleDisplayKey)){var p=s.attr(l,t.__defaultStyleDisplayKey);p&&(l.style.display=p,l.removeAttribute(t.__defaultStyleDisplayKey))}else l.style.display="";else l.hasAttribute(t.__defaultClassesKey)&&(l.className=s.attr(l,t.__defaultClassesKey)||"",l.removeAttribute(t.__defaultClassesKey));l.hasAttribute("style")&&!s.attr(l,"style")&&l.removeAttribute("style"),!i.isInDestruct&&i.destruct(),t.e.off(r),t.e.off(l),t.e.off(u),a.Dom.safeRemove(n),a.Dom.safeRemove(u),r!==l&&a.Dom.safeRemove(r),a.Dom.safeRemove(c),r===l&&(l.innerHTML=o),!d.isInDestruct&&d.destruct()})),this.places.length=0,this.currentPlace={},delete u.instances[this.id],e.prototype.destruct.call(this)}},Jodit.plugins=u.pluginSystem,Jodit.modules=u.modules,Jodit.ns=u.modules,Jodit.decorators={},Jodit.instances=u.instances,Jodit.lang=u.lang,Jodit.core={Plugin:a.Plugin},r.__decorate([d.cache],Jodit.prototype,"uploader",null),r.__decorate([d.cache],Jodit.prototype,"filebrowser",null),r.__decorate([d.autobind],Jodit.prototype,"prepareWYSIWYGEditor",null),Jodit}(c.ViewWithToolbar);t.Jodit=Jodit},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__classPrivateFieldSet=t.__classPrivateFieldGet=t.__importDefault=t.__importStar=t.__makeTemplateObject=t.__asyncValues=t.__asyncDelegator=t.__asyncGenerator=t.__await=t.__spreadArray=t.__spreadArrays=t.__spread=t.__read=t.__values=t.__exportStar=t.__createBinding=t.__generator=t.__awaiter=t.__metadata=t.__param=t.__decorate=t.__rest=t.__assign=t.__extends=void 0;var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}function i(e){return this instanceof i?(this.v=e,this):new i(e)}t.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;r>o;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.__assign.apply(this,arguments)},t.__rest=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);r.length>n;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o},t.__decorate=function(e,t,o,r){var n,i=arguments.length,a=3>i?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(3>i?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},t.__param=function(e,t){return function(o,r){t(o,r,e)}},t.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.__awaiter=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},t.__generator=function(e,t){var o,r,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&n[3]>i[1])){a.label=i[1];break}if(6===i[0]&&n[1]>a.label){a.label=n[1],n=i;break}if(n&&n[2]>a.label){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{o=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},t.__createBinding=Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]},t.__exportStar=function(e,o){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(o,r)||t.__createBinding(o,e,r)},t.__values=r,t.__read=n,t.__spread=function(){for(var e=[],t=0;arguments.length>t;t++)e=e.concat(n(arguments[t]));return e},t.__spreadArrays=function(){for(var e=0,t=0,o=arguments.length;o>t;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;o>t;t++)for(var i=arguments[t],a=0,s=i.length;s>a;a++,n++)r[n]=i[a];return r},t.__spreadArray=function(e,t){for(var o=0,r=t.length,n=e.length;r>o;o++,n++)e[n]=t[o];return e},t.__await=i,t.__asyncGenerator=function(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,n=o.apply(e,t||[]),a=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){n[e]&&(r[e]=function(t){return new Promise((function(o,r){a.push([e,t,o,r])>1||l(e,t)}))})}function l(e,t){try{(o=n[e](t)).value instanceof i?Promise.resolve(o.value.v).then(c,u):d(a[0][2],o)}catch(e){d(a[0][3],e)}var o}function c(e){l("next",e)}function u(e){l("throw",e)}function d(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}},t.__asyncDelegator=function(e){var t,o;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(o=!o)?{value:i(e[r](t)),done:"return"===r}:n?n(t):t}:n}},t.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,o=e[Symbol.asyncIterator];return o?o.call(e):(e=r(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(o){t[o]=e[o]&&function(t){return new Promise((function(r,n){!function(e,t,o,r){Promise.resolve(r).then((function(t){e({value:t,done:o})}),t)}(r,n,(t=e[o](t)).done,t.value)}))}}},t.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var a=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};t.__importStar=function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t.__createBinding(o,e,r);return a(o,e),o},t.__importDefault=function(e){return e&&e.__esModule?e:{default:e}},t.__classPrivateFieldGet=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},t.__classPrivateFieldSet=function(e,t,o){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,o),o}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;var r=o(9),n=function(){function e(){this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window:null,this.shadowRoot=null,this.zIndex=0,this.readonly=!1,this.disabled=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots","selectall"],this.toolbarButtonSize="middle",this.allowTabNavigation=!1,this.inline=!1,this.theme="default",this.saveModeInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n=!1,this.tabIndex=-1,this.toolbar=!0,this.statusbar=!0,this.showTooltip=!0,this.showTooltipDelay=1e3,this.useNativeTooltip=!1,this.enter=r.PARAGRAPH,this.enterBlock="br"!==this.enter?this.enter:r.PARAGRAPH,this.defaultMode=r.MODE_WYSIWYG,this.useSplitMode=!1,this.colors={greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]},this.colorPickerDefaultTab="background",this.imageDefaultWidth=300,this.removeButtons=[],this.disablePlugins=[],this.extraPlugins=[],this.extraButtons=[],this.extraIcons={},this.createAttributes={},this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=[{group:"source",buttons:[]},{group:"font-style",buttons:[]},{group:"script",buttons:[]},{group:"list",buttons:["ul","ol"]},{group:"indent",buttons:[]},{group:"font",buttons:[]},{group:"color",buttons:[]},{group:"media",buttons:[]},"\n",{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}],this.buttonsMD=["source","|","bold","italic","|","ul","ol","eraser","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","\n","undo","redo","|","hr","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","eraser","|","fontsize","brush","paragraph","|","image","table","\n","link","|","align","|","undo","redo","|","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","eraser","\n","align","|","undo","redo","|","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!0}return Object.defineProperty(e,"defaultOptions",{get:function(){return e.__defaultOptions||(e.__defaultOptions=new e),e.__defaultOptions},enumerable:!1,configurable:!0}),e}();t.Config=n,n.prototype.controls={}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BASE_PATH=t.KEY_ALIASES=t.IS_MAC=t.SAFE_COUNT_CHANGE_CALL=t.INSERT_ONLY_TEXT=t.INSERT_AS_TEXT=t.INSERT_CLEAR_HTML=t.INSERT_AS_HTML=t.EMULATE_DBLCLICK_TIMEOUT=t.MARKER_CLASS=t.TEXT_HTML=t.TEXT_PLAIN=t.IS_IE=t.MODE_SPLIT=t.MODE_SOURCE=t.MODE_WYSIWYG=t.PARAGRAPH=t.BR=t.COMMAND_KEYS=t.ACCURACY=t.NEARBY=t.KEY_F3=t.KEY_DELETE=t.KEY_SPACE=t.KEY_DOWN=t.KEY_RIGHT=t.KEY_UP=t.KEY_LEFT=t.KEY_ESC=t.KEY_ENTER=t.KEY_TAB=t.KEY_BACKSPACE=t.MAY_BE_REMOVED_WITH_KEY=t.INSEPARABLE_TAGS=t.IS_INLINE=t.IS_BLOCK=t.SPACE_REG_EXP_END=t.SPACE_REG_EXP_START=t.SPACE_REG_EXP=t.INVISIBLE_SPACE_REG_EXP_START=t.INVISIBLE_SPACE_REG_EXP_END=t.INVISIBLE_SPACE_REG_EXP=t.NBSP_SPACE=t.INVISIBLE_SPACE=void 0,t.INVISIBLE_SPACE="\ufeff",t.NBSP_SPACE=" ",t.INVISIBLE_SPACE_REG_EXP=function(){return/[\uFEFF]/g},t.INVISIBLE_SPACE_REG_EXP_END=function(){return/[\uFEFF]+$/g},t.INVISIBLE_SPACE_REG_EXP_START=function(){return/^[\uFEFF]+/g},t.SPACE_REG_EXP=function(){return/[\s\n\t\r\uFEFF\u200b]+/g},t.SPACE_REG_EXP_START=function(){return/^[\s\n\t\r\uFEFF\u200b]+/g},t.SPACE_REG_EXP_END=function(){return/[\s\n\t\r\uFEFF\u200b]+$/g},t.IS_BLOCK=/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i,t.IS_INLINE=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i,t.INSEPARABLE_TAGS=["img","br","video","iframe","script","input","textarea","hr","link","jodit","jodit-media"],t.MAY_BE_REMOVED_WITH_KEY=RegExp("^"+t.INSEPARABLE_TAGS.join("|")+"$","i"),t.KEY_BACKSPACE="Backspace",t.KEY_TAB="Tab",t.KEY_ENTER="Enter",t.KEY_ESC="Escape",t.KEY_LEFT="ArrowLeft",t.KEY_UP="ArrowUp",t.KEY_RIGHT="ArrowRight",t.KEY_DOWN="ArrowDown",t.KEY_SPACE="Space",t.KEY_DELETE="Delete",t.KEY_F3="F3",t.NEARBY=5,t.ACCURACY=10,t.COMMAND_KEYS=[t.KEY_BACKSPACE,t.KEY_DELETE,t.KEY_UP,t.KEY_DOWN,t.KEY_RIGHT,t.KEY_LEFT,t.KEY_ENTER,t.KEY_ESC,t.KEY_F3,t.KEY_TAB],t.BR="br",t.PARAGRAPH="p",t.MODE_WYSIWYG=1,t.MODE_SOURCE=2,t.MODE_SPLIT=3,t.IS_IE="undefined"!=typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),t.TEXT_PLAIN=t.IS_IE?"text":"text/plain",t.TEXT_HTML=t.IS_IE?"html":"text/html",t.MARKER_CLASS="jodit-selection_marker",t.EMULATE_DBLCLICK_TIMEOUT=300,t.INSERT_AS_HTML="insert_as_html",t.INSERT_CLEAR_HTML="insert_clear_html",t.INSERT_AS_TEXT="insert_as_text",t.INSERT_ONLY_TEXT="insert_only_text",t.SAFE_COUNT_CHANGE_CALL=10,t.IS_MAC="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t.KEY_ALIASES={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:t.IS_MAC?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},t.BASE_PATH=function(){if("undefined"==typeof document)return"";var e=document.currentScript,t=function(e){return e.replace(/\/[^/]+.js$/,"/")};if(e)return t(e.src);var o=document.querySelectorAll("script[src]");return o&&o.length?t(o[o.length-1].src):window.location.href}()},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PluginSystem=t.Uploader=t.ToolbarCollection=t.ToolbarEditorCollection=t.Table=t.StatusBar=t.Snapshot=t.Style=t.Select=t.Observer=t.ImageEditor=t.Helpers=t.FileBrowser=t.ViewWithToolbar=t.View=t.Icon=t.ProgressBar=t.UIBlock=t.UICheckbox=t.UITextArea=t.UIInput=t.UIForm=t.UIList=t.UIGroup=t.UISeparator=t.Popup=t.UIButton=t.UIElement=t.Create=t.Plugin=t.Dom=t.Dialog=t.Prompt=t.Confirm=t.Alert=t.ContextMenu=t.STATUSES=t.ViewComponent=t.Component=t.Ajax=t.Async=void 0;var r=o(7);r.__exportStar(o(11),t);var n=o(158);Object.defineProperty(t,"Async",{enumerable:!0,get:function(){return n.Async}});var i=o(159);Object.defineProperty(t,"Ajax",{enumerable:!0,get:function(){return i.Ajax}});var a=o(27);Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return a.Component}}),Object.defineProperty(t,"ViewComponent",{enumerable:!0,get:function(){return a.ViewComponent}}),Object.defineProperty(t,"STATUSES",{enumerable:!0,get:function(){return a.STATUSES}});var s=o(160);Object.defineProperty(t,"ContextMenu",{enumerable:!0,get:function(){return s.ContextMenu}});var l=o(162);Object.defineProperty(t,"Alert",{enumerable:!0,get:function(){return l.Alert}}),Object.defineProperty(t,"Confirm",{enumerable:!0,get:function(){return l.Confirm}}),Object.defineProperty(t,"Prompt",{enumerable:!0,get:function(){return l.Prompt}}),Object.defineProperty(t,"Dialog",{enumerable:!0,get:function(){return l.Dialog}});var c=o(32);Object.defineProperty(t,"Dom",{enumerable:!0,get:function(){return c.Dom}});var u=o(183);Object.defineProperty(t,"Plugin",{enumerable:!0,get:function(){return u.Plugin}});var d=o(184);Object.defineProperty(t,"Create",{enumerable:!0,get:function(){return d.Create}});var p=o(75);Object.defineProperty(t,"UIElement",{enumerable:!0,get:function(){return p.UIElement}}),Object.defineProperty(t,"UIButton",{enumerable:!0,get:function(){return p.UIButton}}),Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return p.Popup}}),Object.defineProperty(t,"UISeparator",{enumerable:!0,get:function(){return p.UISeparator}}),Object.defineProperty(t,"UIGroup",{enumerable:!0,get:function(){return p.UIGroup}}),Object.defineProperty(t,"UIList",{enumerable:!0,get:function(){return p.UIList}}),Object.defineProperty(t,"UIForm",{enumerable:!0,get:function(){return p.UIForm}}),Object.defineProperty(t,"UIInput",{enumerable:!0,get:function(){return p.UIInput}}),Object.defineProperty(t,"UITextArea",{enumerable:!0,get:function(){return p.UITextArea}}),Object.defineProperty(t,"UICheckbox",{enumerable:!0,get:function(){return p.UICheckbox}}),Object.defineProperty(t,"UIBlock",{enumerable:!0,get:function(){return p.UIBlock}}),Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return p.ProgressBar}}),Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return p.Icon}});var f=o(167);Object.defineProperty(t,"View",{enumerable:!0,get:function(){return f.View}});var h=o(165);Object.defineProperty(t,"ViewWithToolbar",{enumerable:!0,get:function(){return h.ViewWithToolbar}});var m=o(185);Object.defineProperty(t,"FileBrowser",{enumerable:!0,get:function(){return m.FileBrowser}});var v=o(19);t.Helpers=v;var g=o(195);Object.defineProperty(t,"ImageEditor",{enumerable:!0,get:function(){return g.ImageEditor}});var y=o(199);Object.defineProperty(t,"Observer",{enumerable:!0,get:function(){return y.Observer}});var b=o(203);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return b.Select}}),Object.defineProperty(t,"Style",{enumerable:!0,get:function(){return b.Style}});var _=o(200);Object.defineProperty(t,"Snapshot",{enumerable:!0,get:function(){return _.Snapshot}});var w=o(207);Object.defineProperty(t,"StatusBar",{enumerable:!0,get:function(){return w.StatusBar}});var S=o(209);Object.defineProperty(t,"Table",{enumerable:!0,get:function(){return S.Table}});var C=o(175);Object.defineProperty(t,"ToolbarEditorCollection",{enumerable:!0,get:function(){return C.ToolbarEditorCollection}});var k=o(173);Object.defineProperty(t,"ToolbarCollection",{enumerable:!0,get:function(){return k.ToolbarCollection}}),r.__exportStar(o(210),t);var j=o(211);Object.defineProperty(t,"Uploader",{enumerable:!0,get:function(){return j.Uploader}});var E=o(31);Object.defineProperty(t,"PluginSystem",{enumerable:!0,get:function(){return E.PluginSystem}})},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(12),t),r.__exportStar(o(18),t),r.__exportStar(o(13),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventsNative=void 0;var r=o(7),n=o(13),i=o(14),a=o(15),s=o(16),l=o(17),c=function(){function e(e){var t=this;this.__key="__JoditEventsNativeNamespaces",this.doc=document,this.prepareEvent=function(e){e.cancelBubble||(e.type.match(/^touch/)&&e.changedTouches&&e.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach((function(t){Object.defineProperty(e,t,{value:e.changedTouches[0][t],configurable:!0,enumerable:!0})})),e.originalEvent||(e.originalEvent=e),"paste"===e.type&&void 0===e.clipboardData&&t.doc.defaultView.clipboardData&&Object.defineProperty(e,"clipboardData",{get:function(){return t.doc.defaultView.clipboardData},configurable:!0,enumerable:!0}))},this.currents=[],this.__stopped=[],this.isDestructed=!1,e&&(this.doc=e),this.__key+=(new Date).getTime()}return e.prototype.eachEvent=function(e,t){var o=this;e.split(/[\s,]+/).forEach((function(e){var r=e.split(".");t.call(o,r[0],r[1]||n.defaultNameSpace)}))},e.prototype.getStore=function(e){if(!e)throw l.error("Need subject");if(void 0===e[this.__key]){var t=new n.EventHandlersStore;Object.defineProperty(e,this.__key,{enumerable:!1,configurable:!0,value:t})}return e[this.__key]},e.prototype.clearStore=function(e){void 0!==e[this.__key]&&delete e[this.__key]},e.prototype.triggerNativeEvent=function(e,t){var o=this.doc.createEvent("HTMLEvents");"string"==typeof t?o.initEvent(t,!0,!0):(o.initEvent(t.type,t.bubbles,t.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach((function(e){Object.defineProperty(o,e,{value:t[e],enumerable:!0})})),Object.defineProperty(o,"originalEvent",{value:t,enumerable:!0})),e.dispatchEvent(o)},Object.defineProperty(e.prototype,"current",{get:function(){return this.currents[this.currents.length-1]},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t,o,n){var c=this;void 0===n&&(n=!1);var u=i.isString(e)?this:e,d=i.isString(t)?t:e,p=o;void 0===p&&a.isFunction(t)&&(p=t);var f=this.getStore(u);if(!i.isString(d)||""===d)throw l.error("Need events names");if(!a.isFunction(p))throw l.error("Need event handler");if(s.isArray(u))return u.forEach((function(e){c.on(e,d,p,n)})),this;var h=a.isFunction(u.addEventListener),m=this,v=function(e){for(var t=[],o=1;arguments.length>o;o++)t[o-1]=arguments[o];return p&&p.call.apply(p,r.__spreadArray([this,e],t))};return h&&(v=function(e){if(m.prepareEvent(e),p&&!1===p.call(this,e))return e.preventDefault(),e.stopImmediatePropagation(),!1}),this.eachEvent(d,(function(e,t){if(""===e)throw l.error("Need event name");if(!1===f.indexOf(e,t,p)&&(f.set(e,t,{event:e,originalCallback:p,syntheticCallback:v},n),h)){var o=!!["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"].includes(e)&&{passive:!0};u.addEventListener(e,v,o)}})),this},e.prototype.one=function(e,t,o,r){var n=this;void 0===r&&(r=!1);var s=i.isString(e)?this:e,l=i.isString(t)?t:e,c=o;void 0===c&&a.isFunction(t)&&(c=t);var u=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];n.off(s,l,u),c.apply(void 0,e)};return this.on(s,l,u,r),this},e.prototype.off=function(e,t,o){var r=this,s=i.isString(e)?this:e,l=i.isString(t)?t:e,c=this.getStore(s),u=o;if(!i.isString(l)||!l)return c.namespaces().forEach((function(e){r.off(s,"."+e)})),this.clearStore(s),this;void 0===u&&a.isFunction(t)&&(u=t);var d=a.isFunction(s.removeEventListener),p=function(e){d&&s.removeEventListener(e.event,e.syntheticCallback,!1)},f=function(e,t){if(""!==e){var o=c.get(e,t);if(o&&o.length)if(a.isFunction(u)){var r=c.indexOf(e,t,u);!1!==r&&(p(o[r]),o.splice(r,1))}else o.forEach(p),o.length=0}else c.events(t).forEach((function(e){""!==e&&f(e,t)}))};return this.eachEvent(l,(function(e,t){t===n.defaultNameSpace?c.namespaces().forEach((function(t){f(e,t)})):f(e,t)})),this},e.prototype.stopPropagation=function(e,t){var o=this,r=i.isString(e)?this:e,a=i.isString(e)?e:t;if("string"!=typeof a)throw l.error("Need event names");var s=this.getStore(r);this.eachEvent(a,(function(e,t){var i=s.get(e,t);i&&o.__stopped.push(i),t===n.defaultNameSpace&&s.namespaces(!0).forEach((function(t){return o.stopPropagation(r,e+"."+t)}))}))},e.prototype.removeStop=function(e){if(e){var t=this.__stopped.indexOf(e);-1!==t&&this.__stopped.splice(0,t+1)}},e.prototype.isStopped=function(e){return void 0!==e&&-1!==this.__stopped.indexOf(e)},e.prototype.fire=function(e,t){for(var o,s,c=this,u=[],d=2;arguments.length>d;d++)u[d-2]=arguments[d];var p=i.isString(e)?this:e,f=i.isString(e)?e:t,h=i.isString(e)?r.__spreadArray([t],u):u,m=a.isFunction(p.dispatchEvent);if(!m&&!i.isString(f))throw l.error("Need events names");var v=this.getStore(p);return!i.isString(f)&&m?this.triggerNativeEvent(p,t):this.eachEvent(f,(function(e,t){if(m)c.triggerNativeEvent(p,e);else{var i=v.get(e,t);if(i)try{r.__spreadArray([],i).every((function(t){return!c.isStopped(i)&&(c.currents.push(e),s=t.syntheticCallback.apply(p,h),c.currents.pop(),void 0!==s&&(o=s),!0)}))}finally{c.removeStop(i)}t!==n.defaultNameSpace||m||v.namespaces().filter((function(e){return e!==t})).forEach((function(t){var n=c.fire.apply(c,r.__spreadArray([p,e+"."+t],h));void 0!==n&&(o=n)}))}})),o},e.prototype.destruct=function(){this.isDestructed&&(this.isDestructed=!0,this.off(this),this.getStore(this).clear(),delete this[this.__key])},e}();t.EventsNative=c},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandlersStore=t.defaultNameSpace=void 0,t.defaultNameSpace="JoditEventDefaultNamespace";var o=function(){function e(){this.__store={}}return e.prototype.get=function(e,t){if(void 0!==this.__store[t])return this.__store[t][e]},e.prototype.indexOf=function(e,t,o){var r=this.get(e,t);if(r)for(var n=0;r.length>n;n+=1)if(r[n].originalCallback===o)return n;return!1},e.prototype.namespaces=function(e){void 0===e&&(e=!1);var o=Object.keys(this.__store);return e?o.filter((function(e){return e!==t.defaultNameSpace})):o},e.prototype.events=function(e){return this.__store[e]?Object.keys(this.__store[e]):[]},e.prototype.set=function(e,t,o,r){void 0===r&&(r=!1),void 0===this.__store[t]&&(this.__store[t]={}),void 0===this.__store[t][e]&&(this.__store[t][e]=[]),r?this.__store[t][e].unshift(o):this.__store[t][e].push(o)},e.prototype.clear=function(){this.__store={}},e}();t.EventHandlersStore=o},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=void 0,t.isString=function(e){return"string"==typeof e}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=void 0,t.isArray=function(e){return Array.isArray(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.error=t.type=t.hasOwn=void 0;var o={},r=o.toString;t.hasOwn=o.hasOwnProperty,["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment","DOMStringList","HTMLCollection"].forEach((function(e){o["[object "+e+"]"]=e.toLowerCase()})),t.type=function(e){return null===e?"null":"object"==typeof e||"function"==typeof e?o[r.call(e)]||"object":typeof e},t.error=function(e){return new TypeError(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObserveObject=void 0;var r=o(7),n=o(19),i=o(99),a=function(){function e(t,o,i){var a=this;void 0===o&&(o=[]),void 0===i&&(i={}),this.__lockEvent={},this.__data=t,this.__prefix=o,this.__onEvents=i,Object.keys(t).forEach((function(o){var i=a.__prefix.concat(o).filter((function(e){return e.length}));Object.defineProperty(a,o,{set:function(s){var l,c=t[o];if(!n.isFastEqual(c,s)){a.fire(["beforeChange","beforeChange."+i.join(".")],o,s),n.isPlainObject(s)&&(s=new e(s,i,a.__onEvents)),t[o]=s;var u=[];a.fire(r.__spreadArray(["change"],i.reduce((function(e,t){return u.push(t),e.push("change."+u.join(".")),e}),[])),i.join("."),c,(null===(l=s)||void 0===l?void 0:l.valueOf)?s.valueOf():s)}},get:function(){return t[o]},enumerable:!0,configurable:!0}),n.isPlainObject(t[o])&&(t[o]=new e(t[o],i,a.__onEvents))}))}return e.prototype.valueOf=function(){return this.__data},e.prototype.toString=function(){return JSON.stringify(this.valueOf())},e.prototype.on=function(e,t){var o=this;return n.isArray(e)?(e.map((function(e){return o.on(e,t)})),this):(this.__onEvents[e]||(this.__onEvents[e]=[]),this.__onEvents[e].push(t),this)},e.prototype.fire=function(e){for(var t=this,o=[],i=1;arguments.length>i;i++)o[i-1]=arguments[i];if(n.isArray(e))e.map((function(e){return t.fire.apply(t,r.__spreadArray([e],o))}));else try{!this.__lockEvent[e]&&this.__onEvents[e]&&(this.__lockEvent[e]=!0,this.__onEvents[e].forEach((function(e){return e.call.apply(e,r.__spreadArray([t],o))})))}finally{this.__lockEvent[e]=!1}},e.create=function(t,o){return void 0===o&&(o=[]),t instanceof e?t:new e(t,o)},r.__decorate([i.nonenumerable],e.prototype,"__data",void 0),r.__decorate([i.nonenumerable],e.prototype,"__prefix",void 0),r.__decorate([i.nonenumerable],e.prototype,"__onEvents",void 0),r.__decorate([i.nonenumerable],e.prototype,"__lockEvent",void 0),e}();t.ObserveObject=a},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(20),t),r.__exportStar(o(55),t),r.__exportStar(o(59),t),r.__exportStar(o(61),t),r.__exportStar(o(34),t),r.__exportStar(o(62),t),r.__exportStar(o(64),t),r.__exportStar(o(65),t),r.__exportStar(o(82),t),r.__exportStar(o(142),t),r.__exportStar(o(68),t),r.__exportStar(o(147),t),r.__exportStar(o(149),t),r.__exportStar(o(150),t),r.__exportStar(o(81),t),r.__exportStar(o(152),t),r.__exportStar(o(26),t),r.__exportStar(o(74),t),r.__exportStar(o(153),t),r.__exportStar(o(148),t),r.__exportStar(o(154),t),r.__exportStar(o(151),t),r.__exportStar(o(155),t),r.__exportStar(o(156),t),r.__exportStar(o(67),t),r.__exportStar(o(17),t),r.__exportStar(o(157),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(21),t),r.__exportStar(o(22),t),r.__exportStar(o(24),t),r.__exportStar(o(52),t),r.__exportStar(o(53),t),r.__exportStar(o(54),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markDeprecated=t.cns=void 0;var r=o(7);t.cns=console,t.markDeprecated=function(e,o,n){return void 0===o&&(o=[""]),void 0===n&&(n=null),function(){for(var i=[],a=0;arguments.length>a;a++)i[a]=arguments[a];return t.cns.warn('Method "'+o[0]+'" deprecated.'+(o[1]?' Use "'+o[1]+'" instead':"")),e.call.apply(e,r.__spreadArray([n],i))}}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memorizeExec=t.keys=t.loadImage=t.reset=t.callPromise=t.markOwner=t.attr=t.call=void 0;var r=o(15),n=o(23),i=o(24),a=o(26),s=o(34);function l(e,t,o){if(!e||!r.isFunction(e.getAttribute))return null;if(/^-/.test(t)){var n=l(e,"data"+t);if(n)return n;t=t.substr(1)}if(void 0!==o){if(null!=o)return e.setAttribute(t,o.toString()),o.toString();e.hasAttribute(t)&&e.removeAttribute(t)}return e.getAttribute(t)}t.call=function(e){for(var t=[],o=1;arguments.length>o;o++)t[o-1]=arguments[o];return e.apply(void 0,t)},t.attr=l,t.markOwner=function(e,t){l(t,"data-editor_id",e.id),!t.component&&Object.defineProperty(t,"jodit",{value:e})},t.callPromise=function(e,t){return n.isPromise(e)?e.finally(t):t()};var c={};t.reset=function(e){var t,o;if(!(e in c)){var n=document.createElement("iframe");try{if(n.src="about:blank",document.body.appendChild(n),!n.contentWindow)return null;var a=i.get(e,n.contentWindow),s=i.get(e.split(".").slice(0,-1).join("."),n.contentWindow);r.isFunction(a)&&(c[e]=a.bind(s))}catch(e){}finally{null===(t=n.parentNode)||void 0===t||t.removeChild(n)}}return null!==(o=c[e])&&void 0!==o?o:null},t.loadImage=function(e,t){return t.async.promise((function(o,r){var n=new Image,i=function(){t.e.off(n),null==r||r()},a=function(){t.e.off(n),o(n)};t.e.one(n,"load",a).one(n,"error",i).one(n,"abort",i),n.src=e,n.complete&&a()}))},t.keys=function(e,t){if(void 0===t&&(t=!0),t)return Object.keys(e);var o=[];for(var r in e)o.push(r);return o},t.memorizeExec=function(e,t,o,r){var n=o.control,i="button"+n.command,l=n.args&&n.args[0]||a.dataBind(e,i);if(s.isVoid(l))return!1;a.dataBind(e,i,l),r&&(l=r(l)),e.execCommand(n.command,!1,l||void 0)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0,t.isPromise=function(e){return e&&"function"==typeof e.then}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=void 0;var r=o(14),n=o(25);t.get=function(e,t){if(!r.isString(e)||!e.length)return null;for(var o=t,i=0,a=e.split(".");a.length>i;i++){var s=a[i];if(n.isVoid(o[s]))return null;o=o[s]}return n.isVoid(o)?null:o}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVoid=void 0,t.isVoid=function(e){return null==e}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dataBind=void 0;var r=o(27),n=o(34),i=new WeakMap;t.dataBind=function(e,t,o){var a=i.get(e);if(!a){i.set(e,a={});var s=null;e instanceof r.ViewComponent&&(s=e.j.e),n.isViewObject(e)&&(s=e.e),s&&s.on("beforeDestruct",(function(){i.delete(e)}))}return void 0===o?a[t]:(a[t]=o,o)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(28),t),r.__exportStar(o(29),t),r.__exportStar(o(33),t)},(e,t)=>{"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.STATUSES=void 0,(o=t.STATUSES||(t.STATUSES={})).beforeInit="beforeInit",o.ready="ready",o.beforeDestruct="beforeDestruct",o.destructed="destructed"},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=o(19),n=o(30),i=o(28),a=new Map,s=function(){function e(){this.ownerWindow=window,this.__componentStatus=i.STATUSES.beforeInit,this.componentName="jodit-"+r.kebabCase(this.className()||r.getClassName(this)),this.uid="jodit-uid-"+n.uniqueUid()}return e.prototype.getFullElName=function(e,t,o){var n=[this.componentName];return e&&(e=e.replace(/[^a-z0-9-]/gi,"-"),n.push("__"+e)),t&&(n.push("_",t),n.push("_",r.isVoid(o)?"true":o.toString())),n.join("")},Object.defineProperty(e.prototype,"ownerDocument",{get:function(){return this.ow.document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"od",{get:function(){return this.ownerDocument},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ow",{get:function(){return this.ownerWindow},enumerable:!1,configurable:!0}),e.prototype.get=function(e,t){return r.get(e,t||this)},Object.defineProperty(e.prototype,"isReady",{get:function(){return this.componentStatus===i.STATUSES.ready},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDestructed",{get:function(){return this.componentStatus===i.STATUSES.destructed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInDestruct",{get:function(){return i.STATUSES.beforeDestruct===this.componentStatus||i.STATUSES.destructed===this.componentStatus},enumerable:!1,configurable:!0}),e.prototype.bindDestruct=function(e){var t=this,o=function(){!t.isInDestruct&&t.destruct()};return e.e&&e.e.on(i.STATUSES.beforeDestruct,o),this.hookStatus(i.STATUSES.beforeDestruct,(function(){e.e&&e.e.off(i.STATUSES.beforeDestruct,o)})),this},e.prototype.destruct=function(){this.setStatus(i.STATUSES.destructed),a.get(this)&&a.delete(this)},Object.defineProperty(e.prototype,"componentStatus",{get:function(){return this.__componentStatus},set:function(e){this.setStatus(e)},enumerable:!1,configurable:!0}),e.prototype.setStatus=function(e){return this.setStatusComponent(e,this)},e.prototype.setStatusComponent=function(e,t){if(e!==this.__componentStatus){var o=Object.getPrototypeOf(this);o&&r.isFunction(o.setStatusComponent)&&o.setStatusComponent(e,t);var n=a.get(this),i=null==n?void 0:n[e];i&&i.length&&i.forEach((function(e){return e(t)})),t===this&&(this.__componentStatus=e)}},e.prototype.hookStatus=function(e,t){var o=a.get(this);o||a.set(this,o={}),o[e]||(o[e]=[]),o[e].push(t)},e.STATUSES=i.STATUSES,e}();t.Component=s},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eventEmitter=t.getContainer=t.extendLang=t.lang=t.modules=t.pluginSystem=t.uniqueUid=t.instances=void 0;var r=o(31),n=o(32),i=o(19),a=o(11);t.instances={};var s=1;t.uniqueUid=function(){return s+=10*(Math.random()+1),Math.round(s).toString(16)},t.pluginSystem=new r.PluginSystem,t.modules={},t.lang={},t.extendLang=function(e){Object.keys(e).forEach((function(o){t.lang[o]?Object.assign(t.lang[o],e[o]):t.lang[o]=e[o]}))};var l=new WeakMap;t.getContainer=function(e,t,o,r){void 0===o&&(o="div"),void 0===r&&(r=!1);var a=i.getClassName(t.prototype),s=l.get(e)||{},c=a+o,u=i.isViewObject(e)?e:e.j;if(!s[c]){var d=u.c,p=e.od.body;r&&i.isJoditObject(e)&&e.od!==e.ed&&(d=e.createInside,p="style"===o?e.ed.head:e.ed.body);var f=d.element(o,{className:"jodit jodit-"+i.kebabCase(a)+"-container jodit-box"});f.classList.add("jodit_theme_"+(u.o.theme||"default")),p.appendChild(f),s[c]=f,e.hookStatus("beforeDestruct",(function(){n.Dom.safeRemove(f),delete s[c],Object.keys(s).length&&l.delete(e)})),l.set(e,s)}return s[c].classList.remove("jodit_theme_default","jodit_theme_dark"),s[c].classList.add("jodit_theme_"+(u.o.theme||"default")),s[c]},t.eventEmitter=new a.EventsNative},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PluginSystem=void 0;var r=o(7),n=o(19),i=function(){function e(){this.items=new Map}return e.prototype.normalizeName=function(e){return n.kebabCase(e).toLowerCase()},e.prototype.add=function(e,t){this.items.set(this.normalizeName(e),t)},e.prototype.get=function(e){return this.items.get(this.normalizeName(e))},e.prototype.remove=function(e){this.items.delete(this.normalizeName(e))},e.prototype.init=function(t){var o=this,r=t.o.extraPlugins.map((function(e){return n.isString(e)?{name:e}:e})),i=n.splitArray(t.o.disablePlugins).map((function(e){return o.normalizeName(e)})),a=[],s={},l=[],c={},u=function(r,u){var d;if(!(i.includes(u)||a.includes(u)||s[u])){var p=null===(d=r)||void 0===d?void 0:d.requires;if(!(p&&n.isArray(p)&&o.hasDisabledRequires(i,p))){var f=e.makePluginInstance(t,r);o.initOrWait(t,u,f,a,s),l.push(f),c[u]=f}}},d=this.loadExtras(t,r);return n.callPromise(d,(function(){t.isInDestruct||(o.items.forEach(u),o.addListenerOnBeforeDestruct(t,l),t.__plugins=c)}))},e.prototype.hasDisabledRequires=function(e,t){return Boolean((null==t?void 0:t.length)&&e.some((function(e){return t.includes(e)})))},e.makePluginInstance=function(e,t){return n.isFunction(t)?new t(e):t},e.prototype.initOrWait=function(t,o,r,i,a){var s=function(o,r){if(n.isInitable(r)){var s=r.requires;if((null==s?void 0:s.length)&&!s.every((function(e){return i.includes(e)})))return a[o]=r,!1;r.init(t),i.push(o)}else i.push(o);return r.hasStyle&&e.loadStyle(t,o),!0};s(o,r),Object.keys(a).forEach((function(e){var t=a[e];t&&s(e,t)&&(a[e]=void 0,delete a[e])}))},e.prototype.addListenerOnBeforeDestruct=function(e,t){e.e.on("beforeDestruct",(function(){t.forEach((function(t){n.isDestructable(t)&&t.destruct(e)})),t.length=0,delete e.__plugins}))},e.prototype.load=function(t,o){return Promise.all(o.map((function(o){var r=o.url||e.getFullUrl(t,o.name,!0);return n.appendScriptAsync(t,r).then((function(e){return{v:e,status:"fulfilled"}}),(function(e){return{e:e,status:"rejected"}}))})))},e.loadStyle=function(t,o){return r.__awaiter(this,void 0,Promise,(function(){var i;return r.__generator(this,(function(r){return i=e.getFullUrl(t,o,!1),this.styles.has(i)?[2]:(this.styles.add(i),[2,n.appendStyleAsync(t,i)])}))}))},e.getFullUrl=function(e,t,o){return t=n.kebabCase(t),e.basePath+"plugins/"+t+"/"+t+"."+(o?"js":"css")},e.prototype.loadExtras=function(e,t){var o=this;if(t&&t.length)try{var r=t.filter((function(e){return!o.items.has(o.normalizeName(e.name))}));if(r.length)return this.load(e,r)}catch(e){}},e.styles=new Set,e}();t.PluginSystem=i},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dom=void 0;var r=o(9),n=o(19),i=function(){function e(){}return e.detach=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},e.wrapInline=function(t,o,r){var i,a=t,s=t,l=r.s.save(),c=!1;do{c=!1,(i=a.previousSibling)&&!e.isBlock(i,r.ew)&&(c=!0,a=i)}while(c);do{c=!1,(i=s.nextSibling)&&!e.isBlock(i,r.ew)&&(c=!0,s=i)}while(c);var u=n.isString(o)?r.createInside.element(o):o;a.parentNode&&a.parentNode.insertBefore(u,a);for(var d=a;d&&(d=a.nextSibling,u.appendChild(a),a!==s&&d);)a=d;return r.s.restore(l),u},e.wrap=function(e,t,o){var r=o.s.save(),i=n.isString(t)?o.createInside.element(t):t;return e.parentNode?(e.parentNode.insertBefore(i,e),i.appendChild(e),o.s.restore(r),i):null},e.unwrap=function(t){var o=t.parentNode;if(o){for(;t.firstChild;)o.insertBefore(t.firstChild,t);e.safeRemove(t)}},e.each=function(t,o){var r=t.firstChild;if(r)for(;r;){var n=e.next(r,Boolean,t);if(!1===o(r))return!1;if(r.parentNode&&!e.each(r,o))return!1;r=n}return!0},e.between=function(e,t,o){for(var r=e;r&&r!==t&&(e===r||!o(r));){var n=r.firstChild||r.nextSibling;if(!n){for(;r&&!r.nextSibling;)r=r.parentNode;n=null==r?void 0:r.nextSibling}r=n}},e.replace=function(e,t,o,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var a=n.isString(t)?o.element(t):t;if(!i)for(;e.firstChild;)a.appendChild(e.firstChild);return r&&n.toArray(e.attributes).forEach((function(e){a.setAttribute(e.name,e.value)})),e.parentNode&&e.parentNode.replaceChild(a,e),a},e.isEmptyTextNode=function(t){return e.isText(t)&&(!t.nodeValue||0===t.nodeValue.replace(r.INVISIBLE_SPACE_REG_EXP(),"").length)},e.isEmpty=function(t,o){return void 0===o&&(o=/^(img|svg|canvas|input|textarea|form)$/),!t||(e.isText(t)?null==t.nodeValue||0===n.trim(t.nodeValue).length:!o.test(t.nodeName.toLowerCase())&&e.each(t,(function(t){if(e.isText(t)&&null!=t.nodeValue&&0!==n.trim(t.nodeValue).length||e.isElement(t)&&o.test(t.nodeName.toLowerCase()))return!1})))},e.isNode=function(e,t){return!!e&&!("object"!=typeof t||!t||"function"!=typeof t.Node&&"object"!=typeof t.Node)&&e instanceof t.Node},e.isCell=function(t,o){return e.isNode(t,o)&&/^(td|th)$/i.test(t.nodeName)},e.isImage=function(t,o){return e.isNode(t,o)&&/^(img|svg|picture|canvas)$/i.test(t.nodeName)},e.isBlock=function(t,o){return!n.isVoid(t)&&"object"==typeof t&&e.isNode(t,o)&&r.IS_BLOCK.test(t.nodeName)},e.isText=function(e){return Boolean(e&&e.nodeType===Node.TEXT_NODE)},e.isElement=function(e){return Boolean(e&&e.nodeType===Node.ELEMENT_NODE)},e.isHTMLElement=function(t,o){return e.isNode(t,o)&&t instanceof o.HTMLElement},e.isInlineBlock=function(t){return e.isElement(t)&&!/^(BR|HR)$/i.test(t.tagName)&&-1!==["inline","inline-block"].indexOf(n.css(t,"display").toString())},e.canSplitBlock=function(t,o){return!n.isVoid(t)&&t instanceof o.HTMLElement&&e.isBlock(t,o)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&void 0!==t.style&&!/^(fixed|absolute)/i.test(t.style.position)},e.prev=function(t,o,r,n){return void 0===n&&(n=!0),e.find(t,o,r,!1,"previousSibling",!!n&&"lastChild")},e.next=function(t,o,r,n){return void 0===n&&(n=!0),e.find(t,o,r,void 0,void 0,!!n&&"firstChild")},e.prevWithClass=function(t,o){return e.prev(t,(function(t){return e.isElement(t)&&t.classList.contains(o)}),t.parentNode)},e.nextWithClass=function(t,o){return e.next(t,(function(t){return e.isElement(t)&&t.classList.contains(o)}),t.parentNode)},e.find=function(t,o,r,n,i,a){if(void 0===n&&(n=!1),void 0===i&&(i="nextSibling"),void 0===a&&(a="firstChild"),n&&o(t))return t;var s,l=t;do{if(o(s=l[i]))return s||null;if(a&&s&&s[a]){var c=e.find(s[a],o,s,!0,i,a);if(c)return c}s||(s=l.parentNode),l=s}while(l&&l!==r);return null},e.findWithCurrent=function(t,o,r,n,i){void 0===n&&(n="nextSibling"),void 0===i&&(i="firstChild");var a=t;do{if(o(a))return a||null;if(i&&a&&a[i]){var s=e.findWithCurrent(a[i],o,a,n,i);if(s)return s}for(;a&&!a[n]&&a!==r;)a=a.parentNode;a&&a[n]&&a!==r&&(a=a[n])}while(a&&a!==r);return null},e.findSibling=function(t,o,r){void 0===o&&(o=!0),void 0===r&&(r=function(t){return!e.isEmptyTextNode(t)});for(var n=function(e){return o?e.previousSibling:e.nextSibling},i=n(t);i&&!r(i);)i=n(i);return i&&r(i)?i:null},e.up=function(e,t,o,r){void 0===r&&(r=!1);var n=e;if(!n)return null;do{if(t(n))return n;if(n===o||!n.parentNode)break;n=n.parentNode}while(n&&n!==o);return n===o&&r&&t(n)?n:null},e.closest=function(t,o,r){var i;return i=n.isFunction(o)?o:n.isArray(o)?function(e){return e&&o.includes(e.nodeName.toLowerCase())}:function(e){return e&&o===e.nodeName.toLowerCase()},e.up(t,i,r)},e.furthest=function(e,t,o){for(var r=null,n=null==e?void 0:e.parentElement;n&&n!==o&&t(n);)r=n,n=null==n?void 0:n.parentElement;return r},e.appendChildFirst=function(e,t){var o=e.firstChild;o?o!==t&&e.insertBefore(t,o):e.appendChild(t)},e.after=function(e,t){var o=e.parentNode;o&&(o.lastChild===e?o.appendChild(t):o.insertBefore(t,e.nextSibling))},e.before=function(e,t){var o=e.parentNode;o&&o.insertBefore(t,e)},e.prepend=function(e,t){e.insertBefore(t,e.firstChild)},e.append=function(e,t){var o=this;n.isArray(t)?t.forEach((function(t){o.append(e,t)})):e.appendChild(t)},e.moveContent=function(e,t,o){void 0===o&&(o=!1);var r=(e.ownerDocument||document).createDocumentFragment();n.toArray(e.childNodes).forEach((function(e){r.appendChild(e)})),o&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},e.all=function(t,o,r){void 0===r&&(r=!1);var i=t.childNodes?n.toArray(t.childNodes):[];return o(t)?t:(r&&(i=i.reverse()),i.forEach((function(t){e.all(t,o,r)})),null)},e.isOrContains=function(e,t,o){return void 0===o&&(o=!1),e===t?!o:Boolean(t&&e&&this.up(t,(function(t){return t===e}),e,!0))},e.safeRemove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},e.hide=function(e){e&&(n.dataBind(e,"__old_display",e.style.display),e.style.display="none")},e.show=function(e){if(e){var t=n.dataBind(e,"__old_display");"none"===e.style.display&&(e.style.display=t||"")}},e.isTag=function(e,t){for(var o=n.asArray(t).map(String),r=0;o.length>r;r+=1)if(this.isElement(e)&&e.tagName.toLowerCase()===o[r].toLowerCase())return!0;return!1},e}();t.Dom=i},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewComponent=void 0;var r=o(7),n=function(e){function t(t){var o=e.call(this)||this;return o.setParentView(t),o}return r.__extends(t,e),Object.defineProperty(t.prototype,"defaultTimeout",{get:function(){return this.j.defaultTimeout},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"j",{get:function(){return this.jodit},enumerable:!1,configurable:!0}),t.prototype.i18n=function(e){for(var t,o=[],n=1;arguments.length>n;n++)o[n-1]=arguments[n];return(t=this.j).i18n.apply(t,r.__spreadArray([e],o))},t.prototype.setParentView=function(e){return this.jodit=e,e.components.add(this),this},t.prototype.destruct=function(){return this.j.components.delete(this),e.prototype.destruct.call(this)},t}(o(29).Component);t.ViewComponent=n},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(35),t),r.__exportStar(o(16),t),r.__exportStar(o(36),t),r.__exportStar(o(37),t),r.__exportStar(o(15),t),r.__exportStar(o(39),t),r.__exportStar(o(40),t),r.__exportStar(o(41),t),r.__exportStar(o(42),t),r.__exportStar(o(44),t),r.__exportStar(o(45),t),r.__exportStar(o(46),t),r.__exportStar(o(47),t),r.__exportStar(o(43),t),r.__exportStar(o(48),t),r.__exportStar(o(23),t),r.__exportStar(o(14),t),r.__exportStar(o(50),t),r.__exportStar(o(51),t),r.__exportStar(o(25),t),r.__exportStar(o(49),t)},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBrowserColorPicker=void 0,t.hasBrowserColorPicker=function(){var e=!0;try{var t=document.createElement("input");t.type="color",e="color"===t.type&&"number"!=typeof t.selectionStart}catch(t){e=!1}return e}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBoolean=void 0,t.isBoolean=function(e){return"boolean"==typeof e}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFastEqual=t.isEqual=void 0;var r=o(38);t.isEqual=function(e,t){return e===t||r.stringify(e)===r.stringify(t)},t.isFastEqual=function(e,t){return e===t}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0,t.stringify=function(e,t){if(void 0===t&&(t={}),"object"!=typeof e)return e.toString?e.toString():e;var o=new Set(t.excludeKeys),r=new WeakMap;return JSON.stringify(e,(function(e,t){if(!o.has(e)){if("object"==typeof t&&null!=t){if(r.get(t))return"[refObject]";r.set(t,!0)}return t}}),t.prettify)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTML=void 0;var r=o(14);t.isHTML=function(e){return r.isString(e)&&/<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHtmlFromWord=void 0,t.isHtmlFromWord=function(e){return-1!==e.search(//)||-1!==e.search(//)||-1!==e.search(/style="[^"]*mso-/)&&-1!==e.search(/{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasContainer=t.isDestructable=t.isInitable=void 0;var r=o(15),n=o(32),i=o(25);t.isInitable=function(e){return!i.isVoid(e)&&r.isFunction(e.init)},t.isDestructable=function(e){return!i.isVoid(e)&&r.isFunction(e.destruct)},t.hasContainer=function(e){return!i.isVoid(e)&&n.Dom.isElement(e.container)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInt=void 0;var r=o(43),n=o(14);t.isInt=function(e){return n.isString(e)&&r.isNumeric(e)&&(e=parseFloat(e)),"number"==typeof e&&Number.isFinite(e)&&!(e%1)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumeric=void 0;var r=o(14);t.isNumeric=function(e){if(r.isString(e)){if(!e.match(/^([+-])?[0-9]+(\.?)([0-9]+)?(e[0-9]+)?$/))return!1;e=parseFloat(e)}return"number"==typeof e&&!isNaN(e)&&isFinite(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isViewObject=t.isJoditObject=void 0;var r=o(15),n=o(30);t.isJoditObject=function(e){return Boolean(e&&e instanceof Object&&r.isFunction(e.constructor)&&("undefined"!=typeof Jodit&&e instanceof Jodit||e.isJodit))},t.isViewObject=function(e){return Boolean(e&&e instanceof Object&&r.isFunction(e.constructor)&&(e instanceof n.modules.View||e.isView))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLicense=void 0;var r=o(14);t.isLicense=function(e){return r.isString(e)&&23===e.length&&/^[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}$/i.test(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNativeFunction=void 0,t.isNativeFunction=function(e){return Boolean(e)&&"function"===(typeof e).toLowerCase()&&(e===Function.prototype||/^\s*function\s*(\b[a-z$_][a-z0-9$_]*\b)*\s*\((|([a-z$_][a-z0-9$_]*)(\s*,[a-z$_][a-z0-9$_]*)*)\)\s*{\s*\[native code]\s*}\s*$/i.test(String(e)))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=void 0,t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=void 0;var r=o(49),n=o(17);t.isPlainObject=function(e){return!(!e||"object"!=typeof e||e.nodeType||r.isWindow(e)||e.constructor&&!n.hasOwn.call(e.constructor.prototype,"isPrototypeOf"))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWindow=void 0,t.isWindow=function(e){return null!=e&&e===e.window}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isURL=void 0,t.isURL=function(e){return new RegExp("^(https?:\\/\\/)((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidName=void 0,t.isValidName=function(e){return!!e.length&&!/[^0-9A-Za-zа-яА-ЯЁё\w\-_.]/.test(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.set=void 0;var r=o(14),n=o(43),i=o(16),a=o(34);t.set=function(e,t,o){if(r.isString(e)&&e.length){for(var s=e.split("."),l=o,c=s[0],u=0;s.length-1>u;u+=1)i.isArray(l[c=s[u]])||a.isPlainObject(l[c])||(l[c]=n.isNumeric(s[u+1])?[]:{}),l=l[c];l&&(l[s[s.length-1]]=t)}}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getClassName=t.keepNames=void 0;var r=o(15);t.keepNames=new Map,t.getClassName=function(e){var o;if(r.isFunction(e.className))return e.className();var n=(null===(o=e.constructor)||void 0===o?void 0:o.originalConstructor)||e.constructor;if(t.keepNames.has(n))return t.keepNames.get(n);if(n.name)return n.name;var i=new RegExp(/^\s*function\s*(\S*)\s*\(/),a=n.toString().match(i);return a?a[1]:""}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LimitedStack=void 0;var o=function(){function e(e){this.limit=e,this.stack=[]}return e.prototype.push=function(e){return this.stack.push(e),this.stack.length>this.limit&&this.stack.shift(),this},e.prototype.pop=function(){return this.stack.pop()},e.prototype.find=function(e){return this.stack.find(e)},e}();t.LimitedStack=o},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=t.splitArray=t.asArray=void 0;var r=o(56);Object.defineProperty(t,"asArray",{enumerable:!0,get:function(){return r.asArray}});var n=o(57);Object.defineProperty(t,"splitArray",{enumerable:!0,get:function(){return n.splitArray}});var i=o(58);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return i.toArray}})},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asArray=void 0;var r=o(16);t.asArray=function(e){return r.isArray(e)?e:[e]}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitArray=void 0;var r=o(14);t.splitArray=function(e){return r.isString(e)?e.split(/[,\s]+/):e}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var r=o(20),n=o(46);t.toArray=function(){for(var e,t=[],o=0;arguments.length>o;o++)t[o]=arguments[o];var i=n.isNativeFunction(Array.from)?Array.from:null!==(e=r.reset("Array.from"))&&void 0!==e?e:Array.from;return i.apply(Array,t)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(7).__exportStar(o(60),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearTimeout=t.setTimeout=void 0;var r=o(7);t.setTimeout=function(e,t){for(var o=[],n=2;arguments.length>n;n++)o[n-2]=arguments[n];return t?window.setTimeout.apply(window,r.__spreadArray([e,t],o)):(e.call.apply(e,r.__spreadArray([null],o)),0)},t.clearTimeout=function(e){window.clearTimeout(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fastClone=t.markAsAtomic=t.isAtom=void 0;var r=o(38);t.isAtom=function(e){return e&&e.isAtom},t.markAsAtomic=function(e){return Object.defineProperty(e,"isAtom",{enumerable:!1,value:!0,configurable:!1}),e},t.fastClone=function(e){return JSON.parse(r.stringify(e))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(7).__exportStar(o(63),t)},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.colorToHex=void 0,t.colorToHex=function(e){if("rgba(0, 0, 0, 0)"===e||""===e)return!1;if(!e)return"#000000";if("#"===e.substr(0,1))return e;var t=/([\s\n\t\r]*?)rgb\((\d+), (\d+), (\d+)\)/.exec(e)||/([\s\n\t\r]*?)rgba\((\d+), (\d+), (\d+), ([\d.]+)\)/.exec(e);if(!t)return"#000000";for(var o=parseInt(t[2],10),r=parseInt(t[3],10),n=(parseInt(t[4],10)|r<<8|o<<16).toString(16).toUpperCase();6>n.length;)n="0"+n;return t[1]+"#"+n}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigFlatten=t.ConfigProto=void 0;var r=o(7),n=o(61),i=o(34),a=o(8),s=o(20);t.ConfigProto=function e(t,o,s){if(void 0===s&&(s=0),Object.getPrototypeOf(t)!==Object.prototype)return t;var l=a.Config.defaultOptions;if(i.isString(t.preset)){if(void 0!==l.presets[t.preset]){var c=l.presets[t.preset];Object.keys(c).forEach((function(e){i.isVoid(t[e])&&(t[e]=c[e])}))}delete t.preset}var u={};return Object.keys(t).forEach((function(a){var l=t[a],c=o?o[a]:null;u[a]=i.isPlainObject(l)&&i.isPlainObject(c)&&!n.isAtom(l)?e(l,c,s+1):0!==s&&i.isArray(l)&&!n.isAtom(l)&&i.isArray(c)?r.__spreadArray(r.__spreadArray([],l),c.slice(l.length)):l})),Object.setPrototypeOf(u,o),u},t.ConfigFlatten=function(e){return s.keys(e,!1).reduce((function(t,o){return t[o]=e[o],t}),{})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(66),t),r.__exportStar(o(138),t),r.__exportStar(o(139),t),r.__exportStar(o(140),t),r.__exportStar(o(141),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyStyles=void 0;var r=o(32),n=o(67),i=o(68);function a(e){return e.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";]+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,(function(e,t,o){switch(o.toLowerCase()){case"pt":return(1.328*parseFloat(t)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(t)).toFixed(0)+"px"}return e}))}t.applyStyles=function(e){if(-1===e.indexOf("")+"".length);var t=document.createElement("iframe");t.style.display="none",document.body.appendChild(t);var o="",s=[];try{var l=t.contentDocument||(t.contentWindow?t.contentWindow.document:null);if(l){l.open(),l.write(e),l.close(),l.styleSheets.length&&(s=l.styleSheets[l.styleSheets.length-1].cssRules);for(var c=function(e){if(""===s[e].selectorText)return"continue";n.$$(s[e].selectorText,l.body).forEach((function(t){t.style.cssText=a(s[e].style.cssText+";"+t.style.cssText)}))},u=0;s.length>u;u+=1)c(u);r.Dom.each(l.body,(function(e){if(r.Dom.isElement(e)){var t=e,o=t.style.cssText;o&&(t.style.cssText=a(o)),t.hasAttribute("lang")&&t.removeAttribute("lang")}})),o=l.firstChild?i.trim(l.body.innerHTML):""}}catch(e){}finally{r.Dom.safeRemove(t)}return o&&(e=o),i.trim(e.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(//i);-1!==t&&(e=e.substr(t+20));var o=e.search(//i);return-1!==o&&(e=e.substr(0,o)),e}(o)),t.s.insertHTML(o)}},t.getAllTypes=function(e){var t=e.types,o="";if(r.isArray(t)||"domstringlist"===r.type(t))for(var n=0;t.length>n;n+=1)o+=t[n]+";";else o=(t||i.TEXT_PLAIN).toString()+";";return o}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clipboard=t.pluginKey=void 0;var r=o(9),n=o(19),i=o(248);t.pluginKey="clipboard";var a=function(){function e(){this.buttons=[{name:"cut",group:"clipboard"},{name:"copy",group:"clipboard"},{name:"paste",group:"clipboard"},{name:"selectall",group:"clipboard"}]}return e.prototype.init=function(e){var o;null===(o=this.buttons)||void 0===o||o.forEach((function(t){return e.registerButton(t)})),e.e.off("copy."+t.pluginKey+" cut."+t.pluginKey).on("copy."+t.pluginKey+" cut."+t.pluginKey,(function(o){var a,s=e.s.html,l=i.getDataTransfer(o)||i.getDataTransfer(e.ew)||i.getDataTransfer(o.originalEvent);l&&(l.setData(r.TEXT_PLAIN,n.stripTags(s)),l.setData(r.TEXT_HTML,s)),e.buffer.set(t.pluginKey,s),e.e.fire("pasteStack",{html:s,action:e.o.defaultActionOnPaste}),"cut"===o.type&&(e.s.remove(),e.s.focus()),o.preventDefault(),null===(a=null==e?void 0:e.events)||void 0===a||a.fire("afterCopy",s)}))},e.prototype.destruct=function(e){var o,r;null===(o=null==e?void 0:e.buffer)||void 0===o||o.set(t.pluginKey,""),null===(r=null==e?void 0:e.events)||void 0===r||r.off("."+t.pluginKey)},e}();t.clipboard=a},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paste=void 0;var r=o(7),n=o(183),i=o(248),a=o(9),s=o(19),l=o(249),c=o(32),u=o(162),d=o(92),p=o(99),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pasteStack=new s.LimitedStack(20),t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on("paste.paste",this.onPaste).on("pasteStack.paste",(function(e){return t.pasteStack.push(e)})),e.o.nl2brInPlainText&&this.j.e.on("processPaste.paste",this.onProcessPasteReplaceNl2Br)},t.prototype.onPaste=function(e){try{if(!1===this.j.e.fire("beforePaste",e)||!1===this.customPasteProcess(e))return e.preventDefault(),!1;this.defaultPasteProcess(e)}finally{this.j.e.fire("afterPaste",e)}},t.prototype.customPasteProcess=function(e){if(this.j.o.processPasteHTML)for(var t=i.getDataTransfer(e),o=0,r=[null==t?void 0:t.getData(a.TEXT_HTML),null==t?void 0:t.getData(a.TEXT_PLAIN)];r.length>o;o++){var n=r[o];if(s.isHTML(n)&&(this.processWordHTML(e,n)||this.processHTML(e,n)))return!1}},t.prototype.defaultPasteProcess=function(e){var t=i.getDataTransfer(e),o=(null==t?void 0:t.getData(a.TEXT_HTML))||(null==t?void 0:t.getData(a.TEXT_PLAIN));if(t&&o&&""!==s.trim(o)){var r=this.j.e.fire("processPaste",e,o,i.getAllTypes(t));void 0!==r&&(o=r),(s.isString(o)||c.Dom.isNode(o,this.j.ew))&&this.insertByType(e,o,this.j.o.defaultActionOnPaste),e.preventDefault(),e.stopPropagation()}},t.prototype.processWordHTML=function(e,t){var o=this;return!(!this.j.o.processPasteFromWord||!s.isHtmlFromWord(t)||(this.j.o.askBeforePasteFromWord?this.askInsertTypeDialog("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","Word Paste Detected",(function(r){o.insertFromWordByType(e,t,r)})):this.insertFromWordByType(e,t,this.j.o.defaultActionOnPasteFromWord||this.j.o.defaultActionOnPaste),0))},t.prototype.processHTML=function(e,t){var o=this;if(this.j.o.askBeforePasteHTML){var r=this.pasteStack.find((function(e){return e.html===t}));return r?(this.insertByType(e,t,r.action||this.j.o.defaultActionOnPaste),!0):(this.askInsertTypeDialog("Your code is similar to HTML. Keep as HTML?","Paste as HTML",(function(r){o.insertByType(e,t,r)}),"Insert as Text"),!0)}return!1},t.prototype.insertFromWordByType=function(e,t,o){var r;switch(o){case a.INSERT_AS_HTML:if(t=s.applyStyles(t),this.j.o.beautifyHTML){var n=null===(r=this.j.events)||void 0===r?void 0:r.fire("beautifyHTML",t);s.isString(n)&&(t=n)}break;case a.INSERT_AS_TEXT:t=s.cleanFromWord(t);break;case a.INSERT_ONLY_TEXT:t=s.stripTags(s.cleanFromWord(t))}i.pasteInsertHtml(e,this.j,t)},t.prototype.insertByType=function(e,t,o){if(this.pasteStack.push({html:t,action:o}),s.isString(t))switch(this.j.buffer.set(l.pluginKey,t),o){case a.INSERT_CLEAR_HTML:t=s.cleanFromWord(t);break;case a.INSERT_ONLY_TEXT:t=s.stripTags(t);break;case a.INSERT_AS_TEXT:t=s.htmlspecialchars(t)}i.pasteInsertHtml(e,this.j,t)},t.prototype.askInsertTypeDialog=function(e,t,o,r,n){var i,l,c,p;if(void 0===r&&(r="Clean"),void 0===n&&(n="Insert only Text"),!1!==(null===(l=null===(i=this.j)||void 0===i?void 0:i.e)||void 0===l?void 0:l.fire("beforeOpenPasteDialog",e,t,o,r,n))){var f=u.Confirm('
'+this.j.i18n(e)+"
",this.j.i18n(t));f.bindDestruct(this.j),s.markOwner(this.j,f.container);var h=d.Button(this.j,{text:"Keep",name:"keep",status:"primary",tabIndex:0}),m=d.Button(this.j,{text:r,tabIndex:0}),v=d.Button(this.j,{text:n,tabIndex:0}),g=d.Button(this.j,{text:"Cancel",tabIndex:0});return h.onAction((function(){f.close(),o&&o(a.INSERT_AS_HTML)})),m.onAction((function(){f.close(),o&&o(a.INSERT_AS_TEXT)})),v.onAction((function(){f.close(),o&&o(a.INSERT_ONLY_TEXT)})),g.onAction((function(){f.close()})),f.setFooter([h,m,n?v:"",g]),h.focus(),null===(p=null===(c=this.j)||void 0===c?void 0:c.e)||void 0===p||p.fire("afterOpenPasteDialog",f,e,t,o,r,n),f}},t.prototype.onProcessPasteReplaceNl2Br=function(e,t,o){if(o===a.TEXT_PLAIN+";"&&!s.isHTML(t))return s.nl2br(t)},t.prototype.useFakeDivBox=function(e){var t=this,o=this.j.c.div("",{tabindex:-1,contenteditable:!0,style:{left:-9999,top:0,width:0,height:"100%",lineHeight:"140%",overflow:"hidden",position:"fixed",zIndex:2147483647,wordBreak:"break-all"}});this.j.container.appendChild(o);var r=this.j.s.save();o.focus();var n=0,i=function(){c.Dom.safeRemove(o),t.j.selection&&t.j.s.restore(r)},a=function(){if(n+=1,o.childNodes&&o.childNodes.length>0){var r=o.innerHTML;return i(),void t.processHTML(e,r)}5>n?t.j.async.setTimeout(a,20):i()};a()},t.prototype.beforeDestruct=function(e){e.e.off("paste.paste",this.onPaste)},r.__decorate([p.autobind],t.prototype,"onPaste",null),r.__decorate([p.autobind],t.prototype,"onProcessPasteReplaceNl2Br",null),t}(n.Plugin);t.paste=f},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteStorage=void 0;var r=o(7);o(252);var n=o(9),i=o(162),a=o(183),s=o(32),l=o(19),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.currentIndex=0,t.list=[],t.container=null,t.listBox=null,t.previewBox=null,t.dialog=null,t.paste=function(){if(t.j.s.focus(),t.j.s.insertHTML(t.list[t.currentIndex]),0!==t.currentIndex){var e=t.list[0];t.list[0]=t.list[t.currentIndex],t.list[t.currentIndex]=e}t.dialog&&t.dialog.close(),t.j.setEditorValue(),t.j.e.fire("afterPaste")},t.onKeyDown=function(e){var o=t.currentIndex;-1!==[n.KEY_UP,n.KEY_DOWN,n.KEY_ENTER].indexOf(e.key)&&(e.key===n.KEY_UP&&(0===o?o=t.list.length-1:o-=1),e.key===n.KEY_DOWN&&(o===t.list.length-1?o=0:o+=1),e.key!==n.KEY_ENTER?(o!==t.currentIndex&&t.selectIndex(o),e.stopImmediatePropagation(),e.preventDefault()):t.paste())},t.selectIndex=function(e){t.listBox&&l.toArray(t.listBox.childNodes).forEach((function(o,r){o.classList.remove("jodit_active"),e===r&&t.previewBox&&(o.classList.add("jodit_active"),t.previewBox.innerHTML=t.list[e],o.focus())})),t.currentIndex=e},t.showDialog=function(){2>t.list.length||(t.dialog||t.createDialog(),t.listBox&&(t.listBox.innerHTML=""),t.previewBox&&(t.previewBox.innerHTML=""),t.list.forEach((function(e,o){var r=t.j.c.element("a");r.textContent=o+1+". "+e.replace(n.SPACE_REG_EXP(),""),t.j.e.on(r,"keydown",t.onKeyDown),l.attr(r,"href","javascript:void(0)"),l.attr(r,"data-index",o.toString()),l.attr(r,"tab-index","-1"),t.listBox&&t.listBox.appendChild(r)})),t.dialog&&t.dialog.open(),t.j.async.setTimeout((function(){t.selectIndex(0)}),100))},t}return r.__extends(t,e),t.prototype.createDialog=function(){var e=this;this.dialog=new i.Dialog({language:this.j.o.language});var t=this.j.c.fromHTML(''+this.j.i18n("Paste")+"");this.j.e.on(t,"click",this.paste);var o=this.j.c.fromHTML(''+this.j.i18n("Cancel")+"");this.j.e.on(o,"click",this.dialog.close),this.container=this.j.c.div(),this.container.classList.add("jodit-paste-storage"),this.listBox=this.j.c.div(),this.previewBox=this.j.c.div(),this.container.appendChild(this.listBox),this.container.appendChild(this.previewBox),this.dialog.setHeader(this.j.i18n("Choose Content to Paste")),this.dialog.setContent(this.container),this.dialog.setFooter([t,o]),this.j.e.on(this.listBox,"click dblclick",(function(t){var o=t.target;return s.Dom.isTag(o,"a")&&o.hasAttribute("data-index")&&e.selectIndex(parseInt(l.attr(o,"-index")||"0",10)),"dblclick"===t.type&&e.paste(),!1}))},t.prototype.afterInit=function(){var e=this;this.j.e.off("afterCopy.paste-storage").on("pasteStorageList.paste-storage",(function(){return e.list.length})).on("afterCopy.paste-storage",(function(t){-1!==e.list.indexOf(t)&&e.list.splice(e.list.indexOf(t),1),e.list.unshift(t),e.list.length>5&&(e.list.length=5)})),this.j.registerCommand("showPasteStorage",{exec:this.showDialog,hotkeys:["ctrl+shift+v","cmd+shift+v"]})},t.prototype.beforeDestruct=function(){this.dialog&&this.dialog.destruct(),this.j.e.off(".paste-storage"),s.Dom.safeRemove(this.previewBox),s.Dom.safeRemove(this.listBox),s.Dom.safeRemove(this.container),this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.list=[]},t}(a.Plugin);t.pasteStorage=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.copyFormat=void 0;var r=o(8),n=o(32),i=o(19),a="copyformat",s=["fontWeight","fontStyle","fontSize","color","margin","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textDecorationLine","fontFamily"],l=function(e,t,o,r){var n=i.css(o,t);return n===r[t]&&(n=o.parentNode&&o!==e.editor&&o.parentNode!==e.editor?l(e,t,o.parentNode,r):void 0),n};r.Config.prototype.controls.copyformat={exec:function(e,t,o){var r=o.button;if(t){if(e.buffer.exists(a))e.buffer.delete(a),e.e.off(e.editor,"mouseup.copyformat");else{var c={},u=n.Dom.up(t,(function(e){return e&&!n.Dom.isText(e)}),e.editor)||e.editor,d=e.createInside.span();e.editor.appendChild(d),s.forEach((function(e){c[e]=i.css(d,e)})),d!==e.editor&&n.Dom.safeRemove(d);var p=function(e,t,o){var r={};return t&&s.forEach((function(n){r[n]=l(e,n,t,o),n.match(/border(Style|Color)/)&&!r.borderWidth&&(r[n]=void 0)})),r}(e,u,c);e.e.on(e.editor,"mouseup.copyformat",(function(){e.buffer.delete(a);var t=e.s.current();t&&(n.Dom.isTag(t,"img")?i.css(t,p):e.s.applyStyle(p)),e.e.off(e.editor,"mouseup.copyformat")})),e.buffer.set(a,!0)}r.update()}},isActive:function(e){return e.buffer.exists(a)},tooltip:"Paint format"},t.copyFormat=function(e){e.registerButton({name:"copyformat",group:"clipboard"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.color=void 0;var r=o(8),n=o(10),i=o(19),a=o(255);r.Config.prototype.controls.brush={update:function(e){var t=i.dataBind(e,"color"),o=e.j,r=function(t,r){r&&r!==i.css(o.editor,t).toString()&&(e.state.icon.fill=r)};if(t){var a=i.dataBind(e,"color");r("color"===a?a:"background-color",t)}else{var s=o.s.current();if(s&&!e.state.disabled){var l=n.Dom.closest(s,(function(e){return n.Dom.isBlock(e,o.ew)||e&&n.Dom.isElement(e)}),o.editor)||o.editor;r("color",i.css(l,"color").toString()),r("background-color",i.css(l,"background-color").toString())}e.state.icon.fill="",e.state.activated=!1}},popup:function(e,t,o,r,s){var l="",c="",u=[],d=null;return t&&t!==e.editor&&n.Dom.isNode(t,e.ew)&&(n.Dom.isElement(t)&&e.s.isCollapsed()&&!n.Dom.isTag(t,["br","hr"])&&(d=t),n.Dom.up(t,(function(t){if(n.Dom.isHTMLElement(t,e.ew)){var o=i.css(t,"color",void 0,!0),r=i.css(t,"background-color",void 0,!0);if(o)return l=o.toString(),!0;if(r)return c=r.toString(),!0}}),e.editor)),u=[{name:"Background",content:a.ColorPickerWidget(e,(function(t){d?d.style.backgroundColor=t:e.execCommand("background",!1,t),i.dataBind(s,"color",t),i.dataBind(s,"color-mode","background"),r()}),c)},{name:"Text",content:a.ColorPickerWidget(e,(function(t){d?d.style.color=t:e.execCommand("forecolor",!1,t),i.dataBind(s,"color",t),i.dataBind(s,"color-mode","color"),r()}),l)}],"background"!==e.o.colorPickerDefaultTab&&(u=u.reverse()),a.TabsWidget(e,u,d)},exec:function(e,t,o){var r=o.button,a=i.dataBind(r,"color-mode"),s=i.dataBind(r,"color");if(!a)return!1;if(t&&t!==e.editor&&n.Dom.isNode(t,e.ew)&&n.Dom.isElement(t))switch(a){case"color":t.style.color=s;break;case"background":t.style.backgroundColor=s}else e.execCommand("background"===a?a:"forecolor",!1,s)},tooltip:"Fill color or set the text color"},t.color=function(e){e.registerButton({name:"brush",group:"color"});var t=function(t,o,r){var n=i.normalizeColor(r);switch(t){case"background":e.s.applyStyle({backgroundColor:n||""});break;case"forecolor":e.s.applyStyle({color:n||""})}return e.setEditorValue(),!1};e.registerCommand("forecolor",t).registerCommand("background",t)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(256),t),r.__exportStar(o(258),t),r.__exportStar(o(260),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPickerWidget=void 0,o(257);var r=o(19),n=o(75),i=o(32);t.ColorPickerWidget=function(e,t,o){var a=r.normalizeColor(o),s=e.c.div("jodit-color-picker"),l=e.o.textIcons?""+e.i18n("palette")+"":n.Icon.get("palette"),c=function(e){var t=[];return r.isPlainObject(e)?Object.keys(e).forEach((function(o){t.push('
'),t.push(c(e[o])),t.push("
")})):r.isArray(e)&&e.forEach((function(e){t.push("')})),t.join("")};s.appendChild(e.c.fromHTML('
'+c(e.o.colors)+"
")),s.appendChild(e.c.fromHTML('
'));var u=r.refs(s).extra;return e.o.showBrowserColorPicker&&r.hasBrowserColorPicker()&&(u.appendChild(e.c.fromHTML('
'+l+'
')),e.e.on(s,"change",(function(e){e.stopPropagation();var o=e.target;if(o&&o.tagName&&i.Dom.isTag(o,"input")){var n=o.value||"";r.isFunction(t)&&t(n),e.preventDefault()}}))),e.e.on(s,"mousedown touchend",(function(o){o.stopPropagation();var n=o.target;if(n&&n.tagName&&!i.Dom.isTag(n,"svg")&&!i.Dom.isTag(n,"path")||!n.parentNode||(n=i.Dom.closest(n.parentNode,"a",e.editor)),i.Dom.isTag(n,"a")){var a=r.attr(n,"-color")||"";t&&"function"==typeof t&&t(a),o.preventDefault()}})),e.e.fire("afterGenerateColorPicker",s,u,t,a),s}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabsWidget=void 0,o(259);var r=o(19),n=o(75);t.TabsWidget=function(e,t,o){var i=e.c.div("jodit-tabs"),a=e.c.div("jodit-tabs__wrapper"),s=e.c.div("jodit-tabs__buttons"),l={},c=[],u="",d=0;if(i.appendChild(s),i.appendChild(a),t.forEach((function(i){var p=i.icon,f=i.name,h=i.content,m=e.c.div("jodit-tab"),v=n.Button(e,p||f,f);u||(u=f),s.appendChild(v.container),c.push(v),v.container.classList.add("jodit-tabs__button","jodit-tabs__button_columns_"+t.length),r.isFunction(h)?m.appendChild(e.c.div("jodit-tab_empty")):m.appendChild(h),a.appendChild(m),v.onAction((function(){return c.forEach((function(e){e.state.activated=!1})),r.$$(".jodit-tab",a).forEach((function(e){e.classList.remove("jodit-tab_active")})),v.state.activated=!0,m.classList.add("jodit-tab_active"),r.isFunction(h)&&h.call(e),o&&(o.__activeTab=f),!1})),l[f]={button:v,tab:m},d+=1})),!d)return i;r.$$("a",s).forEach((function(e){e.style.width=(100/d).toFixed(10)+"%"}));var p=o&&o.__activeTab&&l[o.__activeTab]?o.__activeTab:u;return l[p].button.state.activated=!0,l[p].tab.classList.add("jodit-tab_active"),i}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSelectorWidget=void 0;var r=o(19),n=o(32),i=o(258),a=o(75);t.FileSelectorWidget=function(e,t,o,s,l){var c;void 0===l&&(l=!0);var u=[];if(t.upload&&e.o.uploader&&(e.o.uploader.url||e.o.uploader.insertImageAsBase64URI)){var d=e.c.fromHTML('
'+e.i18n(l?"Drop image":"Drop file")+"
"+e.i18n("or click")+'
');e.uploader.bind(d,(function(o){var n=r.isFunction(t.upload)?t.upload:e.o.uploader.defaultHandlerSuccess;r.isFunction(n)&&n.call(e,o),e.e.fire("closeAllPopups")}),(function(t){e.e.fire("errorMessage",t.message),e.e.fire("closeAllPopups")})),u.push({icon:"upload",name:"Upload",content:d})}if(t.filebrowser&&(e.o.filebrowser.ajax.url||e.o.filebrowser.items.url)&&u.push({icon:"folder",name:"Browse",content:function(){s&&s(),t.filebrowser&&e.filebrowser.open(t.filebrowser,l)}}),t.url){var p=new a.UIButton(e,{type:"submit",status:"primary",text:"Insert"}),f=new a.UIForm(e,[new a.UIInput(e,{required:!0,label:"URL",name:"url",type:"url",placeholder:"https://"}),new a.UIInput(e,{name:"text",label:"Alternative text"}),new a.UIBlock(e,[p])]);c=null,o&&!n.Dom.isText(o)&&(n.Dom.isTag(o,"img")||r.$$("img",o).length)&&(c="IMG"===o.tagName?o:r.$$("img",o)[0],r.val(f.container,"input[name=url]",r.attr(c,"src")),r.val(f.container,"input[name=text]",r.attr(c,"alt")),p.state.text="Update"),o&&n.Dom.isTag(o,"a")&&(r.val(f.container,"input[name=url]",r.attr(o,"href")),r.val(f.container,"input[name=text]",r.attr(o,"title")),p.state.text="Update"),f.onSubmit((function(o){r.isFunction(t.url)&&t.url.call(e,o.url,o.text)})),u.push({icon:"link",name:"URL",content:f.container})}return i.TabsWidget(e,u)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDrop=void 0;var r=o(7),n=o(9),i=o(32),a=o(19),s=o(183),l=o(248),c=o(99),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isFragmentFromEditor=!1,t.isCopyMode=!1,t.startDragPoint={x:0,y:0},t.draggable=null,t.bufferRange=null,t.getText=function(e){var t=l.getDataTransfer(e);return t?t.getData(n.TEXT_HTML)||t.getData(n.TEXT_PLAIN):null},t}return r.__extends(t,e),t.prototype.afterInit=function(){this.j.e.on([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)},t.prototype.onDragStart=function(e){var t=e.target;if(this.onDragEnd(),this.isFragmentFromEditor=i.Dom.isOrContains(this.j.editor,t,!0),this.isCopyMode=!this.isFragmentFromEditor||a.ctrlKey(e),this.isFragmentFromEditor){var o=this.j.s.sel,r=o&&o.rangeCount?o.getRangeAt(0):null;r&&(this.bufferRange=r.cloneRange())}else this.bufferRange=null;this.startDragPoint.x=e.clientX,this.startDragPoint.y=e.clientY,i.Dom.isElement(t)&&t.classList.contains("jodit-filebrowser__files-item")&&(t=t.querySelector("img")),i.Dom.isTag(t,"img")&&(this.draggable=t.cloneNode(!0),a.dataBind(this.draggable,"target",t)),this.addDragListeners()},t.prototype.addDragListeners=function(){this.j.e.on("dragover",this.onDrag).on("drop.DragAndDrop",this.onDrop).on(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)},t.prototype.removeDragListeners=function(){this.j.e.off("dragover",this.onDrag).off("drop.DragAndDrop",this.onDrop).off(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)},t.prototype.onDrag=function(e){this.draggable&&(this.j.e.fire("hidePopup"),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),e.preventDefault(),e.stopPropagation())},t.prototype.onDragEnd=function(){this.draggable&&(i.Dom.safeRemove(this.draggable),this.draggable=null),this.isCopyMode=!1,this.removeDragListeners()},t.prototype.onDrop=function(e){if(!e.dataTransfer||!e.dataTransfer.files||!e.dataTransfer.files.length){if(!this.isFragmentFromEditor&&!this.draggable)return this.j.e.fire("paste",e),e.preventDefault(),e.stopPropagation(),!1;var t=this.j.s.sel,o=this.bufferRange||(t&&t.rangeCount?t.getRangeAt(0):null),r=null;if(!this.draggable&&o)r=this.isCopyMode?o.cloneContents():o.extractContents();else if(this.draggable)if(this.isCopyMode){var n="1"===a.attr(this.draggable,"-is-file")?["a","href"]:["img","src"],s=n[0],l=n[1];(r=this.j.createInside.element(s)).setAttribute(l,a.attr(this.draggable,"data-src")||a.attr(this.draggable,"src")||""),"a"===s&&(r.textContent=a.attr(r,l)||"")}else r=a.dataBind(this.draggable,"target");else this.getText(e)&&(r=this.j.createInside.fromHTML(this.getText(e)));t&&t.removeAllRanges(),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),r&&(this.j.s.insertNode(r,!1,!1),o&&r.firstChild&&r.lastChild&&(o.setStartBefore(r.firstChild),o.setEndAfter(r.lastChild),this.j.s.selectRange(o),this.j.e.fire("synchro")),i.Dom.isTag(r,"img")&&this.j.events&&this.j.e.fire("afterInsertImage",r)),e.preventDefault(),e.stopPropagation()}this.isFragmentFromEditor=!1,this.removeDragListeners()},t.prototype.beforeDestruct=function(){this.onDragEnd(),this.j.e.off(window,".DragAndDrop").off(".DragAndDrop").off([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)},r.__decorate([c.autobind],t.prototype,"onDragStart",null),r.__decorate([c.throttle((function(e){return e.j.defaultTimeout/10}))],t.prototype,"onDrag",null),r.__decorate([c.autobind],t.prototype,"onDragEnd",null),r.__decorate([c.autobind],t.prototype,"onDrop",null),t}(s.Plugin);t.DragAndDrop=u},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropElement=void 0;var r=o(7),n=o(19),i=o(183),a=o(32),s=o(30),l=o(99),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dragList=[],t.draggable=null,t.wasMoved=!1,t.isCopyMode=!1,t.diffStep=10,t.startX=0,t.startY=0,t}return r.__extends(t,e),t.prototype.afterInit=function(){this.dragList=this.j.o.draggableTags?n.splitArray(this.j.o.draggableTags).filter(Boolean).map((function(e){return e.toLowerCase()})):[],this.dragList.length&&this.j.e.on("mousedown touchstart dragstart",this.onDragStart)},t.prototype.onDragStart=function(e){var t=this;if("dragstart"===e.type&&this.draggable)return!1;var o=e.target;if(this.dragList.length&&o){var r=function(e){return e&&t.dragList.includes(e.nodeName.toLowerCase())},i=a.Dom.furthest(o,r,this.j.editor)||(r(o)?o:null);i&&(this.startX=e.clientX,this.startY=e.clientY,this.isCopyMode=n.ctrlKey(e),this.onDragEnd(),this.draggable=i.cloneNode(!0),n.dataBind(this.draggable,"target",i),this.addDragListeners())}},t.prototype.onDrag=function(e){var o,r;if(this.draggable){var i=e.clientY;if(Math.sqrt(Math.pow(e.clientX-this.startX,2)+Math.pow(i-this.startY,2))>=this.diffStep){if(this.wasMoved=!0,this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){var a=n.dataBind(this.draggable,"target");n.css(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",display:"inline-block",left:e.clientX,top:e.clientY,width:null!==(o=null==a?void 0:a.offsetWidth)&&void 0!==o?o:100,height:null!==(r=null==a?void 0:a.offsetHeight)&&void 0!==r?r:100}),s.getContainer(this.j,t).appendChild(this.draggable)}n.css(this.draggable,{left:e.clientX,top:e.clientY}),this.j.s.insertCursorAtPoint(e.clientX,e.clientY)}}},t.prototype.onDragEnd=function(){this.isInDestruct||this.draggable&&(a.Dom.safeRemove(this.draggable),this.draggable=null,this.wasMoved=!1,this.removeDragListeners())},t.prototype.onDrop=function(){if(this.draggable&&this.wasMoved){var e=n.dataBind(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(e=e.cloneNode(!0));var t=e.parentElement;this.j.s.insertNode(e,!0,!1),t&&a.Dom.isEmpty(t)&&a.Dom.safeRemove(t),a.Dom.isTag(e,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",e),this.j.e.fire("synchro")}else this.onDragEnd()},t.prototype.addDragListeners=function(){this.j.e.on(this.j.editor,"mousemove touchmove",this.onDrag).on("mouseup touchend",this.onDrop).on([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)},t.prototype.removeDragListeners=function(){this.j.e.off(this.j.editor,"mousemove touchmove",this.onDrag).off("mouseup touchend",this.onDrop).off([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)},t.prototype.beforeDestruct=function(){this.onDragEnd(),this.j.e.off("mousedown touchstart dragstart",this.onDragStart),this.removeDragListeners()},r.__decorate([l.autobind],t.prototype,"onDragStart",null),r.__decorate([l.throttle((function(e){return e.j.defaultTimeout/10}))],t.prototype,"onDrag",null),r.__decorate([l.autobind],t.prototype,"onDragEnd",null),r.__decorate([l.autobind],t.prototype,"onDrop",null),t}(i.Plugin);t.DragAndDropElement=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enter=t.insertParagraph=void 0;var r=o(7),n=o(9),i=o(32),a=o(19),s=o(183),l=o(9);t.insertParagraph=function(e,t,o,r){var n,s=e.createInside.element(o),l=e.createInside.element("br");s.appendChild(l),r&&r.cssText&&s.setAttribute("style",r.cssText),e.s.insertNode(s,!1,!1),e.s.setCursorBefore(l);var c=e.s.createRange();return c.setStartBefore("br"!==o.toLowerCase()?l:s),c.collapse(!0),e.s.selectRange(c),i.Dom.safeRemove(t),a.scrollIntoViewIfNeeded(s,e.editor,e.ed),null===(n=e.events)||void 0===n||n.fire("synchro"),s};var c=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.brMode=!1,t.defaultTag=n.PARAGRAPH,t}return r.__extends(o,e),o.prototype.afterInit=function(e){var t=this;this.defaultTag=e.o.enter.toLowerCase(),this.brMode=this.defaultTag===n.BR.toLowerCase(),e.o.enterBlock||(e.o.enterBlock=this.brMode?n.PARAGRAPH:this.defaultTag),e.e.off(".enter").on("keydown.enter",(function(o){if(o.key===n.KEY_ENTER){var r=e.e.fire("beforeEnter",o);return void 0!==r?r:(e.s.isCollapsed()||e.execCommand("Delete"),e.s.focus(),t.onEnter(o),!1)}}))},o.prototype.onEnter=function(e){var o=this.j,r=o.selection,n=this.defaultTag,a=r.current(!1);a&&a!==o.editor||(a=o.createInside.text(l.INVISIBLE_SPACE),r.insertNode(a),r.select(a));var s=this.getBlockWrapper(a),c=i.Dom.isTag(s,"li");if((!c||e.shiftKey)&&!this.checkBR(a,e.shiftKey))return!1;if(s||this.hasPreviousBlock(a)||(s=this.wrapText(a)),!s||s===a)return t.insertParagraph(o,null,c?"li":n),!1;if(!this.checkUnsplittableBox(s))return!1;if(c&&i.Dom.isEmpty(s))return this.enterInsideEmptyLIelement(s),!1;var u,d=s.tagName.toLowerCase()===this.defaultTag||c,p=r.cursorOnTheRight(s),f=r.cursorOnTheLeft(s);if(!d&&(p||f))return u=p?r.setCursorAfter(s):r.setCursorBefore(s),t.insertParagraph(o,u,this.defaultTag),void(f&&!p&&r.setCursorIn(s,!0));r.splitSelection(s)},o.prototype.getBlockWrapper=function(e,t){void 0===t&&(t=n.IS_BLOCK);var o=e,r=this.j.editor;do{if(!o||o===r)break;if(t.test(o.nodeName))return i.Dom.isTag(o,"li")?o:this.getBlockWrapper(o.parentNode,/^li$/i)||o;o=o.parentNode}while(o&&o!==r);return null},o.prototype.checkBR=function(e,t){var o=i.Dom.closest(e,["pre","blockquote"],this.j.editor);if(this.brMode||t&&!o||!t&&o){var r=this.j.createInside.element("br");return this.j.s.insertNode(r,!0),a.scrollIntoViewIfNeeded(r,this.j.editor,this.j.ed),!1}return!0},o.prototype.wrapText=function(e){var t=this,o=e;i.Dom.up(o,(function(e){e&&e.hasChildNodes()&&e!==t.j.editor&&(o=e)}),this.j.editor);var r=i.Dom.wrapInline(o,this.j.o.enter,this.j);if(i.Dom.isEmpty(r)){var n=this.j.createInside.element("br");r.appendChild(n),this.j.s.setCursorBefore(n)}return r},o.prototype.hasPreviousBlock=function(e){var t=this.j;return Boolean(i.Dom.prev(e,(function(e){return i.Dom.isBlock(e,t.ew)||i.Dom.isImage(e,t.ew)}),t.editor))},o.prototype.checkUnsplittableBox=function(e){var t=this.j,o=t.selection;if(!i.Dom.canSplitBlock(e,t.ew)){var r=t.createInside.element("br");return o.insertNode(r,!1),o.setCursorAfter(r),!1}return!0},o.prototype.enterInsideEmptyLIelement=function(e){var o=null,r=i.Dom.closest(e,["ol","ul"],this.j.editor);if(r){if(i.Dom.prev(e,(function(e){return i.Dom.isTag(e,"li")}),r))if(i.Dom.next(e,(function(e){return i.Dom.isTag(e,"li")}),r)){var n=this.j.s.createRange();n.setStartBefore(r),n.setEndAfter(e);var s=n.extractContents();r.parentNode&&r.parentNode.insertBefore(s,r),o=this.j.s.setCursorBefore(r)}else o=this.j.s.setCursorAfter(r);else o=this.j.s.setCursorBefore(r);i.Dom.safeRemove(e),t.insertParagraph(this.j,o,this.defaultTag),a.$$("li",r).length||i.Dom.safeRemove(r)}},o.prototype.beforeDestruct=function(e){e.e.off("keydown.enter")},o}(s.Plugin);t.enter=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessages=void 0,o(265);var r=o(8),n=o(32),i=o(19);r.Config.prototype.showMessageErrors=!0,r.Config.prototype.showMessageErrorTime=3e3,r.Config.prototype.showMessageErrorOffsetPx=3,t.errorMessages=function(e){if(e.o.showMessageErrors){var t,o=e.c.div("jodit_error_box_for_messages"),r=function(){t=5,i.toArray(o.childNodes).forEach((function(r){i.css(o,"bottom",t+"px"),t+=r.offsetWidth+e.o.showMessageErrorOffsetPx}))};e.e.on("beforeDestruct",(function(){n.Dom.safeRemove(o)})).on("errorMessage",(function(t,i,a){e.workplace.appendChild(o);var s=e.c.div("active "+(i||""),t);o.appendChild(s),r(),e.async.setTimeout((function(){s.classList.remove("active"),e.async.setTimeout((function(){n.Dom.safeRemove(s),r()}),300)}),a||e.o.showMessageErrorTime)}))}}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.font=void 0;var r=o(7),n=o(8),i=o(32),a=o(19);n.Config.prototype.defaultFontSizePoints="px",n.Config.prototype.controls.fontsize={command:"fontSize",data:{cssRule:"font-size"},list:["8","9","10","11","12","14","16","18","24","30","36","48","60","72","96"],exec:function(e,t,o){var r=o.control;return a.memorizeExec(e,t,{control:r},(function(t){var o;return"fontsize"===(null===(o=r.command)||void 0===o?void 0:o.toLowerCase())?""+t+e.o.defaultFontSizePoints:t}))},childTemplate:function(e,t,o){return""+o+e.o.defaultFontSizePoints},tooltip:"Font size",isChildActive:function(e,t){var o,r,n=e.s.current(),s=(null===(o=t.data)||void 0===o?void 0:o.cssRule)||"font-size",l=(null===(r=t.data)||void 0===r?void 0:r.normalize)||function(t){return/pt$/i.test(t)&&"pt"===e.o.defaultFontSizePoints?t.replace(/pt$/i,""):t};if(n){var c=i.Dom.closest(n,(function(t){return i.Dom.isBlock(t,e.ew)||t&&i.Dom.isElement(t)}),e.editor)||e.editor,u=a.css(c,s);return Boolean(u&&t.args&&l(t.args[0].toString())===l(u.toString()))}return!1}},n.Config.prototype.controls.font=r.__assign(r.__assign({},n.Config.prototype.controls.fontsize),{command:"fontname",list:{"":"Default","Helvetica,sans-serif":"Helvetica","Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","'Times New Roman',Times,serif":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},childTemplate:function(e,t,o){return''+o+""},data:{cssRule:"font-family",normalize:function(e){return e.toLowerCase().replace(/['"]+/g,"").replace(/[^a-z0-9]+/g,",")}},tooltip:"Font family"}),t.font=function(e){e.registerButton({name:"font",group:"font"}).registerButton({name:"fontsize",group:"font"});var t=function(t,o,r){switch(t){case"fontsize":e.s.applyStyle({fontSize:a.normalizeSize(r)});break;case"fontname":e.s.applyStyle({fontFamily:r})}return e.e.fire("synchro"),!1};e.registerCommand("fontsize",t).registerCommand("fontname",t)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatBlock=void 0;var r=o(8),n=o(10),i=o(19);r.Config.prototype.controls.paragraph={command:"formatBlock",update:function(e){var t=e.j,o=e.control,r=t.s.current();if(r&&t.o.textIcons){var i=(n.Dom.closest(r,(function(e){return n.Dom.isBlock(e,t.ew)}),t.editor)||t.editor).nodeName.toLowerCase(),a=o.list;e&&o.data&&o.data.currentValue!==i&&a&&a[i]&&(t.o.textIcons?e.state.text=i:e.state.icon.name=i,o.data.currentValue=i)}return!1},exec:i.memorizeExec,data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote"},isChildActive:function(e,t){var o=e.s.current();if(o){var r=n.Dom.closest(o,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);return Boolean(r&&r!==e.editor&&void 0!==t.args&&r.nodeName.toLowerCase()===t.args[0])}return!1},isActive:function(e,t){var o=e.s.current();if(o){var r=n.Dom.closest(o,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);return Boolean(r&&r!==e.editor&&void 0!==t.list&&!n.Dom.isTag(r,"p")&&void 0!==t.list[r.nodeName.toLowerCase()])}return!1},childTemplate:function(e,t,o){return"<"+t+' style="margin:0;padding:0">'+e.i18n(o)+""},tooltip:"Insert format block"},t.formatBlock=function(e){e.registerButton({name:"paragraph",group:"font"}),e.registerCommand("formatblock",(function(t,o,r){return e.s.applyStyle(void 0,{element:r}),e.setEditorValue(),!1}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullsize=void 0,o(269);var r=o(8),n=o(9),i=o(19);r.Config.prototype.fullsize=!1,r.Config.prototype.globalFullSize=!0,r.Config.prototype.controls.fullsize={exec:function(e){e.toggleFullSize()},update:function(e){var t=e.j,o=t.isFullSize?"shrink":"fullsize";e.state.activated=t.isFullSize,t.o.textIcons?e.state.text=o:e.state.icon.name=o},tooltip:"Open editor in fullsize",mode:n.MODE_SOURCE+n.MODE_WYSIWYG},t.fullsize=function(e){e.registerButton({name:"fullsize"});var t=!1,o=0,r=0,n=!1,a=function(){e.events&&(t?(o=i.css(e.container,"height",void 0,!0),r=i.css(e.container,"width",void 0,!0),i.css(e.container,{height:e.ow.innerHeight,width:e.ow.innerWidth}),n=!0):n&&i.css(e.container,{height:o||"auto",width:r||"auto"}))},s=function(o){var r;if(e.container){if(void 0===o&&(o=!e.container.classList.contains("jodit_fullsize")),e.setMod("fullsize",o),e.o.fullsize=o,t=o,e.container.classList.toggle("jodit_fullsize",o),e.toolbar&&(i.isJoditObject(e)&&e.toolbarContainer.appendChild(e.toolbar.container),i.css(e.toolbar.container,"width","auto")),e.o.globalFullSize){for(var n=e.container.parentNode;n&&n.nodeType!==Node.DOCUMENT_NODE;)n.classList.toggle("jodit_fullsize-box_true",o),n=n.parentNode;a()}null===(r=e.events)||void 0===r||r.fire("afterResize")}};e.o.globalFullSize&&e.e.on(e.ow,"resize",a),e.e.on("afterInit afterOpen",(function(){var t;e.toggleFullSize(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.fullsize)})).on("toggleFullSize",s).on("beforeDestruct",(function(){t&&s(!1)})).on("beforeDestruct",(function(){e.events&&e.e.off(e.ow,"resize",a)}))}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hotkeys=void 0;var r=o(7),n=o(8),i=o(183),a=o(19),s=o(9);n.Config.prototype.commandToHotkeys={removeFormat:["ctrl+shift+m","cmd+shift+m"],insertOrderedList:["ctrl+shift+7","cmd+shift+7"],insertUnorderedList:["ctrl+shift+8, cmd+shift+8"],selectall:["ctrl+a","cmd+a"]};var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onKeyPress=function(e){var o=t.specialKeys[e.which],r=(e.key||String.fromCharCode(e.which)).toLowerCase(),n=[o||r];return["alt","ctrl","shift","meta"].forEach((function(t){e[t+"Key"]&&o!==t&&n.push(t)})),a.normalizeKeyAliases(n.join("+"))},t.specialKeys={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",91:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;a.keys(e.o.commandToHotkeys,!1).forEach((function(t){var o=e.o.commandToHotkeys[t];o&&(a.isArray(o)||a.isString(o))&&e.registerHotkeyToCommand(o,t)}));var o=!1;e.e.off(".hotkeys").on([e.ow,e.ew],"keydown.hotkeys",(function(e){if(e.key===s.KEY_ESC)return t.j.e.fire("escape",e)})).on("keydown.hotkeys",(function(r){var n=t.onKeyPress(r),i={shouldStop:!0};if(!1===t.j.e.fire(n+".hotkey",r.type,i)){if(i.shouldStop)return o=!0,e.e.stopPropagation("keydown"),!1;r.preventDefault()}}),void 0,!0).on("keyup.hotkeys",(function(){if(o)return o=!1,e.e.stopPropagation("keyup"),!1}),void 0,!0)},t.prototype.beforeDestruct=function(e){e.events&&e.e.off(".hotkeys")},t}(i.Plugin);t.hotkeys=l},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iframe=void 0;var r=o(8),n=o(19),i=o(19),a=o(9);r.Config.prototype.iframeBaseUrl="",r.Config.prototype.iframeTitle="Jodit Editor",r.Config.prototype.iframeDoctype="",r.Config.prototype.iframeDefaultSrc="about:blank",r.Config.prototype.iframeStyle='html{margin:0;padding:0;min-height: 100%;}body{box-sizing:border-box;font-size:13px;line-height:1.6;padding:10px;margin:0;background:transparent;color:#000;position:relative;z-index:2;user-select:auto;margin:0px;overflow:auto;outline:none;}table{width:100%;border:none;border-collapse:collapse;empty-cells: show;max-width: 100%;}th,td{padding: 2px 5px;border:1px solid #ccc;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}p{margin-top:0;}.jodit_editor .jodit_iframe_wrapper{display: block;clear: both;user-select: none;position: relative;}.jodit_editor .jodit_iframe_wrapper:after {position:absolute;content:"";z-index:1;top:0;left:0;right: 0;bottom: 0;cursor: pointer;display: block;background: rgba(0, 0, 0, 0);} .jodit_disabled{user-select: none;-o-user-select: none;-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none}',r.Config.prototype.iframeCSSLinks=[],r.Config.prototype.editHTMLDocumentMode=!1,t.iframe=function(e){var t=e.options;e.e.on("afterSetMode",(function(){e.isEditorMode()&&e.s.focus()})).on("generateDocumentStructure.iframe",(function(e,o){var r=e||o.iframe.contentWindow.document;if(r.open(),r.write(t.iframeDoctype+''+t.iframeTitle+""+(t.iframeBaseUrl?'':"")+''),r.close(),t.iframeCSSLinks&&t.iframeCSSLinks.forEach((function(e){var t=r.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),r.head&&r.head.appendChild(t)})),t.iframeStyle){var i=r.createElement("style");i.innerHTML=t.iframeStyle,r.head&&r.head.appendChild(i)}})).on("createEditor",(function(){if(t.iframe){var o=e.c.element("iframe");o.style.display="block",o.src="about:blank",o.className="jodit-wysiwyg_iframe",o.setAttribute("allowtransparency","true"),o.setAttribute("tabindex",t.tabIndex.toString()),o.setAttribute("frameborder","0"),e.workplace.appendChild(o),e.iframe=o;var r=e.e.fire("generateDocumentStructure.iframe",null,e);return n.callPromise(r,(function(){if(e.iframe){var o=e.iframe.contentWindow.document;e.editorWindow=e.iframe.contentWindow;var r=function(){n.attr(o.body,"contenteditable",e.getMode()!==a.MODE_SOURCE&&!e.getReadOnly()||null)},s=function(e){var t=//im,o="{%%BODY%%}",r=t.exec(e);return r&&(e=e.replace(t,o).replace(/]*?)>(.*?)<\/span>/gim,"").replace(/<span([^&]*?)>(.*?)<\/span>/gim,"").replace(o,r[0].replace(/(]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im,"$1").replace(/(]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5").replace(/(<[^<]+?)\sclass="[\s]*"/gim,"$1").replace(/(<[^<]+?)\sstyle="[\s;]*"/gim,"$1").replace(/(<[^<]+?)\sdir="[\s]*"/gim,"$1")),e};if(t.editHTMLDocumentMode){var l=e.element.tagName;if("TEXTAREA"!==l&&"INPUT"!==l)throw i.error("If enable `editHTMLDocumentMode` - source element should be INPUT or TEXTAREA");e.e.on("beforeGetNativeEditorValue",(function(){return s(e.o.iframeDoctype+o.documentElement.outerHTML)})).on("beforeSetNativeEditorValue",(function(t){return!e.isLocked&&(/<(html|body)/i.test(t)?s(o.documentElement.outerHTML)!==s(t)&&(o.open(),o.write(e.o.iframeDoctype+s(t)),o.close(),e.editor=o.body,r(),e.e.fire("prepareWYSIWYGEditor")):o.body.innerHTML=t,!0)}))}if(e.editor=o.body,e.e.on("afterSetMode afterInit afterAddPlace",r),"auto"===t.height){o.documentElement&&(o.documentElement.style.overflowY="hidden");var c=e.async.throttle((function(){e.editor&&e.iframe&&"auto"===t.height&&n.css(e.iframe,"height",e.editor.offsetHeight)}),e.defaultTimeout/2);e.e.on("change afterInit afterSetMode resize",c).on([e.iframe,e.ew,o.documentElement],"load",c).on(o,"readystatechange DOMContentLoaded",c)}return o.documentElement&&e.e.on(o.documentElement,"mousedown touchend",(function(){e.s.isFocused()||(e.s.focus(),e.editor===o.body&&e.s.setCursorIn(o.body))})).on(e.ew,"mousedown touchstart keydown keyup touchend click mouseup mousemove scroll",(function(t){var o;null===(o=e.events)||void 0===o||o.fire(e.ow,t)})),!1}}))}}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(273),t),r.__exportStar(o(279),t),r.__exportStar(o(280),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageProperties=void 0;var r=o(7);o(274);var n=o(8),i=o(10),a=o(19),s=o(255),l=o(92),c=o(275),u=o(99),d=o(195);n.Config.prototype.image={dialogWidth:600,openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editBorderRadius:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0};var p=function(e){return e=a.trim(e),/^[0-9]+$/.test(e)?e+"px":e},f=function(e){return/^[-+]?[0-9.]+px$/.test(e.toString())?parseFloat(e.toString()):e},h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={image:new Image,get ratio(){return this.image.naturalWidth/this.image.naturalHeight||1},sizeIsLocked:!0,marginIsLocked:!0},t}return r.__extends(t,e),t.prototype.onChangeMarginIsLocked=function(){var e=this;if(this.form){var t=a.refs(this.form),o=t.lockMargin;[t.marginRight,t.marginBottom,t.marginLeft].forEach((function(t){a.attr(t,"disabled",e.state.marginIsLocked||null)})),o.innerHTML=i.Icon.get(this.state.marginIsLocked?"lock":"unlock")}},t.prototype.onChangeSizeIsLocked=function(){if(this.form){var e=a.refs(this.form),t=e.lockSize,o=e.imageWidth;t.innerHTML=i.Icon.get(this.state.sizeIsLocked?"lock":"unlock"),t.classList.remove("jodit-properties__lock"),t.classList.remove("jodit-properties__unlock"),t.classList.add(this.state.sizeIsLocked?"jodit-properties__lock":"jodit-properties__unlock"),this.j.e.fire(o,"change")}},t.prototype.open=function(){return this.makeForm(),this.j.e.fire("hidePopup"),a.markOwner(this.j,this.dialog.container),this.state.marginIsLocked=!0,this.state.sizeIsLocked=!0,this.updateValues(),this.dialog.open().setModal(!0).setPosition(),!1},t.prototype.makeForm=function(){var e=this;if(!this.dialog){this.dialog=new i.Dialog({fullsize:this.j.o.fullsize,globalFullSize:this.j.o.globalFullSize,theme:this.j.o.theme,language:this.j.o.language,minWidth:Math.min(400,screen.width),minHeight:400,buttons:["fullsize","dialog.close"]});var t=this.j,o=t.o,r=t.i18n.bind(t),n={check:l.Button(t,"ok","Apply"),remove:l.Button(t,"bin","Delete")};t.e.on(this.dialog,"afterClose",(function(){e.state.image.parentNode&&o.image.selectImageAfterClose&&t.s.select(e.state.image)})),n.remove.onAction((function(){t.s.removeNode(e.state.image),e.dialog.close()}));var u=this.dialog;u.setHeader(r("Image properties"));var d=c.form(t);this.form=d,u.setContent(d);var p=a.refs(this.form).tabsBox;p&&p.appendChild(s.TabsWidget(t,[{name:"Image",content:c.mainTab(t)},{name:"Advanced",content:c.positionTab(t)}])),n.check.onAction(this.onApply);var f=a.refs(this.form),h=f.editImage;t.e.on(f.changeImage,"click",this.openImagePopup),o.image.useImageEditor&&t.e.on(h,"click",this.openImageEditor);var m=a.refs(d),v=m.lockSize,g=m.lockMargin,y=m.imageWidth,b=m.imageHeight;v&&t.e.on(v,"click",(function(){e.state.sizeIsLocked=!e.state.sizeIsLocked})),t.e.on(g,"click",(function(t){e.state.marginIsLocked=!e.state.marginIsLocked,t.preventDefault()}));var _=function(t){if(a.isNumeric(y.value)&&a.isNumeric(b.value)){var o=parseFloat(y.value),r=parseFloat(b.value);t.target===y?b.value=Math.round(o/e.state.ratio).toString():y.value=Math.round(r*e.state.ratio).toString()}};t.e.on([y,b],"change keydown mousedown paste",(function(o){e.state.sizeIsLocked&&t.async.setTimeout(_.bind(e,o),{timeout:t.defaultTimeout,label:"image-properties-changeSize"})})),u.setFooter([n.remove,n.check]),u.setSize(this.j.o.image.dialogWidth)}},t.prototype.updateValues=function(){var e,t,o=this,r=this.j.o,n=this.state.image,s=a.refs(this.form),l=s.marginTop,c=s.marginRight,u=s.marginBottom,d=s.marginLeft,p=s.imageSrc,h=s.id,m=s.classes,v=s.align,g=s.style,y=s.imageTitle,b=s.imageAlt,_=s.borderRadius,w=s.imageLink,S=s.imageWidth,C=s.imageHeight,k=s.imageLinkOpenInNewTab,j=s.imageViewSrc,E=s.lockSize;s.lockMargin.checked=o.state.marginIsLocked,E.checked=o.state.sizeIsLocked,p.value=a.attr(n,"src")||"",j&&a.attr(j,"src",a.attr(n,"src")||""),function(){y.value=a.attr(n,"title")||"",b.value=a.attr(n,"alt")||"";var e=i.Dom.closest(n,"a",o.j.editor);e?(w.value=a.attr(e,"href")||"",k.checked="_blank"===a.attr(e,"target")):(w.value="",k.checked=!1)}(),e=a.attr(n,"width")||a.css(n,"width",void 0,!0)||!1,t=a.attr(n,"height")||a.css(n,"height",void 0,!0)||!1,S.value=!1!==e?f(e).toString():n.offsetWidth.toString(),C.value=!1!==t?f(t).toString():n.offsetHeight.toString(),o.state.sizeIsLocked=function(){if(!a.isNumeric(S.value)||!a.isNumeric(C.value))return!1;var e=parseFloat(S.value),t=parseFloat(C.value);return 1>Math.abs(e-t*o.state.ratio)}(),function(){if(r.image.editMargins){var e=!0,t=!1;[l,c,u,d].forEach((function(o){var r=a.attr(o,"data-ref")||"",i=n.style.getPropertyValue(a.kebabCase(r));if(!i)return t=!0,void(o.value="");/^[0-9]+(px)?$/.test(i)&&(i=parseInt(i,10)),o.value=i.toString()||"",(t&&o.value||e&&"marginTop"!==r&&o.value!==l.value)&&(e=!1)})),o.state.marginIsLocked=e}}(),m.value=(a.attr(n,"class")||"").replace(/jodit_focused_image[\s]*/,""),h.value=a.attr(n,"id")||"",_.value=(parseInt(n.style.borderRadius||"0",10)||"0").toString(),n.style.cssFloat&&-1!==["left","right"].indexOf(n.style.cssFloat.toLowerCase())?v.value=a.css(n,"float"):"block"===a.css(n,"display")&&"auto"===n.style.marginLeft&&"auto"===n.style.marginRight&&(v.value="center"),g.value=a.attr(n,"style")||""},t.prototype.onApply=function(){var e=a.refs(this.form),t=e.imageSrc,o=e.borderRadius,r=e.imageTitle,n=e.imageAlt,s=e.imageLink,l=e.imageWidth,c=e.imageHeight,u=e.marginTop,d=e.marginRight,f=e.marginBottom,h=e.marginLeft,m=e.imageLinkOpenInNewTab,v=e.align,g=e.classes,y=e.id,b=this.j.o,_=this.state.image;if(b.image.editStyle&&a.attr(_,"style",e.style.value||null),!t.value)return i.Dom.safeRemove(_),void this.dialog.close();a.attr(_,"src",t.value),_.style.borderRadius="0"!==o.value&&/^[0-9]+$/.test(o.value)?o.value+"px":"",a.attr(_,"title",r.value||null),a.attr(_,"alt",n.value||null);var w=i.Dom.closest(_,"a",this.j.editor);s.value?(w||(w=i.Dom.wrap(_,"a",this.j)),a.attr(w,"href",s.value),a.attr(w,"target",m.checked?"_blank":null)):w&&w.parentNode&&w.parentNode.replaceChild(_,w),l.value===_.offsetWidth.toString()&&c.value===_.offsetHeight.toString()||(a.css(_,{width:a.trim(l.value)?p(l.value):null,height:a.trim(c.value)?p(c.value):null}),a.attr(_,"width",null),a.attr(_,"height",null));var S=[u,d,f,h];b.image.editMargins&&(this.state.marginIsLocked?a.css(_,"margin",p(u.value)):S.forEach((function(e){var t=a.attr(e,"data-ref")||"";a.css(_,t,p(e.value))}))),b.image.editClass&&a.attr(_,"class",g.value||null),b.image.editId&&a.attr(_,"id",y.value||null),b.image.editAlign&&(v.value?["right","left"].includes(v.value.toLowerCase())?(a.css(_,"float",v.value),a.clearCenterAlign(_)):a.css(_,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):(a.css(_,"float")&&-1!==["right","left"].indexOf(a.css(_,"float").toString().toLowerCase())&&a.css(_,"float",""),a.clearCenterAlign(_))),this.j.setEditorValue(),this.dialog.close()},t.prototype.openImageEditor=function(){var e=this,t=a.attr(this.state.image,"src")||"",o=this.j.c.element("a"),r=function(){o.host===location.host||i.Confirm(e.j.i18n("You can only edit your own images. Download this image on the host?"),(function(t){t&&e.j.uploader&&e.j.uploader.uploadRemoteImage(o.href.toString(),(function(t){i.Alert(e.j.i18n("The image has been successfully uploaded to the host!"),(function(){a.isString(t.newfilename)&&(a.attr(e.state.image,"src",t.baseurl+t.newfilename),e.updateValues())})).bindDestruct(e.j)}),(function(t){i.Alert(e.j.i18n("There was an error loading %s",t.message)).bindDestruct(e.j)}))})).bindDestruct(e.j)};o.href=t,this.j.filebrowser.dataProvider.getPathByUrl(o.href.toString()).then((function(r){d.openImageEditor.call(e.j.filebrowser,o.href,r.name,r.path,r.source,(function(){var o=(new Date).getTime();a.attr(e.state.image,"src",t+(-1!==t.indexOf("?")?"":"?")+"&_tmp="+o.toString()),e.updateValues()}),(function(t){i.Alert(t.message).bindDestruct(e.j)}))})).catch((function(t){i.Alert(t.message,r).bindDestruct(e.j)}))},t.prototype.openImagePopup=function(e){var t=this,o=new i.Popup(this.j),r=a.refs(this.form).changeImage;o.setZIndex(this.dialog.getZIndex()+1),o.setContent(s.FileSelectorWidget(this.j,{upload:function(e){e.files&&e.files.length&&a.attr(t.state.image,"src",e.baseurl+e.files[0]),t.updateValues(),o.close()},filebrowser:function(e){e&&a.isArray(e.files)&&e.files.length&&(a.attr(t.state.image,"src",e.files[0]),o.close(),t.updateValues())}},this.state.image,o.close)).open((function(){return a.position(r)})),e.stopPropagation()},t.prototype.afterInit=function(e){var t=this,o=this;e.e.on("afterConstructor changePlace",(function(){e.e.off(e.editor,".imageproperties").on(e.editor,"dblclick.imageproperties",(function(t){var r=t.target;i.Dom.isTag(r,"img")&&(e.o.image.openOnDblClick?(o.state.image=r,e.o.readonly||(t.stopImmediatePropagation(),t.preventDefault(),o.open())):(t.stopImmediatePropagation(),e.s.select(r)))}))})).on("openImageProperties.imageproperties",(function(e){t.state.image=e,t.open()}))},t.prototype.beforeDestruct=function(e){this.dialog&&this.dialog.destruct(),e.e.off(e.editor,".imageproperties").off(".imageproperties")},r.__decorate([u.watch("state.marginIsLocked")],t.prototype,"onChangeMarginIsLocked",null),r.__decorate([u.watch("state.sizeIsLocked")],t.prototype,"onChangeSizeIsLocked",null),r.__decorate([u.autobind],t.prototype,"onApply",null),r.__decorate([u.autobind],t.prototype,"openImageEditor",null),r.__decorate([u.autobind],t.prototype,"openImagePopup",null),t}(i.Plugin);t.imageProperties=h},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(276),t),r.__exportStar(o(277),t),r.__exportStar(o(278),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.form=void 0;var r=o(75);t.form=function(e){var t=e.o.image,o=t.showPreview,n=t.editSize,i=r.Icon.get.bind(r.Icon);return e.c.fromHTML('
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t'+i("lock")+'\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t
')}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mainTab=void 0;var r=o(75);t.mainTab=function(e){var t=e.o,o=e.i18n.bind(e),n=r.Icon.get.bind(r.Icon),i=t.filebrowser.ajax.url||t.uploader.url,a=t.image.useImageEditor;return e.c.fromHTML('
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t'+n("image")+'\n\t\t\t\t\t\t'+n("crop")+'\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
")}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.positionTab=void 0;var r=o(75);t.positionTab=function(e){var t=e.o,o=e.i18n.bind(e),n=r.Icon.get.bind(r.Icon);return e.c.fromHTML('
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t'+n("lock")+'\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t")}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageProcessor=void 0;var r=o(19);t.imageProcessor=function(e){e.e.on("change afterInit changePlace",e.async.debounce((function(){e.editor&&r.$$("img",e.editor).forEach((function(t){t.__jodit_imageprocessor_binded||(t.__jodit_imageprocessor_binded=!0,t.complete||t.addEventListener("load",(function o(){var r;!e.isInDestruct&&(null===(r=e.e)||void 0===r||r.fire("resize")),t.removeEventListener("load",o)})),e.e.on(t,"mousedown touchstart",(function(){e.s.select(t)})))}))}),e.defaultTimeout))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.image=void 0;var r=o(7),n=o(32),i=o(19),a=o(255);o(8).Config.prototype.controls.image={popup:function(e,t,o,s){var l=null;t&&!n.Dom.isText(t)&&n.Dom.isHTMLElement(t,e.ew)&&(n.Dom.isTag(t,"img")||i.$$("img",t).length)&&(l=n.Dom.isTag(t,"img")?t:i.$$("img",t)[0]);var c=e.s.save();return a.FileSelectorWidget(e,{filebrowser:function(t){e.s.restore(c),t.files&&t.files.forEach((function(o){return e.s.insertImage(t.baseurl+o,null,e.o.imageDefaultWidth)})),s()},upload:!0,url:function(t,o){return r.__awaiter(void 0,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return e.s.restore(c),(n=l||e.createInside.element("img")).setAttribute("src",t),n.setAttribute("alt",o),l?[3,2]:[4,e.s.insertImage(n,null,e.o.imageDefaultWidth)];case 1:r.sent(),r.label=2;case 2:return s(),[2]}}))}))}},l,s)},tags:["img"],tooltip:"Insert Image"},t.image=function(e){e.registerButton({name:"image",group:"media"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indent=void 0;var r=o(8),n=o(9),i=o(32),a=o(19);r.Config.prototype.controls.indent={tooltip:"Increase Indent"};var s=function(e){return"rtl"===e?"marginRight":"marginLeft"};r.Config.prototype.controls.outdent={isDisabled:function(e){var t=e.s.current();if(t){var o=i.Dom.closest(t,(function(t){return i.Dom.isBlock(t,e.ew)}),e.editor),r=s(e.o.direction);if(o&&o.style&&o.style[r])return 0>=parseInt(o.style[r],10)}return!0},tooltip:"Decrease Indent"},r.Config.prototype.indentMargin=10,t.indent=function(e){var t=s(e.o.direction);e.registerButton({name:"indent",group:"indent"}).registerButton({name:"outdent",group:"indent"});var o=function(o){var r=[];return e.s.eachSelection((function(s){var l=e.s.save(),c=!!s&&i.Dom.up(s,(function(t){return i.Dom.isBlock(t,e.ew)}),e.editor),u=e.o.enter;if(!c&&s&&(c=i.Dom.wrapInline(s,u!==n.BR?u:n.PARAGRAPH,e)),!c)return e.s.restore(l),!1;var d=-1!==r.indexOf(c);if(c&&c.style&&!d){r.push(c);var p=c.style[t]?parseInt(c.style[t],10):0;c.style[t]=(p+=e.o.indentMargin*("outdent"===o?-1:1))>0?p+"px":"",a.attr(c,"style")||c.removeAttribute("style")}e.s.restore(l)})),e.setEditorValue(),!1};e.registerCommand("indent",{exec:o,hotkeys:["ctrl+]","cmd+]"]}),e.registerCommand("outdent",{exec:o,hotkeys:["ctrl+[","cmd+["]})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(7).__exportStar(o(283),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hr=void 0;var r=o(8),n=o(32);r.Config.prototype.controls.hr={command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},t.hr=function(e){e.registerButton({name:"hr",group:"insert"}),e.registerCommand("insertHorizontalRule",(function(){var t=e.createInside.element("hr");e.s.insertNode(t,!1,!1);var o=n.Dom.closest(t.parentElement,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);o&&n.Dom.isEmpty(o)&&o!==e.editor&&(n.Dom.after(o,t),n.Dom.safeRemove(o));var r=n.Dom.next(t,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor,!1);return r||(r=e.createInside.element(e.o.enter),n.Dom.after(t,r)),e.s.setCursorIn(r),!1}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inlinePopup=void 0;var r=o(7);o(285),o(286);var n=o(183),i=o(172),a=o(115),s=o(19),l=o(10),c=o(99),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=null,t.popup=new a.Popup(t.jodit),t.toolbar=i.makeCollection(t.jodit,t.popup),t.snapRange=null,t}return r.__extends(t,e),t.prototype.onClick=function(e){var t=this,o=e.target,r=s.keys(this.j.o.popup,!1),n=l.Dom.isTag(o,"img")?o:l.Dom.closest(o,r,this.j.editor);n&&this.canShowPopupForType(n.nodeName.toLowerCase())&&this.showPopup((function(){return s.position(n,t.j)}),n.nodeName.toLowerCase(),n)},t.prototype.showPopup=function(e,t,o){if(t=t.toLowerCase(),!this.canShowPopupForType(t))return!1;if(this.type!==t||o!==this.previousTarget){this.previousTarget=o;var r=this.j.o.popup[t],n=void 0;n=s.isFunction(r)?r(this.j,o,this.popup.close):r,s.isArray(n)&&(this.toolbar.build(n,o),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,n=this.toolbar.container),this.popup.setContent(n),this.type=t}return this.popup.open(e),!0},t.prototype.hidePopup=function(e){e&&e!==this.type||this.popup.close()},t.prototype.canShowPopupForType=function(e){var t=this.j.o.popup[e.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!t||this.isExcludedTarget(e))},t.prototype.isExcludedTarget=function(e){return s.splitArray(this.j.o.toolbarInlineDisableFor).map((function(e){return e.toLowerCase()})).includes(e.toLowerCase())},t.prototype.afterInit=function(e){var t=this;this.j.e.on("getDiffButtons.mobile",(function(o){if(t.toolbar===o){var r=t.toolbar.getButtonsNames();return s.toArray(e.registeredButtons).filter((function(e){return!t.j.o.toolbarInlineDisabledButtons.includes(e.name)})).filter((function(e){var t=s.isString(e)?e:e.name;return t&&"|"!==t&&"\n"!==t&&!r.includes(t)}))}})).on("hidePopup",this.hidePopup).on("showPopup",(function(e,o,r){t.showPopup(o,r||(s.isString(e)?e:e.nodeName),s.isString(e)?void 0:e)})).on("click",this.onClick).on("mousedown keydown",this.onSelectionStart).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd)},t.prototype.onSelectionStart=function(){this.snapRange=this.j.s.range.cloneRange()},t.prototype.onSelectionEnd=function(e){if(!(e&&e.target&&l.UIElement.closestElement(e.target,a.Popup))){var t=this.snapRange,o=this.j.s.range;t&&!o.collapsed&&o.startContainer===t.startContainer&&o.startOffset===t.startOffset&&o.endContainer===t.endContainer&&o.endOffset===t.endOffset||this.onSelectionChange()}},t.prototype.onSelectionChange=function(){if(this.j.o.toolbarInlineForSelection){var e="selection",t=this.j.s.sel,o=this.j.s.range;(null==t?void 0:t.isCollapsed)||this.isSelectedTarget(o)||this.tableModule.getAllSelectedCells().length?this.type===e&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((function(){return o.getBoundingClientRect()}),e)}},t.prototype.isSelectedTarget=function(e){var t=e.startContainer;return l.Dom.isElement(t)&&t===e.endContainer&&l.Dom.isTag(t.childNodes[e.startOffset],s.keys(this.j.o.popup,!1))&&e.startOffset===e.endOffset-1},Object.defineProperty(t.prototype,"tableModule",{get:function(){return this.j.getInstance("Table",this.j.o)},enumerable:!1,configurable:!0}),t.prototype.beforeDestruct=function(e){e.e.off("showPopup").off("click",this.onClick).off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd)},r.__decorate([c.autobind],t.prototype,"onClick",null),r.__decorate([c.wait((function(e){return!e.j.isLocked}))],t.prototype,"showPopup",null),r.__decorate([c.autobind],t.prototype,"hidePopup",null),r.__decorate([c.autobind],t.prototype,"onSelectionStart",null),r.__decorate([c.autobind],t.prototype,"onSelectionEnd",null),r.__decorate([c.debounce((function(e){return e.defaultTimeout}))],t.prototype,"onSelectionChange",null),t}(n.Plugin);t.inlinePopup=u},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8);r.Config.prototype.toolbarInline=!0,r.Config.prototype.toolbarInlineForSelection=!1,r.Config.prototype.toolbarInlineDisableFor=[],r.Config.prototype.toolbarInlineDisabledButtons=["source"],r.Config.prototype.popup={a:o(287).Z,img:o(288).Z,cells:o(289).Z,jodit:[{name:"bin",tooltip:"Delete",exec:function(e,t){t&&e.s.removeNode(t)}}],"jodit-media":[{name:"bin",tooltip:"Delete",exec:function(e,t){t&&e.s.removeNode(t)}}],selection:["bold","underline","italic","ul","ol","\n","outdent","indent","fontsize","brush","cut","\n","paragraph","link","align","dots"]}},(e,t,o)=>{"use strict";var r=o(20);t.Z=[{name:"eye",tooltip:"Open link",exec:function(e,t){var o=r.attr(t,"href");t&&o&&e.ow.open(o)}},{name:"link",tooltip:"Edit link",icon:"pencil"},"unlink","brush","file"]},(e,t,o)=>{"use strict";var r=o(32),n=o(34),i=o(19);t.Z=[{name:"delete",icon:"bin",tooltip:"Delete",exec:function(e,t){t&&e.s.removeNode(t)}},{name:"pencil",exec:function(e,t){"img"===t.tagName.toLowerCase()&&e.e.fire("openImageProperties",t)},tooltip:"Edit"},{name:"valign",list:["Top","Middle","Bottom","Normal"],tooltip:"Vertical align",exec:function(e,t,o){var a=o.control;if(r.Dom.isTag(t,"img")){var s=a.args&&n.isString(a.args[0])?a.args[0].toLowerCase():"";if(!s)return!1;i.css(t,"vertical-align","normal"===s?"":s),e.e.fire("recalcPositionPopup")}}},{name:"left",childTemplate:function(e,t,o){return o},list:["Left","Right","Center","Normal"],exec:function(e,t,o){var a=o.control;if(r.Dom.isTag(t,"img")){var s=a.args&&n.isString(a.args[0])?a.args[0].toLowerCase():"";if(!s)return!1;"normal"!==s?-1!==["right","left"].indexOf(s)?(i.css(t,"float",s),i.clearCenterAlign(t)):(i.css(t,"float",""),i.css(t,{display:"block","margin-left":"auto","margin-right":"auto"})):(i.css(t,"float")&&-1!==["right","left"].indexOf(i.css(t,"float").toLowerCase())&&i.css(t,"float",""),i.clearCenterAlign(t)),e.setEditorValue(),e.e.fire("recalcPositionPopup")}},tooltip:"Horizontal align"}]},(e,t,o)=>{"use strict";var r=o(34),n=o(19),i=o(255),a=function(e){return e.args&&r.isString(e.args[0])?e.args[0].toLowerCase():""};t.Z=[{name:"brush",popup:function(e){if(r.isJoditObject(e)){var t=e.getInstance("Table",e.o).getAllSelectedCells();if(!t.length)return!1;var o=n.css(t[0],"color"),a=n.css(t[0],"background-color"),s=n.css(t[0],"border-color"),l=i.ColorPickerWidget(e,(function(o){t.forEach((function(e){n.css(e,"background-color",o)})),e.setEditorValue()}),a),c=i.ColorPickerWidget(e,(function(o){t.forEach((function(e){n.css(e,"color",o)})),e.setEditorValue()}),o),u=i.ColorPickerWidget(e,(function(o){t.forEach((function(e){n.css(e,"border-color",o)})),e.setEditorValue()}),s);return i.TabsWidget(e,[{name:"Background",content:l},{name:"Text",content:c},{name:"Border",content:u}])}},tooltip:"Background"},{name:"valign",list:["Top","Middle","Bottom","Normal"],childTemplate:function(e,t,o){return o},exec:function(e,t,o){var r=a(o.control);e.getInstance("Table",e.o).getAllSelectedCells().forEach((function(e){n.css(e,"vertical-align","normal"===r?"":r)}))},tooltip:"Vertical align"},{name:"splitv",list:{tablesplitv:"Split vertical",tablesplitg:"Split horizontal"},tooltip:"Split"},{name:"align",icon:"left"},"\n",{name:"merge",command:"tablemerge",tooltip:"Merge"},{name:"addcolumn",list:{tableaddcolumnbefore:"Insert column before",tableaddcolumnafter:"Insert column after"},exec:function(e,t,o){var n=o.control;if(r.isJoditObject(e)){var i=a(n);e.execCommand(i,!1,t)}},tooltip:"Add column"},{name:"addrow",list:{tableaddrowbefore:"Insert row above",tableaddrowafter:"Insert row below"},exec:function(e,t,o){var n=o.control;if(r.isJoditObject(e)){var i=a(n);e.execCommand(i,!1,t)}},tooltip:"Add row"},{name:"delete",icon:"bin",list:{tablebin:"Delete table",tablebinrow:"Delete row",tablebincolumn:"Delete column",tableempty:"Empty cell"},exec:function(e,t,o){var n=o.control;if(r.isJoditObject(e)){var i=a(n);e.execCommand(i,!1,t),e.e.fire("hidePopup")}},tooltip:"Delete"}]},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.justify=t.alignElement=t.clearAlign=void 0;var r=o(8),n=o(10),i=o(19);r.Config.prototype.controls.align={name:"left",tooltip:"Align",update:function(e){var t=e.j,o=e.control,r=t.s.current();if(r){var a=n.Dom.closest(r,(function(e){return n.Dom.isBlock(e,t.ew)}),t.editor)||t.editor,s=i.css(a,"text-align").toString();o.defaultValue&&-1!==o.defaultValue.indexOf(s)&&(s="left"),o.data&&o.data.currentValue!==s&&o.list&&-1!==o.list.indexOf(s)&&(t.o.textIcons?e.state.text=s:e.state.icon.name=s,o.data.currentValue=s)}},isActive:function(e,t){var o=e.s.current();if(o&&t.defaultValue){var r=n.Dom.closest(o,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor)||e.editor;return-1===t.defaultValue.indexOf(i.css(r,"text-align").toString())}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},r.Config.prototype.controls.center={command:"justifyCenter",css:{"text-align":"center"},tooltip:"Align Center"},r.Config.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},r.Config.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},r.Config.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"},t.clearAlign=function(e,t){n.Dom.each(e,(function(e){n.Dom.isHTMLElement(e,t.ew)&&e.style.textAlign&&(e.style.textAlign="",e.style.cssText.trim().length||e.removeAttribute("style"))}))},t.alignElement=function(e,o,r){if(n.Dom.isNode(o,r.ew)&&n.Dom.isElement(o))switch(t.clearAlign(o,r),e.toLowerCase()){case"justifyfull":o.style.textAlign="justify";break;case"justifyright":o.style.textAlign="right";break;case"justifyleft":o.style.textAlign="left";break;case"justifycenter":o.style.textAlign="center"}},t.justify=function(e){e.registerButton({name:"align",group:"indent"});var o=function(o){return e.s.focus(),e.s.eachSelection((function(r){if(r){var i=n.Dom.up(r,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);i||(i=n.Dom.wrapInline(r,e.o.enterBlock,e)),t.alignElement(o,i,e)}})),!1};e.registerCommand("justifyfull",o),e.registerCommand("justifyright",o),e.registerCommand("justifyleft",o),e.registerCommand("justifycenter",o)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.limit=void 0;var r=o(7),n=o(8),i=o(183),a=o(9),s=o(19),l=o(99);n.Config.prototype.limitWords=!1,n.Config.prototype.limitChars=!1,n.Config.prototype.limitHTML=!1;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this,o=e.o;if(e&&(o.limitWords||o.limitChars)){var r=null;e.e.off(".limit").on("beforePaste.limit",(function(){r=e.observer.snapshot.make()})).on("keydown.limit keyup.limit beforeEnter.limit beforePaste.limit",this.checkPreventKeyPressOrPaste).on("change.limit",this.checkPreventChanging).on("afterPaste.limit",(function(){if(t.shouldPreventInsertHTML()&&r)return e.observer.snapshot.restore(r),!1}))}},t.prototype.shouldPreventInsertHTML=function(e,t){if(void 0===e&&(e=null),void 0===t&&(t=""),e&&a.COMMAND_KEYS.includes(e.key))return!1;var o=this.jodit,r=o.o,n=r.limitWords,i=r.limitChars,s=this.splitWords(t||(o.o.limitHTML?o.value:o.text));return!(!n||n>s.length)||Boolean(i)&&s.join("").length>=i},t.prototype.checkPreventKeyPressOrPaste=function(e){if(this.shouldPreventInsertHTML(e))return!1},t.prototype.checkPreventChanging=function(e,t){var o=this.jodit,r=o.o,n=r.limitWords,i=r.limitChars,a=o.o.limitHTML?e:s.stripTags(e),l=this.splitWords(a);(n&&l.length>n||Boolean(i)&&l.join("").length>i)&&(o.value=t)},t.prototype.splitWords=function(e){return e.replace(a.INVISIBLE_SPACE_REG_EXP(),"").split(a.SPACE_REG_EXP()).filter((function(e){return e.length}))},t.prototype.beforeDestruct=function(e){e.e.off(".limit")},r.__decorate([l.autobind],t.prototype,"checkPreventKeyPressOrPaste",null),r.__decorate([l.autobind],t.prototype,"checkPreventChanging",null),t}(i.Plugin);t.limit=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.link=void 0;var r=o(7),n=o(8),i=o(32),a=o(19),s=o(293),l=o(183),c=o(99),u=o(10);n.Config.prototype.link={formTemplate:s.formTemplate,followOnDblClick:!1,processVideoLink:!0,processPastedLink:!0,noFollowCheckbox:!0,openInNewTabCheckbox:!0,modeClassName:"input",selectMultipleClassName:!0,selectSizeClassName:3,selectOptionsClassName:[],hotkeys:["ctrl+k","cmd+k"]},n.Config.prototype.controls.unlink={exec:function(e,t){var o=i.Dom.closest(t,"a",e.editor);o&&i.Dom.unwrap(o),e.setEditorValue(),e.e.fire("hidePopup")},tooltip:"Unlink"},n.Config.prototype.controls.link={isActive:function(e){var t=e.s.current();return Boolean(t&&i.Dom.closest(t,"a",e.editor))},popup:function(e,t,o,r){return e.e.fire("generateLinkForm.link",t,r)},tags:["a"],tooltip:"Insert link"};var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"link",group:"insert"}],t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.o.link.followOnDblClick&&e.e.on("dblclick.link",this.onDblClickOnLink),e.o.link.processPastedLink&&e.e.on("processPaste.link",this.onProcessPasteLink),e.e.on("generateLinkForm.link",this.generateForm),e.registerCommand("openLinkDialog",{exec:function(){var o=new u.Dialog({resizable:!1}),r=t.generateForm(e.s.current(),(function(){o.close()}));r.container.classList.add("jodit-dialog_alert"),o.setContent(r),o.open(),e.async.requestIdleCallback((function(){var e=a.refs(r.container).url_input;null==e||e.focus()}))},hotkeys:e.o.link.hotkeys})},t.prototype.onDblClickOnLink=function(e){if(i.Dom.isTag(e.target,"a")){var t=a.attr(e.target,"href");t&&(location.href=t,e.preventDefault())}},t.prototype.onProcessPasteLink=function(e,t){var o=this.jodit;if(a.isURL(t)){if(o.o.link.processVideoLink){var r=a.convertMediaUrlToVideoEmbed(t);if(r!==t)return o.createInside.fromHTML(r)}var n=o.createInside.element("a");return n.setAttribute("href",t),n.textContent=t,o.e.stopPropagation("processPaste"),n}},t.prototype.generateForm=function(e,t){var o,r=this.jodit,n=r.i18n.bind(r),s=r.o.link,l=s.openInNewTabCheckbox,c=s.noFollowCheckbox,u=s.formClassName,d=s.modeClassName,p=(0,s.formTemplate)(r),f=a.isString(p)?r.c.fromHTML(p,{target_checkbox_box:l,nofollow_checkbox_box:c}):p,h=i.Dom.isElement(f)?f:f.container,m=a.refs(h),v=m.insert,g=m.unlink,y=m.content_input_box,b=m.target_checkbox,_=m.nofollow_checkbox,w=m.url_input,S=i.Dom.isImage(e,r.ew),C=m.content_input,k=m.className_input,j=m.className_select;C||(C=r.c.element("input",{type:"hidden",ref:"content_input"})),u&&h.classList.add(u),S&&i.Dom.hide(y);var E=function(){return o?o.innerText:a.stripTags(r.s.range.cloneContents(),r.ed)};if(o=!(!e||!i.Dom.closest(e,"a",r.editor))&&i.Dom.closest(e,"a",r.editor),!S&&e&&(C.value=E()),o){if(w.value=a.attr(o,"href")||"",d)switch(d){case"input":k&&(k.value=a.attr(o,"class")||"");break;case"select":if(j){for(var I=0;j.selectedOptions.length>I;I++){var x=j.options.item(I);x&&(x.selected=!1)}(a.attr(o,"class")||"").split(" ").forEach((function(e){if(e)for(var t=0;j.options.length>t;t++){var o=j.options.item(t);(null==o?void 0:o.value)&&o.value===e&&(o.selected=!0)}}))}}l&&b&&(b.checked="_blank"===a.attr(o,"target")),c&&_&&(_.checked="nofollow"===a.attr(o,"rel")),v.textContent=n("Update")}else i.Dom.hide(g);var T=r.observer.snapshot.make();g&&r.e.on(g,"click",(function(e){r.observer.snapshot.restore(T),o&&i.Dom.unwrap(o),r.setEditorValue(),t(),e.preventDefault()}));var P=function(){if(!w.value.trim().length)return w.focus(),w.classList.add("jodit_error"),!1;var e;r.observer.snapshot.restore(T);var n=E()!==C.value.trim();if(o)e=[o];else if(r.s.isCollapsed()){var i=r.createInside.element("a");r.s.insertNode(i),e=[i]}else e=r.s.wrapInTag("a");return e.forEach((function(e){var t;if(a.attr(e,"href",w.value),d&&(null!=k?k:j))if("input"===d)""===k.value&&e.hasAttribute("class")&&a.attr(e,"class",null),""!==k.value&&a.attr(e,"class",k.value);else if("select"===d){e.hasAttribute("class")&&a.attr(e,"class",null);for(var o=0;j.selectedOptions.length>o;o++){var r=null===(t=j.selectedOptions.item(o))||void 0===t?void 0:t.value;r&&e.classList.add(r)}}S||(C.value.trim().length?n&&(e.textContent=C.value):e.textContent=w.value),l&&b&&a.attr(e,"target",b.checked?"_blank":null),c&&_&&a.attr(e,"rel",_.checked?"nofollow":null)})),r.setEditorValue(),t(),!1};return i.Dom.isElement(f)?r.e.on(f,"submit",(function(e){return e.preventDefault(),e.stopImmediatePropagation(),P(),!1})):f.onSubmit(P),f},t.prototype.beforeDestruct=function(e){e.e.off("generateLinkForm.link",this.generateForm).off("dblclick.link",this.onDblClickOnLink).off("processPaste.link",this.onProcessPasteLink)},r.__decorate([c.autobind],t.prototype,"onDblClickOnLink",null),r.__decorate([c.autobind],t.prototype,"onProcessPasteLink",null),r.__decorate([c.autobind],t.prototype,"generateForm",null),t}(l.Plugin);t.link=d},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formTemplate=void 0;var r=o(118),n=o(92);t.formTemplate=function(e){var t=e.o.link,o=t.openInNewTabCheckbox,i=t.noFollowCheckbox,a=t.modeClassName,s=t.selectSizeClassName,l=t.selectMultipleClassName,c=t.selectOptionsClassName;return new r.UIForm(e,[new r.UIBlock(e,[new r.UIInput(e,{name:"url",type:"text",ref:"url_input",label:"URL",placeholder:"http://",required:!0})]),new r.UIBlock(e,[new r.UIInput(e,{name:"content",ref:"content_input",label:"Text"})],{ref:"content_input_box"}),a?new r.UIBlock(e,["input"===a?new r.UIInput(e,{name:"className",ref:"className_input",label:"Class name"}):"select"===a?new r.UISelect(e,{name:"className",ref:"className_select",label:"Class name",size:s,multiple:l,options:c}):null]):null,o?new r.UICheckbox(e,{name:"target",ref:"target_checkbox",label:"Open in new tab"}):null,i?new r.UICheckbox(e,{name:"nofollow",ref:"nofollow_checkbox",label:"No follow"}):null,new r.UIBlock(e,[new n.UIButton(e,{name:"unlink",status:"default",text:"Unlink"}),new n.UIButton(e,{name:"insert",type:"submit",status:"primary",text:"Insert"})],{align:"full"})])}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(295),t),r.__exportStar(o(296),t),r.__exportStar(o(298),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var r=o(8),n=o(9),i=o(19);r.Config.prototype.mediaFakeTag="jodit-media",r.Config.prototype.mediaInFakeBlock=!0,r.Config.prototype.mediaBlocks=["video","audio"],t.media=function(e){var t="jodit_fake_wrapper",o=e.options,r=o.mediaFakeTag,a=o.mediaBlocks;o.mediaInFakeBlock&&e.e.on("afterGetValueFromEditor",(function(e){var o=new RegExp("<"+r+"[^>]+data-"+t+"[^>]+>(.+?)","ig");o.test(e.value)&&(e.value=e.value.replace(o,"$1"))})).on("change afterInit afterSetMode changePlace",e.async.debounce((function(){e.isDestructed||e.getMode()===n.MODE_SOURCE||i.$$(a.join(","),e.editor).forEach((function(o){i.dataBind(o,t)||(i.dataBind(o,t,!0),function(o){if(o.parentNode&&i.attr(o.parentNode,"data-jodit_iframe_wrapper"))o=o.parentNode;else{var n=e.createInside.fromHTML("<"+r+' data-jodit-temp="1" contenteditable="false" draggable="true" data-'+t+'="1">");n.style.display="inline-block"===o.style.display?"inline-block":"block",n.style.width=o.offsetWidth+"px",n.style.height=o.offsetHeight+"px",o.parentNode&&o.parentNode.insertBefore(n,o),n.appendChild(o),o=n}e.e.off(o,"mousedown.select touchstart.select").on(o,"mousedown.select touchstart.select",(function(){e.s.setCursorAfter(o)}))}(o))}))}),e.defaultTimeout))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.video=void 0,o(297),t.video=function(e){e.registerButton({name:"video",group:"media"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(255),i=o(19),a=o(118),s=o(92);r.Config.prototype.controls.video={popup:function(e,t,o,r){var l=new a.UIForm(e,[new a.UIBlock(e,[new a.UIInput(e,{name:"url",required:!0,label:"URL",placeholder:"https://",validators:["url"]})]),new a.UIBlock(e,[s.Button(e,"","Insert","primary").onAction((function(){return l.submit()}))])]),c=new a.UIForm(e,[new a.UIBlock(e,[new a.UITextArea(e,{name:"code",required:!0,label:"Embed code"})]),new a.UIBlock(e,[s.Button(e,"","Insert","primary").onAction((function(){return c.submit()}))])]),u=[],d=e.s.save(),p=function(t){e.s.restore(d),e.s.insertHTML(t),r()};return u.push({icon:"link",name:"Link",content:l.container},{icon:"source",name:"Code",content:c.container}),l.onSubmit((function(e){p(i.convertMediaUrlToVideoEmbed(e.url))})),c.onSubmit((function(e){p(e.code)})),n.TabsWidget(e,u)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.file=void 0;var r=o(8),n=o(32),i=o(255);r.Config.prototype.controls.file={popup:function(e,t,o,r){var a=function(t,o){void 0===o&&(o=""),e.s.insertNode(e.createInside.fromHTML(''+(o||t)+""))},s=null;return t&&(n.Dom.isTag(t,"a")||n.Dom.closest(t,"a",e.editor))&&(s=n.Dom.isTag(t,"a")?t:n.Dom.closest(t,"a",e.editor)),i.FileSelectorWidget(e,{filebrowser:function(e){e.files&&e.files.forEach((function(t){return a(e.baseurl+t)})),r()},upload:!0,url:function(e,t){s?(s.setAttribute("href",e),s.setAttribute("title",t)):a(e,t),r()}},s,r,!1)},tags:["a"],tooltip:"Insert file"},t.file=function(e){e.registerButton({name:"file",group:"media"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mobile=void 0;var r=o(7),n=o(8),i=o(9),a=o(19),s=o(172),l=o(75),c=o(112);n.Config.prototype.mobileTapTimeout=300,n.Config.prototype.toolbarAdaptive=!0,n.Config.prototype.controls.dots={mode:i.MODE_SOURCE+i.MODE_WYSIWYG,popup:function(e,t,o,r,n){var i=o.data;return void 0===i&&(i={toolbar:s.makeCollection(e),rebuild:function(){var t;if(n){var o=e.e.fire("getDiffButtons.mobile",n.closest(l.UIList));if(o&&i){i.toolbar.build(a.splitArray(o));var r=(null===(t=e.toolbar.firstButton)||void 0===t?void 0:t.container.offsetWidth)||36;i.toolbar.container.style.width=3*(r+4)+"px"}}}},o.data=i),i.rebuild(),i.toolbar},tooltip:"Show all"},t.mobile=function(e){var t=0,o=a.splitArray(e.o.buttons);e.e.on("touchend",(function(o){if(o.changedTouches&&o.changedTouches.length){var r=(new Date).getTime();r-t>e.o.mobileTapTimeout&&(t=r,e.s.insertCursorAtPoint(o.changedTouches[0].clientX,o.changedTouches[0].clientY))}})).on("getDiffButtons.mobile",(function(t){if(t===e.toolbar){var n=a.splitArray(e.o.buttons),i=c.flatButtonsSet(o);return n.reduce((function(e,t){return c.isButtonGroup(t)?e.push(r.__assign(r.__assign({},t),{buttons:t.buttons.filter((function(e){return!i.has(e)}))})):i.has(t)||e.push(t),e}),[])}})),e.o.toolbarAdaptive&&e.e.on("resize afterInit recalcAdaptive changePlace afterAddPlace",(function(){if(e.o.toolbar){var t=e.container.offsetWidth,r=a.splitArray(e.o.sizeLG>t?e.o.sizeMD>t?e.o.sizeSM>t?e.o.buttonsXS:e.o.buttonsSM:e.o.buttonsMD:e.o.buttons);r.toString()!==o.toString()&&(o=r,e.e.fire("closeAllPopups"),e.toolbar.setRemoveButtons(e.o.removeButtons).build(o.concat(e.o.extraButtons)))}})).on(e.ow,"load",(function(){return e.e.fire("recalcAdaptive")}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderedList=void 0;var r=o(8),n=o(32),i=o(19),a=function(e,t,o){var r=o.control,n="button"+r.command,a=r.args&&r.args[0]||i.dataBind(e,n);i.dataBind(e,n,a),e.execCommand(r.command,!1,a)};r.Config.prototype.controls.ul={command:"insertUnorderedList",tags:["ul"],tooltip:"Insert Unordered List",list:{default:"Default",circle:"Circle",disc:"Dot",square:"Quadrate"},exec:a},r.Config.prototype.controls.ol={command:"insertOrderedList",tags:["ol"],tooltip:"Insert Ordered List",list:{default:"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},exec:a},t.orderedList=function(e){var t=function(e){return/insert(un)?orderedlist/i.test(e)},o=function(){return n.Dom.up(e.s.current(),(function(e){return e&&/^UL|OL$/i.test(e.nodeName)}),e.editor)},r=function(e,t){"default"!==t&&t?e.style.setProperty("list-style-type",t):e.style.removeProperty("list-style-type")};e.e.on("beforeCommand",(function(e,i,a){if(t(e)&&a){var s=o();if(s&&!function(e,t){var o=e.style.listStyleType;return o===t||!o&&"default"===t}(s,a)&&(n.Dom.isTag(s,"ul")&&/unordered/i.test(e)||n.Dom.isTag(s,"ol")&&!/unordered/i.test(e)))return r(s,a),!1}})).on("afterCommand",(function(a,s,l){if(t(a)){var c=o();c&&(r(c,l),e.createInside.applyCreateAttributes(c),c.querySelectorAll("li").forEach((function(t){e.createInside.applyCreateAttributes(t)})));var u=[],d=function(e){n.Dom.isTag(e,["p","h1","h2","h3","h4","h5","h6"])&&u.push(e)};if(c&&(d(c.parentNode),c.querySelectorAll("li").forEach((function(e){return d(e.firstChild)})),u.length)){var p=e.s.save();i.toArray(c.childNodes).forEach((function(e){n.Dom.isTag(e.lastChild,"br")&&n.Dom.safeRemove(e.lastChild)})),u.forEach((function(e){return n.Dom.unwrap(e)})),e.s.restore(p)}e.setEditorValue()}}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.placeholder=t.isEditorEmpty=void 0;var r=o(7);o(302);var n=o(8),i=o(9),a=o(19),s=o(32),l=o(183),c=o(9),u=o(99);function d(e){if(!e.firstChild)return!0;var t=e.firstChild;if(c.MAY_BE_REMOVED_WITH_KEY.test(t.nodeName)||/^(TABLE)$/i.test(t.nodeName))return!1;var o=s.Dom.next(t,(function(e){return e&&!s.Dom.isEmptyTextNode(e)}),e);return s.Dom.isText(t)&&!o?s.Dom.isEmptyTextNode(t):!o&&s.Dom.each(t,(function(e){return!s.Dom.isTag(e,["ul","li","ol"])&&(s.Dom.isEmpty(e)||s.Dom.isTag(e,"br"))}))}n.Config.prototype.showPlaceholder=!0,n.Config.prototype.useInputsPlaceholder=!0,n.Config.prototype.placeholder="Type something",t.isEditorEmpty=d;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.addNativeListeners=function(){t.j.e.off(t.j.editor,"input.placeholder keydown.placeholder").on(t.j.editor,"input.placeholder keydown.placeholder",t.toggle)},t.addEvents=function(){var e=t.j;e.o.useInputsPlaceholder&&e.element.hasAttribute("placeholder")&&(t.placeholderElm.innerHTML=a.attr(e.element,"placeholder")||""),e.e.fire("placeholder",t.placeholderElm.innerHTML),e.e.off(".placeholder").on("changePlace.placeholder",t.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",t.toggle).on(window,"load",t.toggle),t.addNativeListeners(),t.toggle()},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.o.showPlaceholder&&(this.placeholderElm=e.c.fromHTML('"),"rtl"===e.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),e.e.on("readonly",(function(e){e?t.hide():t.toggle()})).on("changePlace",this.addEvents),this.addEvents())},t.prototype.show=function(){var e=this.j;if(!e.o.readonly){var t=0,o=0,r=e.s.current(),n=r&&s.Dom.closest(r,(function(t){return s.Dom.isBlock(t,e.ew)}),e.editor)||e.editor,i=e.ew.getComputedStyle(n);if(e.workplace.appendChild(this.placeholderElm),s.Dom.isElement(e.editor.firstChild)){var l=e.ew.getComputedStyle(e.editor.firstChild);t=parseInt(l.getPropertyValue("margin-top"),10),o=parseInt(l.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(l.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=l.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=i.getPropertyValue("line-height");a.css(this.placeholderElm,{display:"block",textAlign:i.getPropertyValue("text-align"),marginTop:Math.max(parseInt(i.getPropertyValue("margin-top"),10),t),marginLeft:Math.max(parseInt(i.getPropertyValue("margin-left"),10),o)})}},t.prototype.hide=function(){s.Dom.safeRemove(this.placeholderElm)},t.prototype.toggle=function(){var e=this.j;e.editor&&!e.isInDestruct&&(e.getRealMode()===i.MODE_WYSIWYG&&d(e.editor)?this.show():this.hide())},t.prototype.beforeDestruct=function(e){this.hide(),e.e.off(".placeholder").off(window,"load",this.toggle)},r.__decorate([u.debounce((function(e){return e.defaultTimeout/10}),!0)],t.prototype,"toggle",null),t}(l.Plugin);t.placeholder=p},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redoUndo=void 0;var r=o(7),n=o(8),i=o(9),a=o(183);n.Config.prototype.controls.redo={mode:i.MODE_SPLIT,isDisabled:function(e){return!e.observer.stack.canRedo()},tooltip:"Redo"},n.Config.prototype.controls.undo={mode:i.MODE_SPLIT,isDisabled:function(e){return!e.observer.stack.canUndo()},tooltip:"Undo"};var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"undo",group:"history"},{name:"redo",group:"history"}],t}return r.__extends(t,e),t.prototype.beforeDestruct=function(){},t.prototype.afterInit=function(e){var t=function(t){return e.observer[t](),!1};e.registerCommand("redo",{exec:t,hotkeys:["ctrl+y","ctrl+shift+z","cmd+y","cmd+shift+z"]}),e.registerCommand("undo",{exec:t,hotkeys:["ctrl+z","cmd+z"]})},t}(a.Plugin);t.redoUndo=s},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizer=void 0;var r=o(7);o(305);var n=o(8),i=o(9),a=o(9),s=o(32),l=o(19),c=o(183),u=o(30),d=o(99);n.Config.prototype.useIframeResizer=!0,n.Config.prototype.useTableResizer=!0,n.Config.prototype.useImageResizer=!0,n.Config.prototype.resizer={showSize:!0,hideSizeTimeout:1e3,min_width:10,min_height:10};var p="__jodit-resizer_binded",f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.LOCK_KEY="resizer",t.element=null,t.isResized=!1,t.isShown=!1,t.start_x=0,t.start_y=0,t.width=0,t.height=0,t.ratio=0,t.rect=t.j.c.fromHTML('
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t100x100\n\t\t\t
'),t.sizeViewer=t.rect.getElementsByTagName("span")[0],t.onResize=function(e){if(t.isResized){var o=e.clientX-t.start_x,r=e.clientY-t.start_y;if(!t.element)return;var n=t.handle.className,i=0,a=0;s.Dom.isTag(t.element,"img")?(o?(i=t.width+(n.match(/left/)?-1:1)*o,a=Math.round(i/t.ratio)):(a=t.height+(n.match(/top/)?-1:1)*r,i=Math.round(a*t.ratio)),i>l.innerWidth(t.j.editor,t.j.ow)&&(i=l.innerWidth(t.j.editor,t.j.ow),a=Math.round(i/t.ratio))):(i=t.width+(n.match(/left/)?-1:1)*o,a=t.height+(n.match(/top/)?-1:1)*r),i>t.j.o.resizer.min_width&&l.css(t.element,"width",t.rect.parentNode.offsetWidth>i?i:"100%"),a>t.j.o.resizer.min_height&&l.css(t.element,"height",a),t.updateSize(),t.showSizeViewer(t.element.offsetWidth,t.element.offsetHeight),e.stopImmediatePropagation()}},t.onClickOutside=function(e){t.isShown&&(t.isResized?(t.j.unlock(),t.isResized=!1,t.j.setEditorValue(),e.stopImmediatePropagation(),t.j.e.off(t.j.ow,"mousemove.resizer touchmove.resizer",t.onResize)):t.hide())},t.onClickElement=function(e){t.element===e&&t.isShown||(t.element=e,t.show(),s.Dom.isTag(t.element,"img")&&!t.element.complete&&t.j.e.on(t.element,"load",t.updateSize))},t.updateSize=function(){if(!t.isInDestruct&&t.isShown&&t.element&&t.rect){var e=l.offset(t.rect.parentNode||t.j.od.documentElement,t.j,t.j.od,!0),o=l.offset(t.element,t.j,t.j.ed),r=parseInt(t.rect.style.left||"0",10),n=parseInt(t.rect.style.top||"0",10),i=o.top-1-e.top,a=o.left-1-e.left;n===i&&r===a&&t.rect.offsetWidth===t.element.offsetWidth&&t.rect.offsetHeight===t.element.offsetHeight||(l.css(t.rect,{top:i,left:a,width:t.element.offsetWidth,height:t.element.offsetHeight}),t.j.events&&(t.j.e.fire(t.element,"changesize"),isNaN(r)||t.j.e.fire("resize")))}},t.hideSizeViewer=function(){t.sizeViewer.style.opacity="0"},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;l.$$("i",this.rect).forEach((function(o){e.e.on(o,"mousedown.resizer touchstart.resizer",t.onClickHandle.bind(t,o))})),u.eventEmitter.on("hideHelpers",this.hide),e.e.on("readonly",(function(e){e&&t.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(function(e){var t=/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>.*?<\/iframe>.*?)<\/jodit>/gi;t.test(e.value)&&(e.value=e.value.replace(t,"$1"))})).on("hideResizer",this.hide).on("change afterInit afterSetMode",e.async.debounce(this.onChangeEditor.bind(this),e.defaultTimeout)),this.addEventListeners(),this.onChangeEditor()},t.prototype.addEventListeners=function(){var e=this,t=this.j;t.e.off(t.editor,".resizer").off(t.ow,".resizer").on(t.editor,"keydown.resizer",(function(t){e.isShown&&t.key===i.KEY_DELETE&&e.element&&!s.Dom.isTag(e.element,"table")&&e.onDelete(t)})).on(t.ow,"resize.resizer",this.updateSize).on(t.ow,"mouseup.resizer keydown.resizer touchend.resizer",this.onClickOutside).on([t.ow,t.editor],"scroll.resizer",(function(){e.isShown&&!e.isResized&&e.hide()}))},t.prototype.onClickHandle=function(e,t){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=e,t.preventDefault(),t.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResized=!0,this.start_x=t.clientX,this.start_y=t.clientY,this.j.e.fire("hidePopup"),this.j.lock(this.LOCK_KEY),this.j.e.on(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)},t.prototype.onDelete=function(e){this.element&&("JODIT"!==this.element.tagName?this.j.s.select(this.element):(s.Dom.safeRemove(this.element),this.hide(),e.preventDefault()))},t.prototype.onChangeEditor=function(){var e=this,t=this.j;this.isShown&&(this.element&&this.element.parentNode?this.updateSize():this.hide()),t.isDestructed||l.$$("img, table, iframe",t.editor).forEach((function(o){t.getMode()!==i.MODE_SOURCE&&!o[p]&&(s.Dom.isTag(o,"iframe")&&t.o.useIframeResizer||s.Dom.isTag(o,"img")&&t.o.useImageResizer||s.Dom.isTag(o,"table")&&t.o.useTableResizer)&&(o[p]=!0,e.bind(o))}))},t.prototype.bind=function(e){var t,o=this;if(s.Dom.isTag(e,"iframe")){var r=e;l.attr(e.parentNode,"-jodit_iframe_wrapper")?e=e.parentNode:(t=this.j.createInside.fromHTML(''),l.css(t,{display:"inline-block"===e.style.display?"inline-block":"block",width:e.offsetWidth,height:e.offsetHeight}),e.parentNode&&e.parentNode.insertBefore(t,e),t.appendChild(e),e=t),this.j.e.off(e,"mousedown.select touchstart.select").on(e,"mousedown.select touchstart.select",(function(){o.j.s.select(e)})).off(e,"changesize").on(e,"changesize",(function(){r.setAttribute("width",e.offsetWidth+"px"),r.setAttribute("height",e.offsetHeight+"px")}))}this.j.e.on(e,"dragstart",this.hide).on(e,"mousedown",(function(t){a.IS_IE&&s.Dom.isTag(e,"img")&&t.preventDefault()})).on(e,"click",(function(){return o.onClickElement(e)}))},t.prototype.showSizeViewer=function(e,t){this.j.o.resizer.showSize&&(this.sizeViewer.offsetWidth>e||this.sizeViewer.offsetHeight>t?this.hideSizeViewer():(this.sizeViewer.style.opacity="1",this.sizeViewer.textContent=e+" x "+t,this.j.async.setTimeout(this.hideSizeViewer,{timeout:this.j.o.resizer.hideSizeTimeout,label:"hideSizeViewer"})))},t.prototype.show=function(){this.j.o.readonly||this.isShown||(this.isShown=!0,this.rect.parentNode||(l.markOwner(this.j,this.rect),this.j.workplace.appendChild(this.rect)),this.j.isFullSize&&(this.rect.style.zIndex=l.css(this.j.container,"zIndex").toString()),this.updateSize())},t.prototype.hide=function(){this.isResized=!1,this.isShown=!1,this.element=null,s.Dom.safeRemove(this.rect)},t.prototype.beforeDestruct=function(e){this.hide(),u.eventEmitter.off("hideHelpers",this.hide),e.e.off(this.j.ow,".resizer").off(".resizer")},r.__decorate([d.autobind],t.prototype,"hide",null),t}(c.Plugin);t.resizer=f},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.search=void 0;var r=o(7);o(307);var n=o(8),i=o(9),a=o(9),s=o(32),l=o(183),c=o(75),u=o(19),d=o(99);n.Config.prototype.useSearch=!0,n.Config.prototype.controls.find={tooltip:"Find",icon:"search",exec:function(e,t,o){var r=o.control;switch(r.args&&r.args[0]){case"findPrevious":e.e.fire("searchPrevious");break;case"findNext":e.e.fire("searchNext");break;case"replace":e.execCommand("openReplaceDialog");break;default:e.execCommand("openSearchDialog")}},list:{search:"Find",findNext:"Find Next",findPrevious:"Find Previous",replace:"Replace"},childTemplate:function(e,t,o){return o}};var p=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.buttons=[{name:"find",group:"search"}],o.template='",o.isOpened=!1,o.selInfo=null,o.current=null,o.eachMap=function(e,t,r){s.Dom.findWithCurrent(e,(function(e){return Boolean(e&&t(e))}),o.j.editor,r?"nextSibling":"previousSibling",r?"firstChild":"lastChild")},o.updateCounters=function(){if(o.isOpened){o.counterBox.style.display=o.queryInput.value.length?"inline-block":"none";var e=o.calcCounts(o.queryInput.value,o.j.s.range);o.counterBox.textContent=e.join("/")}},o.calcCounts=function(e,t){void 0===t&&(t=!1);for(var r=[],n=0,i=0,a=!1,s=o.j.editor.firstChild;s&&e.length;)if(a=o.find(s,e,!0,0,a||o.j.ed.createRange())){if(o.boundAlreadyWas(a,r))break;r.push(a),s=a.startContainer,i+=1,t&&o.boundAlreadyWas(t,[a])&&(n=i)}else s=null;return[n,i]},o.findAndReplace=function(e,t){var r=o.find(e,t,!0,0,o.j.s.range);if(r&&r.startContainer&&r.endContainer){var n=o.j.ed.createRange();try{if(r&&r.startContainer&&r.endContainer){n.setStart(r.startContainer,r.startOffset),n.setEnd(r.endContainer,r.endOffset),n.deleteContents();var i=o.j.createInside.text(o.replaceInput.value);n.insertNode(i),o.j.s.select(i),o.tryScrollToElement(i)}}catch(e){}return!0}return!1},o.findAndSelect=function(e,t,r){var n=o.find(e,t,r,0,o.j.s.range);if(n&&n.startContainer&&n.endContainer){var i=o.j.ed.createRange();try{i.setStart(n.startContainer,n.startOffset),i.setEnd(n.endContainer,n.endOffset),o.j.s.selectRange(i)}catch(e){}return o.tryScrollToElement(n.startContainer),o.current=n.startContainer,o.updateCounters(),!0}return!1},o.find=function(e,r,n,i,a){if(e&&r.length){var l="",c={startContainer:null,startOffset:null,endContainer:null,endOffset:null};if(o.eachMap(e,(function(e){if(s.Dom.isText(e)&&null!=e.nodeValue&&e.nodeValue.length){var d=e.nodeValue;n||e!==a.startContainer?n&&e===a.endContainer&&(d=i?d.substr(0,a.startOffset):d.substr(a.endOffset)):d=i?d.substr(a.endOffset):d.substr(0,a.startOffset);var p=n?l+d:d+l,f=t.findSomePartOfString(r,p,n);if(!1!==f){var h=t.findSomePartOfString(r,d,n);!0===h?h=u.trim(r):!1===h&&!0===(h=t.findSomePartOfString(d,r,n))&&(h=u.trim(d));var m=t.getSomePartOfStringIndex(r,d,n)||0;if((n&&!i||!n&&i)&&e.nodeValue.length-d.length>0&&(m+=e.nodeValue.length-d.length),null==c.startContainer&&(c.startContainer=e,c.startOffset=m),!0===f)return c.endContainer=e,c.endOffset=m,c.endOffset+=h.length,!0;l=p}else l="",c={startContainer:null,startOffset:null,endContainer:null,endOffset:null}}else s.Dom.isBlock(e,o.j.ew)&&""!==l&&(l=n?l+" ":" "+l);return!1}),n),c.startContainer&&c.endContainer)return c;if(!i)return o.current=n?o.j.editor.firstChild:o.j.editor.lastChild,o.find(o.current,r,n,i+1,a)}return!1},o.open=function(e){void 0===e&&(e=!1),o.isOpened||(o.searchBox.classList.add("jodit-search_active"),o.isOpened=!0),o.calcSticky(o.j.e.fire("getStickyState.sticky")||!1),o.j.e.fire("hidePopup"),o.searchBox.classList.toggle("jodit-search_replace",e),o.current=o.j.s.current(),o.selInfo=o.j.s.save();var t=(o.j.s.sel||"").toString();t&&(o.queryInput.value=t),o.updateCounters(),t?o.queryInput.select():o.queryInput.focus()},o.close=function(){o.isOpened&&(o.selInfo&&(o.j.s.restore(o.selInfo),o.selInfo=null),o.searchBox.classList.remove("jodit-search_active"),o.isOpened=!1)},o}return r.__extends(t,e),t.getSomePartOfStringIndex=function(e,t,o){return void 0===o&&(o=!0),this.findSomePartOfString(e,t,o,!0)},t.findSomePartOfString=function(e,t,o,r){void 0===o&&(o=!0),void 0===r&&(r=!1),e=u.trim(e.toLowerCase().replace(i.SPACE_REG_EXP()," ")),t=t.toLowerCase();for(var n=o?0:t.length-1,a=o?0:e.length-1,s=0,l=null,c=o?1:-1,d=[];void 0!==t[n];n+=c){var p=e[a]===t[n];if(p||null!=l&&i.SPACE_REG_EXP().test(t[n])?(null!=l&&o||(l=n),d.push(t[n]),p&&(s+=1,a+=c)):(l=null,d.length=0,s=0,a=o?0:e.length-1),s===e.length)return!r||l}return r?null!=l&&l:!!d.length&&(o?d.join(""):d.reverse().join(""))},t.prototype.boundAlreadyWas=function(e,t){return t.some((function(t){return t.startContainer===e.startContainer&&t.endContainer===e.endContainer&&t.startOffset===e.startOffset&&t.endOffset===e.endOffset}),!1)},t.prototype.tryScrollToElement=function(e){var t=s.Dom.closest(e,s.Dom.isElement,this.j.editor);t||(t=s.Dom.prev(e,s.Dom.isElement,this.j.editor)),t&&t!==this.j.editor&&t.scrollIntoView()},t.prototype.afterInit=function(e){var t=this;if(e.o.useSearch){var o=this;o.searchBox=e.c.fromHTML(o.template);var r=u.refs(o.searchBox),n=r.replace,s=r.cancel,l=r.next,c=r.prev,d=r.replaceBtn,p=r.counterBox;o.queryInput=r.query,o.replaceInput=n,o.closeButton=s,o.nextButton=l,o.prevButton=c,o.replaceButton=d,o.counterBox=p;var f=function(){e.workplace.appendChild(t.searchBox),e.e.off(t.j.container,"keydown.search").on(t.j.container,"keydown.search",(function(r){if(e.getRealMode()===a.MODE_WYSIWYG)switch(r.key){case i.KEY_ESC:t.close();break;case i.KEY_F3:o.queryInput.value&&(e.e.fire(r.shiftKey?"searchPrevious":"searchNext"),r.preventDefault())}}))};f(),e.e.on("changePlace",f).on(o.closeButton,"click",this.close).on(o.queryInput,"mousedown",(function(){e.s.isFocused()&&(e.s.removeMarkers(),o.selInfo=e.s.save())})).on(o.replaceButton,"click",(function(r){o.findAndReplace(e.s.current()||e.editor.firstChild,o.queryInput.value),t.updateCounters(),r.preventDefault(),r.stopImmediatePropagation()})).on([o.nextButton,o.prevButton],"click",(function(t){e.e.fire(o.nextButton===this?"searchNext":"searchPrevious"),t.preventDefault(),t.stopImmediatePropagation()})).on(this.queryInput,"keydown",this.j.async.debounce((function(o){switch(o.key){case i.KEY_ENTER:o.preventDefault(),o.stopImmediatePropagation(),e.e.fire("searchNext")&&t.close();break;default:t.updateCounters()}}),this.j.defaultTimeout)).on("beforeSetMode.search",(function(){t.close()})).on("keydown.search mousedown.search",(function(){t.selInfo&&(e.s.removeMarkers(),t.selInfo=null),t.isOpened&&(t.current=t.j.s.current(),t.updateCounters())})).on("searchNext.search searchPrevious.search",(function(){return o.isOpened?o.findAndSelect(e.s.current()||e.editor.firstChild,o.queryInput.value,"searchNext"===e.e.current):o.open()})).on("search.search",(function(t,o){void 0===o&&(o=!0),e.execCommand("search",t,o)})).on("toggleSticky.search",this.calcSticky),e.registerCommand("search",{exec:function(t,r,n){return void 0===n&&(n=!0),o.findAndSelect(e.s.current()||e.editor.firstChild,r||"",n),!1}}).registerCommand("openSearchDialog",{exec:function(){return o.open(),!1},hotkeys:["ctrl+f","cmd+f"]}).registerCommand("openReplaceDialog",{exec:function(){return e.o.readonly||o.open(!0),!1},hotkeys:["ctrl+h","cmd+h"]})}},t.prototype.beforeDestruct=function(e){var t;s.Dom.safeRemove(this.searchBox),null===(t=e.events)||void 0===t||t.off(".search")},t.prototype.calcSticky=function(e){if(this.isOpened)if(this.searchBox.classList.toggle("jodit-search_sticky",e),e){var t=u.position(this.j.toolbarContainer);u.css(this.searchBox,{top:t.top+t.height,left:t.left+t.width})}else u.css(this.searchBox,{top:null,left:null})},r.__decorate([d.autobind],t.prototype,"calcSticky",null),t}(l.Plugin);t.search=p},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);o(309),r.__exportStar(o(310),t),r.__exportStar(o(311),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8);r.Config.prototype.width="auto",r.Config.prototype.minWidth=200,r.Config.prototype.maxWidth="100%",r.Config.prototype.allowResizeX=!1,r.Config.prototype.allowResizeY=!0,r.Config.prototype.height="auto",r.Config.prototype.minHeight=200,r.Config.prototype.maxHeight="auto",r.Config.prototype.saveHeightInStorage=!1},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeHandler=void 0;var r=o(7),n=o(183),i=o(32),a=o(99),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isResized=!1,t.start={x:0,y:0,w:0,h:0},t.handle=t.j.c.div("jodit-editor__resize",''),t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;"auto"!==e.o.height&&(e.o.allowResizeX||e.o.allowResizeY)&&(e.e.on("toggleFullSize.resizeHandler",(function(){t.handle.style.display=e.isFullSize?"none":"block"})).on(this.handle,"mousedown touchstart",this.onHandleResizeStart).on(e.ow,"mouseup touchsend",this.onHandleResizeEnd),e.container.appendChild(this.handle))},t.prototype.onHandleResizeStart=function(e){this.isResized=!0,this.start.x=e.clientX,this.start.y=e.clientY,this.start.w=this.j.container.offsetWidth,this.start.h=this.j.container.offsetHeight,this.j.lock(),this.j.e.on(this.j.ow,"mousemove touchmove",this.onHandleResize),e.preventDefault()},t.prototype.onHandleResize=function(e){this.isResized&&(this.j.o.allowResizeY&&this.j.e.fire("setHeight",this.start.h+e.clientY-this.start.y),this.j.o.allowResizeX&&this.j.e.fire("setWidth",this.start.w+e.clientX-this.start.x),this.j.e.fire("resize"))},t.prototype.onHandleResizeEnd=function(){this.isResized&&(this.isResized=!1,this.j.e.off(this.j.ow,"mousemove touchmove",this.onHandleResize),this.j.unlock())},t.prototype.beforeDestruct=function(e){i.Dom.safeRemove(this.handle),this.j.e.off(this.j.ow,"mouseup touchsend",this.onHandleResizeEnd)},t.requires=["size"],r.__decorate([a.autobind],t)}(n.Plugin);t.resizeHandler=s},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.size=void 0;var r=o(7);o(312);var n=o(19),i=o(183),a=o(99),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resizeWorkspaces=t.j.async.debounce(t.resizeWorkspaceImd,t.j.defaultTimeout,!0),t}return r.__extends(t,e),t.prototype.afterInit=function(e){e.e.on("setHeight.size",this.setHeight).on("setWidth.size",this.setWidth).on("afterInit.size changePlace.size",this.initialize,void 0,!0).on(e.ow,"load.size",this.resizeWorkspaces).on("afterInit.size resize.size afterUpdateToolbar.size scroll.size afterResize.size toggleFullSize.size",this.resizeWorkspaces),this.initialize()},t.prototype.initialize=function(){var e=this.j;if(!e.o.inline){var t=e.o.height;if(e.o.saveHeightInStorage&&"auto"!==t){var o=e.storage.get("height");o&&(t=o)}n.css(e.editor,{minHeight:"100%"}),n.css(e.container,{minHeight:e.o.minHeight,maxHeight:e.o.maxHeight,minWidth:e.o.minWidth,maxWidth:e.o.maxWidth}),this.setHeight(t),this.setWidth(e.o.width)}},t.prototype.setHeight=function(e){if(n.isNumber(e)){var t=this.j.o,o=t.minHeight,r=t.maxHeight;n.isNumber(o)&&o>e&&(e=o),n.isNumber(r)&&e>r&&(e=r)}n.css(this.j.container,"height",e),this.j.o.saveHeightInStorage&&this.j.storage.set("height",e),this.resizeWorkspaceImd()},t.prototype.setWidth=function(e){if(n.isNumber(e)){var t=this.j.o,o=t.minWidth,r=t.maxWidth;n.isNumber(o)&&o>e&&(e=o),n.isNumber(r)&&e>r&&(e=r)}n.css(this.j.container,"width",e),this.resizeWorkspaceImd()},t.prototype.getNotWorkHeight=function(){var e,t;return((null===(e=this.j.toolbarContainer)||void 0===e?void 0:e.offsetHeight)||0)+((null===(t=this.j.statusbar)||void 0===t?void 0:t.getHeight())||0)+2},t.prototype.resizeWorkspaceImd=function(){if(this.j&&!this.j.isDestructed&&this.j.o&&!this.j.o.inline&&this.j.container&&this.j.container.parentNode){var e=(n.css(this.j.container,"minHeight")||0)-this.getNotWorkHeight();if(n.isNumber(e)&&e>0&&([this.j.workplace,this.j.iframe,this.j.editor].map((function(t){t&&n.css(t,"minHeight",e)})),this.j.e.fire("setMinHeight",e)),n.isNumber(this.j.o.maxHeight)){var t=this.j.o.maxHeight-this.getNotWorkHeight();[this.j.workplace,this.j.iframe,this.j.editor].map((function(e){e&&n.css(e,"maxHeight",t)})),this.j.e.fire("setMaxHeight",t)}this.j.container&&n.css(this.j.workplace,"height","auto"!==this.j.o.height||this.j.isFullSize?this.j.container.offsetHeight-this.getNotWorkHeight():"auto")}},t.prototype.beforeDestruct=function(e){this.j.e.off(this.j.ow,"load.size",this.resizeWorkspaces).off(".size")},r.__decorate([a.autobind],t)}(i.Plugin);t.size=s},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);o(314),r.__exportStar(o(315),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(9),i=o(9);r.Config.prototype.beautifyHTML=!i.IS_IE,r.Config.prototype.sourceEditor="ace",r.Config.prototype.sourceEditorNativeOptions={showGutter:!0,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},r.Config.prototype.sourceEditorCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"],r.Config.prototype.beautifyHTMLCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js","https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify-html.min.js"],r.Config.prototype.controls.source={mode:n.MODE_SPLIT,exec:function(e){e.toggleMode()},isActive:function(e){return e.getRealMode()===n.MODE_SOURCE},tooltip:"Change mode"}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.source=void 0;var r=o(7);o(316);var n=o(9),i=o(9),a=o(183),s=o(32),l=o(19),c=o(317),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"source",group:"source"}],t.__lock=!1,t.__oldMirrorValue="",t.tempMarkerStart="{start-jodit-selection}",t.tempMarkerStartReg=/{start-jodit-selection}/g,t.tempMarkerEnd="{end-jodit-selection}",t.tempMarkerEndReg=/{end-jodit-selection}/g,t.selInfo=[],t.insertHTML=function(e){var o;null===(o=t.sourceEditor)||void 0===o||o.insertRaw(e),t.toWYSIWYG()},t.fromWYSIWYG=function(e){if(void 0===e&&(e=!1),!t.__lock||!0===e){t.__lock=!0;var o=t.j.getEditorValue(!1);o!==t.getMirrorValue()&&t.setMirrorValue(o),t.__lock=!1}},t.toWYSIWYG=function(){if(!t.__lock){var e=t.getMirrorValue();e!==t.__oldMirrorValue&&(t.__lock=!0,t.j.setEditorValue(e),t.__lock=!1,t.__oldMirrorValue=e)}},t.getNormalPosition=function(e,t){for(var o=e;o>0;){if("<"===t[--o]&&void 0!==t[o+1]&&t[o+1].match(/[\w/]+/i))return o;if(">"===t[o])return e}return e},t.__clear=function(e){return e.replace(n.INVISIBLE_SPACE_REG_EXP(),"")},t.selectAll=function(){var e;null===(e=t.sourceEditor)||void 0===e||e.selectAll()},t.onSelectAll=function(e){if("selectall"===e.toLowerCase()&&t.j.getRealMode()===i.MODE_SOURCE)return t.selectAll(),!1},t.getSelectionStart=function(){var e,o;return null!==(o=null===(e=t.sourceEditor)||void 0===e?void 0:e.getSelectionStart())&&void 0!==o?o:0},t.getSelectionEnd=function(){var e,o;return null!==(o=null===(e=t.sourceEditor)||void 0===e?void 0:e.getSelectionEnd())&&void 0!==o?o:0},t.saveSelection=function(){if(t.j.getRealMode()===n.MODE_WYSIWYG)t.selInfo=t.j.s.save()||[],t.j.setEditorValue(),t.fromWYSIWYG(!0);else{if(t.selInfo.length=0,t.j.o.editHTMLDocumentMode)return;var e=t.getMirrorValue();if(t.getSelectionStart()===t.getSelectionEnd()){var o=t.j.s.marker(!0);t.selInfo[0]={startId:o.id,collapsed:!0,startMarker:o.outerHTML};var r=t.getNormalPosition(t.getSelectionStart(),t.getMirrorValue());t.setMirrorValue(e.substr(0,r)+t.__clear(t.selInfo[0].startMarker)+e.substr(r))}else{var i=t.j.s.marker(!0),a=t.j.s.marker(!1);t.selInfo[0]={startId:i.id,endId:a.id,collapsed:!1,startMarker:t.__clear(i.outerHTML),endMarker:t.__clear(a.outerHTML)},r=t.getNormalPosition(t.getSelectionStart(),e);var s=t.getNormalPosition(t.getSelectionEnd(),e);t.setMirrorValue(e.substr(0,r)+t.selInfo[0].startMarker+e.substr(r,s-r)+t.selInfo[0].endMarker+e.substr(s))}t.toWYSIWYG()}},t.removeSelection=function(){if(t.selInfo.length){if(t.j.getRealMode()===n.MODE_WYSIWYG)return t.__lock=!0,t.j.s.restore(t.selInfo),void(t.__lock=!1);var e=t.getMirrorValue(),o=0,r=0;try{if(t.selInfo[0].startMarker&&(e=e.replace(/]+data-jodit-selection_marker="start"[^>]*>[<>]*?<\/span>/gim,t.tempMarkerStart)),t.selInfo[0].endMarker&&(e=e.replace(/]+data-jodit-selection_marker="end"[^>]*>[<>]*?<\/span>/gim,t.tempMarkerEnd)),!t.j.o.editHTMLDocumentMode&&t.j.o.beautifyHTML){var i=t.j.e.fire("beautifyHTML",e);l.isString(i)&&(e=i)}r=o=e.indexOf(t.tempMarkerStart),e=e.replace(t.tempMarkerStartReg,""),t.selInfo[0].collapsed&&-1!==o||(r=e.indexOf(t.tempMarkerEnd),-1===o&&(o=r)),e=e.replace(t.tempMarkerEndReg,"")}finally{e=e.replace(t.tempMarkerEndReg,"").replace(t.tempMarkerStartReg,"")}t.setMirrorValue(e),t.setMirrorSelectionRange(o,r),t.toWYSIWYG(),t.setFocusToMirror()}},t.setMirrorSelectionRange=function(e,o){var r;null===(r=t.sourceEditor)||void 0===r||r.setSelectionRange(e,o)},t.onReadonlyReact=function(){var e;null===(e=t.sourceEditor)||void 0===e||e.setReadOnly(t.j.o.readonly)},t}return r.__extends(t,e),t.prototype.getMirrorValue=function(){var e;return(null===(e=this.sourceEditor)||void 0===e?void 0:e.getValue())||""},t.prototype.setMirrorValue=function(e){var t;null===(t=this.sourceEditor)||void 0===t||t.setValue(e)},t.prototype.setFocusToMirror=function(){var e;null===(e=this.sourceEditor)||void 0===e||e.focus()},t.prototype.initSourceEditor=function(e){var t,o=this;if("area"!==e.o.sourceEditor){var r=c.createSourceEditor(e.o.sourceEditor,e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG);r.onReadyAlways((function(){var t,n;null===(t=o.sourceEditor)||void 0===t||t.destruct(),o.sourceEditor=r,o.fromWYSIWYG(!0),null===(n=e.events)||void 0===n||n.fire("sourceEditorReady",e)}))}else null===(t=this.sourceEditor)||void 0===t||t.onReadyAlways((function(){var t;o.fromWYSIWYG(!0),null===(t=e.events)||void 0===t||t.fire("sourceEditorReady",e)}))},t.prototype.afterInit=function(e){var t=this;if(this.mirrorContainer=e.c.div("jodit-source"),e.workplace.appendChild(this.mirrorContainer),e.e.on("afterAddPlace changePlace afterInit",(function(){e.workplace.appendChild(t.mirrorContainer)})),this.sourceEditor=c.createSourceEditor("area",e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG),e.e.off("beforeSetMode.source afterSetMode.source").on("beforeSetMode.source",t.saveSelection).on("afterSetMode.source",t.removeSelection),this.onReadonlyReact(),e.e.on("insertHTML.source",(function(o){if(!e.o.readonly&&!t.j.isEditorMode())return t.insertHTML(o),!1})).on("readonly.source",this.onReadonlyReact).on("placeholder.source",(function(e){var o;null===(o=t.sourceEditor)||void 0===o||o.setPlaceHolder(e)})).on("beforeCommand.source",this.onSelectAll).on("change.source",this.fromWYSIWYG),e.e.on("beautifyHTML",(function(e){return e})),e.o.beautifyHTML){var o=function(){var t,o,r=e.ow.html_beautify;return!(!r||e.isInDestruct||(null===(o=null===(t=e.events)||void 0===t?void 0:t.off("beautifyHTML"))||void 0===o||o.on("beautifyHTML",(function(e){return r(e)})),0))};o()||l.loadNext(e,e.o.beautifyHTMLCDNUrlsJS).then(o)}this.fromWYSIWYG(),this.initSourceEditor(e)},t.prototype.beforeDestruct=function(e){this.sourceEditor&&(this.sourceEditor.destruct(),delete this.sourceEditor),s.Dom.safeRemove(this.mirrorContainer)},t}(a.Plugin);t.source=u},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSourceEditor=void 0;var r=o(318);t.createSourceEditor=function(e,t,o,n,i){var a;switch(e){case"ace":if(!t.o.shadowRoot){a=new r.AceEditor(t,o,n,i);break}default:a=new r.TextAreaEditor(t,o,n,i)}return a.init(t),a.onReadyAlways((function(){a.setReadOnly(t.o.readonly)})),a}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(319),t),r.__exportStar(o(321),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextAreaEditor=void 0;var r=o(7),n=o(19),i=o(10),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autosize=t.j.async.debounce((function(){t.instance.style.height="auto",t.instance.style.height=t.instance.scrollHeight+"px"}),t.j.defaultTimeout),t}return r.__extends(t,e),t.prototype.init=function(e){var t=this;this.instance=e.c.element("textarea",{class:"jodit-source__mirror"}),this.container.appendChild(this.instance),e.e.on(this.instance,"mousedown keydown touchstart input",e.async.debounce(this.toWYSIWYG,e.defaultTimeout)).on("setMinHeight.source",(function(e){n.css(t.instance,"minHeight",e)})).on(this.instance,"change keydown mousedown touchstart input",this.autosize).on("afterSetMode.source",this.autosize).on(this.instance,"mousedown focus",(function(t){e.e.fire(t.type,t)})),this.autosize(),this.onReady()},t.prototype.destruct=function(){i.Dom.safeRemove(this.instance)},t.prototype.getValue=function(){return this.instance.value},t.prototype.setValue=function(e){this.instance.value=e},t.prototype.insertRaw=function(e){var t=this.getValue();if(0>this.getSelectionStart())this.setValue(t+e);else{var o=this.getSelectionStart(),r=this.getSelectionEnd();this.setValue(t.substring(0,o)+e+t.substring(r,t.length))}},t.prototype.getSelectionStart=function(){return this.instance.selectionStart},t.prototype.getSelectionEnd=function(){return this.instance.selectionEnd},t.prototype.setSelectionRange=function(e,t){void 0===t&&(t=e),this.instance.setSelectionRange(e,t)},t.prototype.focus=function(){this.instance.focus()},t.prototype.setPlaceHolder=function(e){this.instance.setAttribute("placeholder",e)},t.prototype.setReadOnly=function(e){e?this.instance.setAttribute("readonly","true"):this.instance.removeAttribute("readonly")},t.prototype.selectAll=function(){this.instance.select()},t.prototype.replaceUndoManager=function(){var e=this,t=this.jodit.observer;this.j.e.on(this.instance,"keydown",(function(o){if((o.ctrlKey||o.metaKey)&&"z"===o.key)return o.shiftKey?t.redo():t.undo(),e.setSelectionRange(e.getValue().length),!1}))},t}(o(320).SourceEditor);t.TextAreaEditor=a},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceEditor=void 0;var o=function(){function e(e,t,o,r){this.jodit=e,this.container=t,this.toWYSIWYG=o,this.fromWYSIWYG=r,this.className="",this.isReady=!1}return Object.defineProperty(e.prototype,"j",{get:function(){return this.jodit},enumerable:!1,configurable:!0}),e.prototype.onReady=function(){this.replaceUndoManager(),this.isReady=!0,this.j.e.fire(this,"ready")},e.prototype.onReadyAlways=function(e){var t;this.isReady?e():null===(t=this.j.events)||void 0===t||t.on(this,"ready",e)},e}();t.SourceEditor=o},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AceEditor=void 0;var r=o(7),n=o(9),i=o(19),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.className="jodit_ace_editor",t.proxyOnFocus=function(e){t.j.e.fire("focus",e)},t.proxyOnMouseDown=function(e){t.j.e.fire("mousedown",e)},t}return r.__extends(t,e),t.prototype.aceExists=function(){return void 0!==this.j.ow.ace},t.prototype.getLastColumnIndex=function(e){return this.instance.session.getLine(e).length},t.prototype.getLastColumnIndices=function(){for(var e=this.instance.session.getLength(),t=[],o=0,r=0;e>r;r++)o+=this.getLastColumnIndex(r),r>0&&(o+=1),t[r]=o;return t},t.prototype.getRowColumnIndices=function(e){var t=this.getLastColumnIndices();if(t[0]>=e)return{row:0,column:e};for(var o=1,r=1;t.length>r;r++)e>t[r]&&(o=r+1);return{row:o,column:e-t[o-1]-1}},t.prototype.setSelectionRangeIndices=function(e,t){var o=this.getRowColumnIndices(e),r=this.getRowColumnIndices(t);this.instance.getSelection().setSelectionRange({start:o,end:r})},t.prototype.getIndexByRowColumn=function(e,t){return this.getLastColumnIndices()[e]-this.getLastColumnIndex(e)+t},t.prototype.init=function(e){var t=this,o=function(){if(void 0===t.instance&&t.aceExists()){var o=t.j.c.div("jodit-source__mirror-fake");t.container.appendChild(o),t.instance=e.ow.ace.edit(o),t.instance.setTheme(e.o.sourceEditorNativeOptions.theme),t.instance.renderer.setShowGutter(e.o.sourceEditorNativeOptions.showGutter),t.instance.getSession().setMode(e.o.sourceEditorNativeOptions.mode),t.instance.setHighlightActiveLine(e.o.sourceEditorNativeOptions.highlightActiveLine),t.instance.getSession().setUseWrapMode(!0),t.instance.setOption("indentedSoftWrap",!1),t.instance.setOption("wrap",e.o.sourceEditorNativeOptions.wrap),t.instance.getSession().setUseWorker(!1),t.instance.$blockScrolling=1/0,t.instance.on("change",t.toWYSIWYG),t.instance.on("focus",t.proxyOnFocus),t.instance.on("mousedown",t.proxyOnMouseDown),e.getRealMode()!==n.MODE_WYSIWYG&&t.setValue(t.getValue());var r=t.j.async.debounce((function(){e.isInDestruct||(t.instance.setOption("maxLines","auto"!==e.o.height?e.workplace.offsetHeight/t.instance.renderer.lineHeight:1/0),t.instance.resize())}),2*t.j.defaultTimeout);e.e.on("afterResize afterSetMode",r),r(),t.onReady()}};e.e.on("afterSetMode",(function(){e.getRealMode()!==n.MODE_SOURCE&&e.getMode()!==n.MODE_SPLIT||(t.fromWYSIWYG(),o())})),o(),this.aceExists()||i.loadNext(e,e.o.sourceEditorCDNUrlsJS).then((function(){e.isInDestruct||o()}))},t.prototype.destruct=function(){var e,t;this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),null===(t=null===(e=this.j)||void 0===e?void 0:e.events)||void 0===t||t.off("aceInited.source")},t.prototype.setValue=function(e){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){var t=this.j.e.fire("beautifyHTML",e);i.isString(t)&&(e=t)}this.instance.setValue(e),this.instance.clearSelection()},t.prototype.getValue=function(){return this.instance.getValue()},t.prototype.setReadOnly=function(e){this.instance.setReadOnly(e)},t.prototype.focus=function(){this.instance.focus()},t.prototype.getSelectionStart=function(){var e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.start.row,e.start.column)},t.prototype.getSelectionEnd=function(){var e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.end.row,e.end.column)},t.prototype.selectAll=function(){this.instance.selection.selectAll()},t.prototype.insertRaw=function(e){var t=this.instance.selection.getCursor(),o=this.instance.session.insert(t,e);this.instance.selection.setRange({start:t,end:o},!1)},t.prototype.setSelectionRange=function(e,t){this.setSelectionRangeIndices(e,t)},t.prototype.setPlaceHolder=function(e){},t.prototype.replaceUndoManager=function(){var e=this.jodit.observer;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec:function(){e.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec:function(){e.redo()}})},t}(o(320).SourceEditor);t.AceEditor=a},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stat=void 0;var r=o(7),n=o(8),i=o(9),a=o(183),s=o(32);n.Config.prototype.showCharsCounter=!0,n.Config.prototype.countHTMLChars=!1,n.Config.prototype.showWordsCounter=!0;var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.charCounter=null,t.wordCounter=null,t.reInit=function(){t.j.o.showCharsCounter&&t.charCounter&&t.j.statusbar.append(t.charCounter,!0),t.j.o.showWordsCounter&&t.wordCounter&&t.j.statusbar.append(t.wordCounter,!0),t.j.e.off("change keyup",t.calc).on("change keyup",t.calc),t.calc()},t.calc=t.j.async.throttle((function(){var e=t.j.text;if(t.j.o.showCharsCounter&&t.charCounter){var o=t.j.o.countHTMLChars?t.j.value:e.replace(i.SPACE_REG_EXP(),"");t.charCounter.textContent=t.j.i18n("Chars: %d",o.length)}t.j.o.showWordsCounter&&t.wordCounter&&(t.wordCounter.textContent=t.j.i18n("Words: %d",e.replace(i.INVISIBLE_SPACE_REG_EXP(),"").split(i.SPACE_REG_EXP()).filter((function(e){return e.length})).length))}),t.j.defaultTimeout),t}return r.__extends(t,e),t.prototype.afterInit=function(){this.charCounter=this.j.c.span(),this.wordCounter=this.j.c.span(),this.j.e.on("afterInit changePlace afterAddPlace",this.reInit),this.reInit()},t.prototype.beforeDestruct=function(){s.Dom.safeRemove(this.charCounter),s.Dom.safeRemove(this.wordCounter),this.j.e.off("afterInit changePlace afterAddPlace",this.reInit),this.charCounter=null,this.wordCounter=null},t}(a.Plugin);t.stat=l},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sticky=void 0;var r=o(7);o(324);var n=o(8),i=o(9),a=o(10),s=o(19),l=o(99);n.Config.prototype.toolbarSticky=!0,n.Config.prototype.toolbarDisableStickyForMobile=!0,n.Config.prototype.toolbarStickyOffset=0;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isToolbarSticked=!1,t.createDummy=function(e){i.IS_IE&&!t.dummyBox&&(t.dummyBox=t.j.c.div(),t.dummyBox.classList.add("jodit_sticky-dummy_toolbar"),t.j.container.insertBefore(t.dummyBox,e))},t.addSticky=function(e){t.isToolbarSticked||(t.createDummy(e),t.j.container.classList.add("jodit_sticky"),t.isToolbarSticked=!0),s.css(e,{top:t.j.o.toolbarStickyOffset||null,width:t.j.container.offsetWidth-2}),i.IS_IE&&t.dummyBox&&s.css(t.dummyBox,{height:e.offsetHeight})},t.removeSticky=function(e){t.isToolbarSticked&&(s.css(e,{width:"",top:""}),t.j.container.classList.remove("jodit_sticky"),t.isToolbarSticked=!1)},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).on("getStickyState.sticky",(function(){return t.isToolbarSticked}))},t.prototype.onScroll=function(){var e=this.jodit,t=e.ow.pageYOffset||e.od.documentElement&&e.od.documentElement.scrollTop||0,o=s.offset(e.container,e,e.od,!0),r=e.getMode()===i.MODE_WYSIWYG&&t+e.o.toolbarStickyOffset>o.top&&o.top+o.height>t+e.o.toolbarStickyOffset&&!(e.o.toolbarDisableStickyForMobile&&this.isMobile());if(e.o.toolbarSticky&&!0===e.o.toolbar&&this.isToolbarSticked!==r){var n=e.toolbarContainer;n&&(r?this.addSticky(n):this.removeSticky(n)),e.e.fire("toggleSticky",r)}},t.prototype.isMobile=function(){return this.j&&this.j.options&&this.j.container&&this.j.o.sizeSM>=this.j.container.offsetWidth},t.prototype.beforeDestruct=function(e){this.dummyBox&&a.Dom.safeRemove(this.dummyBox),e.e.off(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).off(".sticky")},r.__decorate([l.throttle()],t.prototype,"onScroll",null),t}(a.Plugin);t.sticky=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbols=void 0;var r=o(7);o(326),o(327);var n=o(9),i=o(10),a=o(20),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"symbol",group:"insert"}],t.countInRow=17,t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on("generateSpecialCharactersTable.symbols",(function(){for(var o=e.c.fromHTML('
'),r=o.querySelector(".jodit-symbols__preview"),s=o.querySelector("table").tBodies[0],l=[],c=0;e.o.specialCharacters.length>c;){for(var u=e.c.element("tr"),d=0;t.countInRow>d&&e.o.specialCharacters.length>c;d+=1,c+=1){var p=e.c.element("td"),f=e.c.fromHTML(''+e.o.specialCharacters[c]+"");l.push(f),p.appendChild(f),u.appendChild(p)}s.appendChild(u)}var h=t;return e.e.on(l,"focus",(function(){r.innerHTML=this.innerHTML})).on(l,"mousedown",(function(t){i.Dom.isTag(this,"a")&&(e.s.focus(),e.s.insertHTML(this.innerHTML),e.e.fire(this,"close_dialog"),t&&t.preventDefault(),t&&t.stopImmediatePropagation())})).on(l,"mouseenter",(function(){i.Dom.isTag(this,"a")&&this.focus()})).on(l,"keydown",(function(t){var o=t.target;if(i.Dom.isTag(o,"a")){var r=parseInt(a.attr(o,"-index")||"0",10),s=parseInt(a.attr(o,"data-index-j")||"0",10),c=void 0;switch(t.key){case n.KEY_UP:case n.KEY_DOWN:void 0===l[c=t.key===n.KEY_UP?r-h.countInRow:r+h.countInRow]&&(c=t.key===n.KEY_UP?Math.floor(l.length/h.countInRow)*h.countInRow+s:s)>l.length-1&&(c-=h.countInRow),l[c]&&l[c].focus();break;case n.KEY_RIGHT:case n.KEY_LEFT:void 0===l[c=t.key===n.KEY_LEFT?r-1:r+1]&&(c=t.key===n.KEY_LEFT?l.length-1:0),l[c]&&l[c].focus();break;case n.KEY_ENTER:e.e.fire(o,"mousedown"),t.stopImmediatePropagation(),t.preventDefault()}}})),o}))},t.prototype.beforeDestruct=function(e){e.e.off("generateSpecialCharactersTable.symbols")},t}(i.Plugin);t.symbols=s},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(162);r.Config.prototype.usePopupForSpecialCharacters=!1,r.Config.prototype.specialCharacters=["!",""","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","»","¬","®","¯","°","²","³","´","µ","¶","·","¸","¹","º","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"],r.Config.prototype.controls.symbol={icon:"omega",hotkeys:["ctrl+shift+i","cmd+shift+i"],tooltip:"Insert Special Character",popup:function(e,t,o,r){var i=e.e.fire("generateSpecialCharactersTable.symbols");if(i){if(e.o.usePopupForSpecialCharacters){var a=e.c.div();return a.classList.add("jodit-symbols"),a.appendChild(i),e.e.on(i,"close_dialog",r),a}n.Alert(i,e.i18n("Select Special Character"),void 0,"jodit-symbols").bindDestruct(e);var s=i.querySelector("a");s&&s.focus()}}}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);o(329),r.__exportStar(o(330),t),r.__exportStar(o(332),t),r.__exportStar(o(333),t),r.__exportStar(o(334),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(32),i=o(20),a=o(19);r.Config.prototype.table={allowCellSelection:!0,selectionCellStyle:"border: 1px double #1e88e5 !important;",allowCellResize:!0,useExtraClassesOptions:!1},r.Config.prototype.controls.table={data:{cols:10,rows:10,classList:{"table table-bordered":"Bootstrap Bordered","table table-striped":"Bootstrap Striped","table table-dark":"Bootstrap Dark"}},popup:function(e,t,o,r,s){for(var l=o.data&&o.data.rows?o.data.rows:10,c=o.data&&o.data.cols?o.data.cols:10,u=e.c.fromHTML('
'+function(){if(!e.o.table.useExtraClassesOptions)return"";var t=[];if(o.data){var r=o.data.classList;Object.keys(r).forEach((function(e){t.push('")}))}return t.join("")}()+'
'),d=u.querySelectorAll("span")[0],p=u.querySelectorAll("span")[1],f=u.querySelector(".jodit-form__container"),h=u.querySelector(".jodit-form__options"),m=[],v=l*c,g=0;v>g;g+=1)m[g]||m.push(e.c.element("span",{dataIndex:g}));if(e.e.on(f,"mousemove",(function(e,t){var o=e.target;if(n.Dom.isTag(o,"span")){for(var r=void 0===t||isNaN(t)?parseInt(i.attr(o,"-index")||"0",10):t||0,a=Math.ceil((r+1)/c),s=r%c+1,l=0;m.length>l;l+=1)m[l].className=l%c+1>s||a=y;y+=1){m=d.element("tr");for(var b=1;u>=b;b+=1)v=d.element("td"),g||(g=v),v.appendChild(d.element("br")),m.appendChild(d.text("\n")),m.appendChild(d.text("\t")),m.appendChild(v);p.appendChild(d.text("\n")),p.appendChild(m)}var _=e.s.current();if(_&&e.s.isCollapsed()){var w=n.Dom.closest(_,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);w&&w!==e.editor&&!w.nodeName.match(/^TD|TH|TBODY|TABLE|THEADER|TFOOTER$/)&&e.s.setCursorAfter(w)}a.$$("input[type=checkbox]:checked",h).forEach((function(e){e.value.split(/[\s]+/).forEach((function(e){f.classList.add(e)}))})),e.s.insertNode(d.text("\n")),e.s.insertNode(f,!1),g&&(e.s.setCursorIn(g),a.scrollIntoViewIfNeeded(g,e.editor,e.ed)),r()}})),s&&s.parentElement){for(g=0;l>g;g+=1){for(var y=e.c.div(),b=0;c>b;b+=1)y.appendChild(m[g*c+b]);f.appendChild(y)}m[0]&&(m[0].className="hovered")}return u},tooltip:"Insert table"}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeCells=void 0;var r=o(7);o(331);var n=o(9),i=o(10),a=o(19),s=o(99),l="table_processor_observer-resize",c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectMode=!1,t.resizeDelta=0,t.createResizeHandle=function(){t.resizeHandler||(t.resizeHandler=t.j.c.div("jodit-table-resizer"),t.j.e.on(t.resizeHandler,"mousedown.table touchstart.table",t.onHandleMouseDown).on(t.resizeHandler,"mouseenter.table",(function(){t.j.async.clearTimeout(t.hideTimeout)})))},t.hideTimeout=0,t.drag=!1,t.minX=0,t.maxX=0,t.startX=0,t}return r.__extends(t,e),Object.defineProperty(t.prototype,"module",{get:function(){return this.j.getInstance("Table",this.j.o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRTL",{get:function(){return"rtl"===this.j.o.direction},enumerable:!1,configurable:!0}),t.prototype.showResizeHandle=function(){this.j.async.clearTimeout(this.hideTimeout),this.j.workplace.appendChild(this.resizeHandler)},t.prototype.hideResizeHandle=function(){var e=this;this.hideTimeout=this.j.async.setTimeout((function(){i.Dom.safeRemove(e.resizeHandler)}),{timeout:this.j.defaultTimeout,label:"hideResizer"})},t.prototype.onHandleMouseDown=function(e){var t=this;if(!this.j.isLocked){this.drag=!0,this.j.e.on(this.j.ow,"mouseup.resize-cells touchend.resize-cells",this.onMouseUp).on(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.startX=e.clientX,this.j.lock(l),this.resizeHandler.classList.add("jodit-table-resizer_moved");var o,r=this.workTable.getBoundingClientRect();if(this.minX=0,this.maxX=1e6,null!=this.wholeTable)r=this.workTable.parentNode.getBoundingClientRect(),this.minX=r.left,this.maxX=this.minX+r.width;else{var a=i.Table.formalCoordinate(this.workTable,this.workCell,!0);i.Table.formalMatrix(this.workTable,(function(e,r,i){a[1]===i&&(o=e.getBoundingClientRect(),t.minX=Math.max(o.left+n.NEARBY/2,t.minX)),a[1]+(t.isRTL?-1:1)===i&&(o=e.getBoundingClientRect(),t.maxX=Math.min(o.left+o.width-n.NEARBY/2,t.maxX))}))}return!1}},t.prototype.onMouseMove=function(e){if(this.drag){this.j.e.fire("closeAllPopups");var t=e.clientX,o=a.offset(this.resizeHandler.parentNode||this.j.od.documentElement,this.j,this.j.od,!0);this.minX>t&&(t=this.minX),t>this.maxX&&(t=this.maxX),this.resizeDelta=t-this.startX+(this.j.o.iframe?o.left:0),this.resizeHandler.style.left=t-(this.j.o.iframe?0:o.left)+"px";var r=this.j.s.sel;r&&r.removeAllRanges()}},t.prototype.onMouseUp=function(e){(this.selectMode||this.drag)&&(this.selectMode=!1,this.j.unlock()),this.resizeHandler&&this.drag&&(this.drag=!1,this.j.e.off(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.resizeHandler.classList.remove("jodit-table-resizer_moved"),this.startX!==e.clientX&&(null==this.wholeTable?this.resizeColumns():this.resizeTable()),this.j.setEditorValue(),this.j.s.focus())},t.prototype.resizeColumns=function(){var e=this,t=this.resizeDelta,o=[];i.Table.setColumnWidthByDelta(this.workTable,i.Table.formalCoordinate(this.workTable,this.workCell,!0)[1],t,!0,o);var r=a.call(this.isRTL?i.Dom.prev:i.Dom.next,this.workCell,(function(t){return i.Dom.isCell(t,e.j.ew)}),this.workCell.parentNode);i.Table.setColumnWidthByDelta(this.workTable,i.Table.formalCoordinate(this.workTable,r)[1],-t,!1,o)},t.prototype.resizeTable=function(){var e=this.resizeDelta*(this.isRTL?-1:1),t=this.workTable.offsetWidth,o=a.getContentWidth(this.workTable.parentNode,this.j.ew),r=!this.wholeTable;if(this.isRTL?!r:r)this.workTable.style.width=(t+e)/o*100+"%";else{var n=this.isRTL?"marginRight":"marginLeft",i=parseInt(this.j.ew.getComputedStyle(this.workTable)[n]||"0",10);this.workTable.style.width=(t-e)/o*100+"%",this.workTable.style[n]=(i+e)/o*100+"%"}},t.prototype.setWorkCell=function(e,t){void 0===t&&(t=null),this.wholeTable=t,this.workCell=e,this.workTable=i.Dom.up(e,(function(e){return i.Dom.isTag(e,"table")}),this.j.editor)},t.prototype.calcHandlePosition=function(e,t,o,r){var s=this;void 0===o&&(o=0),void 0===r&&(r=0);var l=a.offset(t,this.j,this.j.ed);if(o>n.NEARBY&&l.width-n.NEARBY>o)this.hideResizeHandle();else{var c=a.offset(this.j.workplace,this.j,this.j.od,!0),u=a.offset(e,this.j,this.j.ed);if(this.resizeHandler.style.left=(o>n.NEARBY?l.left+l.width:l.left)-c.left+r+"px",Object.assign(this.resizeHandler.style,{height:u.height+"px",top:u.top-c.top+"px"}),this.showResizeHandle(),o>n.NEARBY){var d=a.call(this.isRTL?i.Dom.prev:i.Dom.next,t,(function(e){return i.Dom.isCell(e,s.j.ew)}),t.parentNode);this.setWorkCell(t,!!d&&null)}else{var p=a.call(this.isRTL?i.Dom.next:i.Dom.prev,t,(function(e){return i.Dom.isCell(e,s.j.ew)}),t.parentNode);this.setWorkCell(p||t,!p||null)}}},t.prototype.afterInit=function(e){var t=this;e.o.table.allowCellResize&&e.e.off(this.j.ow,".resize-cells").off(".resize-cells").on("change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells",(function(){a.$$("table",e.editor).forEach(t.observe)})).on(this.j.ow,"scroll.resize-cells",(function(){if(t.drag){var o=i.Dom.up(t.workCell,(function(e){return i.Dom.isTag(e,"table")}),e.editor);if(o){var r=o.getBoundingClientRect();t.resizeHandler.style.top=r.top+"px"}}})).on("beforeSetMode.resize-cells",(function(){t.module.getAllSelectedCells().forEach((function(o){t.module.removeSelection(o),i.Table.normalizeTable(i.Dom.closest(o,"table",e.editor))}))}))},t.prototype.observe=function(e){var t=this;a.dataBind(e,l)||(a.dataBind(e,l,!0),this.j.e.on(e,"mouseleave.resize-cells",(function(e){t.resizeHandler&&t.resizeHandler!==e.relatedTarget&&t.hideResizeHandle()})).on(e,"mousemove.resize-cells touchmove.resize-cells",(function(o){if(!t.j.isLocked){var r=i.Dom.up(o.target,(function(e){return i.Dom.isCell(e,t.j.ew)}),e);r&&t.calcHandlePosition(e,r,o.offsetX)}})),this.createResizeHandle())},t.prototype.beforeDestruct=function(e){e.events&&(e.e.off(this.j.ow,".resize-cells"),e.e.off(".resize-cells"))},r.__decorate([s.autobind],t.prototype,"onHandleMouseDown",null),r.__decorate([s.autobind],t.prototype,"onMouseMove",null),r.__decorate([s.autobind],t.prototype,"onMouseUp",null),r.__decorate([s.autobind],t.prototype,"observe",null),t}(i.Plugin);t.resizeCells=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectCells=void 0;var r=o(7),n=o(183),i=o(10),a=o(19),s=o(290),l=o(9),c=o(99),u="table_processor_observer",d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectedCell=null,t}return r.__extends(t,e),Object.defineProperty(t.prototype,"module",{get:function(){return this.j.getInstance("Table",this.j.o)},enumerable:!1,configurable:!0}),t.prototype.afterInit=function(e){var t=this;e.o.table.allowCellSelection&&e.e.on(this.j.ow,"click.select-cells",this.onRemoveSelection).on("keydown.select-cells",(function(e){e.key===l.KEY_TAB&&t.unselectCells()})).on("beforeCommand.select-cells",this.onExecCommand).on("afterCommand.select-cells",this.onAfterCommand).on("change afterCommand afterSetMode click afterInit".split(" ").map((function(e){return e+".select-cells"})).join(" "),(function(){a.$$("table",e.editor).forEach(t.observe)}))},t.prototype.observe=function(e){a.dataBind(e,u)||(this.onRemoveSelection(),a.dataBind(e,u,!0),this.j.e.on(e,"mousedown.select-cells touchstart.select-cells",this.onStartSelection.bind(this,e)))},t.prototype.onStartSelection=function(e,t){var o=this;if(!this.j.o.readonly){this.unselectCells();var r=i.Dom.closest(t.target,["td","th"],e);r&&(r.firstChild||r.appendChild(this.j.createInside.element("br")),this.selectedCell=r,this.module.addSelection(r),this.j.e.on(e,"mousemove.select-cells touchmove.select-cells",this.onMove.bind(this,e)).on(e,"mouseup.select-cells touchend.select-cells",this.onStopSelection.bind(this,e)),this.j.e.fire("showPopup",e,(function(){return a.position(r,o.j)}),"cells"))}},t.prototype.onMove=function(e,t){var o=this;if(!this.j.o.readonly&&!this.j.isLockedNotBy(u)){var r=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(r){var n=i.Dom.closest(r,["td","th"],e);if(n&&this.selectedCell){n!==this.selectedCell&&this.j.lock(u),this.unselectCells(e);for(var a,s=i.Table.getSelectedBound(e,[n,this.selectedCell]),l=i.Table.formalMatrix(e),c=s[0][0];s[1][0]>=c;c+=1)for(var d=s[0][1];s[1][1]>=d;d+=1)this.module.addSelection(l[c][d]);this.j.e.fire("hidePopup"),t.stopPropagation(),a=o.j.createInside.fromHTML('
 
'),n.appendChild(a),o.j.async.setTimeout((function(){var e;null===(e=a.parentNode)||void 0===e||e.removeChild(a)}),o.j.defaultTimeout/5)}}}},t.prototype.onRemoveSelection=function(e){var t;if(!(null===(t=null==e?void 0:e.buffer)||void 0===t?void 0:t.actionTrigger)&&!this.selectedCell&&this.module.getAllSelectedCells().length)return this.j.unlock(),this.unselectCells(),void this.j.e.fire("hidePopup","cells");this.selectedCell=null},t.prototype.onStopSelection=function(e,t){var o=this;if(this.selectedCell){this.j.unlock();var r=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(r){var n=i.Dom.closest(r,["td","th"],e);if(n){var s=i.Dom.closest(n,"table",e);if(!s||s===e){var l=i.Table.getSelectedBound(e,[n,this.selectedCell]),c=i.Table.formalMatrix(e),u=c[l[1][0]][l[1][1]],d=c[l[0][0]][l[0][1]];this.j.e.fire("showPopup",e,(function(){var e=a.position(d,o.j),t=a.position(u,o.j);return{left:e.left,top:e.top,width:t.left-e.left+t.width,height:t.top-e.top+t.height}}),"cells"),a.$$("table",this.j.editor).forEach((function(e){o.j.e.off(e,"mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells")}))}}}}},t.prototype.unselectCells=function(e,t){var o=this.module,r=o.getAllSelectedCells();r.length&&r.forEach((function(e){t&&t===e||o.removeSelection(e)}))},t.prototype.onExecCommand=function(e){if(/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(e)){e=e.replace("table","");var t=this.module.getAllSelectedCells();if(t.length){var o=t.shift();if(!o)return;var r=i.Dom.closest(o,"table",this.j.editor);if(!r)return;switch(e){case"splitv":i.Table.splitVertical(r,this.j);break;case"splitg":i.Table.splitHorizontal(r,this.j);break;case"merge":i.Table.mergeSelected(r,this.j);break;case"empty":t.forEach((function(e){return e.innerHTML=""}));break;case"bin":i.Dom.safeRemove(r);break;case"binrow":i.Table.removeRow(r,o.parentNode.rowIndex);break;case"bincolumn":i.Table.removeColumn(r,o.cellIndex);break;case"addcolumnafter":case"addcolumnbefore":i.Table.appendColumn(r,o.cellIndex,"addcolumnafter"===e,this.j.createInside);break;case"addrowafter":case"addrowbefore":i.Table.appendRow(r,o.parentNode,"addrowafter"===e,this.j.createInside)}}return!1}},t.prototype.onAfterCommand=function(e){var t=this;/^justify/.test(e)&&this.module.getAllSelectedCells().forEach((function(o){return s.alignElement(e,o,t.j)}))},t.prototype.beforeDestruct=function(e){this.onRemoveSelection(),e.e.off(".select-cells")},r.__decorate([c.autobind],t.prototype,"observe",null),r.__decorate([c.autobind],t.prototype,"onRemoveSelection",null),r.__decorate([c.autobind],t.prototype,"onStopSelection",null),r.__decorate([c.autobind],t.prototype,"onExecCommand",null),r.__decorate([c.autobind],t.prototype,"onAfterCommand",null),t}(n.Plugin);t.selectCells=d},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableKeyboardNavigation=void 0;var r=o(9),n=o(32),i=o(10);t.tableKeyboardNavigation=function(e){e.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(function(t){var o,a;if((t.key===r.KEY_TAB||t.key===r.KEY_LEFT||t.key===r.KEY_RIGHT||t.key===r.KEY_UP||t.key===r.KEY_DOWN)&&(o=e.s.current(),a=n.Dom.up(o,(function(e){return e&&e.nodeName&&/^td|th$/i.test(e.nodeName)}),e.editor))){var s=e.s.range;if(t.key===r.KEY_TAB||o===a||(t.key!==r.KEY_LEFT&&t.key!==r.KEY_UP||!(n.Dom.prev(o,(function(e){return t.key===r.KEY_UP?n.Dom.isTag(e,"br"):Boolean(e)}),a)||t.key!==r.KEY_UP&&n.Dom.isText(o)&&0!==s.startOffset))&&(t.key!==r.KEY_RIGHT&&t.key!==r.KEY_DOWN||!(n.Dom.next(o,(function(e){return t.key===r.KEY_DOWN?n.Dom.isTag(e,"br"):Boolean(e)}),a)||t.key!==r.KEY_DOWN&&n.Dom.isText(o)&&o.nodeValue&&s.startOffset!==o.nodeValue.length))){var l=n.Dom.up(a,(function(e){return e&&/^table$/i.test(e.nodeName)}),e.editor),c=null;switch(t.key){case r.KEY_TAB:case r.KEY_LEFT:var u=t.key===r.KEY_LEFT||t.shiftKey?"prev":"next";(c=n.Dom[u](a,(function(e){return e&&/^td|th$/i.test(e.tagName)}),l))||(i.Table.appendRow(l,"next"!==u&&l.querySelector("tr"),"next"===u,e.createInside),c=n.Dom[u](a,(function(t){return t&&n.Dom.isCell(t,e.ew)}),l));break;case r.KEY_UP:case r.KEY_DOWN:var d=0,p=0,f=i.Table.formalMatrix(l,(function(e,t,o){e===a&&(d=t,p=o)}));t.key===r.KEY_UP?void 0!==f[d-1]&&(c=f[d-1][p]):void 0!==f[d+1]&&(c=f[d+1][p])}if(c){if(c.firstChild)t.key===r.KEY_TAB?e.s.select(c,!0):e.s.setCursorIn(c,t.key===r.KEY_RIGHT||t.key===r.KEY_DOWN);else{var h=e.createInside.element("br");c.appendChild(h),e.s.setCursorBefore(h)}return!1}}}}))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table=void 0,t.table=function(e){e.registerButton({name:"table",group:"insert"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tooltip=void 0;var r=o(7);o(336);var n=o(19),i=o(183),a=o(32),s=o(30),l=o(99),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOpened=!1,t.delayShowTimeout=0,t}return r.__extends(t,e),t.prototype.afterInit=function(e){var o=this;this.container=e.c.div("jodit-tooltip"),s.getContainer(this.j,t).appendChild(this.container);var r=0;e.e.off(".tooltip").on("showTooltip.tooltip",(function(t,n){e.async.clearTimeout(r),o.open(t,n)})).on("delayShowTooltip.tooltip",this.delayOpen).on("escape.tooltip",this.close).on("hideTooltip.tooltip change.tooltip scroll.tooltip changePlace.tooltip hidePopup.tooltip closeAllPopups.tooltip",(function(){o.j.async.clearTimeout(o.delayShowTimeout),r=e.async.setTimeout(o.close,o.j.defaultTimeout)}))},t.prototype.delayOpen=function(e,t){var o=this,r=this.j.o.showTooltipDelay||this.j.defaultTimeout;this.j.async.clearTimeout(this.delayShowTimeout),this.delayShowTimeout=this.j.async.setTimeout((function(){return o.open(e,t)}),{timeout:r,label:"tooltip"})},t.prototype.open=function(e,t){this.container.classList.add("jodit-tooltip_visible"),this.container.innerHTML=t,this.isOpened=!0,this.setPosition(e)},t.prototype.setPosition=function(e){var t=e();n.css(this.container,{left:t.x,top:t.y})},t.prototype.close=function(){this.j.async.clearTimeout(this.delayShowTimeout),this.isOpened&&(this.isOpened=!1,this.container.classList.remove("jodit-tooltip_visible"),n.css(this.container,{left:-5e3}))},t.prototype.beforeDestruct=function(e){null==e||e.e.off(".tooltip"),this.close(),a.Dom.safeRemove(this.container)},r.__decorate([l.autobind],t.prototype,"delayOpen",null),r.__decorate([l.autobind],t.prototype,"close",null),t}(i.Plugin);t.tooltip=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(338),t),r.__exportStar(o(339),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preview=void 0;var r=o(8),n=o(19),i=o(9);r.Config.prototype.controls.preview={icon:"eye",exec:function(e){var t=e.getInstance("Dialog",{language:e.o.language,theme:e.o.theme}),o=e.c.div();if(n.css(o,{padding:16}),e.iframe){var r=e.create.element("iframe");n.css(r,{minWidth:800,minHeight:600,border:0}),o.appendChild(r),t.open(o,e.i18n("Preview"));var i=r.contentWindow;i&&(e.e.fire("generateDocumentStructure.iframe",i.document,e),i.document.body.innerHTML=e.value)}else n.css(o,{minWidth:1024,minHeight:600,border:0}),o.innerHTML=e.value,t.open(o,e.i18n("Preview"));t.setModal(!0)},mode:i.MODE_SOURCE+i.MODE_WYSIWYG,tooltip:"Preview"},t.preview=function(e){e.registerButton({name:"preview"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=void 0;var r=o(8),n=o(30),i=o(32),a=o(19),s=o(9);r.Config.prototype.controls.print={exec:function(e){var t=e.create.element("iframe");Object.assign(t.style,{position:"fixed",right:0,bottom:0,width:0,height:0,border:0}),n.getContainer(e,r.Config).appendChild(t);var o=function(){e.e.off(e.ow,"mousemove",o),i.Dom.safeRemove(t)},s=t.contentWindow;s&&(e.e.on(s,"onbeforeunload onafterprint",o).on(e.ow,"mousemove",o),e.o.iframe?(e.e.fire("generateDocumentStructure.iframe",s.document,e),s.document.body.innerHTML=e.value):(s.document.write(''+e.value+""),s.document.close()),s.focus(),s.print())},mode:s.MODE_SOURCE+s.MODE_WYSIWYG,tooltip:"Print"},t.print=function(e){e.registerButton({name:"print"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xpath=void 0;var r=o(7);o(341);var n=o(8),i=o(9),a=o(160),s=o(32),l=o(19),c=o(183),u=o(172);n.Config.prototype.showXPathInStatusbar=!0;var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onContext=function(e,o){return t.menu||(t.menu=new a.ContextMenu(t.j)),t.menu.show(o.clientX,o.clientY,[{icon:"bin",title:e===t.j.editor?"Clear":"Remove",exec:function(){e!==t.j.editor?s.Dom.safeRemove(e):t.j.value="",t.j.setEditorValue()}},{icon:"select-all",title:"Select",exec:function(){t.j.s.select(e)}}]),!1},t.onSelectPath=function(e,o){t.j.s.focus();var r=l.attr(o.target,"-path")||"/";if("/"===r)return t.j.execCommand("selectall"),!1;try{var n=t.j.ed.evaluate(r,t.j.editor,null,XPathResult.ANY_TYPE,null).iterateNext();if(n)return t.j.s.select(n),!1}catch(e){}return t.j.s.select(e),!1},t.tpl=function(e,o,r,n){var i=t.j.c.fromHTML(''+l.trim(r)+""),a=i.firstChild;return t.j.e.on(a,"click",t.onSelectPath.bind(t,e)).on(a,"contextmenu",t.onContext.bind(t,e)),i},t.removeSelectAll=function(){t.selectAllButton&&(t.selectAllButton.destruct(),delete t.selectAllButton)},t.appendSelectAll=function(){t.removeSelectAll(),t.selectAllButton=u.makeButton(t.j,r.__assign({name:"selectall"},t.j.o.controls.selectall)),t.selectAllButton.state.size="tiny",t.container&&t.container.insertBefore(t.selectAllButton.container,t.container.firstChild)},t.calcPathImd=function(){if(!t.isDestructed){var e,o,r,n=t.j.s.current();t.container&&(t.container.innerHTML=i.INVISIBLE_SPACE),n&&s.Dom.up(n,(function(n){n&&t.j.editor!==n&&!s.Dom.isText(n)&&(e=n.nodeName.toLowerCase(),o=l.getXPathByElement(n,t.j.editor).replace(/^\//,""),r=t.tpl(n,o,e,t.j.i18n("Select %s",e)),t.container&&t.container.insertBefore(r,t.container.firstChild))}),t.j.editor),t.appendSelectAll()}},t.calcPath=t.j.async.debounce(t.calcPathImd,2*t.j.defaultTimeout),t}return r.__extends(t,e),t.prototype.afterInit=function(){var e=this;this.j.o.showXPathInStatusbar&&(this.container=this.j.c.div("jodit-xpath"),this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath",this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath",(function(){e.j.o.showXPathInStatusbar&&e.container&&(e.j.statusbar.append(e.container),e.j.getRealMode()===i.MODE_WYSIWYG?e.calcPath():(e.container&&(e.container.innerHTML=i.INVISIBLE_SPACE),e.appendSelectAll()))})),this.calcPath())},t.prototype.beforeDestruct=function(){this.j&&this.j.events&&this.j.e.off(".xpath"),this.removeSelectAll(),this.menu&&this.menu.destruct(),s.Dom.safeRemove(this.container),delete this.menu,delete this.container},t}(c.Plugin);t.xpath=d},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paragraph=t.palette=t.outdent=t.omega=t.ol=t.ok=t.merge=t.menu=t.lock=t.link=t.left=t.justify=t.italic=t.info_circle=t.indent=t.image=t.hr=t.fullsize=t.fontsize=t.font=t.folder=t.file=t.eye=t.eraser=t.enter=t.chevron=t.dots=t.dedent=t.cut=t.crop=t.copy=t.copyformat=t.check_square=t.check=t.chain_broken=t.center=t.cancel=t.brush=t.bold=t.bin=t.attachment=t.arrows_h=t.arrows_alt=t.angle_up=t.angle_right=t.angle_left=t.angle_down=t.addrow=t.addcolumn=t.about=void 0,t.video=t.valign=t.upload=t.update=t.unlock=t.unlink=t.undo=t.underline=t.ul=t.th_list=t.th=t.table=t.superscript=t.subscript=t.strikethrough=t.splitv=t.splitg=t.source=t.shrink=t.settings=t.select_all=t.search=t.save=t.right=t.resizer=t.resize=t.redo=t.print=t.plus=t.pencil=t.paste=void 0;var r=o(343);t.about=r;var n=o(344);t.addcolumn=n;var i=o(345);t.addrow=i;var a=o(346);t.angle_down=a;var s=o(347);t.angle_left=s;var l=o(348);t.angle_right=l;var c=o(349);t.angle_up=c;var u=o(350);t.arrows_alt=u;var d=o(351);t.arrows_h=d;var p=o(352);t.attachment=p;var f=o(353);t.bin=f;var h=o(354);t.bold=h;var m=o(355);t.brush=m;var v=o(356);t.cancel=v;var g=o(357);t.center=g;var y=o(358);t.chain_broken=y;var b=o(359);t.check=b;var _=o(360);t.check_square=_;var w=o(361);t.chevron=w;var S=o(362);t.copyformat=S;var C=o(363);t.crop=C;var k=o(364);t.copy=k;var j=o(365);t.cut=j;var E=o(366);t.dedent=E;var I=o(367);t.dots=I;var x=o(368);t.enter=x;var T=o(369);t.eraser=T;var P=o(370);t.eye=P;var D=o(371);t.file=D;var z=o(372);t.folder=z;var A=o(373);t.font=A;var M=o(374);t.fontsize=M;var L=o(375);t.fullsize=L;var O=o(376);t.hr=O;var B=o(377);t.image=B;var N=o(378);t.indent=N;var R=o(379);t.info_circle=R;var q=o(380);t.italic=q;var H=o(381);t.justify=H;var F=o(382);t.left=F;var U=o(383);t.link=U;var V=o(384);t.lock=V;var W=o(385);t.menu=W;var Y=o(386);t.merge=Y;var K=o(387);t.ok=K;var G=o(388);t.ol=G;var J=o(389);t.omega=J;var X=o(390);t.outdent=X;var $=o(391);t.palette=$;var Z=o(392);t.paragraph=Z;var Q=o(393);t.paste=Q;var ee=o(394);t.pencil=ee;var te=o(395);t.plus=te;var oe=o(396);t.print=oe;var re=o(397);t.redo=re;var ne=o(398);t.resize=ne;var ie=o(399);t.resizer=ie;var ae=o(400);t.right=ae;var se=o(401);t.save=se;var le=o(402);t.search=le;var ce=o(403);t.settings=ce;var ue=o(404);t.select_all=ue;var de=o(405);t.shrink=de;var pe=o(406);t.source=pe;var fe=o(407);t.splitg=fe;var he=o(408);t.splitv=he;var me=o(409);t.strikethrough=me;var ve=o(410);t.subscript=ve;var ge=o(411);t.superscript=ge;var ye=o(412);t.table=ye;var be=o(413);t.th=be;var _e=o(414);t.th_list=_e;var we=o(415);t.ul=we;var Se=o(416);t.underline=Se;var Ce=o(417);t.undo=Ce;var ke=o(418);t.unlink=ke;var je=o(419);t.unlock=je;var Ee=o(420);t.update=Ee;var Ie=o(421);t.upload=Ie;var xe=o(422);t.valign=xe;var Te=o(423);t.video=Te},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '}],t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={exports:{}};return e[r].call(n.exports,n,n.exports,o),n.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.Jodit=void 0,o(1),"undefined"!=typeof window&&o(2);var t=o(6),n=o(213),i=o(99),a=o(9),s=o(10),l=o(233),c=o(342);Object.keys(a).forEach((function(e){t.Jodit[e]=a[e]}));var u=function(e){return"__esModule"!==e};Object.keys(c).filter(u).forEach((function(e){s.Icon.set(e.replace("_","-"),c[e])})),Object.keys(s).filter(u).forEach((function(e){t.Jodit.modules[e]=s[e]})),Object.keys(i).filter(u).forEach((function(e){t.Jodit.decorators[e]=i[e]})),["Confirm","Alert","Prompt"].forEach((function(e){t.Jodit[e]=s[e]})),Object.keys(l).filter(u).forEach((function(e){t.Jodit.plugins.add(e,l[e])})),Object.keys(n.default).filter(u).forEach((function(e){t.Jodit.lang[e]=n.default[e]})),e.Jodit=t.Jodit})(),r})()})); \ No newline at end of file +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,(function(){return(()=>{var e=[,(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(3),o(4),Array.from||(Array.from=function(e){if(e instanceof Set){var t=[];return e.forEach((function(e){return t.push(e)})),t}return[].slice.call(e)}),Array.prototype.includes||(Array.prototype.includes=function(e){return this.indexOf(e)>-1}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(e),r=1;arguments.length>r;r++){var n=arguments[r];if(null!=n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=n[i])}return o},writable:!0,configurable:!0}),Array.prototype.find||(Array.prototype.find=function(e){return this.indexOf(e)>-1?e:void 0})},()=>{"use strict";"document"in window.self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(e){if("Element"in e){var t="classList",o=e.Element.prototype,r=Object,n=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},i=Array.prototype.indexOf||function(e){for(var t=0,o=this.length;o>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},s=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return i.call(e,t)},l=function(e){for(var t=n.call(e.getAttribute("class")||""),o=t?t.split(/\s+/):[],r=0,i=o.length;i>r;r++)this.push(o[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=l.prototype=[],u=function(){return new l(this)};if(a.prototype=Error.prototype,c.item=function(e){return this[e]||null},c.contains=function(e){return-1!==s(this,e+="")},c.add=function(){var e,t=arguments,o=0,r=t.length,n=!1;do{-1===s(this,e=t[o]+"")&&(this.push(e),n=!0)}while(++oo;o++)t.call(this,e=arguments[o])}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:o.call(this,e)}}e=null}())},(e,t,o)=>{"use strict";e.exports=o(5).polyfill()},function(e,t,o){"use strict";e.exports=function(){function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,n=void 0,i=void 0,a=function(e,t){f[r]=e,f[r+1]=t,2===(r+=2)&&(i?i(h):b())},s="undefined"!=typeof window?window:void 0,l=s||{},c=l.MutationObserver||l.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(h,1)}}var f=new Array(1e3);function h(){for(var e=0;r>e;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;r=0}var m,v,g,y,b=void 0;function _(e,t){var o=this,r=new this.constructor(C);void 0===r[S]&&M(r);var n=o._state;if(n){var i=arguments[n-1];a((function(){return z(n,r,i,o._result)}))}else P(o,r,e,t);return r}function w(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(C);return E(t,e),t}b=u?function(){return process.nextTick(h)}:c?(v=0,g=new c(h),y=document.createTextNode(""),g.observe(y,{characterData:!0}),function(){y.data=v=++v%2}):d?((m=new MessageChannel).port1.onmessage=h,function(){return m.port2.postMessage(0)}):void 0===s?function(){try{var e=Function("return this")().require("vertx");return void 0!==(n=e.runOnLoop||e.runOnContext)?function(){n(h)}:p()}catch(e){return p()}}():p();var S=Math.random().toString(36).substring(2);function C(){}var k=void 0;function j(t,o,r){o.constructor===t.constructor&&r===_&&o.constructor.resolve===w?function(e,t){1===t._state?x(e,t._result):2===t._state?T(e,t._result):P(t,void 0,(function(t){return E(e,t)}),(function(t){return T(e,t)}))}(t,o):void 0===r?x(t,o):e(r)?function(e,t,o){a((function(e){var r=!1,n=function(o,n,i,a){try{o.call(n,(function(o){r||(r=!0,t!==o?E(e,o):x(e,o))}),(function(t){r||(r=!0,T(e,t))}))}catch(e){return e}}(o,t);!r&&n&&(r=!0,T(e,n))}),e)}(t,o,r):x(t,o)}function E(e,t){if(e===t)T(e,new TypeError("You cannot resolve a promise with itself"));else if(n=typeof(r=t),null===r||"object"!==n&&"function"!==n)x(e,t);else{var o=void 0;try{o=t.then}catch(t){return void T(e,t)}j(e,t,o)}var r,n}function I(e){e._onerror&&e._onerror(e._result),D(e)}function x(e,t){e._state===k&&(e._result=t,e._state=1,0!==e._subscribers.length&&a(D,e))}function T(e,t){e._state===k&&(e._state=2,e._result=t,a(I,e))}function P(e,t,o,r){var n=e._subscribers,i=n.length;e._onerror=null,n[i]=t,n[i+1]=o,n[i+2]=r,0===i&&e._state&&a(D,e)}function D(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var r=void 0,n=void 0,i=e._result,a=0;t.length>a;a+=3)n=t[a+o],(r=t[a])?z(o,r,n,i):n(i);e._subscribers.length=0}}function z(t,o,r,n){var i=e(r),a=void 0,s=void 0,l=!0;if(i){try{a=r(n)}catch(e){l=!1,s=e}if(o===a)return void T(o,new TypeError("A promises callback cannot return that same promise."))}else a=n;o._state!==k||(i&&l?E(o,a):!1===l?T(o,s):1===t?x(o,a):2===t&&T(o,a))}var A=0;function M(e){e[S]=A++,e._state=void 0,e._result=void 0,e._subscribers=[]}var L=function(){function e(e,o){this._instanceConstructor=e,this.promise=new e(C),this.promise[S]||M(this.promise),t(o)?(this.length=o.length,this._remaining=o.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(o),0===this._remaining&&x(this.promise,this._result))):T(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===k&&e.length>t;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var o=this._instanceConstructor,r=o.resolve;if(r===w){var n=void 0,i=void 0,a=!1;try{n=e.then}catch(e){a=!0,i=e}if(n===_&&e._state!==k)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(o===O){var s=new o(C);a?T(s,i):j(s,e,n),this._willSettleAt(s,t)}else this._willSettleAt(new o((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,o){var r=this.promise;r._state===k&&(this._remaining--,2===e?T(r,o):this._result[t]=o),0===this._remaining&&x(r,this._result)},e.prototype._willSettleAt=function(e,t){var o=this;P(e,void 0,(function(e){return o._settledAt(1,t,e)}),(function(e){return o._settledAt(2,t,e)}))},e}(),O=function(){function t(e){this[S]=A++,this._result=this._state=void 0,this._subscribers=[],C!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){E(e,t)}),(function(t){T(e,t)}))}catch(t){T(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var o=this,r=o.constructor;return e(t)?o.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):o.then(t,t)},t}();return O.prototype.then=_,O.all=function(e){return new L(this,e).promise},O.race=function(e){var o=this;return t(e)?new o((function(t,r){for(var n=e.length,i=0;n>i;i++)o.resolve(e[i]).then(t,r)})):new o((function(e,t){return t(new TypeError("You must pass an array to race."))}))},O.resolve=w,O.reject=function(e){var t=new this(C);return T(t,e),t},O._setScheduler=function(e){i=e},O._setAsap=function(e){a=e},O._asap=a,O.polyfill=function(){var e=void 0;if(void 0!==o.g)e=o.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=O},O.Promise=O,O}()},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jodit=void 0;var r=o(7),n=o(8),i=o(9),a=o(10),s=o(19),l=o(168),c=o(165),u=o(30),d=o(99),Jodit=function(e){function Jodit(t,o){var r=e.call(this,o,!0)||this;r.isJodit=!0,r.__defaultStyleDisplayKey="data-jodit-default-style-display",r.__defaultClassesKey="data-jodit-default-classes",r.commands={},r.__selectionLocked=null,r.__wasReadOnly=!1,r.createInside=new a.Create((function(){return r.ed}),r.o.createAttributes),r.editorIsActive=!1,r.__mode=i.MODE_WYSIWYG,r.__callChangeCount=0,r.elementToPlace=new Map;try{s.resolveElement(t,r.o.shadowRoot||r.od)}catch(e){throw r.destruct(),e}r.setStatus(a.STATUSES.beforeInit),r.id=s.attr(s.resolveElement(t,r.o.shadowRoot||r.od),"id")||(new Date).getTime().toString(),u.instances[r.id]=r,r.storage=l.Storage.makeStorage(!0,r.id),r.attachEvents(r.o),r.e.on(r.ow,"resize",(function(){r.e&&r.e.fire("resize")})),r.e.on("prepareWYSIWYGEditor",r.prepareWYSIWYGEditor),r.selection=new a.Select(r);var n=r.beforeInitHook();return s.callPromise(n,(function(){r.e.fire("beforeInit",r);var e=u.pluginSystem.init(r);s.callPromise(e,(function(){r.e.fire("afterPluginSystemInit",r),r.e.on("changePlace",(function(){r.setReadOnly(r.o.readonly),r.setDisabled(r.o.disabled)})),r.places.length=0;var e=r.addPlace(t,o);u.instances[r.id]=r,s.callPromise(e,(function(){r.e&&r.e.fire("afterInit",r),r.afterInitHook(),r.setStatus(a.STATUSES.ready),r.e.fire("afterConstructor",r)}))}))})),r}return r.__extends(Jodit,e),Jodit.prototype.className=function(){return"Jodit"},Object.defineProperty(Jodit.prototype,"text",{get:function(){if(this.editor)return this.editor.innerText||"";var e=this.createInside.div();return e.innerHTML=this.getElementValue(),e.innerText||""},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"value",{get:function(){return this.getEditorValue()},set:function(e){this.setEditorValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"defaultTimeout",{get:function(){return this.options&&this.o.observer?this.o.observer.timeout:n.Config.defaultOptions.observer.timeout},enumerable:!1,configurable:!0}),Jodit.atom=function(e){return s.markAsAtomic(e)},Jodit.make=function(e,t){return new Jodit(e,t)},Object.defineProperty(Jodit,"defaultOptions",{get:function(){return n.Config.defaultOptions},enumerable:!1,configurable:!0}),Jodit.prototype.setPlaceField=function(e,t){this.currentPlace||(this.currentPlace={},this.places=[this.currentPlace]),this.currentPlace[e]=t},Object.defineProperty(Jodit.prototype,"element",{get:function(){return this.currentPlace.element},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"editor",{get:function(){return this.currentPlace.editor},set:function(e){this.setPlaceField("editor",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"container",{get:function(){return this.currentPlace.container},set:function(e){this.setPlaceField("container",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"workplace",{get:function(){return this.currentPlace.workplace},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"statusbar",{get:function(){return this.currentPlace.statusbar},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"iframe",{get:function(){return this.currentPlace.iframe},set:function(e){this.setPlaceField("iframe",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"observer",{get:function(){return this.currentPlace.observer},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"editorWindow",{get:function(){return this.currentPlace.editorWindow},set:function(e){this.setPlaceField("editorWindow",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"ew",{get:function(){return this.editorWindow},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"editorDocument",{get:function(){return this.currentPlace.editorWindow.document},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"ed",{get:function(){return this.editorDocument},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"options",{get:function(){return this.currentPlace.options},set:function(e){this.setPlaceField("options",e)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"s",{get:function(){return this.selection},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"uploader",{get:function(){return this.getInstance("Uploader",this.o.uploader)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"filebrowser",{get:function(){var e=this,t=s.ConfigProto({defaultTimeout:e.defaultTimeout,uploader:e.o.uploader,language:e.o.language,license:e.o.license,theme:e.o.theme,defaultCallback:function(t){t.files&&t.files.length&&t.files.forEach((function(o,r){var n=t.baseurl+o;t.isImages&&t.isImages[r]?e.s.insertImage(n,null,e.o.imageDefaultWidth):e.s.insertNode(e.createInside.fromHTML(""+n+""))}))}},this.o.filebrowser);return e.getInstance("FileBrowser",t)},enumerable:!1,configurable:!0}),Object.defineProperty(Jodit.prototype,"mode",{get:function(){return this.__mode},set:function(e){this.setMode(e)},enumerable:!1,configurable:!0}),Jodit.prototype.getNativeEditorValue=function(){var e=this.e.fire("beforeGetNativeEditorValue");return s.isString(e)?e:this.editor?this.editor.innerHTML:this.getElementValue()},Jodit.prototype.setNativeEditorValue=function(e){this.e.fire("beforeSetNativeEditorValue",e)||this.editor&&(this.editor.innerHTML=e)},Jodit.prototype.getEditorValue=function(e){var t;if(void 0===e&&(e=!0),void 0!==(t=this.e.fire("beforeGetValueFromEditor")))return t;t=this.getNativeEditorValue().replace(i.INVISIBLE_SPACE_REG_EXP(),""),e&&(t=t.replace(/]+id="jodit-selection_marker_[^>]+><\/span>/g,"")),"
"===t&&(t="");var o={value:t};return this.e.fire("afterGetValueFromEditor",o),o.value},Jodit.prototype.setEditorValue=function(e){var t=this.e.fire("beforeSetValueToEditor",e);if(!1!==t)if(s.isString(t)&&(e=t),this.editor){if(!s.isString(e)&&!s.isVoid(e))throw s.error("value must be string");void 0!==e&&this.getNativeEditorValue()!==e&&this.setNativeEditorValue(e),this.e.fire("postProcessSetEditorValue");var o=this.getElementValue(),r=this.getEditorValue();if(o!==r&&i.SAFE_COUNT_CHANGE_CALL>this.__callChangeCount){this.setElementValue(r),this.__callChangeCount+=1;try{this.observer.upTick(),this.e.fire("change",r,o),this.e.fire(this.observer,"change",r,o)}finally{this.__callChangeCount=0}}}else void 0!==e&&this.setElementValue(e)},Jodit.prototype.getElementValue=function(){return void 0!==this.element.value?this.element.value:this.element.innerHTML},Jodit.prototype.setElementValue=function(e){if(!s.isString(e)&&void 0!==e)throw s.error("value must be string");void 0!==e?this.element!==this.container&&(void 0!==this.element.value?this.element.value=e:this.element.innerHTML=e):e=this.getElementValue(),e!==this.getEditorValue()&&this.setEditorValue(e)},Jodit.prototype.registerCommand=function(e,t,o){var r=e.toLowerCase();if(void 0===this.commands[r]&&(this.commands[r]=[]),this.commands[r].push(t),!s.isFunction(t)){var n=this.o.commandToHotkeys[r]||this.o.commandToHotkeys[e]||t.hotkeys;n&&this.registerHotkeyToCommand(n,r,null==o?void 0:o.stopPropagation)}return this},Jodit.prototype.registerHotkeyToCommand=function(e,t,o){var r=this;void 0===o&&(o=!0);var n=s.asArray(e).map(s.normalizeKeyAliases).map((function(e){return e+".hotkey"})).join(" ");this.e.off(n).on(n,(function(e,n){return n.shouldStop=null==o||o,r.execCommand(t)}))},Jodit.prototype.execCommand=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=null),!this.o.readonly||"selectall"===e){var r;if(e=e.toLowerCase(),!1!==(r=this.e.fire("beforeCommand",e,t,o))&&(r=this.execCustomCommands(e,t,o)),!1!==r)if(this.s.focus(),"selectall"===e)this.s.select(this.editor,!0);else try{r=this.ed.execCommand(e,t,o)}catch(e){}return this.e.fire("afterCommand",e,t,o),this.setEditorValue(),r}},Jodit.prototype.execCustomCommands=function(e,t,o){var r,n;if(void 0===t&&(t=!1),void 0===o&&(o=null),e=e.toLowerCase(),void 0!==this.commands[e]){for(var i,a=0;this.commands[e].length>a;a+=1)void 0!==(n=(s.isFunction(r=this.commands[e][a])?r:r.exec).call(this,e,t,o))&&(i=n);return i}},Jodit.prototype.lock=function(t){return void 0===t&&(t="any"),!!e.prototype.lock.call(this,t)&&(this.__selectionLocked=this.s.save(),this.s.clear(),this.editor.classList.add("jodit_disabled"),this.e.fire("lock",!0),!0)},Jodit.prototype.unlock=function(){return!!e.prototype.unlock.call(this)&&(this.editor.classList.remove("jodit_disabled"),this.__selectionLocked&&this.s.restore(this.__selectionLocked),this.e.fire("lock",!1),!0)},Jodit.prototype.getMode=function(){return this.mode},Jodit.prototype.isEditorMode=function(){return this.getRealMode()===i.MODE_WYSIWYG},Jodit.prototype.getRealMode=function(){if(this.getMode()!==i.MODE_SPLIT)return this.getMode();var e=this.od.activeElement;return e&&(e===this.iframe||a.Dom.isOrContains(this.editor,e)||a.Dom.isOrContains(this.toolbar.container,e))?i.MODE_WYSIWYG:i.MODE_SOURCE},Jodit.prototype.setMode=function(e){var t=this,o=this.getMode(),r={mode:parseInt(e.toString(),10)},n=["jodit-wysiwyg_mode","jodit-source__mode","jodit_split_mode"];!1!==this.e.fire("beforeSetMode",r)&&(this.__mode=[i.MODE_SOURCE,i.MODE_WYSIWYG,i.MODE_SPLIT].includes(r.mode)?r.mode:i.MODE_WYSIWYG,this.o.saveModeInStorage&&this.storage.set("jodit_default_mode",this.mode),n.forEach((function(e){t.container.classList.remove(e)})),this.container.classList.add(n[this.mode-1]),o!==this.getMode()&&this.e.fire("afterSetMode"))},Jodit.prototype.toggleMode=function(){var e=this.getMode();[i.MODE_SOURCE,i.MODE_WYSIWYG,this.o.useSplitMode?i.MODE_SPLIT:9].includes(e+1)?e+=1:e=i.MODE_WYSIWYG,this.setMode(e)},Jodit.prototype.setDisabled=function(e){this.o.disabled=e;var t=this.__wasReadOnly;this.setReadOnly(e||t),this.__wasReadOnly=t,this.editor&&(this.editor.setAttribute("aria-disabled",e.toString()),this.container.classList.toggle("jodit_disabled",e),this.e.fire("disabled",e))},Jodit.prototype.getDisabled=function(){return this.o.disabled},Jodit.prototype.setReadOnly=function(e){this.__wasReadOnly!==e&&(this.__wasReadOnly=e,this.o.readonly=e,e?this.editor&&this.editor.removeAttribute("contenteditable"):this.editor&&this.editor.setAttribute("contenteditable","true"),this.e&&this.e.fire("readonly",e))},Jodit.prototype.getReadOnly=function(){return this.o.readonly},Jodit.prototype.beforeInitHook=function(){},Jodit.prototype.afterInitHook=function(){},Jodit.prototype.initOptions=function(e){this.options=s.ConfigProto(e||{},n.Config.defaultOptions)},Jodit.prototype.initOwners=function(){this.editorWindow=this.o.ownerWindow,this.ownerWindow=this.o.ownerWindow},Jodit.prototype.addPlace=function(e,t){var o=this,r=s.resolveElement(e,this.o.shadowRoot||this.od);this.attachEvents(t),r.attributes&&s.toArray(r.attributes).forEach((function(e){var r=e.name,i=e.value;void 0===n.Config.defaultOptions[r]||t&&void 0!==t[r]||(-1!==["readonly","disabled"].indexOf(r)&&(i=""===i||"true"===i),/^[0-9]+(\.)?([0-9]+)?$/.test(i.toString())&&(i=Number(i)),o.options[r]=i)}));var i=this.c.div("jodit-container");i.classList.add("jodit"),i.classList.add("jodit-container"),i.classList.add("jodit_theme_"+(this.o.theme||"default")),i.setAttribute("contenteditable","false");var l=null;this.o.inline&&(-1===["TEXTAREA","INPUT"].indexOf(r.nodeName)&&(i=r,r.setAttribute(this.__defaultClassesKey,r.className.toString()),l=i.innerHTML,i.innerHTML=""),i.classList.add("jodit_inline"),i.classList.add("jodit-container")),r!==i&&(r.style.display&&r.setAttribute(this.__defaultStyleDisplayKey,r.style.display),r.style.display="none");var c=this.c.div("jodit-workplace",{contenteditable:!1});i.appendChild(c);var u=new a.StatusBar(this,i);r.parentNode&&r!==i&&r.parentNode.insertBefore(i,r);var d=this.c.div("jodit-wysiwyg",{contenteditable:!0,"aria-disabled":!1,tabindex:this.o.tabIndex});c.appendChild(d);var p={editor:d,element:r,container:i,workplace:c,statusbar:u,options:this.isReady?s.ConfigProto(t||{},n.Config.defaultOptions):this.options,observer:new a.Observer(this),editorWindow:this.ow};this.elementToPlace.set(d,p),this.setCurrentPlace(p),this.places.push(p),this.setNativeEditorValue(this.getElementValue());var f=this.initEditor(l),h=this.options;return s.callPromise(f,(function(){h.enableDragAndDropFileToEditor&&h.uploader&&(h.uploader.url||h.uploader.insertImageAsBase64URI)&&o.uploader.bind(o.editor),o.elementToPlace.get(o.editor)||o.elementToPlace.set(o.editor,p),o.e.fire("afterAddPlace",p)}))},Jodit.prototype.addDisclaimer=function(e){this.workplace.appendChild(e)},Jodit.prototype.setCurrentPlace=function(e){this.currentPlace!==e&&(this.isEditorMode()||this.setMode(i.MODE_WYSIWYG),this.currentPlace=e,this.buildToolbar(),this.isReady&&this.e.fire("changePlace",e))},Jodit.prototype.initEditor=function(e){var t=this,o=this.createEditor();return s.callPromise(o,(function(){if(!t.isInDestruct){t.element!==t.container?t.setElementValue():null!=e&&t.setEditorValue(e);var o=t.o.defaultMode;if(t.o.saveModeInStorage){var r=t.storage.get("jodit_default_mode");"string"==typeof r&&(o=parseInt(r,10))}t.setMode(o),t.o.readonly&&(t.__wasReadOnly=!1,t.setReadOnly(!0)),t.o.disabled&&t.setDisabled(!0);try{t.ed.execCommand("defaultParagraphSeparator",!1,t.o.enter.toLowerCase())}catch(e){}try{t.ed.execCommand("enableObjectResizing",!1,"false")}catch(e){}try{t.ed.execCommand("enableInlineTableEditing",!1,"false")}catch(e){}}}))},Jodit.prototype.createEditor=function(){var e=this,t=this.editor,o=this.e.fire("createEditor",this);return s.callPromise(o,(function(){if(!e.isInDestruct){if((!1===o||s.isPromise(o))&&a.Dom.safeRemove(t),e.o.editorCssClass&&e.editor.classList.add(e.o.editorCssClass),e.o.style&&s.css(e.editor,e.o.style),e.e.on("synchro",(function(){e.setEditorValue()})).on("focus",(function(){e.editorIsActive=!0})).on("blur",(function(){return e.editorIsActive=!1})),e.prepareWYSIWYGEditor(),e.o.direction){var r="rtl"===e.o.direction.toLowerCase()?"rtl":"ltr";e.container.style.direction=r,e.container.setAttribute("dir",r),e.toolbar.setDirection(r)}e.o.triggerChangeEvent&&e.e.on("change",e.async.debounce((function(){e.e&&e.e.fire(e.element,"change")}),e.defaultTimeout))}}))},Jodit.prototype.attachEvents=function(e){var t=this,o=null==e?void 0:e.events;o&&Object.keys(o).forEach((function(e){return t.e.on(e,o[e])}))},Jodit.prototype.prepareWYSIWYGEditor=function(){var e=this,t=this.editor;if(this.o.spellcheck&&this.editor.setAttribute("spellcheck","true"),this.o.direction){var o="rtl"===this.o.direction.toLowerCase()?"rtl":"ltr";this.editor.style.direction=o,this.editor.setAttribute("dir",o)}this.e.on(t,"mousedown touchstart focus",(function(){var o=e.elementToPlace.get(t);o&&e.setCurrentPlace(o)})).on(t,"compositionend",(function(){e.setEditorValue()})).on(t,"selectionchange selectionstart keydown keyup keypress dblclick mousedown mouseup click copy cut dragstart drop dragover paste resize touchstart touchend focus blur",(function(t){if(!e.o.readonly&&!(t instanceof e.ew.KeyboardEvent&&t.isComposing)&&e.e&&e.e.fire){if(!1===e.e.fire(t.type,t))return!1;e.setEditorValue()}}))},Jodit.prototype.destruct=function(){var t=this;if(!this.isInDestruct&&(this.setStatus(a.STATUSES.beforeDestruct),this.elementToPlace.clear(),this.editor)){var o=this.getEditorValue();this.storage.clear(),this.buffer.clear(),this.commands={},this.__selectionLocked=null,this.e.off(this.ow,"resize"),this.e.off(this.ow),this.e.off(this.od),this.e.off(this.od.body),this.places.forEach((function(e){var r=e.container,n=e.workplace,i=e.statusbar,l=e.element,c=e.iframe,u=e.editor,d=e.observer;if(l!==r)if(l.hasAttribute(t.__defaultStyleDisplayKey)){var p=s.attr(l,t.__defaultStyleDisplayKey);p&&(l.style.display=p,l.removeAttribute(t.__defaultStyleDisplayKey))}else l.style.display="";else l.hasAttribute(t.__defaultClassesKey)&&(l.className=s.attr(l,t.__defaultClassesKey)||"",l.removeAttribute(t.__defaultClassesKey));l.hasAttribute("style")&&!s.attr(l,"style")&&l.removeAttribute("style"),!i.isInDestruct&&i.destruct(),t.e.off(r),t.e.off(l),t.e.off(u),a.Dom.safeRemove(n),a.Dom.safeRemove(u),r!==l&&a.Dom.safeRemove(r),a.Dom.safeRemove(c),r===l&&(l.innerHTML=o),!d.isInDestruct&&d.destruct()})),this.places.length=0,this.currentPlace={},delete u.instances[this.id],e.prototype.destruct.call(this)}},Jodit.fatMode=!1,Jodit.plugins=u.pluginSystem,Jodit.modules=u.modules,Jodit.ns=u.modules,Jodit.decorators={},Jodit.instances=u.instances,Jodit.lang=u.lang,Jodit.core={Plugin:a.Plugin},r.__decorate([d.cache],Jodit.prototype,"uploader",null),r.__decorate([d.cache],Jodit.prototype,"filebrowser",null),r.__decorate([d.autobind],Jodit.prototype,"prepareWYSIWYGEditor",null),Jodit}(c.ViewWithToolbar);t.Jodit=Jodit},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__classPrivateFieldSet=t.__classPrivateFieldGet=t.__importDefault=t.__importStar=t.__makeTemplateObject=t.__asyncValues=t.__asyncDelegator=t.__asyncGenerator=t.__await=t.__spreadArray=t.__spreadArrays=t.__spread=t.__read=t.__values=t.__exportStar=t.__createBinding=t.__generator=t.__awaiter=t.__metadata=t.__param=t.__decorate=t.__rest=t.__assign=t.__extends=void 0;var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a}function i(e){return this instanceof i?(this.v=e,this):new i(e)}t.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;r>o;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.__assign.apply(this,arguments)},t.__rest=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);r.length>n;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o},t.__decorate=function(e,t,o,r){var n,i=arguments.length,a=3>i?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(3>i?n(a):i>3?n(t,o,a):n(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},t.__param=function(e,t){return function(o,r){t(o,r,e)}},t.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.__awaiter=function(e,t,o,r){return new(o||(o=Promise))((function(n,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},t.__generator=function(e,t){var o,r,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&n[3]>i[1])){a.label=i[1];break}if(6===i[0]&&n[1]>a.label){a.label=n[1],n=i;break}if(n&&n[2]>a.label){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{o=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},t.__createBinding=Object.create?function(e,t,o,r){void 0===r&&(r=o),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]},t.__exportStar=function(e,o){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(o,r)||t.__createBinding(o,e,r)},t.__values=r,t.__read=n,t.__spread=function(){for(var e=[],t=0;arguments.length>t;t++)e=e.concat(n(arguments[t]));return e},t.__spreadArrays=function(){for(var e=0,t=0,o=arguments.length;o>t;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;o>t;t++)for(var i=arguments[t],a=0,s=i.length;s>a;a++,n++)r[n]=i[a];return r},t.__spreadArray=function(e,t){for(var o=0,r=t.length,n=e.length;r>o;o++,n++)e[n]=t[o];return e},t.__await=i,t.__asyncGenerator=function(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,n=o.apply(e,t||[]),a=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){n[e]&&(r[e]=function(t){return new Promise((function(o,r){a.push([e,t,o,r])>1||l(e,t)}))})}function l(e,t){try{(o=n[e](t)).value instanceof i?Promise.resolve(o.value.v).then(c,u):d(a[0][2],o)}catch(e){d(a[0][3],e)}var o}function c(e){l("next",e)}function u(e){l("throw",e)}function d(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}},t.__asyncDelegator=function(e){var t,o;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(o=!o)?{value:i(e[r](t)),done:"return"===r}:n?n(t):t}:n}},t.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,o=e[Symbol.asyncIterator];return o?o.call(e):(e=r(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(o){t[o]=e[o]&&function(t){return new Promise((function(r,n){!function(e,t,o,r){Promise.resolve(r).then((function(t){e({value:t,done:o})}),t)}(r,n,(t=e[o](t)).done,t.value)}))}}},t.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var a=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};t.__importStar=function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t.__createBinding(o,e,r);return a(o,e),o},t.__importDefault=function(e){return e&&e.__esModule?e:{default:e}},t.__classPrivateFieldGet=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},t.__classPrivateFieldSet=function(e,t,o){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,o),o}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;var r=o(9),n=function(){function e(){this.namespace="",this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window:null,this.shadowRoot=null,this.zIndex=0,this.readonly=!1,this.disabled=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots","selectall"],this.toolbarButtonSize="middle",this.allowTabNavigation=!1,this.inline=!1,this.theme="default",this.saveModeInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n=!1,this.tabIndex=-1,this.toolbar=!0,this.statusbar=!0,this.showTooltip=!0,this.showTooltipDelay=1e3,this.useNativeTooltip=!1,this.enter=r.PARAGRAPH,this.enterBlock="br"!==this.enter?this.enter:r.PARAGRAPH,this.defaultMode=r.MODE_WYSIWYG,this.useSplitMode=!1,this.colors={greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]},this.colorPickerDefaultTab="background",this.imageDefaultWidth=300,this.removeButtons=[],this.disablePlugins=[],this.extraPlugins=[],this.extraButtons=[],this.extraIcons={},this.createAttributes={},this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=[{group:"source",buttons:[]},{group:"font-style",buttons:[]},{group:"script",buttons:[]},{group:"list",buttons:["ul","ol"]},{group:"indent",buttons:[]},{group:"font",buttons:[]},{group:"color",buttons:[]},{group:"media",buttons:[]},"\n",{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}],this.buttonsMD=["source","|","bold","italic","|","ul","ol","eraser","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","\n","undo","redo","|","hr","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","eraser","|","fontsize","brush","paragraph","|","image","table","\n","link","|","align","|","undo","redo","|","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","eraser","\n","align","|","undo","redo","|","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!0}return Object.defineProperty(e,"defaultOptions",{get:function(){return e.__defaultOptions||(e.__defaultOptions=new e),e.__defaultOptions},enumerable:!1,configurable:!0}),e}();t.Config=n,n.prototype.controls={}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BASE_PATH=t.KEY_ALIASES=t.IS_MAC=t.SAFE_COUNT_CHANGE_CALL=t.INSERT_ONLY_TEXT=t.INSERT_AS_TEXT=t.INSERT_CLEAR_HTML=t.INSERT_AS_HTML=t.EMULATE_DBLCLICK_TIMEOUT=t.MARKER_CLASS=t.TEXT_HTML=t.TEXT_PLAIN=t.IS_IE=t.MODE_SPLIT=t.MODE_SOURCE=t.MODE_WYSIWYG=t.PARAGRAPH=t.BR=t.COMMAND_KEYS=t.ACCURACY=t.NEARBY=t.KEY_F3=t.KEY_DELETE=t.KEY_SPACE=t.KEY_DOWN=t.KEY_RIGHT=t.KEY_UP=t.KEY_LEFT=t.KEY_ESC=t.KEY_ENTER=t.KEY_TAB=t.KEY_BACKSPACE=t.MAY_BE_REMOVED_WITH_KEY=t.INSEPARABLE_TAGS=t.IS_INLINE=t.IS_BLOCK=t.SPACE_REG_EXP_END=t.SPACE_REG_EXP_START=t.SPACE_REG_EXP=t.INVISIBLE_SPACE_REG_EXP_START=t.INVISIBLE_SPACE_REG_EXP_END=t.INVISIBLE_SPACE_REG_EXP=t.NBSP_SPACE=t.INVISIBLE_SPACE=void 0,t.INVISIBLE_SPACE="\ufeff",t.NBSP_SPACE=" ",t.INVISIBLE_SPACE_REG_EXP=function(){return/[\uFEFF]/g},t.INVISIBLE_SPACE_REG_EXP_END=function(){return/[\uFEFF]+$/g},t.INVISIBLE_SPACE_REG_EXP_START=function(){return/^[\uFEFF]+/g},t.SPACE_REG_EXP=function(){return/[\s\n\t\r\uFEFF\u200b]+/g},t.SPACE_REG_EXP_START=function(){return/^[\s\n\t\r\uFEFF\u200b]+/g},t.SPACE_REG_EXP_END=function(){return/[\s\n\t\r\uFEFF\u200b]+$/g},t.IS_BLOCK=/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i,t.IS_INLINE=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i,t.INSEPARABLE_TAGS=["img","br","video","iframe","script","input","textarea","hr","link","jodit","jodit-media"],t.MAY_BE_REMOVED_WITH_KEY=RegExp("^"+t.INSEPARABLE_TAGS.join("|")+"$","i"),t.KEY_BACKSPACE="Backspace",t.KEY_TAB="Tab",t.KEY_ENTER="Enter",t.KEY_ESC="Escape",t.KEY_LEFT="ArrowLeft",t.KEY_UP="ArrowUp",t.KEY_RIGHT="ArrowRight",t.KEY_DOWN="ArrowDown",t.KEY_SPACE="Space",t.KEY_DELETE="Delete",t.KEY_F3="F3",t.NEARBY=5,t.ACCURACY=10,t.COMMAND_KEYS=[t.KEY_BACKSPACE,t.KEY_DELETE,t.KEY_UP,t.KEY_DOWN,t.KEY_RIGHT,t.KEY_LEFT,t.KEY_ENTER,t.KEY_ESC,t.KEY_F3,t.KEY_TAB],t.BR="br",t.PARAGRAPH="p",t.MODE_WYSIWYG=1,t.MODE_SOURCE=2,t.MODE_SPLIT=3,t.IS_IE="undefined"!=typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),t.TEXT_PLAIN=t.IS_IE?"text":"text/plain",t.TEXT_HTML=t.IS_IE?"html":"text/html",t.MARKER_CLASS="jodit-selection_marker",t.EMULATE_DBLCLICK_TIMEOUT=300,t.INSERT_AS_HTML="insert_as_html",t.INSERT_CLEAR_HTML="insert_clear_html",t.INSERT_AS_TEXT="insert_as_text",t.INSERT_ONLY_TEXT="insert_only_text",t.SAFE_COUNT_CHANGE_CALL=10,t.IS_MAC="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t.KEY_ALIASES={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:t.IS_MAC?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},t.BASE_PATH=function(){if("undefined"==typeof document)return"";var e=document.currentScript,t=function(e){return e.replace(/\/[^/]+.js$/,"/")};if(e)return t(e.src);var o=document.querySelectorAll("script[src]");return o&&o.length?t(o[o.length-1].src):window.location.href}()},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PluginSystem=t.Uploader=t.ToolbarCollection=t.ToolbarEditorCollection=t.Table=t.StatusBar=t.Snapshot=t.Style=t.Select=t.Observer=t.ImageEditor=t.Helpers=t.FileBrowser=t.ViewWithToolbar=t.View=t.Icon=t.ProgressBar=t.UIBlock=t.UICheckbox=t.UITextArea=t.UIInput=t.UIForm=t.UIList=t.UIGroup=t.UISeparator=t.Popup=t.UIButton=t.UIElement=t.Create=t.Plugin=t.Dom=t.Dialog=t.Prompt=t.Confirm=t.Alert=t.ContextMenu=t.STATUSES=t.ViewComponent=t.Component=t.Ajax=t.Async=void 0;var r=o(7);r.__exportStar(o(11),t);var n=o(158);Object.defineProperty(t,"Async",{enumerable:!0,get:function(){return n.Async}});var i=o(159);Object.defineProperty(t,"Ajax",{enumerable:!0,get:function(){return i.Ajax}});var a=o(27);Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return a.Component}}),Object.defineProperty(t,"ViewComponent",{enumerable:!0,get:function(){return a.ViewComponent}}),Object.defineProperty(t,"STATUSES",{enumerable:!0,get:function(){return a.STATUSES}});var s=o(160);Object.defineProperty(t,"ContextMenu",{enumerable:!0,get:function(){return s.ContextMenu}});var l=o(162);Object.defineProperty(t,"Alert",{enumerable:!0,get:function(){return l.Alert}}),Object.defineProperty(t,"Confirm",{enumerable:!0,get:function(){return l.Confirm}}),Object.defineProperty(t,"Prompt",{enumerable:!0,get:function(){return l.Prompt}}),Object.defineProperty(t,"Dialog",{enumerable:!0,get:function(){return l.Dialog}});var c=o(32);Object.defineProperty(t,"Dom",{enumerable:!0,get:function(){return c.Dom}});var u=o(183);Object.defineProperty(t,"Plugin",{enumerable:!0,get:function(){return u.Plugin}});var d=o(184);Object.defineProperty(t,"Create",{enumerable:!0,get:function(){return d.Create}});var p=o(75);Object.defineProperty(t,"UIElement",{enumerable:!0,get:function(){return p.UIElement}}),Object.defineProperty(t,"UIButton",{enumerable:!0,get:function(){return p.UIButton}}),Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return p.Popup}}),Object.defineProperty(t,"UISeparator",{enumerable:!0,get:function(){return p.UISeparator}}),Object.defineProperty(t,"UIGroup",{enumerable:!0,get:function(){return p.UIGroup}}),Object.defineProperty(t,"UIList",{enumerable:!0,get:function(){return p.UIList}}),Object.defineProperty(t,"UIForm",{enumerable:!0,get:function(){return p.UIForm}}),Object.defineProperty(t,"UIInput",{enumerable:!0,get:function(){return p.UIInput}}),Object.defineProperty(t,"UITextArea",{enumerable:!0,get:function(){return p.UITextArea}}),Object.defineProperty(t,"UICheckbox",{enumerable:!0,get:function(){return p.UICheckbox}}),Object.defineProperty(t,"UIBlock",{enumerable:!0,get:function(){return p.UIBlock}}),Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return p.ProgressBar}}),Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return p.Icon}});var f=o(167);Object.defineProperty(t,"View",{enumerable:!0,get:function(){return f.View}});var h=o(165);Object.defineProperty(t,"ViewWithToolbar",{enumerable:!0,get:function(){return h.ViewWithToolbar}});var m=o(185);Object.defineProperty(t,"FileBrowser",{enumerable:!0,get:function(){return m.FileBrowser}});var v=o(19);t.Helpers=v;var g=o(195);Object.defineProperty(t,"ImageEditor",{enumerable:!0,get:function(){return g.ImageEditor}});var y=o(199);Object.defineProperty(t,"Observer",{enumerable:!0,get:function(){return y.Observer}});var b=o(203);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return b.Select}}),Object.defineProperty(t,"Style",{enumerable:!0,get:function(){return b.Style}});var _=o(200);Object.defineProperty(t,"Snapshot",{enumerable:!0,get:function(){return _.Snapshot}});var w=o(207);Object.defineProperty(t,"StatusBar",{enumerable:!0,get:function(){return w.StatusBar}});var S=o(209);Object.defineProperty(t,"Table",{enumerable:!0,get:function(){return S.Table}});var C=o(175);Object.defineProperty(t,"ToolbarEditorCollection",{enumerable:!0,get:function(){return C.ToolbarEditorCollection}});var k=o(173);Object.defineProperty(t,"ToolbarCollection",{enumerable:!0,get:function(){return k.ToolbarCollection}}),r.__exportStar(o(210),t);var j=o(211);Object.defineProperty(t,"Uploader",{enumerable:!0,get:function(){return j.Uploader}});var E=o(31);Object.defineProperty(t,"PluginSystem",{enumerable:!0,get:function(){return E.PluginSystem}})},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(12),t),r.__exportStar(o(18),t),r.__exportStar(o(13),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventsNative=void 0;var r=o(7),n=o(13),i=o(14),a=o(15),s=o(16),l=o(17),c=function(){function e(e){var t=this;this.__key="__JoditEventsNativeNamespaces",this.doc=document,this.prepareEvent=function(e){e.cancelBubble||(e.type.match(/^touch/)&&e.changedTouches&&e.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach((function(t){Object.defineProperty(e,t,{value:e.changedTouches[0][t],configurable:!0,enumerable:!0})})),e.originalEvent||(e.originalEvent=e),"paste"===e.type&&void 0===e.clipboardData&&t.doc.defaultView.clipboardData&&Object.defineProperty(e,"clipboardData",{get:function(){return t.doc.defaultView.clipboardData},configurable:!0,enumerable:!0}))},this.currents=[],this.__stopped=[],this.isDestructed=!1,e&&(this.doc=e),this.__key+=(new Date).getTime()}return e.prototype.eachEvent=function(e,t){var o=this;e.split(/[\s,]+/).forEach((function(e){var r=e.split(".");t.call(o,r[0],r[1]||n.defaultNameSpace)}))},e.prototype.getStore=function(e){if(!e)throw l.error("Need subject");if(void 0===e[this.__key]){var t=new n.EventHandlersStore;Object.defineProperty(e,this.__key,{enumerable:!1,configurable:!0,value:t})}return e[this.__key]},e.prototype.clearStore=function(e){void 0!==e[this.__key]&&delete e[this.__key]},e.prototype.triggerNativeEvent=function(e,t){var o=this.doc.createEvent("HTMLEvents");"string"==typeof t?o.initEvent(t,!0,!0):(o.initEvent(t.type,t.bubbles,t.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach((function(e){Object.defineProperty(o,e,{value:t[e],enumerable:!0})})),Object.defineProperty(o,"originalEvent",{value:t,enumerable:!0})),e.dispatchEvent(o)},Object.defineProperty(e.prototype,"current",{get:function(){return this.currents[this.currents.length-1]},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t,o,n){var c=this;void 0===n&&(n=!1);var u=i.isString(e)?this:e,d=i.isString(t)?t:e,p=o;void 0===p&&a.isFunction(t)&&(p=t);var f=this.getStore(u);if(!i.isString(d)||""===d)throw l.error("Need events names");if(!a.isFunction(p))throw l.error("Need event handler");if(s.isArray(u))return u.forEach((function(e){c.on(e,d,p,n)})),this;var h=a.isFunction(u.addEventListener),m=this,v=function(e){for(var t=[],o=1;arguments.length>o;o++)t[o-1]=arguments[o];return p&&p.call.apply(p,r.__spreadArray([this,e],t))};return h&&(v=function(e){if(m.prepareEvent(e),p&&!1===p.call(this,e))return e.preventDefault(),e.stopImmediatePropagation(),!1}),this.eachEvent(d,(function(e,t){if(""===e)throw l.error("Need event name");if(!1===f.indexOf(e,t,p)&&(f.set(e,t,{event:e,originalCallback:p,syntheticCallback:v},n),h)){var o=!!["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"].includes(e)&&{passive:!0};u.addEventListener(e,v,o)}})),this},e.prototype.one=function(e,t,o,r){var n=this;void 0===r&&(r=!1);var s=i.isString(e)?this:e,l=i.isString(t)?t:e,c=o;void 0===c&&a.isFunction(t)&&(c=t);var u=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];n.off(s,l,u),c.apply(void 0,e)};return this.on(s,l,u,r),this},e.prototype.off=function(e,t,o){var r=this,s=i.isString(e)?this:e,l=i.isString(t)?t:e,c=this.getStore(s),u=o;if(!i.isString(l)||!l)return c.namespaces().forEach((function(e){r.off(s,"."+e)})),this.clearStore(s),this;void 0===u&&a.isFunction(t)&&(u=t);var d=a.isFunction(s.removeEventListener),p=function(e){d&&s.removeEventListener(e.event,e.syntheticCallback,!1)},f=function(e,t){if(""!==e){var o=c.get(e,t);if(o&&o.length)if(a.isFunction(u)){var r=c.indexOf(e,t,u);!1!==r&&(p(o[r]),o.splice(r,1))}else o.forEach(p),o.length=0}else c.events(t).forEach((function(e){""!==e&&f(e,t)}))};return this.eachEvent(l,(function(e,t){t===n.defaultNameSpace?c.namespaces().forEach((function(t){f(e,t)})):f(e,t)})),this},e.prototype.stopPropagation=function(e,t){var o=this,r=i.isString(e)?this:e,a=i.isString(e)?e:t;if("string"!=typeof a)throw l.error("Need event names");var s=this.getStore(r);this.eachEvent(a,(function(e,t){var i=s.get(e,t);i&&o.__stopped.push(i),t===n.defaultNameSpace&&s.namespaces(!0).forEach((function(t){return o.stopPropagation(r,e+"."+t)}))}))},e.prototype.removeStop=function(e){if(e){var t=this.__stopped.indexOf(e);-1!==t&&this.__stopped.splice(0,t+1)}},e.prototype.isStopped=function(e){return void 0!==e&&-1!==this.__stopped.indexOf(e)},e.prototype.fire=function(e,t){for(var o,s,c=this,u=[],d=2;arguments.length>d;d++)u[d-2]=arguments[d];var p=i.isString(e)?this:e,f=i.isString(e)?e:t,h=i.isString(e)?r.__spreadArray([t],u):u,m=a.isFunction(p.dispatchEvent);if(!m&&!i.isString(f))throw l.error("Need events names");var v=this.getStore(p);return!i.isString(f)&&m?this.triggerNativeEvent(p,t):this.eachEvent(f,(function(e,t){if(m)c.triggerNativeEvent(p,e);else{var i=v.get(e,t);if(i)try{r.__spreadArray([],i).every((function(t){return!c.isStopped(i)&&(c.currents.push(e),s=t.syntheticCallback.apply(p,h),c.currents.pop(),void 0!==s&&(o=s),!0)}))}finally{c.removeStop(i)}t!==n.defaultNameSpace||m||v.namespaces().filter((function(e){return e!==t})).forEach((function(t){var n=c.fire.apply(c,r.__spreadArray([p,e+"."+t],h));void 0!==n&&(o=n)}))}})),o},e.prototype.destruct=function(){this.isDestructed&&(this.isDestructed=!0,this.off(this),this.getStore(this).clear(),delete this[this.__key])},e}();t.EventsNative=c},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandlersStore=t.defaultNameSpace=void 0,t.defaultNameSpace="JoditEventDefaultNamespace";var o=function(){function e(){this.__store={}}return e.prototype.get=function(e,t){if(void 0!==this.__store[t])return this.__store[t][e]},e.prototype.indexOf=function(e,t,o){var r=this.get(e,t);if(r)for(var n=0;r.length>n;n+=1)if(r[n].originalCallback===o)return n;return!1},e.prototype.namespaces=function(e){void 0===e&&(e=!1);var o=Object.keys(this.__store);return e?o.filter((function(e){return e!==t.defaultNameSpace})):o},e.prototype.events=function(e){return this.__store[e]?Object.keys(this.__store[e]):[]},e.prototype.set=function(e,t,o,r){void 0===r&&(r=!1),void 0===this.__store[t]&&(this.__store[t]={}),void 0===this.__store[t][e]&&(this.__store[t][e]=[]),r?this.__store[t][e].unshift(o):this.__store[t][e].push(o)},e.prototype.clear=function(){this.__store={}},e}();t.EventHandlersStore=o},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=void 0,t.isString=function(e){return"string"==typeof e}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=void 0,t.isArray=function(e){return Array.isArray(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.error=t.type=t.hasOwn=void 0;var o={},r=o.toString;t.hasOwn=o.hasOwnProperty,["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment","DOMStringList","HTMLCollection"].forEach((function(e){o["[object "+e+"]"]=e.toLowerCase()})),t.type=function(e){return null===e?"null":"object"==typeof e||"function"==typeof e?o[r.call(e)]||"object":typeof e},t.error=function(e){return new TypeError(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObserveObject=void 0;var r=o(7),n=o(19),i=o(99),a=function(){function e(t,o,i){var a=this;void 0===o&&(o=[]),void 0===i&&(i={}),this.__lockEvent={},this.__data=t,this.__prefix=o,this.__onEvents=i,Object.keys(t).forEach((function(o){var i=a.__prefix.concat(o).filter((function(e){return e.length}));Object.defineProperty(a,o,{set:function(s){var l,c=t[o];if(!n.isFastEqual(c,s)){a.fire(["beforeChange","beforeChange."+i.join(".")],o,s),n.isPlainObject(s)&&(s=new e(s,i,a.__onEvents)),t[o]=s;var u=[];a.fire(r.__spreadArray(["change"],i.reduce((function(e,t){return u.push(t),e.push("change."+u.join(".")),e}),[])),i.join("."),c,(null===(l=s)||void 0===l?void 0:l.valueOf)?s.valueOf():s)}},get:function(){return t[o]},enumerable:!0,configurable:!0}),n.isPlainObject(t[o])&&(t[o]=new e(t[o],i,a.__onEvents))}))}return e.prototype.valueOf=function(){return this.__data},e.prototype.toString=function(){return JSON.stringify(this.valueOf())},e.prototype.on=function(e,t){var o=this;return n.isArray(e)?(e.map((function(e){return o.on(e,t)})),this):(this.__onEvents[e]||(this.__onEvents[e]=[]),this.__onEvents[e].push(t),this)},e.prototype.fire=function(e){for(var t=this,o=[],i=1;arguments.length>i;i++)o[i-1]=arguments[i];if(n.isArray(e))e.map((function(e){return t.fire.apply(t,r.__spreadArray([e],o))}));else try{!this.__lockEvent[e]&&this.__onEvents[e]&&(this.__lockEvent[e]=!0,this.__onEvents[e].forEach((function(e){return e.call.apply(e,r.__spreadArray([t],o))})))}finally{this.__lockEvent[e]=!1}},e.create=function(t,o){return void 0===o&&(o=[]),t instanceof e?t:new e(t,o)},r.__decorate([i.nonenumerable],e.prototype,"__data",void 0),r.__decorate([i.nonenumerable],e.prototype,"__prefix",void 0),r.__decorate([i.nonenumerable],e.prototype,"__onEvents",void 0),r.__decorate([i.nonenumerable],e.prototype,"__lockEvent",void 0),e}();t.ObserveObject=a},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(20),t),r.__exportStar(o(55),t),r.__exportStar(o(59),t),r.__exportStar(o(61),t),r.__exportStar(o(34),t),r.__exportStar(o(62),t),r.__exportStar(o(64),t),r.__exportStar(o(65),t),r.__exportStar(o(82),t),r.__exportStar(o(142),t),r.__exportStar(o(68),t),r.__exportStar(o(147),t),r.__exportStar(o(149),t),r.__exportStar(o(150),t),r.__exportStar(o(81),t),r.__exportStar(o(152),t),r.__exportStar(o(26),t),r.__exportStar(o(74),t),r.__exportStar(o(153),t),r.__exportStar(o(148),t),r.__exportStar(o(154),t),r.__exportStar(o(151),t),r.__exportStar(o(155),t),r.__exportStar(o(156),t),r.__exportStar(o(67),t),r.__exportStar(o(17),t),r.__exportStar(o(157),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(21),t),r.__exportStar(o(22),t),r.__exportStar(o(24),t),r.__exportStar(o(52),t),r.__exportStar(o(53),t),r.__exportStar(o(54),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markDeprecated=t.cns=void 0;var r=o(7);t.cns=console,t.markDeprecated=function(e,o,n){return void 0===o&&(o=[""]),void 0===n&&(n=null),function(){for(var i=[],a=0;arguments.length>a;a++)i[a]=arguments[a];return t.cns.warn('Method "'+o[0]+'" deprecated.'+(o[1]?' Use "'+o[1]+'" instead':"")),e.call.apply(e,r.__spreadArray([n],i))}}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memorizeExec=t.keys=t.loadImage=t.reset=t.callPromise=t.markOwner=t.attr=t.call=void 0;var r=o(15),n=o(23),i=o(24),a=o(26),s=o(34);function l(e,t,o){if(!e||!r.isFunction(e.getAttribute))return null;if(/^-/.test(t)){var n=l(e,"data"+t);if(n)return n;t=t.substr(1)}if(void 0!==o){if(null!=o)return e.setAttribute(t,o.toString()),o.toString();e.hasAttribute(t)&&e.removeAttribute(t)}return e.getAttribute(t)}t.call=function(e){for(var t=[],o=1;arguments.length>o;o++)t[o-1]=arguments[o];return e.apply(void 0,t)},t.attr=l,t.markOwner=function(e,t){l(t,"data-editor_id",e.id),!t.component&&Object.defineProperty(t,"jodit",{value:e})},t.callPromise=function(e,t){return n.isPromise(e)?e.finally(t):t()};var c={};t.reset=function(e){var t,o;if(!(e in c)){var n=document.createElement("iframe");try{if(n.src="about:blank",document.body.appendChild(n),!n.contentWindow)return null;var a=i.get(e,n.contentWindow),s=i.get(e.split(".").slice(0,-1).join("."),n.contentWindow);r.isFunction(a)&&(c[e]=a.bind(s))}catch(e){}finally{null===(t=n.parentNode)||void 0===t||t.removeChild(n)}}return null!==(o=c[e])&&void 0!==o?o:null},t.loadImage=function(e,t){return t.async.promise((function(o,r){var n=new Image,i=function(){t.e.off(n),null==r||r()},a=function(){t.e.off(n),o(n)};t.e.one(n,"load",a).one(n,"error",i).one(n,"abort",i),n.src=e,n.complete&&a()}))},t.keys=function(e,t){if(void 0===t&&(t=!0),t)return Object.keys(e);var o=[];for(var r in e)o.push(r);return o},t.memorizeExec=function(e,t,o,r){var n=o.control,i="button"+n.command,l=n.args&&n.args[0]||a.dataBind(e,i);if(s.isVoid(l))return!1;a.dataBind(e,i,l),r&&(l=r(l)),e.execCommand(n.command,!1,l||void 0)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0,t.isPromise=function(e){return e&&"function"==typeof e.then}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=void 0;var r=o(14),n=o(25);t.get=function(e,t){if(!r.isString(e)||!e.length)return null;for(var o=t,i=0,a=e.split(".");a.length>i;i++){var s=a[i];if(n.isVoid(o[s]))return null;o=o[s]}return n.isVoid(o)?null:o}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVoid=void 0,t.isVoid=function(e){return null==e}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dataBind=void 0;var r=o(27),n=o(34),i=new WeakMap;t.dataBind=function(e,t,o){var a=i.get(e);if(!a){i.set(e,a={});var s=null;e instanceof r.ViewComponent&&(s=e.j.e),n.isViewObject(e)&&(s=e.e),s&&s.on("beforeDestruct",(function(){i.delete(e)}))}return void 0===o?a[t]:(a[t]=o,o)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(28),t),r.__exportStar(o(29),t),r.__exportStar(o(33),t)},(e,t)=>{"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.STATUSES=void 0,(o=t.STATUSES||(t.STATUSES={})).beforeInit="beforeInit",o.ready="ready",o.beforeDestruct="beforeDestruct",o.destructed="destructed"},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=o(19),n=o(30),i=o(28),a=new Map,s=function(){function e(){this.ownerWindow=window,this.__componentStatus=i.STATUSES.beforeInit,this.componentName="jodit-"+r.kebabCase(this.className()||r.getClassName(this)),this.uid="jodit-uid-"+n.uniqueUid()}return e.prototype.getFullElName=function(e,t,o){var n=[this.componentName];return e&&(e=e.replace(/[^a-z0-9-]/gi,"-"),n.push("__"+e)),t&&(n.push("_",t),n.push("_",r.isVoid(o)?"true":o.toString())),n.join("")},Object.defineProperty(e.prototype,"ownerDocument",{get:function(){return this.ow.document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"od",{get:function(){return this.ownerDocument},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ow",{get:function(){return this.ownerWindow},enumerable:!1,configurable:!0}),e.prototype.get=function(e,t){return r.get(e,t||this)},Object.defineProperty(e.prototype,"isReady",{get:function(){return this.componentStatus===i.STATUSES.ready},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDestructed",{get:function(){return this.componentStatus===i.STATUSES.destructed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInDestruct",{get:function(){return i.STATUSES.beforeDestruct===this.componentStatus||i.STATUSES.destructed===this.componentStatus},enumerable:!1,configurable:!0}),e.prototype.bindDestruct=function(e){var t=this,o=function(){!t.isInDestruct&&t.destruct()};return e.e&&e.e.on(i.STATUSES.beforeDestruct,o),this.hookStatus(i.STATUSES.beforeDestruct,(function(){e.e&&e.e.off(i.STATUSES.beforeDestruct,o)})),this},e.prototype.destruct=function(){this.setStatus(i.STATUSES.destructed),a.get(this)&&a.delete(this)},Object.defineProperty(e.prototype,"componentStatus",{get:function(){return this.__componentStatus},set:function(e){this.setStatus(e)},enumerable:!1,configurable:!0}),e.prototype.setStatus=function(e){return this.setStatusComponent(e,this)},e.prototype.setStatusComponent=function(e,t){if(e!==this.__componentStatus){var o=Object.getPrototypeOf(this);o&&r.isFunction(o.setStatusComponent)&&o.setStatusComponent(e,t);var n=a.get(this),i=null==n?void 0:n[e];i&&i.length&&i.forEach((function(e){return e(t)})),t===this&&(this.__componentStatus=e)}},e.prototype.hookStatus=function(e,t){var o=a.get(this);o||a.set(this,o={}),o[e]||(o[e]=[]),o[e].push(t)},e.STATUSES=i.STATUSES,e}();t.Component=s},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eventEmitter=t.getContainer=t.extendLang=t.lang=t.modules=t.pluginSystem=t.uniqueUid=t.instances=void 0;var r=o(31),n=o(32),i=o(19),a=o(11);t.instances={};var s=1;t.uniqueUid=function(){return s+=10*(Math.random()+1),Math.round(s).toString(16)},t.pluginSystem=new r.PluginSystem,t.modules={},t.lang={},t.extendLang=function(e){Object.keys(e).forEach((function(o){t.lang[o]?Object.assign(t.lang[o],e[o]):t.lang[o]=e[o]}))};var l=new WeakMap;t.getContainer=function(e,t,o,r){void 0===o&&(o="div"),void 0===r&&(r=!1);var a=i.getClassName(t.prototype),s=l.get(e)||{},c=a+o,u=i.isViewObject(e)?e:e.j;if(!s[c]){var d=u.c,p=e.od.body;r&&i.isJoditObject(e)&&e.od!==e.ed&&(d=e.createInside,p="style"===o?e.ed.head:e.ed.body);var f=d.element(o,{className:"jodit jodit-"+i.kebabCase(a)+"-container jodit-box"});f.classList.add("jodit_theme_"+(u.o.theme||"default")),p.appendChild(f),s[c]=f,e.hookStatus("beforeDestruct",(function(){n.Dom.safeRemove(f),delete s[c],Object.keys(s).length&&l.delete(e)})),l.set(e,s)}return s[c].classList.remove("jodit_theme_default","jodit_theme_dark"),s[c].classList.add("jodit_theme_"+(u.o.theme||"default")),s[c]},t.eventEmitter=new a.EventsNative},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PluginSystem=void 0;var r=o(7),n=o(19),i=function(){function e(){this.items=new Map}return e.prototype.normalizeName=function(e){return n.kebabCase(e).toLowerCase()},e.prototype.add=function(e,t){this.items.set(this.normalizeName(e),t)},e.prototype.get=function(e){return this.items.get(this.normalizeName(e))},e.prototype.remove=function(e){this.items.delete(this.normalizeName(e))},e.prototype.init=function(t){var o=this,r=t.o.extraPlugins.map((function(e){return n.isString(e)?{name:e}:e})),i=n.splitArray(t.o.disablePlugins).map((function(e){return o.normalizeName(e)})),a=[],s={},l=[],c={},u=function(r,u){var d;if(!(i.includes(u)||a.includes(u)||s[u])){var p=null===(d=r)||void 0===d?void 0:d.requires;if(!(p&&n.isArray(p)&&o.hasDisabledRequires(i,p))){var f=e.makePluginInstance(t,r);o.initOrWait(t,u,f,a,s),l.push(f),c[u]=f}}},d=this.loadExtras(t,r);return n.callPromise(d,(function(){t.isInDestruct||(o.items.forEach(u),o.addListenerOnBeforeDestruct(t,l),t.__plugins=c)}))},e.prototype.hasDisabledRequires=function(e,t){return Boolean((null==t?void 0:t.length)&&e.some((function(e){return t.includes(e)})))},e.makePluginInstance=function(e,t){return n.isFunction(t)?new t(e):t},e.prototype.initOrWait=function(t,o,r,i,a){var s=function(o,r){if(n.isInitable(r)){var s=r.requires;if((null==s?void 0:s.length)&&!s.every((function(e){return i.includes(e)})))return a[o]=r,!1;r.init(t),i.push(o)}else i.push(o);return r.hasStyle&&e.loadStyle(t,o),!0};s(o,r),Object.keys(a).forEach((function(e){var t=a[e];t&&s(e,t)&&(a[e]=void 0,delete a[e])}))},e.prototype.addListenerOnBeforeDestruct=function(e,t){e.e.on("beforeDestruct",(function(){t.forEach((function(t){n.isDestructable(t)&&t.destruct(e)})),t.length=0,delete e.__plugins}))},e.prototype.load=function(t,o){return Promise.all(o.map((function(o){var r=o.url||e.getFullUrl(t,o.name,!0);return n.appendScriptAsync(t,r).then((function(e){return{v:e,status:"fulfilled"}}),(function(e){return{e:e,status:"rejected"}}))})))},e.loadStyle=function(t,o){return r.__awaiter(this,void 0,Promise,(function(){var i;return r.__generator(this,(function(r){return i=e.getFullUrl(t,o,!1),this.styles.has(i)?[2]:(this.styles.add(i),[2,n.appendStyleAsync(t,i)])}))}))},e.getFullUrl=function(e,t,o){return t=n.kebabCase(t),e.basePath+"plugins/"+t+"/"+t+"."+(o?"js":"css")},e.prototype.loadExtras=function(e,t){var o=this;if(t&&t.length)try{var r=t.filter((function(e){return!o.items.has(o.normalizeName(e.name))}));if(r.length)return this.load(e,r)}catch(e){}},e.styles=new Set,e}();t.PluginSystem=i},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dom=void 0;var r=o(9),n=o(19),i=function(){function e(){}return e.detach=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},e.wrapInline=function(t,o,r){var i,a=t,s=t,l=r.s.save(),c=!1;do{c=!1,(i=a.previousSibling)&&!e.isBlock(i,r.ew)&&(c=!0,a=i)}while(c);do{c=!1,(i=s.nextSibling)&&!e.isBlock(i,r.ew)&&(c=!0,s=i)}while(c);var u=n.isString(o)?r.createInside.element(o):o;a.parentNode&&a.parentNode.insertBefore(u,a);for(var d=a;d&&(d=a.nextSibling,u.appendChild(a),a!==s&&d);)a=d;return r.s.restore(l),u},e.wrap=function(e,t,o){var r=o.s.save(),i=n.isString(t)?o.createInside.element(t):t;return e.parentNode?(e.parentNode.insertBefore(i,e),i.appendChild(e),o.s.restore(r),i):null},e.unwrap=function(t){var o=t.parentNode;if(o){for(;t.firstChild;)o.insertBefore(t.firstChild,t);e.safeRemove(t)}},e.each=function(t,o){var r=t.firstChild;if(r)for(;r;){var n=e.next(r,Boolean,t);if(!1===o(r))return!1;if(r.parentNode&&!e.each(r,o))return!1;r=n}return!0},e.between=function(e,t,o){for(var r=e;r&&r!==t&&(e===r||!o(r));){var n=r.firstChild||r.nextSibling;if(!n){for(;r&&!r.nextSibling;)r=r.parentNode;n=null==r?void 0:r.nextSibling}r=n}},e.replace=function(e,t,o,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var a=n.isString(t)?o.element(t):t;if(!i)for(;e.firstChild;)a.appendChild(e.firstChild);return r&&n.toArray(e.attributes).forEach((function(e){a.setAttribute(e.name,e.value)})),e.parentNode&&e.parentNode.replaceChild(a,e),a},e.isEmptyTextNode=function(t){return e.isText(t)&&(!t.nodeValue||0===t.nodeValue.replace(r.INVISIBLE_SPACE_REG_EXP(),"").length)},e.isEmpty=function(t,o){return void 0===o&&(o=/^(img|svg|canvas|input|textarea|form)$/),!t||(e.isText(t)?null==t.nodeValue||0===n.trim(t.nodeValue).length:!o.test(t.nodeName.toLowerCase())&&e.each(t,(function(t){if(e.isText(t)&&null!=t.nodeValue&&0!==n.trim(t.nodeValue).length||e.isElement(t)&&o.test(t.nodeName.toLowerCase()))return!1})))},e.isNode=function(e,t){return!!e&&!("object"!=typeof t||!t||"function"!=typeof t.Node&&"object"!=typeof t.Node)&&e instanceof t.Node},e.isCell=function(t,o){return e.isNode(t,o)&&/^(td|th)$/i.test(t.nodeName)},e.isImage=function(t,o){return e.isNode(t,o)&&/^(img|svg|picture|canvas)$/i.test(t.nodeName)},e.isBlock=function(t,o){return!n.isVoid(t)&&"object"==typeof t&&e.isNode(t,o)&&r.IS_BLOCK.test(t.nodeName)},e.isText=function(e){return Boolean(e&&e.nodeType===Node.TEXT_NODE)},e.isElement=function(e){return Boolean(e&&e.nodeType===Node.ELEMENT_NODE)},e.isHTMLElement=function(t,o){return e.isNode(t,o)&&t instanceof o.HTMLElement},e.isInlineBlock=function(t){return e.isElement(t)&&!/^(BR|HR)$/i.test(t.tagName)&&-1!==["inline","inline-block"].indexOf(n.css(t,"display").toString())},e.canSplitBlock=function(t,o){return!n.isVoid(t)&&t instanceof o.HTMLElement&&e.isBlock(t,o)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&void 0!==t.style&&!/^(fixed|absolute)/i.test(t.style.position)},e.prev=function(t,o,r,n){return void 0===n&&(n=!0),e.find(t,o,r,!1,"previousSibling",!!n&&"lastChild")},e.next=function(t,o,r,n){return void 0===n&&(n=!0),e.find(t,o,r,void 0,void 0,!!n&&"firstChild")},e.prevWithClass=function(t,o){return e.prev(t,(function(t){return e.isElement(t)&&t.classList.contains(o)}),t.parentNode)},e.nextWithClass=function(t,o){return e.next(t,(function(t){return e.isElement(t)&&t.classList.contains(o)}),t.parentNode)},e.find=function(t,o,r,n,i,a){if(void 0===n&&(n=!1),void 0===i&&(i="nextSibling"),void 0===a&&(a="firstChild"),n&&o(t))return t;var s,l=t;do{if(o(s=l[i]))return s||null;if(a&&s&&s[a]){var c=e.find(s[a],o,s,!0,i,a);if(c)return c}s||(s=l.parentNode),l=s}while(l&&l!==r);return null},e.findWithCurrent=function(t,o,r,n,i){void 0===n&&(n="nextSibling"),void 0===i&&(i="firstChild");var a=t;do{if(o(a))return a||null;if(i&&a&&a[i]){var s=e.findWithCurrent(a[i],o,a,n,i);if(s)return s}for(;a&&!a[n]&&a!==r;)a=a.parentNode;a&&a[n]&&a!==r&&(a=a[n])}while(a&&a!==r);return null},e.findSibling=function(t,o,r){void 0===o&&(o=!0),void 0===r&&(r=function(t){return!e.isEmptyTextNode(t)});for(var n=function(e){return o?e.previousSibling:e.nextSibling},i=n(t);i&&!r(i);)i=n(i);return i&&r(i)?i:null},e.up=function(e,t,o,r){void 0===r&&(r=!1);var n=e;if(!n)return null;do{if(t(n))return n;if(n===o||!n.parentNode)break;n=n.parentNode}while(n&&n!==o);return n===o&&r&&t(n)?n:null},e.closest=function(t,o,r){var i;return i=n.isFunction(o)?o:n.isArray(o)?function(e){return e&&o.includes(e.nodeName.toLowerCase())}:function(e){return e&&o===e.nodeName.toLowerCase()},e.up(t,i,r)},e.furthest=function(e,t,o){for(var r=null,n=null==e?void 0:e.parentElement;n&&n!==o&&t(n);)r=n,n=null==n?void 0:n.parentElement;return r},e.appendChildFirst=function(e,t){var o=e.firstChild;o?o!==t&&e.insertBefore(t,o):e.appendChild(t)},e.after=function(e,t){var o=e.parentNode;o&&(o.lastChild===e?o.appendChild(t):o.insertBefore(t,e.nextSibling))},e.before=function(e,t){var o=e.parentNode;o&&o.insertBefore(t,e)},e.prepend=function(e,t){e.insertBefore(t,e.firstChild)},e.append=function(e,t){var o=this;n.isArray(t)?t.forEach((function(t){o.append(e,t)})):e.appendChild(t)},e.moveContent=function(e,t,o){void 0===o&&(o=!1);var r=(e.ownerDocument||document).createDocumentFragment();n.toArray(e.childNodes).forEach((function(e){r.appendChild(e)})),o&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},e.all=function(t,o,r){void 0===r&&(r=!1);var i=t.childNodes?n.toArray(t.childNodes):[];return o(t)?t:(r&&(i=i.reverse()),i.forEach((function(t){e.all(t,o,r)})),null)},e.isOrContains=function(e,t,o){return void 0===o&&(o=!1),e===t?!o:Boolean(t&&e&&this.up(t,(function(t){return t===e}),e,!0))},e.safeRemove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},e.hide=function(e){e&&(n.dataBind(e,"__old_display",e.style.display),e.style.display="none")},e.show=function(e){if(e){var t=n.dataBind(e,"__old_display");"none"===e.style.display&&(e.style.display=t||"")}},e.isTag=function(e,t){for(var o=n.asArray(t).map(String),r=0;o.length>r;r+=1)if(this.isElement(e)&&e.tagName.toLowerCase()===o[r].toLowerCase())return!0;return!1},e}();t.Dom=i},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewComponent=void 0;var r=o(7),n=function(e){function t(t){var o=e.call(this)||this;return o.setParentView(t),o}return r.__extends(t,e),Object.defineProperty(t.prototype,"defaultTimeout",{get:function(){return this.j.defaultTimeout},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"j",{get:function(){return this.jodit},enumerable:!1,configurable:!0}),t.prototype.i18n=function(e){for(var t,o=[],n=1;arguments.length>n;n++)o[n-1]=arguments[n];return(t=this.j).i18n.apply(t,r.__spreadArray([e],o))},t.prototype.setParentView=function(e){return this.jodit=e,e.components.add(this),this},t.prototype.destruct=function(){return this.j.components.delete(this),e.prototype.destruct.call(this)},t}(o(29).Component);t.ViewComponent=n},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(35),t),r.__exportStar(o(16),t),r.__exportStar(o(36),t),r.__exportStar(o(37),t),r.__exportStar(o(15),t),r.__exportStar(o(39),t),r.__exportStar(o(40),t),r.__exportStar(o(41),t),r.__exportStar(o(42),t),r.__exportStar(o(44),t),r.__exportStar(o(45),t),r.__exportStar(o(46),t),r.__exportStar(o(47),t),r.__exportStar(o(43),t),r.__exportStar(o(48),t),r.__exportStar(o(23),t),r.__exportStar(o(14),t),r.__exportStar(o(50),t),r.__exportStar(o(51),t),r.__exportStar(o(25),t),r.__exportStar(o(49),t)},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBrowserColorPicker=void 0,t.hasBrowserColorPicker=function(){var e=!0;try{var t=document.createElement("input");t.type="color",e="color"===t.type&&"number"!=typeof t.selectionStart}catch(t){e=!1}return e}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBoolean=void 0,t.isBoolean=function(e){return"boolean"==typeof e}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFastEqual=t.isEqual=void 0;var r=o(38);t.isEqual=function(e,t){return e===t||r.stringify(e)===r.stringify(t)},t.isFastEqual=function(e,t){return e===t}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0,t.stringify=function(e,t){if(void 0===t&&(t={}),"object"!=typeof e)return e.toString?e.toString():e;var o=new Set(t.excludeKeys),r=new WeakMap;return JSON.stringify(e,(function(e,t){if(!o.has(e)){if("object"==typeof t&&null!=t){if(r.get(t))return"[refObject]";r.set(t,!0)}return t}}),t.prettify)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTML=void 0;var r=o(14);t.isHTML=function(e){return r.isString(e)&&/<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHtmlFromWord=void 0,t.isHtmlFromWord=function(e){return-1!==e.search(//)||-1!==e.search(//)||-1!==e.search(/style="[^"]*mso-/)&&-1!==e.search(/{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasContainer=t.isDestructable=t.isInitable=void 0;var r=o(15),n=o(32),i=o(25);t.isInitable=function(e){return!i.isVoid(e)&&r.isFunction(e.init)},t.isDestructable=function(e){return!i.isVoid(e)&&r.isFunction(e.destruct)},t.hasContainer=function(e){return!i.isVoid(e)&&n.Dom.isElement(e.container)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInt=void 0;var r=o(43),n=o(14);t.isInt=function(e){return n.isString(e)&&r.isNumeric(e)&&(e=parseFloat(e)),"number"==typeof e&&Number.isFinite(e)&&!(e%1)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumeric=void 0;var r=o(14);t.isNumeric=function(e){if(r.isString(e)){if(!e.match(/^([+-])?[0-9]+(\.?)([0-9]+)?(e[0-9]+)?$/))return!1;e=parseFloat(e)}return"number"==typeof e&&!isNaN(e)&&isFinite(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isViewObject=t.isJoditObject=void 0;var r=o(15),n=o(30);t.isJoditObject=function(e){return Boolean(e&&e instanceof Object&&r.isFunction(e.constructor)&&("undefined"!=typeof Jodit&&e instanceof Jodit||e.isJodit))},t.isViewObject=function(e){return Boolean(e&&e instanceof Object&&r.isFunction(e.constructor)&&(e instanceof n.modules.View||e.isView))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLicense=void 0;var r=o(14);t.isLicense=function(e){return r.isString(e)&&23===e.length&&/^[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}$/i.test(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNativeFunction=void 0,t.isNativeFunction=function(e){return Boolean(e)&&"function"===(typeof e).toLowerCase()&&(e===Function.prototype||/^\s*function\s*(\b[a-z$_][a-z0-9$_]*\b)*\s*\((|([a-z$_][a-z0-9$_]*)(\s*,[a-z$_][a-z0-9$_]*)*)\)\s*{\s*\[native code]\s*}\s*$/i.test(String(e)))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=void 0,t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=void 0;var r=o(49),n=o(17);t.isPlainObject=function(e){return!(!e||"object"!=typeof e||e.nodeType||r.isWindow(e)||e.constructor&&!n.hasOwn.call(e.constructor.prototype,"isPrototypeOf"))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWindow=void 0,t.isWindow=function(e){return null!=e&&e===e.window}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isURL=void 0,t.isURL=function(e){return new RegExp("^(https?:\\/\\/)((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidName=void 0,t.isValidName=function(e){return!!e.length&&!/[^0-9A-Za-zа-яА-ЯЁё\w\-_.]/.test(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.set=void 0;var r=o(14),n=o(43),i=o(16),a=o(34);t.set=function(e,t,o){if(r.isString(e)&&e.length){for(var s=e.split("."),l=o,c=s[0],u=0;s.length-1>u;u+=1)i.isArray(l[c=s[u]])||a.isPlainObject(l[c])||(l[c]=n.isNumeric(s[u+1])?[]:{}),l=l[c];l&&(l[s[s.length-1]]=t)}}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getClassName=t.keepNames=void 0;var r=o(15);t.keepNames=new Map,t.getClassName=function(e){var o;if(r.isFunction(e.className))return e.className();var n=(null===(o=e.constructor)||void 0===o?void 0:o.originalConstructor)||e.constructor;if(t.keepNames.has(n))return t.keepNames.get(n);if(n.name)return n.name;var i=new RegExp(/^\s*function\s*(\S*)\s*\(/),a=n.toString().match(i);return a?a[1]:""}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LimitedStack=void 0;var o=function(){function e(e){this.limit=e,this.stack=[]}return e.prototype.push=function(e){return this.stack.push(e),this.stack.length>this.limit&&this.stack.shift(),this},e.prototype.pop=function(){return this.stack.pop()},e.prototype.find=function(e){return this.stack.find(e)},e}();t.LimitedStack=o},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=t.splitArray=t.asArray=void 0;var r=o(56);Object.defineProperty(t,"asArray",{enumerable:!0,get:function(){return r.asArray}});var n=o(57);Object.defineProperty(t,"splitArray",{enumerable:!0,get:function(){return n.splitArray}});var i=o(58);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return i.toArray}})},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asArray=void 0;var r=o(16);t.asArray=function(e){return r.isArray(e)?e:[e]}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitArray=void 0;var r=o(14);t.splitArray=function(e){return r.isString(e)?e.split(/[,\s]+/):e}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var r=o(20),n=o(46);t.toArray=function(){for(var e,t=[],o=0;arguments.length>o;o++)t[o]=arguments[o];var i=n.isNativeFunction(Array.from)?Array.from:null!==(e=r.reset("Array.from"))&&void 0!==e?e:Array.from;return i.apply(Array,t)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(7).__exportStar(o(60),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearTimeout=t.setTimeout=void 0;var r=o(7);t.setTimeout=function(e,t){for(var o=[],n=2;arguments.length>n;n++)o[n-2]=arguments[n];return t?window.setTimeout.apply(window,r.__spreadArray([e,t],o)):(e.call.apply(e,r.__spreadArray([null],o)),0)},t.clearTimeout=function(e){window.clearTimeout(e)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fastClone=t.markAsAtomic=t.isAtom=void 0;var r=o(38);t.isAtom=function(e){return e&&e.isAtom},t.markAsAtomic=function(e){return Object.defineProperty(e,"isAtom",{enumerable:!1,value:!0,configurable:!1}),e},t.fastClone=function(e){return JSON.parse(r.stringify(e))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(7).__exportStar(o(63),t)},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.colorToHex=void 0,t.colorToHex=function(e){if("rgba(0, 0, 0, 0)"===e||""===e)return!1;if(!e)return"#000000";if("#"===e.substr(0,1))return e;var t=/([\s\n\t\r]*?)rgb\((\d+), (\d+), (\d+)\)/.exec(e)||/([\s\n\t\r]*?)rgba\((\d+), (\d+), (\d+), ([\d.]+)\)/.exec(e);if(!t)return"#000000";for(var o=parseInt(t[2],10),r=parseInt(t[3],10),n=(parseInt(t[4],10)|r<<8|o<<16).toString(16).toUpperCase();6>n.length;)n="0"+n;return t[1]+"#"+n}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigFlatten=t.ConfigProto=void 0;var r=o(7),n=o(61),i=o(34),a=o(8),s=o(20);t.ConfigProto=function e(t,o,s){if(void 0===s&&(s=0),Object.getPrototypeOf(t)!==Object.prototype)return t;var l=a.Config.defaultOptions;if(i.isString(t.preset)){if(void 0!==l.presets[t.preset]){var c=l.presets[t.preset];Object.keys(c).forEach((function(e){i.isVoid(t[e])&&(t[e]=c[e])}))}delete t.preset}var u={};return Object.keys(t).forEach((function(a){var l=t[a],c=o?o[a]:null;u[a]=i.isPlainObject(l)&&i.isPlainObject(c)&&!n.isAtom(l)?e(l,c,s+1):0!==s&&i.isArray(l)&&!n.isAtom(l)&&i.isArray(c)?r.__spreadArray(r.__spreadArray([],l),c.slice(l.length)):l})),Object.setPrototypeOf(u,o),u},t.ConfigFlatten=function(e){return s.keys(e,!1).reduce((function(t,o){return t[o]=e[o],t}),{})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(66),t),r.__exportStar(o(138),t),r.__exportStar(o(139),t),r.__exportStar(o(140),t),r.__exportStar(o(141),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyStyles=void 0;var r=o(32),n=o(67),i=o(68);function a(e){return e.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";]+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,(function(e,t,o){switch(o.toLowerCase()){case"pt":return(1.328*parseFloat(t)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(t)).toFixed(0)+"px"}return e}))}t.applyStyles=function(e){if(-1===e.indexOf("")+"".length);var t=document.createElement("iframe");t.style.display="none",document.body.appendChild(t);var o="",s=[];try{var l=t.contentDocument||(t.contentWindow?t.contentWindow.document:null);if(l){l.open(),l.write(e),l.close(),l.styleSheets.length&&(s=l.styleSheets[l.styleSheets.length-1].cssRules);for(var c=function(e){if(""===s[e].selectorText)return"continue";n.$$(s[e].selectorText,l.body).forEach((function(t){t.style.cssText=a(s[e].style.cssText+";"+t.style.cssText)}))},u=0;s.length>u;u+=1)c(u);r.Dom.each(l.body,(function(e){if(r.Dom.isElement(e)){var t=e,o=t.style.cssText;o&&(t.style.cssText=a(o)),t.hasAttribute("lang")&&t.removeAttribute("lang")}})),o=l.firstChild?i.trim(l.body.innerHTML):""}}catch(e){}finally{r.Dom.safeRemove(t)}return o&&(e=o),i.trim(e.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(//i);-1!==t&&(e=e.substr(t+20));var o=e.search(//i);return-1!==o&&(e=e.substr(0,o)),e}(o)),t.s.insertHTML(o)}},t.getAllTypes=function(e){var t=e.types,o="";if(r.isArray(t)||"domstringlist"===r.type(t))for(var n=0;t.length>n;n+=1)o+=t[n]+";";else o=(t||i.TEXT_PLAIN).toString()+";";return o}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clipboard=t.pluginKey=void 0;var r=o(9),n=o(19),i=o(248);t.pluginKey="clipboard";var a=function(){function e(){this.buttons=[{name:"cut",group:"clipboard"},{name:"copy",group:"clipboard"},{name:"paste",group:"clipboard"},{name:"selectall",group:"clipboard"}]}return e.prototype.init=function(e){var o;null===(o=this.buttons)||void 0===o||o.forEach((function(t){return e.registerButton(t)})),e.e.off("copy."+t.pluginKey+" cut."+t.pluginKey).on("copy."+t.pluginKey+" cut."+t.pluginKey,(function(o){var a,s=e.s.html,l=i.getDataTransfer(o)||i.getDataTransfer(e.ew)||i.getDataTransfer(o.originalEvent);l&&(l.setData(r.TEXT_PLAIN,n.stripTags(s)),l.setData(r.TEXT_HTML,s)),e.buffer.set(t.pluginKey,s),e.e.fire("pasteStack",{html:s,action:e.o.defaultActionOnPaste}),"cut"===o.type&&(e.s.remove(),e.s.focus()),o.preventDefault(),null===(a=null==e?void 0:e.events)||void 0===a||a.fire("afterCopy",s)}))},e.prototype.destruct=function(e){var o,r;null===(o=null==e?void 0:e.buffer)||void 0===o||o.set(t.pluginKey,""),null===(r=null==e?void 0:e.events)||void 0===r||r.off("."+t.pluginKey)},e}();t.clipboard=a},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paste=void 0;var r=o(7),n=o(183),i=o(248),a=o(9),s=o(19),l=o(249),c=o(32),u=o(162),d=o(92),p=o(99),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pasteStack=new s.LimitedStack(20),t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on("paste.paste",this.onPaste).on("pasteStack.paste",(function(e){return t.pasteStack.push(e)})),e.o.nl2brInPlainText&&this.j.e.on("processPaste.paste",this.onProcessPasteReplaceNl2Br)},t.prototype.onPaste=function(e){try{if(!1===this.j.e.fire("beforePaste",e)||!1===this.customPasteProcess(e))return e.preventDefault(),!1;this.defaultPasteProcess(e)}finally{this.j.e.fire("afterPaste",e)}},t.prototype.customPasteProcess=function(e){if(this.j.o.processPasteHTML)for(var t=i.getDataTransfer(e),o=0,r=[null==t?void 0:t.getData(a.TEXT_HTML),null==t?void 0:t.getData(a.TEXT_PLAIN)];r.length>o;o++){var n=r[o];if(s.isHTML(n)&&(this.processWordHTML(e,n)||this.processHTML(e,n)))return!1}},t.prototype.defaultPasteProcess=function(e){var t=i.getDataTransfer(e),o=(null==t?void 0:t.getData(a.TEXT_HTML))||(null==t?void 0:t.getData(a.TEXT_PLAIN));if(t&&o&&""!==s.trim(o)){var r=this.j.e.fire("processPaste",e,o,i.getAllTypes(t));void 0!==r&&(o=r),(s.isString(o)||c.Dom.isNode(o,this.j.ew))&&this.insertByType(e,o,this.j.o.defaultActionOnPaste),e.preventDefault(),e.stopPropagation()}},t.prototype.processWordHTML=function(e,t){var o=this;return!(!this.j.o.processPasteFromWord||!s.isHtmlFromWord(t)||(this.j.o.askBeforePasteFromWord?this.askInsertTypeDialog("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","Word Paste Detected",(function(r){o.insertFromWordByType(e,t,r)})):this.insertFromWordByType(e,t,this.j.o.defaultActionOnPasteFromWord||this.j.o.defaultActionOnPaste),0))},t.prototype.processHTML=function(e,t){var o=this;if(this.j.o.askBeforePasteHTML){var r=this.pasteStack.find((function(e){return e.html===t}));return r?(this.insertByType(e,t,r.action||this.j.o.defaultActionOnPaste),!0):(this.askInsertTypeDialog("Your code is similar to HTML. Keep as HTML?","Paste as HTML",(function(r){o.insertByType(e,t,r)}),"Insert as Text"),!0)}return!1},t.prototype.insertFromWordByType=function(e,t,o){var r;switch(o){case a.INSERT_AS_HTML:if(t=s.applyStyles(t),this.j.o.beautifyHTML){var n=null===(r=this.j.events)||void 0===r?void 0:r.fire("beautifyHTML",t);s.isString(n)&&(t=n)}break;case a.INSERT_AS_TEXT:t=s.cleanFromWord(t);break;case a.INSERT_ONLY_TEXT:t=s.stripTags(s.cleanFromWord(t))}i.pasteInsertHtml(e,this.j,t)},t.prototype.insertByType=function(e,t,o){if(this.pasteStack.push({html:t,action:o}),s.isString(t))switch(this.j.buffer.set(l.pluginKey,t),o){case a.INSERT_CLEAR_HTML:t=s.cleanFromWord(t);break;case a.INSERT_ONLY_TEXT:t=s.stripTags(t);break;case a.INSERT_AS_TEXT:t=s.htmlspecialchars(t)}i.pasteInsertHtml(e,this.j,t)},t.prototype.askInsertTypeDialog=function(e,t,o,r,n){var i,l,c,p;if(void 0===r&&(r="Clean"),void 0===n&&(n="Insert only Text"),!1!==(null===(l=null===(i=this.j)||void 0===i?void 0:i.e)||void 0===l?void 0:l.fire("beforeOpenPasteDialog",e,t,o,r,n))){var f=u.Confirm('
'+this.j.i18n(e)+"
",this.j.i18n(t));f.bindDestruct(this.j),s.markOwner(this.j,f.container);var h=d.Button(this.j,{text:"Keep",name:"keep",status:"primary",tabIndex:0}),m=d.Button(this.j,{text:r,tabIndex:0}),v=d.Button(this.j,{text:n,tabIndex:0}),g=d.Button(this.j,{text:"Cancel",tabIndex:0});return h.onAction((function(){f.close(),o&&o(a.INSERT_AS_HTML)})),m.onAction((function(){f.close(),o&&o(a.INSERT_AS_TEXT)})),v.onAction((function(){f.close(),o&&o(a.INSERT_ONLY_TEXT)})),g.onAction((function(){f.close()})),f.setFooter([h,m,n?v:"",g]),h.focus(),null===(p=null===(c=this.j)||void 0===c?void 0:c.e)||void 0===p||p.fire("afterOpenPasteDialog",f,e,t,o,r,n),f}},t.prototype.onProcessPasteReplaceNl2Br=function(e,t,o){if(o===a.TEXT_PLAIN+";"&&!s.isHTML(t))return s.nl2br(t)},t.prototype.useFakeDivBox=function(e){var t=this,o=this.j.c.div("",{tabindex:-1,contenteditable:!0,style:{left:-9999,top:0,width:0,height:"100%",lineHeight:"140%",overflow:"hidden",position:"fixed",zIndex:2147483647,wordBreak:"break-all"}});this.j.container.appendChild(o);var r=this.j.s.save();o.focus();var n=0,i=function(){c.Dom.safeRemove(o),t.j.selection&&t.j.s.restore(r)},a=function(){if(n+=1,o.childNodes&&o.childNodes.length>0){var r=o.innerHTML;return i(),void t.processHTML(e,r)}5>n?t.j.async.setTimeout(a,20):i()};a()},t.prototype.beforeDestruct=function(e){e.e.off("paste.paste",this.onPaste)},r.__decorate([p.autobind],t.prototype,"onPaste",null),r.__decorate([p.autobind],t.prototype,"onProcessPasteReplaceNl2Br",null),t}(n.Plugin);t.paste=f},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pasteStorage=void 0;var r=o(7);o(252);var n=o(9),i=o(162),a=o(183),s=o(32),l=o(19),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.currentIndex=0,t.list=[],t.container=null,t.listBox=null,t.previewBox=null,t.dialog=null,t.paste=function(){if(t.j.s.focus(),t.j.s.insertHTML(t.list[t.currentIndex]),0!==t.currentIndex){var e=t.list[0];t.list[0]=t.list[t.currentIndex],t.list[t.currentIndex]=e}t.dialog&&t.dialog.close(),t.j.setEditorValue(),t.j.e.fire("afterPaste")},t.onKeyDown=function(e){var o=t.currentIndex;-1!==[n.KEY_UP,n.KEY_DOWN,n.KEY_ENTER].indexOf(e.key)&&(e.key===n.KEY_UP&&(0===o?o=t.list.length-1:o-=1),e.key===n.KEY_DOWN&&(o===t.list.length-1?o=0:o+=1),e.key!==n.KEY_ENTER?(o!==t.currentIndex&&t.selectIndex(o),e.stopImmediatePropagation(),e.preventDefault()):t.paste())},t.selectIndex=function(e){t.listBox&&l.toArray(t.listBox.childNodes).forEach((function(o,r){o.classList.remove("jodit_active"),e===r&&t.previewBox&&(o.classList.add("jodit_active"),t.previewBox.innerHTML=t.list[e],o.focus())})),t.currentIndex=e},t.showDialog=function(){2>t.list.length||(t.dialog||t.createDialog(),t.listBox&&(t.listBox.innerHTML=""),t.previewBox&&(t.previewBox.innerHTML=""),t.list.forEach((function(e,o){var r=t.j.c.element("a");r.textContent=o+1+". "+e.replace(n.SPACE_REG_EXP(),""),t.j.e.on(r,"keydown",t.onKeyDown),l.attr(r,"href","javascript:void(0)"),l.attr(r,"data-index",o.toString()),l.attr(r,"tab-index","-1"),t.listBox&&t.listBox.appendChild(r)})),t.dialog&&t.dialog.open(),t.j.async.setTimeout((function(){t.selectIndex(0)}),100))},t}return r.__extends(t,e),t.prototype.createDialog=function(){var e=this;this.dialog=new i.Dialog({language:this.j.o.language});var t=this.j.c.fromHTML(''+this.j.i18n("Paste")+"");this.j.e.on(t,"click",this.paste);var o=this.j.c.fromHTML(''+this.j.i18n("Cancel")+"");this.j.e.on(o,"click",this.dialog.close),this.container=this.j.c.div(),this.container.classList.add("jodit-paste-storage"),this.listBox=this.j.c.div(),this.previewBox=this.j.c.div(),this.container.appendChild(this.listBox),this.container.appendChild(this.previewBox),this.dialog.setHeader(this.j.i18n("Choose Content to Paste")),this.dialog.setContent(this.container),this.dialog.setFooter([t,o]),this.j.e.on(this.listBox,"click dblclick",(function(t){var o=t.target;return s.Dom.isTag(o,"a")&&o.hasAttribute("data-index")&&e.selectIndex(parseInt(l.attr(o,"-index")||"0",10)),"dblclick"===t.type&&e.paste(),!1}))},t.prototype.afterInit=function(){var e=this;this.j.e.off("afterCopy.paste-storage").on("pasteStorageList.paste-storage",(function(){return e.list.length})).on("afterCopy.paste-storage",(function(t){-1!==e.list.indexOf(t)&&e.list.splice(e.list.indexOf(t),1),e.list.unshift(t),e.list.length>5&&(e.list.length=5)})),this.j.registerCommand("showPasteStorage",{exec:this.showDialog,hotkeys:["ctrl+shift+v","cmd+shift+v"]})},t.prototype.beforeDestruct=function(){this.dialog&&this.dialog.destruct(),this.j.e.off(".paste-storage"),s.Dom.safeRemove(this.previewBox),s.Dom.safeRemove(this.listBox),s.Dom.safeRemove(this.container),this.container=null,this.listBox=null,this.previewBox=null,this.dialog=null,this.list=[]},t}(a.Plugin);t.pasteStorage=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.copyFormat=void 0;var r=o(8),n=o(32),i=o(19),a="copyformat",s=["fontWeight","fontStyle","fontSize","color","margin","padding","borderWidth","borderStyle","borderColor","borderRadius","backgroundColor","textDecorationLine","fontFamily"],l=function(e,t,o,r){var n=i.css(o,t);return n===r[t]&&(n=o.parentNode&&o!==e.editor&&o.parentNode!==e.editor?l(e,t,o.parentNode,r):void 0),n};r.Config.prototype.controls.copyformat={exec:function(e,t,o){var r=o.button;if(t){if(e.buffer.exists(a))e.buffer.delete(a),e.e.off(e.editor,"mouseup.copyformat");else{var c={},u=n.Dom.up(t,(function(e){return e&&!n.Dom.isText(e)}),e.editor)||e.editor,d=e.createInside.span();e.editor.appendChild(d),s.forEach((function(e){c[e]=i.css(d,e)})),d!==e.editor&&n.Dom.safeRemove(d);var p=function(e,t,o){var r={};return t&&s.forEach((function(n){r[n]=l(e,n,t,o),n.match(/border(Style|Color)/)&&!r.borderWidth&&(r[n]=void 0)})),r}(e,u,c);e.e.on(e.editor,"mouseup.copyformat",(function(){e.buffer.delete(a);var t=e.s.current();t&&(n.Dom.isTag(t,"img")?i.css(t,p):e.s.applyStyle(p)),e.e.off(e.editor,"mouseup.copyformat")})),e.buffer.set(a,!0)}r.update()}},isActive:function(e){return e.buffer.exists(a)},tooltip:"Paint format"},t.copyFormat=function(e){e.registerButton({name:"copyformat",group:"clipboard"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.color=void 0;var r=o(8),n=o(10),i=o(19),a=o(255);r.Config.prototype.controls.brush={update:function(e){var t=i.dataBind(e,"color"),o=e.j,r=function(t,r){r&&r!==i.css(o.editor,t).toString()&&(e.state.icon.fill=r)};if(t){var a=i.dataBind(e,"color");r("color"===a?a:"background-color",t)}else{var s=o.s.current();if(s&&!e.state.disabled){var l=n.Dom.closest(s,(function(e){return n.Dom.isBlock(e,o.ew)||e&&n.Dom.isElement(e)}),o.editor)||o.editor;r("color",i.css(l,"color").toString()),r("background-color",i.css(l,"background-color").toString())}e.state.icon.fill="",e.state.activated=!1}},popup:function(e,t,o,r,s){var l="",c="",u=[],d=null;return t&&t!==e.editor&&n.Dom.isNode(t,e.ew)&&(n.Dom.isElement(t)&&e.s.isCollapsed()&&!n.Dom.isTag(t,["br","hr"])&&(d=t),n.Dom.up(t,(function(t){if(n.Dom.isHTMLElement(t,e.ew)){var o=i.css(t,"color",void 0,!0),r=i.css(t,"background-color",void 0,!0);if(o)return l=o.toString(),!0;if(r)return c=r.toString(),!0}}),e.editor)),u=[{name:"Background",content:a.ColorPickerWidget(e,(function(t){d?d.style.backgroundColor=t:e.execCommand("background",!1,t),i.dataBind(s,"color",t),i.dataBind(s,"color-mode","background"),r()}),c)},{name:"Text",content:a.ColorPickerWidget(e,(function(t){d?d.style.color=t:e.execCommand("forecolor",!1,t),i.dataBind(s,"color",t),i.dataBind(s,"color-mode","color"),r()}),l)}],"background"!==e.o.colorPickerDefaultTab&&(u=u.reverse()),a.TabsWidget(e,u,d)},exec:function(e,t,o){var r=o.button,a=i.dataBind(r,"color-mode"),s=i.dataBind(r,"color");if(!a)return!1;if(t&&t!==e.editor&&n.Dom.isNode(t,e.ew)&&n.Dom.isElement(t))switch(a){case"color":t.style.color=s;break;case"background":t.style.backgroundColor=s}else e.execCommand("background"===a?a:"forecolor",!1,s)},tooltip:"Fill color or set the text color"},t.color=function(e){e.registerButton({name:"brush",group:"color"});var t=function(t,o,r){var n=i.normalizeColor(r);switch(t){case"background":e.s.applyStyle({backgroundColor:n||""});break;case"forecolor":e.s.applyStyle({color:n||""})}return e.setEditorValue(),!1};e.registerCommand("forecolor",t).registerCommand("background",t)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(256),t),r.__exportStar(o(258),t),r.__exportStar(o(260),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPickerWidget=void 0,o(257);var r=o(19),n=o(75),i=o(32);t.ColorPickerWidget=function(e,t,o){var a=r.normalizeColor(o),s=e.c.div("jodit-color-picker"),l=e.o.textIcons?""+e.i18n("palette")+"":n.Icon.get("palette"),c=function(e){var t=[];return r.isPlainObject(e)?Object.keys(e).forEach((function(o){t.push('
'),t.push(c(e[o])),t.push("
")})):r.isArray(e)&&e.forEach((function(e){t.push("')})),t.join("")};s.appendChild(e.c.fromHTML('
'+c(e.o.colors)+"
")),s.appendChild(e.c.fromHTML('
'));var u=r.refs(s).extra;return e.o.showBrowserColorPicker&&r.hasBrowserColorPicker()&&(u.appendChild(e.c.fromHTML('
'+l+'
')),e.e.on(s,"change",(function(e){e.stopPropagation();var o=e.target;if(o&&o.tagName&&i.Dom.isTag(o,"input")){var n=o.value||"";r.isFunction(t)&&t(n),e.preventDefault()}}))),e.e.on(s,"mousedown touchend",(function(o){o.stopPropagation();var n=o.target;if(n&&n.tagName&&!i.Dom.isTag(n,"svg")&&!i.Dom.isTag(n,"path")||!n.parentNode||(n=i.Dom.closest(n.parentNode,"a",e.editor)),i.Dom.isTag(n,"a")){var a=r.attr(n,"-color")||"";t&&"function"==typeof t&&t(a),o.preventDefault()}})),e.e.fire("afterGenerateColorPicker",s,u,t,a),s}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabsWidget=void 0,o(259);var r=o(19),n=o(75);t.TabsWidget=function(e,t,o){var i=e.c.div("jodit-tabs"),a=e.c.div("jodit-tabs__wrapper"),s=e.c.div("jodit-tabs__buttons"),l={},c=[],u="",d=0;if(i.appendChild(s),i.appendChild(a),t.forEach((function(i){var p=i.icon,f=i.name,h=i.content,m=e.c.div("jodit-tab"),v=n.Button(e,p||f,f);u||(u=f),s.appendChild(v.container),c.push(v),v.container.classList.add("jodit-tabs__button","jodit-tabs__button_columns_"+t.length),r.isFunction(h)?m.appendChild(e.c.div("jodit-tab_empty")):m.appendChild(h),a.appendChild(m),v.onAction((function(){return c.forEach((function(e){e.state.activated=!1})),r.$$(".jodit-tab",a).forEach((function(e){e.classList.remove("jodit-tab_active")})),v.state.activated=!0,m.classList.add("jodit-tab_active"),r.isFunction(h)&&h.call(e),o&&(o.__activeTab=f),!1})),l[f]={button:v,tab:m},d+=1})),!d)return i;r.$$("a",s).forEach((function(e){e.style.width=(100/d).toFixed(10)+"%"}));var p=o&&o.__activeTab&&l[o.__activeTab]?o.__activeTab:u;return l[p].button.state.activated=!0,l[p].tab.classList.add("jodit-tab_active"),i}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSelectorWidget=void 0;var r=o(19),n=o(32),i=o(258),a=o(75);t.FileSelectorWidget=function(e,t,o,s,l){var c;void 0===l&&(l=!0);var u=[];if(t.upload&&e.o.uploader&&(e.o.uploader.url||e.o.uploader.insertImageAsBase64URI)){var d=e.c.fromHTML('
'+e.i18n(l?"Drop image":"Drop file")+"
"+e.i18n("or click")+'
');e.uploader.bind(d,(function(o){var n=r.isFunction(t.upload)?t.upload:e.o.uploader.defaultHandlerSuccess;r.isFunction(n)&&n.call(e,o),e.e.fire("closeAllPopups")}),(function(t){e.e.fire("errorMessage",t.message),e.e.fire("closeAllPopups")})),u.push({icon:"upload",name:"Upload",content:d})}if(t.filebrowser&&(e.o.filebrowser.ajax.url||e.o.filebrowser.items.url)&&u.push({icon:"folder",name:"Browse",content:function(){s&&s(),t.filebrowser&&e.filebrowser.open(t.filebrowser,l)}}),t.url){var p=new a.UIButton(e,{type:"submit",status:"primary",text:"Insert"}),f=new a.UIForm(e,[new a.UIInput(e,{required:!0,label:"URL",name:"url",type:"url",placeholder:"https://"}),new a.UIInput(e,{name:"text",label:"Alternative text"}),new a.UIBlock(e,[p])]);c=null,o&&!n.Dom.isText(o)&&(n.Dom.isTag(o,"img")||r.$$("img",o).length)&&(c="IMG"===o.tagName?o:r.$$("img",o)[0],r.val(f.container,"input[name=url]",r.attr(c,"src")),r.val(f.container,"input[name=text]",r.attr(c,"alt")),p.state.text="Update"),o&&n.Dom.isTag(o,"a")&&(r.val(f.container,"input[name=url]",r.attr(o,"href")),r.val(f.container,"input[name=text]",r.attr(o,"title")),p.state.text="Update"),f.onSubmit((function(o){r.isFunction(t.url)&&t.url.call(e,o.url,o.text)})),u.push({icon:"link",name:"URL",content:f.container})}return i.TabsWidget(e,u)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDrop=void 0;var r=o(7),n=o(9),i=o(32),a=o(19),s=o(183),l=o(248),c=o(99),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isFragmentFromEditor=!1,t.isCopyMode=!1,t.startDragPoint={x:0,y:0},t.draggable=null,t.bufferRange=null,t.getText=function(e){var t=l.getDataTransfer(e);return t?t.getData(n.TEXT_HTML)||t.getData(n.TEXT_PLAIN):null},t}return r.__extends(t,e),t.prototype.afterInit=function(){this.j.e.on([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)},t.prototype.onDragStart=function(e){var t=e.target;if(this.onDragEnd(),this.isFragmentFromEditor=i.Dom.isOrContains(this.j.editor,t,!0),this.isCopyMode=!this.isFragmentFromEditor||a.ctrlKey(e),this.isFragmentFromEditor){var o=this.j.s.sel,r=o&&o.rangeCount?o.getRangeAt(0):null;r&&(this.bufferRange=r.cloneRange())}else this.bufferRange=null;this.startDragPoint.x=e.clientX,this.startDragPoint.y=e.clientY,i.Dom.isElement(t)&&t.classList.contains("jodit-filebrowser__files-item")&&(t=t.querySelector("img")),i.Dom.isTag(t,"img")&&(this.draggable=t.cloneNode(!0),a.dataBind(this.draggable,"target",t)),this.addDragListeners()},t.prototype.addDragListeners=function(){this.j.e.on("dragover",this.onDrag).on("drop.DragAndDrop",this.onDrop).on(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)},t.prototype.removeDragListeners=function(){this.j.e.off("dragover",this.onDrag).off("drop.DragAndDrop",this.onDrop).off(window,"dragend.DragAndDrop drop.DragAndDrop mouseup.DragAndDrop",this.onDragEnd)},t.prototype.onDrag=function(e){this.draggable&&(this.j.e.fire("hidePopup"),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),e.preventDefault(),e.stopPropagation())},t.prototype.onDragEnd=function(){this.draggable&&(i.Dom.safeRemove(this.draggable),this.draggable=null),this.isCopyMode=!1,this.removeDragListeners()},t.prototype.onDrop=function(e){if(!e.dataTransfer||!e.dataTransfer.files||!e.dataTransfer.files.length){if(!this.isFragmentFromEditor&&!this.draggable)return this.j.e.fire("paste",e),e.preventDefault(),e.stopPropagation(),!1;var t=this.j.s.sel,o=this.bufferRange||(t&&t.rangeCount?t.getRangeAt(0):null),r=null;if(!this.draggable&&o)r=this.isCopyMode?o.cloneContents():o.extractContents();else if(this.draggable)if(this.isCopyMode){var n="1"===a.attr(this.draggable,"-is-file")?["a","href"]:["img","src"],s=n[0],l=n[1];(r=this.j.createInside.element(s)).setAttribute(l,a.attr(this.draggable,"data-src")||a.attr(this.draggable,"src")||""),"a"===s&&(r.textContent=a.attr(r,l)||"")}else r=a.dataBind(this.draggable,"target");else this.getText(e)&&(r=this.j.createInside.fromHTML(this.getText(e)));t&&t.removeAllRanges(),this.j.s.insertCursorAtPoint(e.clientX,e.clientY),r&&(this.j.s.insertNode(r,!1,!1),o&&r.firstChild&&r.lastChild&&(o.setStartBefore(r.firstChild),o.setEndAfter(r.lastChild),this.j.s.selectRange(o),this.j.e.fire("synchro")),i.Dom.isTag(r,"img")&&this.j.events&&this.j.e.fire("afterInsertImage",r)),e.preventDefault(),e.stopPropagation()}this.isFragmentFromEditor=!1,this.removeDragListeners()},t.prototype.beforeDestruct=function(){this.onDragEnd(),this.j.e.off(window,".DragAndDrop").off(".DragAndDrop").off([window,this.j.ed,this.j.editor],"dragstart.DragAndDrop",this.onDragStart)},r.__decorate([c.autobind],t.prototype,"onDragStart",null),r.__decorate([c.throttle((function(e){return e.j.defaultTimeout/10}))],t.prototype,"onDrag",null),r.__decorate([c.autobind],t.prototype,"onDragEnd",null),r.__decorate([c.autobind],t.prototype,"onDrop",null),t}(s.Plugin);t.DragAndDrop=u},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropElement=void 0;var r=o(7),n=o(19),i=o(183),a=o(32),s=o(30),l=o(99),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dragList=[],t.draggable=null,t.wasMoved=!1,t.isCopyMode=!1,t.diffStep=10,t.startX=0,t.startY=0,t}return r.__extends(t,e),t.prototype.afterInit=function(){this.dragList=this.j.o.draggableTags?n.splitArray(this.j.o.draggableTags).filter(Boolean).map((function(e){return e.toLowerCase()})):[],this.dragList.length&&this.j.e.on("mousedown touchstart dragstart",this.onDragStart)},t.prototype.onDragStart=function(e){var t=this;if("dragstart"===e.type&&this.draggable)return!1;var o=e.target;if(this.dragList.length&&o){var r=function(e){return e&&t.dragList.includes(e.nodeName.toLowerCase())},i=a.Dom.furthest(o,r,this.j.editor)||(r(o)?o:null);i&&(this.startX=e.clientX,this.startY=e.clientY,this.isCopyMode=n.ctrlKey(e),this.onDragEnd(),this.draggable=i.cloneNode(!0),n.dataBind(this.draggable,"target",i),this.addDragListeners())}},t.prototype.onDrag=function(e){var o,r;if(this.draggable){var i=e.clientY;if(Math.sqrt(Math.pow(e.clientX-this.startX,2)+Math.pow(i-this.startY,2))>=this.diffStep){if(this.wasMoved=!0,this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){var a=n.dataBind(this.draggable,"target");n.css(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",opacity:.7,display:"inline-block",left:e.clientX,top:e.clientY,width:null!==(o=null==a?void 0:a.offsetWidth)&&void 0!==o?o:100,height:null!==(r=null==a?void 0:a.offsetHeight)&&void 0!==r?r:100}),s.getContainer(this.j,t).appendChild(this.draggable)}n.css(this.draggable,{left:e.clientX,top:e.clientY}),this.j.s.insertCursorAtPoint(e.clientX,e.clientY)}}},t.prototype.onDragEnd=function(){this.isInDestruct||this.draggable&&(a.Dom.safeRemove(this.draggable),this.draggable=null,this.wasMoved=!1,this.removeDragListeners())},t.prototype.onDrop=function(){if(this.draggable&&this.wasMoved){var e=n.dataBind(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(e=e.cloneNode(!0));var t=e.parentElement;this.j.s.insertNode(e,!0,!1),t&&a.Dom.isEmpty(t)&&a.Dom.safeRemove(t),a.Dom.isTag(e,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",e),this.j.e.fire("synchro")}else this.onDragEnd()},t.prototype.addDragListeners=function(){this.j.e.on(this.j.editor,"mousemove touchmove",this.onDrag).on("mouseup touchend",this.onDrop).on([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)},t.prototype.removeDragListeners=function(){this.j.e.off(this.j.editor,"mousemove touchmove",this.onDrag).off("mouseup touchend",this.onDrop).off([this.j.ew,this.ow],"mouseup touchend",this.onDragEnd)},t.prototype.beforeDestruct=function(){this.onDragEnd(),this.j.e.off("mousedown touchstart dragstart",this.onDragStart),this.removeDragListeners()},r.__decorate([l.autobind],t.prototype,"onDragStart",null),r.__decorate([l.throttle((function(e){return e.j.defaultTimeout/10}))],t.prototype,"onDrag",null),r.__decorate([l.autobind],t.prototype,"onDragEnd",null),r.__decorate([l.autobind],t.prototype,"onDrop",null),t}(i.Plugin);t.DragAndDropElement=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enter=t.insertParagraph=void 0;var r=o(7),n=o(9),i=o(32),a=o(19),s=o(183),l=o(9);t.insertParagraph=function(e,t,o,r){var n,s=e.createInside.element(o),l=e.createInside.element("br");s.appendChild(l),r&&r.cssText&&s.setAttribute("style",r.cssText),e.s.insertNode(s,!1,!1),e.s.setCursorBefore(l);var c=e.s.createRange();return c.setStartBefore("br"!==o.toLowerCase()?l:s),c.collapse(!0),e.s.selectRange(c),i.Dom.safeRemove(t),a.scrollIntoViewIfNeeded(s,e.editor,e.ed),null===(n=e.events)||void 0===n||n.fire("synchro"),s};var c=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.brMode=!1,t.defaultTag=n.PARAGRAPH,t}return r.__extends(o,e),o.prototype.afterInit=function(e){var t=this;this.defaultTag=e.o.enter.toLowerCase(),this.brMode=this.defaultTag===n.BR.toLowerCase(),e.o.enterBlock||(e.o.enterBlock=this.brMode?n.PARAGRAPH:this.defaultTag),e.e.off(".enter").on("keydown.enter",(function(o){if(o.key===n.KEY_ENTER){var r=e.e.fire("beforeEnter",o);return void 0!==r?r:(e.s.isCollapsed()||e.execCommand("Delete"),e.s.focus(),t.onEnter(o),!1)}}))},o.prototype.onEnter=function(e){var o=this.j,r=o.selection,n=this.defaultTag,a=r.current(!1);a&&a!==o.editor||(a=o.createInside.text(l.INVISIBLE_SPACE),r.insertNode(a),r.select(a));var s=this.getBlockWrapper(a),c=i.Dom.isTag(s,"li");if((!c||e.shiftKey)&&!this.checkBR(a,e.shiftKey))return!1;if(s||this.hasPreviousBlock(a)||(s=this.wrapText(a)),!s||s===a)return t.insertParagraph(o,null,c?"li":n),!1;if(!this.checkUnsplittableBox(s))return!1;if(c&&i.Dom.isEmpty(s))return this.enterInsideEmptyLIelement(s),!1;var u,d=s.tagName.toLowerCase()===this.defaultTag||c,p=r.cursorOnTheRight(s),f=r.cursorOnTheLeft(s);if(!d&&(p||f))return u=p?r.setCursorAfter(s):r.setCursorBefore(s),t.insertParagraph(o,u,this.defaultTag),void(f&&!p&&r.setCursorIn(s,!0));r.splitSelection(s)},o.prototype.getBlockWrapper=function(e,t){void 0===t&&(t=n.IS_BLOCK);var o=e,r=this.j.editor;do{if(!o||o===r)break;if(t.test(o.nodeName))return i.Dom.isTag(o,"li")?o:this.getBlockWrapper(o.parentNode,/^li$/i)||o;o=o.parentNode}while(o&&o!==r);return null},o.prototype.checkBR=function(e,t){var o=i.Dom.closest(e,["pre","blockquote"],this.j.editor);if(this.brMode||t&&!o||!t&&o){var r=this.j.createInside.element("br");return this.j.s.insertNode(r,!0),a.scrollIntoViewIfNeeded(r,this.j.editor,this.j.ed),!1}return!0},o.prototype.wrapText=function(e){var t=this,o=e;i.Dom.up(o,(function(e){e&&e.hasChildNodes()&&e!==t.j.editor&&(o=e)}),this.j.editor);var r=i.Dom.wrapInline(o,this.j.o.enter,this.j);if(i.Dom.isEmpty(r)){var n=this.j.createInside.element("br");r.appendChild(n),this.j.s.setCursorBefore(n)}return r},o.prototype.hasPreviousBlock=function(e){var t=this.j;return Boolean(i.Dom.prev(e,(function(e){return i.Dom.isBlock(e,t.ew)||i.Dom.isImage(e,t.ew)}),t.editor))},o.prototype.checkUnsplittableBox=function(e){var t=this.j,o=t.selection;if(!i.Dom.canSplitBlock(e,t.ew)){var r=t.createInside.element("br");return o.insertNode(r,!1),o.setCursorAfter(r),!1}return!0},o.prototype.enterInsideEmptyLIelement=function(e){var o=null,r=i.Dom.closest(e,["ol","ul"],this.j.editor);if(r){if(i.Dom.prev(e,(function(e){return i.Dom.isTag(e,"li")}),r))if(i.Dom.next(e,(function(e){return i.Dom.isTag(e,"li")}),r)){var n=this.j.s.createRange();n.setStartBefore(r),n.setEndAfter(e);var s=n.extractContents();r.parentNode&&r.parentNode.insertBefore(s,r),o=this.j.s.setCursorBefore(r)}else o=this.j.s.setCursorAfter(r);else o=this.j.s.setCursorBefore(r);i.Dom.safeRemove(e),t.insertParagraph(this.j,o,this.defaultTag),a.$$("li",r).length||i.Dom.safeRemove(r)}},o.prototype.beforeDestruct=function(e){e.e.off("keydown.enter")},o}(s.Plugin);t.enter=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessages=void 0,o(265);var r=o(8),n=o(32),i=o(19);r.Config.prototype.showMessageErrors=!0,r.Config.prototype.showMessageErrorTime=3e3,r.Config.prototype.showMessageErrorOffsetPx=3,t.errorMessages=function(e){if(e.o.showMessageErrors){var t,o=e.c.div("jodit_error_box_for_messages"),r=function(){t=5,i.toArray(o.childNodes).forEach((function(r){i.css(o,"bottom",t+"px"),t+=r.offsetWidth+e.o.showMessageErrorOffsetPx}))};e.e.on("beforeDestruct",(function(){n.Dom.safeRemove(o)})).on("errorMessage",(function(t,i,a){e.workplace.appendChild(o);var s=e.c.div("active "+(i||""),t);o.appendChild(s),r(),e.async.setTimeout((function(){s.classList.remove("active"),e.async.setTimeout((function(){n.Dom.safeRemove(s),r()}),300)}),a||e.o.showMessageErrorTime)}))}}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.font=void 0;var r=o(7),n=o(8),i=o(32),a=o(19);n.Config.prototype.defaultFontSizePoints="px",n.Config.prototype.controls.fontsize={command:"fontSize",data:{cssRule:"font-size"},list:["8","9","10","11","12","14","16","18","24","30","36","48","60","72","96"],exec:function(e,t,o){var r=o.control;return a.memorizeExec(e,t,{control:r},(function(t){var o;return"fontsize"===(null===(o=r.command)||void 0===o?void 0:o.toLowerCase())?""+t+e.o.defaultFontSizePoints:t}))},childTemplate:function(e,t,o){return""+o+e.o.defaultFontSizePoints},tooltip:"Font size",isChildActive:function(e,t){var o,r,n=e.s.current(),s=(null===(o=t.data)||void 0===o?void 0:o.cssRule)||"font-size",l=(null===(r=t.data)||void 0===r?void 0:r.normalize)||function(t){return/pt$/i.test(t)&&"pt"===e.o.defaultFontSizePoints?t.replace(/pt$/i,""):t};if(n){var c=i.Dom.closest(n,(function(t){return i.Dom.isBlock(t,e.ew)||t&&i.Dom.isElement(t)}),e.editor)||e.editor,u=a.css(c,s);return Boolean(u&&t.args&&l(t.args[0].toString())===l(u.toString()))}return!1}},n.Config.prototype.controls.font=r.__assign(r.__assign({},n.Config.prototype.controls.fontsize),{command:"fontname",list:{"":"Default","Helvetica,sans-serif":"Helvetica","Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma","'Times New Roman',Times,serif":"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},childTemplate:function(e,t,o){return''+o+""},data:{cssRule:"font-family",normalize:function(e){return e.toLowerCase().replace(/['"]+/g,"").replace(/[^a-z0-9]+/g,",")}},tooltip:"Font family"}),t.font=function(e){e.registerButton({name:"font",group:"font"}).registerButton({name:"fontsize",group:"font"});var t=function(t,o,r){switch(t){case"fontsize":e.s.applyStyle({fontSize:a.normalizeSize(r)});break;case"fontname":e.s.applyStyle({fontFamily:r})}return e.e.fire("synchro"),!1};e.registerCommand("fontsize",t).registerCommand("fontname",t)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatBlock=void 0;var r=o(8),n=o(10),i=o(19);r.Config.prototype.controls.paragraph={command:"formatBlock",update:function(e){var t=e.j,o=e.control,r=t.s.current();if(r&&t.o.textIcons){var i=(n.Dom.closest(r,(function(e){return n.Dom.isBlock(e,t.ew)}),t.editor)||t.editor).nodeName.toLowerCase(),a=o.list;e&&o.data&&o.data.currentValue!==i&&a&&a[i]&&(t.o.textIcons?e.state.text=i:e.state.icon.name=i,o.data.currentValue=i)}return!1},exec:i.memorizeExec,data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote"},isChildActive:function(e,t){var o=e.s.current();if(o){var r=n.Dom.closest(o,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);return Boolean(r&&r!==e.editor&&void 0!==t.args&&r.nodeName.toLowerCase()===t.args[0])}return!1},isActive:function(e,t){var o=e.s.current();if(o){var r=n.Dom.closest(o,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);return Boolean(r&&r!==e.editor&&void 0!==t.list&&!n.Dom.isTag(r,"p")&&void 0!==t.list[r.nodeName.toLowerCase()])}return!1},childTemplate:function(e,t,o){return"<"+t+' style="margin:0;padding:0">'+e.i18n(o)+""},tooltip:"Insert format block"},t.formatBlock=function(e){e.registerButton({name:"paragraph",group:"font"}),e.registerCommand("formatblock",(function(t,o,r){return e.s.applyStyle(void 0,{element:r}),e.setEditorValue(),!1}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullsize=void 0,o(269);var r=o(8),n=o(9),i=o(19);r.Config.prototype.fullsize=!1,r.Config.prototype.globalFullSize=!0,r.Config.prototype.controls.fullsize={exec:function(e){e.toggleFullSize()},update:function(e){var t=e.j,o=t.isFullSize?"shrink":"fullsize";e.state.activated=t.isFullSize,t.o.textIcons?e.state.text=o:e.state.icon.name=o},tooltip:"Open editor in fullsize",mode:n.MODE_SOURCE+n.MODE_WYSIWYG},t.fullsize=function(e){e.registerButton({name:"fullsize"});var t=!1,o=0,r=0,n=!1,a=function(){e.events&&(t?(o=i.css(e.container,"height",void 0,!0),r=i.css(e.container,"width",void 0,!0),i.css(e.container,{height:e.ow.innerHeight,width:e.ow.innerWidth}),n=!0):n&&i.css(e.container,{height:o||"auto",width:r||"auto"}))},s=function(o){var r;if(e.container){if(void 0===o&&(o=!e.container.classList.contains("jodit_fullsize")),e.setMod("fullsize",o),e.o.fullsize=o,t=o,e.container.classList.toggle("jodit_fullsize",o),e.toolbar&&(i.isJoditObject(e)&&e.toolbarContainer.appendChild(e.toolbar.container),i.css(e.toolbar.container,"width","auto")),e.o.globalFullSize){for(var n=e.container.parentNode;n&&n.nodeType!==Node.DOCUMENT_NODE;)n.classList.toggle("jodit_fullsize-box_true",o),n=n.parentNode;a()}null===(r=e.events)||void 0===r||r.fire("afterResize")}};e.o.globalFullSize&&e.e.on(e.ow,"resize",a),e.e.on("afterInit afterOpen",(function(){var t;e.toggleFullSize(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.fullsize)})).on("toggleFullSize",s).on("beforeDestruct",(function(){t&&s(!1)})).on("beforeDestruct",(function(){e.events&&e.e.off(e.ow,"resize",a)}))}},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hotkeys=void 0;var r=o(7),n=o(8),i=o(183),a=o(19),s=o(9);n.Config.prototype.commandToHotkeys={removeFormat:["ctrl+shift+m","cmd+shift+m"],insertOrderedList:["ctrl+shift+7","cmd+shift+7"],insertUnorderedList:["ctrl+shift+8, cmd+shift+8"],selectall:["ctrl+a","cmd+a"]};var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onKeyPress=function(e){var o=t.specialKeys[e.which],r=(e.key||String.fromCharCode(e.which)).toLowerCase(),n=[o||r];return["alt","ctrl","shift","meta"].forEach((function(t){e[t+"Key"]&&o!==t&&n.push(t)})),a.normalizeKeyAliases(n.join("+"))},t.specialKeys={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",91:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;a.keys(e.o.commandToHotkeys,!1).forEach((function(t){var o=e.o.commandToHotkeys[t];o&&(a.isArray(o)||a.isString(o))&&e.registerHotkeyToCommand(o,t)}));var o=!1;e.e.off(".hotkeys").on([e.ow,e.ew],"keydown.hotkeys",(function(e){if(e.key===s.KEY_ESC)return t.j.e.fire("escape",e)})).on("keydown.hotkeys",(function(r){var n=t.onKeyPress(r),i={shouldStop:!0};if(!1===t.j.e.fire(n+".hotkey",r.type,i)){if(i.shouldStop)return o=!0,e.e.stopPropagation("keydown"),!1;r.preventDefault()}}),void 0,!0).on("keyup.hotkeys",(function(){if(o)return o=!1,e.e.stopPropagation("keyup"),!1}),void 0,!0)},t.prototype.beforeDestruct=function(e){e.events&&e.e.off(".hotkeys")},t}(i.Plugin);t.hotkeys=l},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iframe=void 0;var r=o(8),n=o(19),i=o(19),a=o(9);r.Config.prototype.iframeBaseUrl="",r.Config.prototype.iframeTitle="Jodit Editor",r.Config.prototype.iframeDoctype="",r.Config.prototype.iframeDefaultSrc="about:blank",r.Config.prototype.iframeStyle='html{margin:0;padding:0;min-height: 100%;}body{box-sizing:border-box;font-size:13px;line-height:1.6;padding:10px;margin:0;background:transparent;color:#000;position:relative;z-index:2;user-select:auto;margin:0px;overflow:auto;outline:none;}table{width:100%;border:none;border-collapse:collapse;empty-cells: show;max-width: 100%;}th,td{padding: 2px 5px;border:1px solid #ccc;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}p{margin-top:0;}.jodit_editor .jodit_iframe_wrapper{display: block;clear: both;user-select: none;position: relative;}.jodit_editor .jodit_iframe_wrapper:after {position:absolute;content:"";z-index:1;top:0;left:0;right: 0;bottom: 0;cursor: pointer;display: block;background: rgba(0, 0, 0, 0);} .jodit_disabled{user-select: none;-o-user-select: none;-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none}',r.Config.prototype.iframeCSSLinks=[],r.Config.prototype.editHTMLDocumentMode=!1,t.iframe=function(e){var t=e.options;e.e.on("afterSetMode",(function(){e.isEditorMode()&&e.s.focus()})).on("generateDocumentStructure.iframe",(function(e,o){var r=e||o.iframe.contentWindow.document;if(r.open(),r.write(t.iframeDoctype+''+t.iframeTitle+""+(t.iframeBaseUrl?'':"")+''),r.close(),t.iframeCSSLinks&&t.iframeCSSLinks.forEach((function(e){var t=r.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),r.head&&r.head.appendChild(t)})),t.iframeStyle){var i=r.createElement("style");i.innerHTML=t.iframeStyle,r.head&&r.head.appendChild(i)}})).on("createEditor",(function(){if(t.iframe){var o=e.c.element("iframe");o.style.display="block",o.src="about:blank",o.className="jodit-wysiwyg_iframe",o.setAttribute("allowtransparency","true"),o.setAttribute("tabindex",t.tabIndex.toString()),o.setAttribute("frameborder","0"),e.workplace.appendChild(o),e.iframe=o;var r=e.e.fire("generateDocumentStructure.iframe",null,e);return n.callPromise(r,(function(){if(e.iframe){var o=e.iframe.contentWindow.document;e.editorWindow=e.iframe.contentWindow;var r=function(){n.attr(o.body,"contenteditable",e.getMode()!==a.MODE_SOURCE&&!e.getReadOnly()||null)},s=function(e){var t=//im,o="{%%BODY%%}",r=t.exec(e);return r&&(e=e.replace(t,o).replace(/]*?)>(.*?)<\/span>/gim,"").replace(/<span([^&]*?)>(.*?)<\/span>/gim,"").replace(o,r[0].replace(/(]+?)min-height["'\s]*:[\s"']*[0-9]+(px|%)/im,"$1").replace(/(]+?)([\s]*["'])?contenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5").replace(/(<[^<]+?)\sclass="[\s]*"/gim,"$1").replace(/(<[^<]+?)\sstyle="[\s;]*"/gim,"$1").replace(/(<[^<]+?)\sdir="[\s]*"/gim,"$1")),e};if(t.editHTMLDocumentMode){var l=e.element.tagName;if("TEXTAREA"!==l&&"INPUT"!==l)throw i.error("If enable `editHTMLDocumentMode` - source element should be INPUT or TEXTAREA");e.e.on("beforeGetNativeEditorValue",(function(){return s(e.o.iframeDoctype+o.documentElement.outerHTML)})).on("beforeSetNativeEditorValue",(function(t){return!e.isLocked&&(/<(html|body)/i.test(t)?s(o.documentElement.outerHTML)!==s(t)&&(o.open(),o.write(e.o.iframeDoctype+s(t)),o.close(),e.editor=o.body,r(),e.e.fire("prepareWYSIWYGEditor")):o.body.innerHTML=t,!0)}))}if(e.editor=o.body,e.e.on("afterSetMode afterInit afterAddPlace",r),"auto"===t.height){o.documentElement&&(o.documentElement.style.overflowY="hidden");var c=e.async.throttle((function(){e.editor&&e.iframe&&"auto"===t.height&&n.css(e.iframe,"height",e.editor.offsetHeight)}),e.defaultTimeout/2);e.e.on("change afterInit afterSetMode resize",c).on([e.iframe,e.ew,o.documentElement],"load",c).on(o,"readystatechange DOMContentLoaded",c)}return o.documentElement&&e.e.on(o.documentElement,"mousedown touchend",(function(){e.s.isFocused()||(e.s.focus(),e.editor===o.body&&e.s.setCursorIn(o.body))})).on(e.ew,"mousedown touchstart keydown keyup touchend click mouseup mousemove scroll",(function(t){var o;null===(o=e.events)||void 0===o||o.fire(e.ow,t)})),!1}}))}}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(273),t),r.__exportStar(o(279),t),r.__exportStar(o(280),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageProperties=void 0;var r=o(7);o(274);var n=o(8),i=o(10),a=o(19),s=o(255),l=o(92),c=o(275),u=o(99),d=o(195);n.Config.prototype.image={dialogWidth:600,openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editBorderRadius:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0};var p=function(e){return e=a.trim(e),/^[0-9]+$/.test(e)?e+"px":e},f=function(e){return/^[-+]?[0-9.]+px$/.test(e.toString())?parseFloat(e.toString()):e},h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={image:new Image,get ratio(){return this.image.naturalWidth/this.image.naturalHeight||1},sizeIsLocked:!0,marginIsLocked:!0},t}return r.__extends(t,e),t.prototype.onChangeMarginIsLocked=function(){var e=this;if(this.form){var t=a.refs(this.form),o=t.lockMargin;[t.marginRight,t.marginBottom,t.marginLeft].forEach((function(t){a.attr(t,"disabled",e.state.marginIsLocked||null)})),o.innerHTML=i.Icon.get(this.state.marginIsLocked?"lock":"unlock")}},t.prototype.onChangeSizeIsLocked=function(){if(this.form){var e=a.refs(this.form),t=e.lockSize,o=e.imageWidth;t.innerHTML=i.Icon.get(this.state.sizeIsLocked?"lock":"unlock"),t.classList.remove("jodit-properties__lock"),t.classList.remove("jodit-properties__unlock"),t.classList.add(this.state.sizeIsLocked?"jodit-properties__lock":"jodit-properties__unlock"),this.j.e.fire(o,"change")}},t.prototype.open=function(){return this.makeForm(),this.j.e.fire("hidePopup"),a.markOwner(this.j,this.dialog.container),this.state.marginIsLocked=!0,this.state.sizeIsLocked=!0,this.updateValues(),this.dialog.open().setModal(!0).setPosition(),!1},t.prototype.makeForm=function(){var e=this;if(!this.dialog){this.dialog=new i.Dialog({fullsize:this.j.o.fullsize,globalFullSize:this.j.o.globalFullSize,theme:this.j.o.theme,language:this.j.o.language,minWidth:Math.min(400,screen.width),minHeight:400,buttons:["fullsize","dialog.close"]});var t=this.j,o=t.o,r=t.i18n.bind(t),n={check:l.Button(t,"ok","Apply"),remove:l.Button(t,"bin","Delete")};t.e.on(this.dialog,"afterClose",(function(){e.state.image.parentNode&&o.image.selectImageAfterClose&&t.s.select(e.state.image)})),n.remove.onAction((function(){t.s.removeNode(e.state.image),e.dialog.close()}));var u=this.dialog;u.setHeader(r("Image properties"));var d=c.form(t);this.form=d,u.setContent(d);var p=a.refs(this.form).tabsBox;p&&p.appendChild(s.TabsWidget(t,[{name:"Image",content:c.mainTab(t)},{name:"Advanced",content:c.positionTab(t)}])),n.check.onAction(this.onApply);var f=a.refs(this.form),h=f.editImage;t.e.on(f.changeImage,"click",this.openImagePopup),o.image.useImageEditor&&t.e.on(h,"click",this.openImageEditor);var m=a.refs(d),v=m.lockSize,g=m.lockMargin,y=m.imageWidth,b=m.imageHeight;v&&t.e.on(v,"click",(function(){e.state.sizeIsLocked=!e.state.sizeIsLocked})),t.e.on(g,"click",(function(t){e.state.marginIsLocked=!e.state.marginIsLocked,t.preventDefault()}));var _=function(t){if(a.isNumeric(y.value)&&a.isNumeric(b.value)){var o=parseFloat(y.value),r=parseFloat(b.value);t.target===y?b.value=Math.round(o/e.state.ratio).toString():y.value=Math.round(r*e.state.ratio).toString()}};t.e.on([y,b],"change keydown mousedown paste",(function(o){e.state.sizeIsLocked&&t.async.setTimeout(_.bind(e,o),{timeout:t.defaultTimeout,label:"image-properties-changeSize"})})),u.setFooter([n.remove,n.check]),u.setSize(this.j.o.image.dialogWidth)}},t.prototype.updateValues=function(){var e,t,o=this,r=this.j.o,n=this.state.image,s=a.refs(this.form),l=s.marginTop,c=s.marginRight,u=s.marginBottom,d=s.marginLeft,p=s.imageSrc,h=s.id,m=s.classes,v=s.align,g=s.style,y=s.imageTitle,b=s.imageAlt,_=s.borderRadius,w=s.imageLink,S=s.imageWidth,C=s.imageHeight,k=s.imageLinkOpenInNewTab,j=s.imageViewSrc,E=s.lockSize;s.lockMargin.checked=o.state.marginIsLocked,E.checked=o.state.sizeIsLocked,p.value=a.attr(n,"src")||"",j&&a.attr(j,"src",a.attr(n,"src")||""),function(){y.value=a.attr(n,"title")||"",b.value=a.attr(n,"alt")||"";var e=i.Dom.closest(n,"a",o.j.editor);e?(w.value=a.attr(e,"href")||"",k.checked="_blank"===a.attr(e,"target")):(w.value="",k.checked=!1)}(),e=a.attr(n,"width")||a.css(n,"width",void 0,!0)||!1,t=a.attr(n,"height")||a.css(n,"height",void 0,!0)||!1,S.value=!1!==e?f(e).toString():n.offsetWidth.toString(),C.value=!1!==t?f(t).toString():n.offsetHeight.toString(),o.state.sizeIsLocked=function(){if(!a.isNumeric(S.value)||!a.isNumeric(C.value))return!1;var e=parseFloat(S.value),t=parseFloat(C.value);return 1>Math.abs(e-t*o.state.ratio)}(),function(){if(r.image.editMargins){var e=!0,t=!1;[l,c,u,d].forEach((function(o){var r=a.attr(o,"data-ref")||"",i=n.style.getPropertyValue(a.kebabCase(r));if(!i)return t=!0,void(o.value="");/^[0-9]+(px)?$/.test(i)&&(i=parseInt(i,10)),o.value=i.toString()||"",(t&&o.value||e&&"marginTop"!==r&&o.value!==l.value)&&(e=!1)})),o.state.marginIsLocked=e}}(),m.value=(a.attr(n,"class")||"").replace(/jodit_focused_image[\s]*/,""),h.value=a.attr(n,"id")||"",_.value=(parseInt(n.style.borderRadius||"0",10)||"0").toString(),n.style.cssFloat&&-1!==["left","right"].indexOf(n.style.cssFloat.toLowerCase())?v.value=a.css(n,"float"):"block"===a.css(n,"display")&&"auto"===n.style.marginLeft&&"auto"===n.style.marginRight&&(v.value="center"),g.value=a.attr(n,"style")||""},t.prototype.onApply=function(){var e=a.refs(this.form),t=e.imageSrc,o=e.borderRadius,r=e.imageTitle,n=e.imageAlt,s=e.imageLink,l=e.imageWidth,c=e.imageHeight,u=e.marginTop,d=e.marginRight,f=e.marginBottom,h=e.marginLeft,m=e.imageLinkOpenInNewTab,v=e.align,g=e.classes,y=e.id,b=this.j.o,_=this.state.image;if(b.image.editStyle&&a.attr(_,"style",e.style.value||null),!t.value)return i.Dom.safeRemove(_),void this.dialog.close();a.attr(_,"src",t.value),_.style.borderRadius="0"!==o.value&&/^[0-9]+$/.test(o.value)?o.value+"px":"",a.attr(_,"title",r.value||null),a.attr(_,"alt",n.value||null);var w=i.Dom.closest(_,"a",this.j.editor);s.value?(w||(w=i.Dom.wrap(_,"a",this.j)),a.attr(w,"href",s.value),a.attr(w,"target",m.checked?"_blank":null)):w&&w.parentNode&&w.parentNode.replaceChild(_,w),l.value===_.offsetWidth.toString()&&c.value===_.offsetHeight.toString()||(a.css(_,{width:a.trim(l.value)?p(l.value):null,height:a.trim(c.value)?p(c.value):null}),a.attr(_,"width",null),a.attr(_,"height",null));var S=[u,d,f,h];b.image.editMargins&&(this.state.marginIsLocked?a.css(_,"margin",p(u.value)):S.forEach((function(e){var t=a.attr(e,"data-ref")||"";a.css(_,t,p(e.value))}))),b.image.editClass&&a.attr(_,"class",g.value||null),b.image.editId&&a.attr(_,"id",y.value||null),b.image.editAlign&&(v.value?["right","left"].includes(v.value.toLowerCase())?(a.css(_,"float",v.value),a.clearCenterAlign(_)):a.css(_,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):(a.css(_,"float")&&-1!==["right","left"].indexOf(a.css(_,"float").toString().toLowerCase())&&a.css(_,"float",""),a.clearCenterAlign(_))),this.j.setEditorValue(),this.dialog.close()},t.prototype.openImageEditor=function(){var e=this,t=a.attr(this.state.image,"src")||"",o=this.j.c.element("a"),r=function(){o.host===location.host||i.Confirm(e.j.i18n("You can only edit your own images. Download this image on the host?"),(function(t){t&&e.j.uploader&&e.j.uploader.uploadRemoteImage(o.href.toString(),(function(t){i.Alert(e.j.i18n("The image has been successfully uploaded to the host!"),(function(){a.isString(t.newfilename)&&(a.attr(e.state.image,"src",t.baseurl+t.newfilename),e.updateValues())})).bindDestruct(e.j)}),(function(t){i.Alert(e.j.i18n("There was an error loading %s",t.message)).bindDestruct(e.j)}))})).bindDestruct(e.j)};o.href=t,this.j.filebrowser.dataProvider.getPathByUrl(o.href.toString()).then((function(r){d.openImageEditor.call(e.j.filebrowser,o.href,r.name,r.path,r.source,(function(){var o=(new Date).getTime();a.attr(e.state.image,"src",t+(-1!==t.indexOf("?")?"":"?")+"&_tmp="+o.toString()),e.updateValues()}),(function(t){i.Alert(t.message).bindDestruct(e.j)}))})).catch((function(t){i.Alert(t.message,r).bindDestruct(e.j)}))},t.prototype.openImagePopup=function(e){var t=this,o=new i.Popup(this.j),r=a.refs(this.form).changeImage;o.setZIndex(this.dialog.getZIndex()+1),o.setContent(s.FileSelectorWidget(this.j,{upload:function(e){e.files&&e.files.length&&a.attr(t.state.image,"src",e.baseurl+e.files[0]),t.updateValues(),o.close()},filebrowser:function(e){e&&a.isArray(e.files)&&e.files.length&&(a.attr(t.state.image,"src",e.files[0]),o.close(),t.updateValues())}},this.state.image,o.close)).open((function(){return a.position(r)})),e.stopPropagation()},t.prototype.afterInit=function(e){var t=this,o=this;e.e.on("afterConstructor changePlace",(function(){e.e.off(e.editor,".imageproperties").on(e.editor,"dblclick.imageproperties",(function(t){var r=t.target;i.Dom.isTag(r,"img")&&(e.o.image.openOnDblClick?(o.state.image=r,e.o.readonly||(t.stopImmediatePropagation(),t.preventDefault(),o.open())):(t.stopImmediatePropagation(),e.s.select(r)))}))})).on("openImageProperties.imageproperties",(function(e){t.state.image=e,t.open()}))},t.prototype.beforeDestruct=function(e){this.dialog&&this.dialog.destruct(),e.e.off(e.editor,".imageproperties").off(".imageproperties")},r.__decorate([u.watch("state.marginIsLocked")],t.prototype,"onChangeMarginIsLocked",null),r.__decorate([u.watch("state.sizeIsLocked")],t.prototype,"onChangeSizeIsLocked",null),r.__decorate([u.autobind],t.prototype,"onApply",null),r.__decorate([u.autobind],t.prototype,"openImageEditor",null),r.__decorate([u.autobind],t.prototype,"openImagePopup",null),t}(i.Plugin);t.imageProperties=h},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(276),t),r.__exportStar(o(277),t),r.__exportStar(o(278),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.form=void 0;var r=o(75);t.form=function(e){var t=e.o.image,o=t.showPreview,n=t.editSize,i=r.Icon.get.bind(r.Icon);return e.c.fromHTML('
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t'+i("lock")+'\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t
')}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mainTab=void 0;var r=o(75);t.mainTab=function(e){var t=e.o,o=e.i18n.bind(e),n=r.Icon.get.bind(r.Icon),i=t.filebrowser.ajax.url||t.uploader.url,a=t.image.useImageEditor;return e.c.fromHTML('
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t'+n("image")+'\n\t\t\t\t\t\t'+n("crop")+'\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
")}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.positionTab=void 0;var r=o(75);t.positionTab=function(e){var t=e.o,o=e.i18n.bind(e),n=r.Icon.get.bind(r.Icon);return e.c.fromHTML('
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t'+n("lock")+'\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t")}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageProcessor=void 0;var r=o(19);t.imageProcessor=function(e){e.e.on("change afterInit changePlace",e.async.debounce((function(){e.editor&&r.$$("img",e.editor).forEach((function(t){t.__jodit_imageprocessor_binded||(t.__jodit_imageprocessor_binded=!0,t.complete||t.addEventListener("load",(function o(){var r;!e.isInDestruct&&(null===(r=e.e)||void 0===r||r.fire("resize")),t.removeEventListener("load",o)})),e.e.on(t,"mousedown touchstart",(function(){e.s.select(t)})))}))}),e.defaultTimeout))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.image=void 0;var r=o(7),n=o(32),i=o(19),a=o(255);o(8).Config.prototype.controls.image={popup:function(e,t,o,s){var l=null;t&&!n.Dom.isText(t)&&n.Dom.isHTMLElement(t,e.ew)&&(n.Dom.isTag(t,"img")||i.$$("img",t).length)&&(l=n.Dom.isTag(t,"img")?t:i.$$("img",t)[0]);var c=e.s.save();return a.FileSelectorWidget(e,{filebrowser:function(t){e.s.restore(c),t.files&&t.files.forEach((function(o){return e.s.insertImage(t.baseurl+o,null,e.o.imageDefaultWidth)})),s()},upload:!0,url:function(t,o){return r.__awaiter(void 0,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return e.s.restore(c),(n=l||e.createInside.element("img")).setAttribute("src",t),n.setAttribute("alt",o),l?[3,2]:[4,e.s.insertImage(n,null,e.o.imageDefaultWidth)];case 1:r.sent(),r.label=2;case 2:return s(),[2]}}))}))}},l,s)},tags:["img"],tooltip:"Insert Image"},t.image=function(e){e.registerButton({name:"image",group:"media"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indent=void 0;var r=o(8),n=o(9),i=o(32),a=o(19);r.Config.prototype.controls.indent={tooltip:"Increase Indent"};var s=function(e){return"rtl"===e?"marginRight":"marginLeft"};r.Config.prototype.controls.outdent={isDisabled:function(e){var t=e.s.current();if(t){var o=i.Dom.closest(t,(function(t){return i.Dom.isBlock(t,e.ew)}),e.editor),r=s(e.o.direction);if(o&&o.style&&o.style[r])return 0>=parseInt(o.style[r],10)}return!0},tooltip:"Decrease Indent"},r.Config.prototype.indentMargin=10,t.indent=function(e){var t=s(e.o.direction);e.registerButton({name:"indent",group:"indent"}).registerButton({name:"outdent",group:"indent"});var o=function(o){var r=[];return e.s.eachSelection((function(s){var l=e.s.save(),c=!!s&&i.Dom.up(s,(function(t){return i.Dom.isBlock(t,e.ew)}),e.editor),u=e.o.enter;if(!c&&s&&(c=i.Dom.wrapInline(s,u!==n.BR?u:n.PARAGRAPH,e)),!c)return e.s.restore(l),!1;var d=-1!==r.indexOf(c);if(c&&c.style&&!d){r.push(c);var p=c.style[t]?parseInt(c.style[t],10):0;c.style[t]=(p+=e.o.indentMargin*("outdent"===o?-1:1))>0?p+"px":"",a.attr(c,"style")||c.removeAttribute("style")}e.s.restore(l)})),e.setEditorValue(),!1};e.registerCommand("indent",{exec:o,hotkeys:["ctrl+]","cmd+]"]}),e.registerCommand("outdent",{exec:o,hotkeys:["ctrl+[","cmd+["]})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o(7).__exportStar(o(283),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hr=void 0;var r=o(8),n=o(32);r.Config.prototype.controls.hr={command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},t.hr=function(e){e.registerButton({name:"hr",group:"insert"}),e.registerCommand("insertHorizontalRule",(function(){var t=e.createInside.element("hr");e.s.insertNode(t,!1,!1);var o=n.Dom.closest(t.parentElement,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);o&&n.Dom.isEmpty(o)&&o!==e.editor&&(n.Dom.after(o,t),n.Dom.safeRemove(o));var r=n.Dom.next(t,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor,!1);return r||(r=e.createInside.element(e.o.enter),n.Dom.after(t,r)),e.s.setCursorIn(r),!1}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inlinePopup=void 0;var r=o(7);o(285),o(286);var n=o(183),i=o(172),a=o(115),s=o(19),l=o(10),c=o(99),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.requires=["select"],t.type=null,t.popup=new a.Popup(t.jodit,!1),t.toolbar=i.makeCollection(t.jodit,t.popup),t.snapRange=null,t.elmsList=s.keys(t.j.o.popup,!1).filter((function(e){return!t.isExcludedTarget(e)})),t}return r.__extends(t,e),t.prototype.onClick=function(e){var t=this,o=this.elmsList,r=l.Dom.isTag(e,"img")?e:l.Dom.closest(e,o,this.j.editor);if(r&&this.canShowPopupForType(r.nodeName.toLowerCase()))return this.showPopup((function(){return s.position(r,t.j)}),r.nodeName.toLowerCase(),r),!1},t.prototype.showPopup=function(e,t,o){if(t=t.toLowerCase(),!this.canShowPopupForType(t))return!1;if(this.type!==t||o!==this.previousTarget){this.previousTarget=o;var r=this.j.o.popup[t],n=void 0;n=s.isFunction(r)?r(this.j,o,this.popup.close):r,s.isArray(n)&&(this.toolbar.build(n,o),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,n=this.toolbar.container),this.popup.setContent(n),this.type=t}return this.popup.open(e),!0},t.prototype.hidePopup=function(e){s.isString(e)&&e!==this.type||this.popup.close()},t.prototype.onOutsideClick=function(e){this.popup.close()},t.prototype.canShowPopupForType=function(e){var t=this.j.o.popup[e.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!t||this.isExcludedTarget(e))},t.prototype.isExcludedTarget=function(e){return s.splitArray(this.j.o.toolbarInlineDisableFor).map((function(e){return e.toLowerCase()})).includes(e.toLowerCase())},t.prototype.afterInit=function(e){var t=this;this.j.e.on("getDiffButtons.mobile",(function(o){if(t.toolbar===o){var r=t.toolbar.getButtonsNames();return s.toArray(e.registeredButtons).filter((function(e){return!t.j.o.toolbarInlineDisabledButtons.includes(e.name)})).filter((function(e){var t=s.isString(e)?e:e.name;return t&&"|"!==t&&"\n"!==t&&!r.includes(t)}))}})).on("hidePopup",this.hidePopup).on("showPopup",(function(e,o,r){t.showPopup(o,r||(s.isString(e)?e:e.nodeName),s.isString(e)?void 0:e)})).on("mousedown keydown",this.onSelectionStart).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.addListenersForElements()},t.prototype.onSelectionStart=function(){this.snapRange=this.j.s.range.cloneRange()},t.prototype.onSelectionEnd=function(e){if(!(e&&e.target&&l.UIElement.closestElement(e.target,a.Popup))){var t=this.snapRange,o=this.j.s.range;t&&!o.collapsed&&o.startContainer===t.startContainer&&o.startOffset===t.startOffset&&o.endContainer===t.endContainer&&o.endOffset===t.endOffset||this.onSelectionChange()}},t.prototype.onSelectionChange=function(){if(this.j.o.toolbarInlineForSelection){var e="selection",t=this.j.s.sel,o=this.j.s.range;(null==t?void 0:t.isCollapsed)||this.isSelectedTarget(o)||this.tableModule.getAllSelectedCells().length?this.type===e&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((function(){return o.getBoundingClientRect()}),e)}},t.prototype.isSelectedTarget=function(e){var t=e.startContainer;return l.Dom.isElement(t)&&t===e.endContainer&&l.Dom.isTag(t.childNodes[e.startOffset],s.keys(this.j.o.popup,!1))&&e.startOffset===e.endOffset-1},Object.defineProperty(t.prototype,"tableModule",{get:function(){return this.j.getInstance("Table",this.j.o)},enumerable:!1,configurable:!0}),t.prototype.beforeDestruct=function(e){e.e.off("showPopup").off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.removeListenersForElements()},t.prototype.addListenersForElements=function(){this.j.e.on(this.elmsList.map((function(e){return s.camelCase("click_"+e)})).join(" "),this.onClick)},t.prototype.removeListenersForElements=function(){this.j.e.off(this.elmsList.map((function(e){return s.camelCase("click_"+e)})).join(" "),this.onClick)},r.__decorate([c.autobind],t.prototype,"onClick",null),r.__decorate([c.wait((function(e){return!e.j.isLocked}))],t.prototype,"showPopup",null),r.__decorate([c.watch(":clickEditor"),c.autobind],t.prototype,"hidePopup",null),r.__decorate([c.watch(":outsideClick")],t.prototype,"onOutsideClick",null),r.__decorate([c.autobind],t.prototype,"onSelectionStart",null),r.__decorate([c.autobind],t.prototype,"onSelectionEnd",null),r.__decorate([c.debounce((function(e){return e.defaultTimeout}))],t.prototype,"onSelectionChange",null),t}(n.Plugin);t.inlinePopup=u},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8);r.Config.prototype.toolbarInline=!0,r.Config.prototype.toolbarInlineForSelection=!1,r.Config.prototype.toolbarInlineDisableFor=[],r.Config.prototype.toolbarInlineDisabledButtons=["source"],r.Config.prototype.popup={a:o(287).Z,img:o(288).Z,cells:o(289).Z,jodit:[{name:"bin",tooltip:"Delete",exec:function(e,t){t&&e.s.removeNode(t)}}],"jodit-media":[{name:"bin",tooltip:"Delete",exec:function(e,t){t&&e.s.removeNode(t)}}],selection:["bold","underline","italic","ul","ol","\n","outdent","indent","fontsize","brush","cut","\n","paragraph","link","align","dots"]}},(e,t,o)=>{"use strict";var r=o(20);t.Z=[{name:"eye",tooltip:"Open link",exec:function(e,t){var o=r.attr(t,"href");t&&o&&e.ow.open(o)}},{name:"link",tooltip:"Edit link",icon:"pencil"},"unlink","brush","file"]},(e,t,o)=>{"use strict";var r=o(32),n=o(34),i=o(19);t.Z=[{name:"delete",icon:"bin",tooltip:"Delete",exec:function(e,t){t&&e.s.removeNode(t)}},{name:"pencil",exec:function(e,t){"img"===t.tagName.toLowerCase()&&e.e.fire("openImageProperties",t)},tooltip:"Edit"},{name:"valign",list:["Top","Middle","Bottom","Normal"],tooltip:"Vertical align",exec:function(e,t,o){var a=o.control;if(r.Dom.isTag(t,"img")){var s=a.args&&n.isString(a.args[0])?a.args[0].toLowerCase():"";if(!s)return!1;i.css(t,"vertical-align","normal"===s?"":s),e.e.fire("recalcPositionPopup")}}},{name:"left",childTemplate:function(e,t,o){return o},list:["Left","Right","Center","Normal"],exec:function(e,t,o){var a=o.control;if(r.Dom.isTag(t,"img")){var s=a.args&&n.isString(a.args[0])?a.args[0].toLowerCase():"";if(!s)return!1;"normal"!==s?-1!==["right","left"].indexOf(s)?(i.css(t,"float",s),i.clearCenterAlign(t)):(i.css(t,"float",""),i.css(t,{display:"block","margin-left":"auto","margin-right":"auto"})):(i.css(t,"float")&&-1!==["right","left"].indexOf(i.css(t,"float").toLowerCase())&&i.css(t,"float",""),i.clearCenterAlign(t)),e.setEditorValue(),e.e.fire("recalcPositionPopup")}},tooltip:"Horizontal align"}]},(e,t,o)=>{"use strict";var r=o(34),n=o(19),i=o(255),a=function(e){return e.args&&r.isString(e.args[0])?e.args[0].toLowerCase():""};t.Z=[{name:"brush",popup:function(e){if(r.isJoditObject(e)){var t=e.getInstance("Table",e.o).getAllSelectedCells();if(!t.length)return!1;var o=n.css(t[0],"color"),a=n.css(t[0],"background-color"),s=n.css(t[0],"border-color"),l=i.ColorPickerWidget(e,(function(o){t.forEach((function(e){n.css(e,"background-color",o)})),e.setEditorValue()}),a),c=i.ColorPickerWidget(e,(function(o){t.forEach((function(e){n.css(e,"color",o)})),e.setEditorValue()}),o),u=i.ColorPickerWidget(e,(function(o){t.forEach((function(e){n.css(e,"border-color",o)})),e.setEditorValue()}),s);return i.TabsWidget(e,[{name:"Background",content:l},{name:"Text",content:c},{name:"Border",content:u}])}},tooltip:"Background"},{name:"valign",list:["Top","Middle","Bottom","Normal"],childTemplate:function(e,t,o){return o},exec:function(e,t,o){var r=a(o.control);e.getInstance("Table",e.o).getAllSelectedCells().forEach((function(e){n.css(e,"vertical-align","normal"===r?"":r)}))},tooltip:"Vertical align"},{name:"splitv",list:{tablesplitv:"Split vertical",tablesplitg:"Split horizontal"},tooltip:"Split"},{name:"align",icon:"left"},"\n",{name:"merge",command:"tablemerge",tooltip:"Merge"},{name:"addcolumn",list:{tableaddcolumnbefore:"Insert column before",tableaddcolumnafter:"Insert column after"},exec:function(e,t,o){var n=o.control;if(r.isJoditObject(e)){var i=a(n);e.execCommand(i,!1,t)}},tooltip:"Add column"},{name:"addrow",list:{tableaddrowbefore:"Insert row above",tableaddrowafter:"Insert row below"},exec:function(e,t,o){var n=o.control;if(r.isJoditObject(e)){var i=a(n);e.execCommand(i,!1,t)}},tooltip:"Add row"},{name:"delete",icon:"bin",list:{tablebin:"Delete table",tablebinrow:"Delete row",tablebincolumn:"Delete column",tableempty:"Empty cell"},exec:function(e,t,o){var n=o.control;if(r.isJoditObject(e)){var i=a(n);e.execCommand(i,!1,t),e.e.fire("hidePopup")}},tooltip:"Delete"}]},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.justify=t.alignElement=t.clearAlign=void 0;var r=o(8),n=o(10),i=o(19);r.Config.prototype.controls.align={name:"left",tooltip:"Align",update:function(e){var t=e.j,o=e.control,r=t.s.current();if(r){var a=n.Dom.closest(r,(function(e){return n.Dom.isBlock(e,t.ew)}),t.editor)||t.editor,s=i.css(a,"text-align").toString();o.defaultValue&&-1!==o.defaultValue.indexOf(s)&&(s="left"),o.data&&o.data.currentValue!==s&&o.list&&-1!==o.list.indexOf(s)&&(t.o.textIcons?e.state.text=s:e.state.icon.name=s,o.data.currentValue=s)}},isActive:function(e,t){var o=e.s.current();if(o&&t.defaultValue){var r=n.Dom.closest(o,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor)||e.editor;return-1===t.defaultValue.indexOf(i.css(r,"text-align").toString())}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},r.Config.prototype.controls.center={command:"justifyCenter",css:{"text-align":"center"},tooltip:"Align Center"},r.Config.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},r.Config.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},r.Config.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"},t.clearAlign=function(e,t){n.Dom.each(e,(function(e){n.Dom.isHTMLElement(e,t.ew)&&e.style.textAlign&&(e.style.textAlign="",e.style.cssText.trim().length||e.removeAttribute("style"))}))},t.alignElement=function(e,o,r){if(n.Dom.isNode(o,r.ew)&&n.Dom.isElement(o))switch(t.clearAlign(o,r),e.toLowerCase()){case"justifyfull":o.style.textAlign="justify";break;case"justifyright":o.style.textAlign="right";break;case"justifyleft":o.style.textAlign="left";break;case"justifycenter":o.style.textAlign="center"}},t.justify=function(e){e.registerButton({name:"align",group:"indent"});var o=function(o){return e.s.focus(),e.s.eachSelection((function(r){if(r){var i=n.Dom.up(r,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);i||(i=n.Dom.wrapInline(r,e.o.enterBlock,e)),t.alignElement(o,i,e)}})),!1};e.registerCommand("justifyfull",o),e.registerCommand("justifyright",o),e.registerCommand("justifyleft",o),e.registerCommand("justifycenter",o)}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.limit=void 0;var r=o(7),n=o(8),i=o(183),a=o(9),s=o(19),l=o(99);n.Config.prototype.limitWords=!1,n.Config.prototype.limitChars=!1,n.Config.prototype.limitHTML=!1;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this,o=e.o;if(e&&(o.limitWords||o.limitChars)){var r=null;e.e.off(".limit").on("beforePaste.limit",(function(){r=e.observer.snapshot.make()})).on("keydown.limit keyup.limit beforeEnter.limit beforePaste.limit",this.checkPreventKeyPressOrPaste).on("change.limit",this.checkPreventChanging).on("afterPaste.limit",(function(){if(t.shouldPreventInsertHTML()&&r)return e.observer.snapshot.restore(r),!1}))}},t.prototype.shouldPreventInsertHTML=function(e,t){if(void 0===e&&(e=null),void 0===t&&(t=""),e&&a.COMMAND_KEYS.includes(e.key))return!1;var o=this.jodit,r=o.o,n=r.limitWords,i=r.limitChars,s=this.splitWords(t||(o.o.limitHTML?o.value:o.text));return!(!n||n>s.length)||Boolean(i)&&s.join("").length>=i},t.prototype.checkPreventKeyPressOrPaste=function(e){if(this.shouldPreventInsertHTML(e))return!1},t.prototype.checkPreventChanging=function(e,t){var o=this.jodit,r=o.o,n=r.limitWords,i=r.limitChars,a=o.o.limitHTML?e:s.stripTags(e),l=this.splitWords(a);(n&&l.length>n||Boolean(i)&&l.join("").length>i)&&(o.value=t)},t.prototype.splitWords=function(e){return e.replace(a.INVISIBLE_SPACE_REG_EXP(),"").split(a.SPACE_REG_EXP()).filter((function(e){return e.length}))},t.prototype.beforeDestruct=function(e){e.e.off(".limit")},r.__decorate([l.autobind],t.prototype,"checkPreventKeyPressOrPaste",null),r.__decorate([l.autobind],t.prototype,"checkPreventChanging",null),t}(i.Plugin);t.limit=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.link=void 0;var r=o(7),n=o(8),i=o(32),a=o(19),s=o(293),l=o(183),c=o(99),u=o(10);n.Config.prototype.link={formTemplate:s.formTemplate,followOnDblClick:!1,processVideoLink:!0,processPastedLink:!0,noFollowCheckbox:!0,openInNewTabCheckbox:!0,modeClassName:"input",selectMultipleClassName:!0,selectSizeClassName:3,selectOptionsClassName:[],hotkeys:["ctrl+k","cmd+k"]},n.Config.prototype.controls.unlink={exec:function(e,t){var o=i.Dom.closest(t,"a",e.editor);o&&i.Dom.unwrap(o),e.setEditorValue(),e.e.fire("hidePopup")},tooltip:"Unlink"},n.Config.prototype.controls.link={isActive:function(e){var t=e.s.current();return Boolean(t&&i.Dom.closest(t,"a",e.editor))},popup:function(e,t,o,r){return e.e.fire("generateLinkForm.link",t,r)},tags:["a"],tooltip:"Insert link"};var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"link",group:"insert"}],t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.o.link.followOnDblClick&&e.e.on("dblclick.link",this.onDblClickOnLink),e.o.link.processPastedLink&&e.e.on("processPaste.link",this.onProcessPasteLink),e.e.on("generateLinkForm.link",this.generateForm),e.registerCommand("openLinkDialog",{exec:function(){var o=new u.Dialog({resizable:!1}),r=t.generateForm(e.s.current(),(function(){o.close()}));r.container.classList.add("jodit-dialog_alert"),o.setContent(r),o.open(),e.async.requestIdleCallback((function(){var e=a.refs(r.container).url_input;null==e||e.focus()}))},hotkeys:e.o.link.hotkeys})},t.prototype.onDblClickOnLink=function(e){if(i.Dom.isTag(e.target,"a")){var t=a.attr(e.target,"href");t&&(location.href=t,e.preventDefault())}},t.prototype.onProcessPasteLink=function(e,t){var o=this.jodit;if(a.isURL(t)){if(o.o.link.processVideoLink){var r=a.convertMediaUrlToVideoEmbed(t);if(r!==t)return o.createInside.fromHTML(r)}var n=o.createInside.element("a");return n.setAttribute("href",t),n.textContent=t,o.e.stopPropagation("processPaste"),n}},t.prototype.generateForm=function(e,t){var o,r=this.jodit,n=r.i18n.bind(r),s=r.o.link,l=s.openInNewTabCheckbox,c=s.noFollowCheckbox,u=s.formClassName,d=s.modeClassName,p=(0,s.formTemplate)(r),f=a.isString(p)?r.c.fromHTML(p,{target_checkbox_box:l,nofollow_checkbox_box:c}):p,h=i.Dom.isElement(f)?f:f.container,m=a.refs(h),v=m.insert,g=m.unlink,y=m.content_input_box,b=m.target_checkbox,_=m.nofollow_checkbox,w=m.url_input,S=i.Dom.isImage(e,r.ew),C=m.content_input,k=m.className_input,j=m.className_select;C||(C=r.c.element("input",{type:"hidden",ref:"content_input"})),u&&h.classList.add(u),S&&i.Dom.hide(y);var E=function(){return o?o.innerText:a.stripTags(r.s.range.cloneContents(),r.ed)};if(o=!(!e||!i.Dom.closest(e,"a",r.editor))&&i.Dom.closest(e,"a",r.editor),!S&&e&&(C.value=E()),o){if(w.value=a.attr(o,"href")||"",d)switch(d){case"input":k&&(k.value=a.attr(o,"class")||"");break;case"select":if(j){for(var I=0;j.selectedOptions.length>I;I++){var x=j.options.item(I);x&&(x.selected=!1)}(a.attr(o,"class")||"").split(" ").forEach((function(e){if(e)for(var t=0;j.options.length>t;t++){var o=j.options.item(t);(null==o?void 0:o.value)&&o.value===e&&(o.selected=!0)}}))}}l&&b&&(b.checked="_blank"===a.attr(o,"target")),c&&_&&(_.checked="nofollow"===a.attr(o,"rel")),v.textContent=n("Update")}else i.Dom.hide(g);var T=r.observer.snapshot.make();g&&r.e.on(g,"click",(function(e){r.observer.snapshot.restore(T),o&&i.Dom.unwrap(o),r.setEditorValue(),t(),e.preventDefault()}));var P=function(){if(!w.value.trim().length)return w.focus(),w.classList.add("jodit_error"),!1;var e;r.observer.snapshot.restore(T);var n=E()!==C.value.trim();if(o)e=[o];else if(r.s.isCollapsed()){var s=r.createInside.element("a");r.s.insertNode(s),e=[s]}else{var u=r.s.current();e=i.Dom.isTag(u,["img"])?[i.Dom.wrap(u,"a",r)]:r.s.wrapInTag("a")}return e.forEach((function(e){var t;if(a.attr(e,"href",w.value),d&&(null!=k?k:j))if("input"===d)""===k.value&&e.hasAttribute("class")&&a.attr(e,"class",null),""!==k.value&&a.attr(e,"class",k.value);else if("select"===d){e.hasAttribute("class")&&a.attr(e,"class",null);for(var o=0;j.selectedOptions.length>o;o++){var r=null===(t=j.selectedOptions.item(o))||void 0===t?void 0:t.value;r&&e.classList.add(r)}}S||(C.value.trim().length?n&&(e.textContent=C.value):e.textContent=w.value),l&&b&&a.attr(e,"target",b.checked?"_blank":null),c&&_&&a.attr(e,"rel",_.checked?"nofollow":null)})),r.setEditorValue(),t(),!1};return i.Dom.isElement(f)?r.e.on(f,"submit",(function(e){return e.preventDefault(),e.stopImmediatePropagation(),P(),!1})):f.onSubmit(P),f},t.prototype.beforeDestruct=function(e){e.e.off("generateLinkForm.link",this.generateForm).off("dblclick.link",this.onDblClickOnLink).off("processPaste.link",this.onProcessPasteLink)},r.__decorate([c.autobind],t.prototype,"onDblClickOnLink",null),r.__decorate([c.autobind],t.prototype,"onProcessPasteLink",null),r.__decorate([c.autobind],t.prototype,"generateForm",null),t}(l.Plugin);t.link=d},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formTemplate=void 0;var r=o(118),n=o(92);t.formTemplate=function(e){var t=e.o.link,o=t.openInNewTabCheckbox,i=t.noFollowCheckbox,a=t.modeClassName,s=t.selectSizeClassName,l=t.selectMultipleClassName,c=t.selectOptionsClassName;return new r.UIForm(e,[new r.UIBlock(e,[new r.UIInput(e,{name:"url",type:"text",ref:"url_input",label:"URL",placeholder:"http://",required:!0})]),new r.UIBlock(e,[new r.UIInput(e,{name:"content",ref:"content_input",label:"Text"})],{ref:"content_input_box"}),a?new r.UIBlock(e,["input"===a?new r.UIInput(e,{name:"className",ref:"className_input",label:"Class name"}):"select"===a?new r.UISelect(e,{name:"className",ref:"className_select",label:"Class name",size:s,multiple:l,options:c}):null]):null,o?new r.UICheckbox(e,{name:"target",ref:"target_checkbox",label:"Open in new tab"}):null,i?new r.UICheckbox(e,{name:"nofollow",ref:"nofollow_checkbox",label:"No follow"}):null,new r.UIBlock(e,[new n.UIButton(e,{name:"unlink",status:"default",text:"Unlink"}),new n.UIButton(e,{name:"insert",type:"submit",status:"primary",text:"Insert"})],{align:"full"})])}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(295),t),r.__exportStar(o(296),t),r.__exportStar(o(298),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var r=o(8),n=o(9),i=o(19);r.Config.prototype.mediaFakeTag="jodit-media",r.Config.prototype.mediaInFakeBlock=!0,r.Config.prototype.mediaBlocks=["video","audio"],t.media=function(e){var t="jodit_fake_wrapper",o=e.options,r=o.mediaFakeTag,a=o.mediaBlocks;o.mediaInFakeBlock&&e.e.on("afterGetValueFromEditor",(function(e){var o=new RegExp("<"+r+"[^>]+data-"+t+"[^>]+>(.+?)","ig");o.test(e.value)&&(e.value=e.value.replace(o,"$1"))})).on("change afterInit afterSetMode changePlace",e.async.debounce((function(){e.isDestructed||e.getMode()===n.MODE_SOURCE||i.$$(a.join(","),e.editor).forEach((function(o){i.dataBind(o,t)||(i.dataBind(o,t,!0),function(o){if(o.parentNode&&i.attr(o.parentNode,"data-jodit_iframe_wrapper"))o=o.parentNode;else{var n=e.createInside.fromHTML("<"+r+' data-jodit-temp="1" contenteditable="false" draggable="true" data-'+t+'="1">");n.style.display="inline-block"===o.style.display?"inline-block":"block",n.style.width=o.offsetWidth+"px",n.style.height=o.offsetHeight+"px",o.parentNode&&o.parentNode.insertBefore(n,o),n.appendChild(o),o=n}e.e.off(o,"mousedown.select touchstart.select").on(o,"mousedown.select touchstart.select",(function(){e.s.setCursorAfter(o)}))}(o))}))}),e.defaultTimeout))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.video=void 0,o(297),t.video=function(e){e.registerButton({name:"video",group:"media"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(255),i=o(19),a=o(118),s=o(92);r.Config.prototype.controls.video={popup:function(e,t,o,r){var l=new a.UIForm(e,[new a.UIBlock(e,[new a.UIInput(e,{name:"url",required:!0,label:"URL",placeholder:"https://",validators:["url"]})]),new a.UIBlock(e,[s.Button(e,"","Insert","primary").onAction((function(){return l.submit()}))])]),c=new a.UIForm(e,[new a.UIBlock(e,[new a.UITextArea(e,{name:"code",required:!0,label:"Embed code"})]),new a.UIBlock(e,[s.Button(e,"","Insert","primary").onAction((function(){return c.submit()}))])]),u=[],d=e.s.save(),p=function(t){e.s.restore(d),e.s.insertHTML(t),r()};return u.push({icon:"link",name:"Link",content:l.container},{icon:"source",name:"Code",content:c.container}),l.onSubmit((function(e){p(i.convertMediaUrlToVideoEmbed(e.url))})),c.onSubmit((function(e){p(e.code)})),n.TabsWidget(e,u)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.file=void 0;var r=o(8),n=o(32),i=o(255);r.Config.prototype.controls.file={popup:function(e,t,o,r){var a=function(t,o){void 0===o&&(o=""),e.s.insertNode(e.createInside.fromHTML(''+(o||t)+""))},s=null;return t&&(n.Dom.isTag(t,"a")||n.Dom.closest(t,"a",e.editor))&&(s=n.Dom.isTag(t,"a")?t:n.Dom.closest(t,"a",e.editor)),i.FileSelectorWidget(e,{filebrowser:function(e){e.files&&e.files.forEach((function(t){return a(e.baseurl+t)})),r()},upload:!0,url:function(e,t){s?(s.setAttribute("href",e),s.setAttribute("title",t)):a(e,t),r()}},s,r,!1)},tags:["a"],tooltip:"Insert file"},t.file=function(e){e.registerButton({name:"file",group:"media"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mobile=void 0;var r=o(7),n=o(8),i=o(9),a=o(19),s=o(172),l=o(75),c=o(112);n.Config.prototype.mobileTapTimeout=300,n.Config.prototype.toolbarAdaptive=!0,n.Config.prototype.controls.dots={mode:i.MODE_SOURCE+i.MODE_WYSIWYG,popup:function(e,t,o,r,n){var i=o.data;return void 0===i&&(i={toolbar:s.makeCollection(e),rebuild:function(){var t;if(n){var o=e.e.fire("getDiffButtons.mobile",n.closest(l.UIList));if(o&&i){i.toolbar.build(a.splitArray(o));var r=(null===(t=e.toolbar.firstButton)||void 0===t?void 0:t.container.offsetWidth)||36;i.toolbar.container.style.width=3*(r+4)+"px"}}}},o.data=i),i.rebuild(),i.toolbar},tooltip:"Show all"},t.mobile=function(e){var t=0,o=a.splitArray(e.o.buttons);e.e.on("touchend",(function(o){if(o.changedTouches&&o.changedTouches.length){var r=(new Date).getTime();r-t>e.o.mobileTapTimeout&&(t=r,e.s.insertCursorAtPoint(o.changedTouches[0].clientX,o.changedTouches[0].clientY))}})).on("getDiffButtons.mobile",(function(t){if(t===e.toolbar){var n=a.splitArray(e.o.buttons),i=c.flatButtonsSet(o);return n.reduce((function(e,t){return c.isButtonGroup(t)?e.push(r.__assign(r.__assign({},t),{buttons:t.buttons.filter((function(e){return!i.has(e)}))})):i.has(t)||e.push(t),e}),[])}})),e.o.toolbarAdaptive&&e.e.on("resize afterInit recalcAdaptive changePlace afterAddPlace",(function(){if(e.o.toolbar){var t=e.container.offsetWidth,r=a.splitArray(e.o.sizeLG>t?e.o.sizeMD>t?e.o.sizeSM>t?e.o.buttonsXS:e.o.buttonsSM:e.o.buttonsMD:e.o.buttons);r.toString()!==o.toString()&&(o=r,e.e.fire("closeAllPopups"),e.toolbar.setRemoveButtons(e.o.removeButtons).build(o.concat(e.o.extraButtons)))}})).on(e.ow,"load",(function(){return e.e.fire("recalcAdaptive")}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderedList=void 0;var r=o(8),n=o(32),i=o(19),a=function(e,t,o){var r=o.control,n="button"+r.command,a=r.args&&r.args[0]||i.dataBind(e,n);i.dataBind(e,n,a),e.execCommand(r.command,!1,a)};r.Config.prototype.controls.ul={command:"insertUnorderedList",tags:["ul"],tooltip:"Insert Unordered List",list:{default:"Default",circle:"Circle",disc:"Dot",square:"Quadrate"},exec:a},r.Config.prototype.controls.ol={command:"insertOrderedList",tags:["ol"],tooltip:"Insert Ordered List",list:{default:"Default","lower-alpha":"Lower Alpha","lower-greek":"Lower Greek","lower-roman":"Lower Roman","upper-alpha":"Upper Alpha","upper-roman":"Upper Roman"},exec:a},t.orderedList=function(e){var t=function(e){return/insert(un)?orderedlist/i.test(e)},o=function(){return n.Dom.up(e.s.current(),(function(e){return e&&/^UL|OL$/i.test(e.nodeName)}),e.editor)},r=function(e,t){"default"!==t&&t?e.style.setProperty("list-style-type",t):e.style.removeProperty("list-style-type")};e.e.on("beforeCommand",(function(e,i,a){if(t(e)&&a){var s=o();if(s&&!function(e,t){var o=e.style.listStyleType;return o===t||!o&&"default"===t}(s,a)&&(n.Dom.isTag(s,"ul")&&/unordered/i.test(e)||n.Dom.isTag(s,"ol")&&!/unordered/i.test(e)))return r(s,a),!1}})).on("afterCommand",(function(a,s,l){if(t(a)){var c=o();c&&(r(c,l),e.createInside.applyCreateAttributes(c),c.querySelectorAll("li").forEach((function(t){e.createInside.applyCreateAttributes(t)})));var u=[],d=function(e){n.Dom.isTag(e,["p","h1","h2","h3","h4","h5","h6"])&&u.push(e)};if(c&&(d(c.parentNode),c.querySelectorAll("li").forEach((function(e){return d(e.firstChild)})),u.length)){var p=e.s.save();i.toArray(c.childNodes).forEach((function(e){n.Dom.isTag(e.lastChild,"br")&&n.Dom.safeRemove(e.lastChild)})),u.forEach((function(e){return n.Dom.unwrap(e)})),e.s.restore(p)}e.setEditorValue()}}))}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.placeholder=t.isEditorEmpty=void 0;var r=o(7);o(302);var n=o(8),i=o(9),a=o(19),s=o(32),l=o(183),c=o(9),u=o(99);function d(e){if(!e.firstChild)return!0;var t=e.firstChild;if(c.MAY_BE_REMOVED_WITH_KEY.test(t.nodeName)||/^(TABLE)$/i.test(t.nodeName))return!1;var o=s.Dom.next(t,(function(e){return e&&!s.Dom.isEmptyTextNode(e)}),e);return s.Dom.isText(t)&&!o?s.Dom.isEmptyTextNode(t):!o&&s.Dom.each(t,(function(e){return!s.Dom.isTag(e,["ul","li","ol"])&&(s.Dom.isEmpty(e)||s.Dom.isTag(e,"br"))}))}n.Config.prototype.showPlaceholder=!0,n.Config.prototype.useInputsPlaceholder=!0,n.Config.prototype.placeholder="Type something",t.isEditorEmpty=d;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.addNativeListeners=function(){t.j.e.off(t.j.editor,"input.placeholder keydown.placeholder").on(t.j.editor,"input.placeholder keydown.placeholder",t.toggle)},t.addEvents=function(){var e=t.j;e.o.useInputsPlaceholder&&e.element.hasAttribute("placeholder")&&(t.placeholderElm.innerHTML=a.attr(e.element,"placeholder")||""),e.e.fire("placeholder",t.placeholderElm.innerHTML),e.e.off(".placeholder").on("changePlace.placeholder",t.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",t.toggle).on(window,"load",t.toggle),t.addNativeListeners(),t.toggle()},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.o.showPlaceholder&&(this.placeholderElm=e.c.fromHTML('"),"rtl"===e.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),e.e.on("readonly",(function(e){e?t.hide():t.toggle()})).on("changePlace",this.addEvents),this.addEvents())},t.prototype.show=function(){var e=this.j;if(!e.o.readonly){var t=0,o=0,r=e.s.current(),n=r&&s.Dom.closest(r,(function(t){return s.Dom.isBlock(t,e.ew)}),e.editor)||e.editor,i=e.ew.getComputedStyle(n);if(e.workplace.appendChild(this.placeholderElm),s.Dom.isElement(e.editor.firstChild)){var l=e.ew.getComputedStyle(e.editor.firstChild);t=parseInt(l.getPropertyValue("margin-top"),10),o=parseInt(l.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(l.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=l.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=i.getPropertyValue("line-height");a.css(this.placeholderElm,{display:"block",textAlign:i.getPropertyValue("text-align"),marginTop:Math.max(parseInt(i.getPropertyValue("margin-top"),10),t),marginLeft:Math.max(parseInt(i.getPropertyValue("margin-left"),10),o)})}},t.prototype.hide=function(){s.Dom.safeRemove(this.placeholderElm)},t.prototype.toggle=function(){var e=this.j;e.editor&&!e.isInDestruct&&(e.getRealMode()===i.MODE_WYSIWYG&&d(e.editor)?this.show():this.hide())},t.prototype.beforeDestruct=function(e){this.hide(),e.e.off(".placeholder").off(window,"load",this.toggle)},r.__decorate([u.debounce((function(e){return e.defaultTimeout/10}),!0)],t.prototype,"toggle",null),t}(l.Plugin);t.placeholder=p},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redoUndo=void 0;var r=o(7),n=o(8),i=o(9),a=o(183);n.Config.prototype.controls.redo={mode:i.MODE_SPLIT,isDisabled:function(e){return!e.observer.stack.canRedo()},tooltip:"Redo"},n.Config.prototype.controls.undo={mode:i.MODE_SPLIT,isDisabled:function(e){return!e.observer.stack.canUndo()},tooltip:"Undo"};var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"undo",group:"history"},{name:"redo",group:"history"}],t}return r.__extends(t,e),t.prototype.beforeDestruct=function(){},t.prototype.afterInit=function(e){var t=function(t){return e.observer[t](),!1};e.registerCommand("redo",{exec:t,hotkeys:["ctrl+y","ctrl+shift+z","cmd+y","cmd+shift+z"]}),e.registerCommand("undo",{exec:t,hotkeys:["ctrl+z","cmd+z"]})},t}(a.Plugin);t.redoUndo=s},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizer=void 0;var r=o(7);o(305);var n=o(8),i=o(9),a=o(9),s=o(32),l=o(19),c=o(183),u=o(30),d=o(99);n.Config.prototype.useIframeResizer=!0,n.Config.prototype.useTableResizer=!0,n.Config.prototype.useImageResizer=!0,n.Config.prototype.resizer={showSize:!0,hideSizeTimeout:1e3,min_width:10,min_height:10};var p="__jodit-resizer_binded",f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.LOCK_KEY="resizer",t.element=null,t.isResized=!1,t.isShown=!1,t.start_x=0,t.start_y=0,t.width=0,t.height=0,t.ratio=0,t.rect=t.j.c.fromHTML('
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t100x100\n\t\t\t
'),t.sizeViewer=t.rect.getElementsByTagName("span")[0],t.onResize=function(e){if(t.isResized){var o=e.clientX-t.start_x,r=e.clientY-t.start_y;if(!t.element)return;var n=t.handle.className,i=0,a=0;s.Dom.isTag(t.element,"img")?(o?(i=t.width+(n.match(/left/)?-1:1)*o,a=Math.round(i/t.ratio)):(a=t.height+(n.match(/top/)?-1:1)*r,i=Math.round(a*t.ratio)),i>l.innerWidth(t.j.editor,t.j.ow)&&(i=l.innerWidth(t.j.editor,t.j.ow),a=Math.round(i/t.ratio))):(i=t.width+(n.match(/left/)?-1:1)*o,a=t.height+(n.match(/top/)?-1:1)*r),i>t.j.o.resizer.min_width&&l.css(t.element,"width",t.rect.parentNode.offsetWidth>i?i:"100%"),a>t.j.o.resizer.min_height&&l.css(t.element,"height",a),t.updateSize(),t.showSizeViewer(t.element.offsetWidth,t.element.offsetHeight),e.stopImmediatePropagation()}},t.onClickOutside=function(e){t.isShown&&(t.isResized?(t.j.unlock(),t.isResized=!1,t.j.setEditorValue(),e.stopImmediatePropagation(),t.j.e.off(t.j.ow,"mousemove.resizer touchmove.resizer",t.onResize)):t.hide())},t.onClickElement=function(e,o){t.element===e&&t.isShown||(t.element=e,t.show(),s.Dom.isTag(t.element,"img")&&!t.element.complete&&t.j.e.on(t.element,"load",t.updateSize))},t.updateSize=function(){if(!t.isInDestruct&&t.isShown&&t.element&&t.rect){var e=l.offset(t.rect.parentNode||t.j.od.documentElement,t.j,t.j.od,!0),o=l.offset(t.element,t.j,t.j.ed),r=parseInt(t.rect.style.left||"0",10),n=parseInt(t.rect.style.top||"0",10),i=o.top-1-e.top,a=o.left-1-e.left;n===i&&r===a&&t.rect.offsetWidth===t.element.offsetWidth&&t.rect.offsetHeight===t.element.offsetHeight||(l.css(t.rect,{top:i,left:a,width:t.element.offsetWidth,height:t.element.offsetHeight}),t.j.events&&(t.j.e.fire(t.element,"changesize"),isNaN(r)||t.j.e.fire("resize")))}},t.hideSizeViewer=function(){t.sizeViewer.style.opacity="0"},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;l.$$("i",this.rect).forEach((function(o){e.e.on(o,"mousedown.resizer touchstart.resizer",t.onClickHandle.bind(t,o))})),u.eventEmitter.on("hideHelpers",this.hide),e.e.on("readonly",(function(e){e&&t.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(function(e){var t=/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>.*?<\/iframe>.*?)<\/jodit>/gi;t.test(e.value)&&(e.value=e.value.replace(t,"$1"))})).on("hideResizer",this.hide).on("change afterInit afterSetMode",this.onChangeEditor),this.addEventListeners(),this.onChangeEditor()},t.prototype.addEventListeners=function(){var e=this,t=this.j;t.e.off(t.editor,".resizer").off(t.ow,".resizer").on(t.editor,"keydown.resizer",(function(t){e.isShown&&t.key===i.KEY_DELETE&&e.element&&!s.Dom.isTag(e.element,"table")&&e.onDelete(t)})).on(t.ow,"resize.resizer",this.updateSize).on(t.ow,"mouseup.resizer keydown.resizer touchend.resizer",this.onClickOutside).on([t.ow,t.editor],"scroll.resizer",(function(){e.isShown&&!e.isResized&&e.hide()}))},t.prototype.onClickHandle=function(e,t){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=e,t.preventDefault(),t.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResized=!0,this.start_x=t.clientX,this.start_y=t.clientY,this.j.e.fire("hidePopup"),this.j.lock(this.LOCK_KEY),this.j.e.on(this.j.ow,"mousemove.resizer touchmove.resizer",this.onResize)},t.prototype.onDelete=function(e){this.element&&("JODIT"!==this.element.tagName?this.j.s.select(this.element):(s.Dom.safeRemove(this.element),this.hide(),e.preventDefault()))},t.prototype.onChangeEditor=function(){var e=this,t=this.j;this.isShown&&(this.element&&this.element.parentNode?this.updateSize():this.hide()),t.isDestructed||l.$$("img, table, iframe",t.editor).forEach((function(o){t.getMode()!==i.MODE_SOURCE&&!o[p]&&(s.Dom.isTag(o,"iframe")&&t.o.useIframeResizer||s.Dom.isTag(o,"img")&&t.o.useImageResizer||s.Dom.isTag(o,"table")&&t.o.useTableResizer)&&(o[p]=!0,e.bind(o))}))},t.prototype.bind=function(e){var t,o=this;if(s.Dom.isTag(e,"iframe")){var r=e;l.attr(e.parentNode,"-jodit_iframe_wrapper")?e=e.parentNode:(t=this.j.createInside.fromHTML(''),l.css(t,{display:"inline-block"===e.style.display?"inline-block":"block",width:e.offsetWidth,height:e.offsetHeight}),e.parentNode&&e.parentNode.insertBefore(t,e),t.appendChild(e),e=t),this.j.e.off(e,"mousedown.select touchstart.select").on(e,"mousedown.select touchstart.select",(function(){o.j.s.select(e)})).off(e,"changesize").on(e,"changesize",(function(){r.setAttribute("width",e.offsetWidth+"px"),r.setAttribute("height",e.offsetHeight+"px")}))}this.j.e.on(e,"dragstart",this.hide).on(e,"mousedown",(function(t){a.IS_IE&&s.Dom.isTag(e,"img")&&t.preventDefault()})).on(e,"click",(function(t){return o.onClickElement(e,t)}))},t.prototype.showSizeViewer=function(e,t){this.j.o.resizer.showSize&&(this.sizeViewer.offsetWidth>e||this.sizeViewer.offsetHeight>t?this.hideSizeViewer():(this.sizeViewer.style.opacity="1",this.sizeViewer.textContent=e+" x "+t,this.j.async.setTimeout(this.hideSizeViewer,{timeout:this.j.o.resizer.hideSizeTimeout,label:"hideSizeViewer"})))},t.prototype.show=function(){this.j.o.readonly||this.isShown||(this.isShown=!0,this.rect.parentNode||(l.markOwner(this.j,this.rect),this.j.workplace.appendChild(this.rect)),this.j.isFullSize&&(this.rect.style.zIndex=l.css(this.j.container,"zIndex").toString()),this.updateSize())},t.prototype.hide=function(){this.isResized=!1,this.isShown=!1,this.element=null,s.Dom.safeRemove(this.rect)},t.prototype.beforeDestruct=function(e){this.hide(),u.eventEmitter.off("hideHelpers",this.hide),e.e.off(this.j.ow,".resizer").off(".resizer")},r.__decorate([d.debounce()],t.prototype,"onChangeEditor",null),r.__decorate([d.autobind],t.prototype,"hide",null),t}(c.Plugin);t.resizer=f},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.search=void 0;var r=o(7);o(307);var n=o(8),i=o(9),a=o(9),s=o(32),l=o(183),c=o(75),u=o(19),d=o(99);n.Config.prototype.useSearch=!0,n.Config.prototype.controls.find={tooltip:"Find",icon:"search",exec:function(e,t,o){var r=o.control;switch(r.args&&r.args[0]){case"findPrevious":e.e.fire("searchPrevious");break;case"findNext":e.e.fire("searchNext");break;case"replace":e.execCommand("openReplaceDialog");break;default:e.execCommand("openSearchDialog")}},list:{search:"Find",findNext:"Find Next",findPrevious:"Find Previous",replace:"Replace"},childTemplate:function(e,t,o){return o}};var p=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.buttons=[{name:"find",group:"search"}],o.template='",o.isOpened=!1,o.selInfo=null,o.current=null,o.eachMap=function(e,t,r){s.Dom.findWithCurrent(e,(function(e){return Boolean(e&&t(e))}),o.j.editor,r?"nextSibling":"previousSibling",r?"firstChild":"lastChild")},o.updateCounters=function(){if(o.isOpened){o.counterBox.style.display=o.queryInput.value.length?"inline-block":"none";var e=o.calcCounts(o.queryInput.value,o.j.s.range);o.counterBox.textContent=e.join("/")}},o.calcCounts=function(e,t){void 0===t&&(t=!1);for(var r=[],n=0,i=0,a=!1,s=o.j.editor.firstChild;s&&e.length;)if(a=o.find(s,e,!0,0,a||o.j.ed.createRange())){if(o.boundAlreadyWas(a,r))break;r.push(a),s=a.startContainer,i+=1,t&&o.boundAlreadyWas(t,[a])&&(n=i)}else s=null;return[n,i]},o.findAndReplace=function(e,t){var r=o.find(e,t,!0,0,o.j.s.range);if(r&&r.startContainer&&r.endContainer){var n=o.j.ed.createRange();try{if(r&&r.startContainer&&r.endContainer){n.setStart(r.startContainer,r.startOffset),n.setEnd(r.endContainer,r.endOffset),n.deleteContents();var i=o.j.createInside.text(o.replaceInput.value);n.insertNode(i),o.j.s.select(i),o.tryScrollToElement(i)}}catch(e){}return!0}return!1},o.findAndSelect=function(e,t,r){var n=o.find(e,t,r,0,o.j.s.range);if(n&&n.startContainer&&n.endContainer){var i=o.j.ed.createRange();try{i.setStart(n.startContainer,n.startOffset),i.setEnd(n.endContainer,n.endOffset),o.j.s.selectRange(i)}catch(e){}return o.tryScrollToElement(n.startContainer),o.current=n.startContainer,o.updateCounters(),!0}return!1},o.find=function(e,r,n,i,a){if(e&&r.length){var l="",c={startContainer:null,startOffset:null,endContainer:null,endOffset:null};if(o.eachMap(e,(function(e){if(s.Dom.isText(e)&&null!=e.nodeValue&&e.nodeValue.length){var d=e.nodeValue;n||e!==a.startContainer?n&&e===a.endContainer&&(d=i?d.substr(0,a.startOffset):d.substr(a.endOffset)):d=i?d.substr(a.endOffset):d.substr(0,a.startOffset);var p=n?l+d:d+l,f=t.findSomePartOfString(r,p,n);if(!1!==f){var h=t.findSomePartOfString(r,d,n);!0===h?h=u.trim(r):!1===h&&!0===(h=t.findSomePartOfString(d,r,n))&&(h=u.trim(d));var m=t.getSomePartOfStringIndex(r,d,n)||0;if((n&&!i||!n&&i)&&e.nodeValue.length-d.length>0&&(m+=e.nodeValue.length-d.length),null==c.startContainer&&(c.startContainer=e,c.startOffset=m),!0===f)return c.endContainer=e,c.endOffset=m,c.endOffset+=h.length,!0;l=p}else l="",c={startContainer:null,startOffset:null,endContainer:null,endOffset:null}}else s.Dom.isBlock(e,o.j.ew)&&""!==l&&(l=n?l+" ":" "+l);return!1}),n),c.startContainer&&c.endContainer)return c;if(!i)return o.current=n?o.j.editor.firstChild:o.j.editor.lastChild,o.find(o.current,r,n,i+1,a)}return!1},o.open=function(e){void 0===e&&(e=!1),o.isOpened||(o.searchBox.classList.add("jodit-search_active"),o.isOpened=!0),o.calcSticky(o.j.e.fire("getStickyState.sticky")||!1),o.j.e.fire("hidePopup"),o.searchBox.classList.toggle("jodit-search_replace",e),o.current=o.j.s.current(),o.selInfo=o.j.s.save();var t=(o.j.s.sel||"").toString();t&&(o.queryInput.value=t),o.updateCounters(),t?o.queryInput.select():o.queryInput.focus()},o.close=function(){o.isOpened&&(o.selInfo&&(o.j.s.restore(o.selInfo),o.selInfo=null),o.searchBox.classList.remove("jodit-search_active"),o.isOpened=!1)},o}return r.__extends(t,e),t.getSomePartOfStringIndex=function(e,t,o){return void 0===o&&(o=!0),this.findSomePartOfString(e,t,o,!0)},t.findSomePartOfString=function(e,t,o,r){void 0===o&&(o=!0),void 0===r&&(r=!1),e=u.trim(e.toLowerCase().replace(i.SPACE_REG_EXP()," ")),t=t.toLowerCase();for(var n=o?0:t.length-1,a=o?0:e.length-1,s=0,l=null,c=o?1:-1,d=[];void 0!==t[n];n+=c){var p=e[a]===t[n];if(p||null!=l&&i.SPACE_REG_EXP().test(t[n])?(null!=l&&o||(l=n),d.push(t[n]),p&&(s+=1,a+=c)):(l=null,d.length=0,s=0,a=o?0:e.length-1),s===e.length)return!r||l}return r?null!=l&&l:!!d.length&&(o?d.join(""):d.reverse().join(""))},t.prototype.boundAlreadyWas=function(e,t){return t.some((function(t){return t.startContainer===e.startContainer&&t.endContainer===e.endContainer&&t.startOffset===e.startOffset&&t.endOffset===e.endOffset}),!1)},t.prototype.tryScrollToElement=function(e){var t=s.Dom.closest(e,s.Dom.isElement,this.j.editor);t||(t=s.Dom.prev(e,s.Dom.isElement,this.j.editor)),t&&t!==this.j.editor&&t.scrollIntoView()},t.prototype.afterInit=function(e){var t=this;if(e.o.useSearch){var o=this;o.searchBox=e.c.fromHTML(o.template);var r=u.refs(o.searchBox),n=r.replace,s=r.cancel,l=r.next,c=r.prev,d=r.replaceBtn,p=r.counterBox;o.queryInput=r.query,o.replaceInput=n,o.closeButton=s,o.nextButton=l,o.prevButton=c,o.replaceButton=d,o.counterBox=p;var f=function(){e.workplace.appendChild(t.searchBox),e.e.off(t.j.container,"keydown.search").on(t.j.container,"keydown.search",(function(r){if(e.getRealMode()===a.MODE_WYSIWYG)switch(r.key){case i.KEY_ESC:t.close();break;case i.KEY_F3:o.queryInput.value&&(e.e.fire(r.shiftKey?"searchPrevious":"searchNext"),r.preventDefault())}}))};f(),e.e.on("changePlace",f).on(o.closeButton,"click",this.close).on(o.queryInput,"mousedown",(function(){e.s.isFocused()&&(e.s.removeMarkers(),o.selInfo=e.s.save())})).on(o.replaceButton,"click",(function(r){o.findAndReplace(e.s.current()||e.editor.firstChild,o.queryInput.value),t.updateCounters(),r.preventDefault(),r.stopImmediatePropagation()})).on([o.nextButton,o.prevButton],"click",(function(t){e.e.fire(o.nextButton===this?"searchNext":"searchPrevious"),t.preventDefault(),t.stopImmediatePropagation()})).on(this.queryInput,"keydown",this.j.async.debounce((function(o){switch(o.key){case i.KEY_ENTER:o.preventDefault(),o.stopImmediatePropagation(),e.e.fire("searchNext")&&t.close();break;default:t.updateCounters()}}),this.j.defaultTimeout)).on("beforeSetMode.search",(function(){t.close()})).on("keydown.search mousedown.search",(function(){t.selInfo&&(e.s.removeMarkers(),t.selInfo=null),t.isOpened&&(t.current=t.j.s.current(),t.updateCounters())})).on("searchNext.search searchPrevious.search",(function(){return o.isOpened?o.findAndSelect(e.s.current()||e.editor.firstChild,o.queryInput.value,"searchNext"===e.e.current):o.open()})).on("search.search",(function(t,o){void 0===o&&(o=!0),e.execCommand("search",t,o)})).on("toggleSticky.search",this.calcSticky),e.registerCommand("search",{exec:function(t,r,n){return void 0===n&&(n=!0),o.findAndSelect(e.s.current()||e.editor.firstChild,r||"",n),!1}}).registerCommand("openSearchDialog",{exec:function(){return o.open(),!1},hotkeys:["ctrl+f","cmd+f"]}).registerCommand("openReplaceDialog",{exec:function(){return e.o.readonly||o.open(!0),!1},hotkeys:["ctrl+h","cmd+h"]})}},t.prototype.beforeDestruct=function(e){var t;s.Dom.safeRemove(this.searchBox),null===(t=e.events)||void 0===t||t.off(".search")},t.prototype.calcSticky=function(e){if(this.isOpened)if(this.searchBox.classList.toggle("jodit-search_sticky",e),e){var t=u.position(this.j.toolbarContainer);u.css(this.searchBox,{top:t.top+t.height,left:t.left+t.width})}else u.css(this.searchBox,{top:null,left:null})},r.__decorate([d.autobind],t.prototype,"calcSticky",null),t}(l.Plugin);t.search=p},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.select=void 0;var r=o(7),n=o(183),i=o(99),a=o(19),s=o(32),l=o(75),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.proxyEventsList=["click","mousedown","touchstart","mouseup","touchend"],t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;this.proxyEventsList.forEach((function(o){e.e.on(o+".inline-popup",t.onStartSelection)}))},t.prototype.beforeDestruct=function(e){var t=this;this.proxyEventsList.forEach((function(o){e.e.on(o+".inline-popup",t.onStartSelection)}))},t.prototype.onStartSelection=function(e){for(var t,o=this.j,r=e.target;void 0===t&&r&&r!==o.editor;)t=o.e.fire(a.camelCase(e.type+"_"+r.nodeName.toLowerCase()),r,e),r=r.parentElement;"click"===e.type&&void 0===t&&r===o.editor&&o.e.fire(e.type+"Editor",r,e)},t.prototype.onOutsideClick=function(e){var t=this,o=e.target;s.Dom.up(o,(function(e){return e===t.j.editor}))||l.UIElement.closestElement(o,l.Popup)||this.j.e.fire("outsideClick",e)},r.__decorate([i.autobind],t.prototype,"onStartSelection",null),r.__decorate([i.watch("ow:click")],t.prototype,"onOutsideClick",null),t}(n.Plugin);t.select=c},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);o(310),r.__exportStar(o(311),t),r.__exportStar(o(312),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8);r.Config.prototype.width="auto",r.Config.prototype.minWidth=200,r.Config.prototype.maxWidth="100%",r.Config.prototype.allowResizeX=!1,r.Config.prototype.allowResizeY=!0,r.Config.prototype.height="auto",r.Config.prototype.minHeight=200,r.Config.prototype.maxHeight="auto",r.Config.prototype.saveHeightInStorage=!1},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeHandler=void 0;var r=o(7),n=o(183),i=o(32),a=o(99),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isResized=!1,t.start={x:0,y:0,w:0,h:0},t.handle=t.j.c.div("jodit-editor__resize",''),t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;"auto"!==e.o.height&&(e.o.allowResizeX||e.o.allowResizeY)&&(e.e.on("toggleFullSize.resizeHandler",(function(){t.handle.style.display=e.isFullSize?"none":"block"})).on(this.handle,"mousedown touchstart",this.onHandleResizeStart).on(e.ow,"mouseup touchsend",this.onHandleResizeEnd),e.container.appendChild(this.handle))},t.prototype.onHandleResizeStart=function(e){this.isResized=!0,this.start.x=e.clientX,this.start.y=e.clientY,this.start.w=this.j.container.offsetWidth,this.start.h=this.j.container.offsetHeight,this.j.lock(),this.j.e.on(this.j.ow,"mousemove touchmove",this.onHandleResize),e.preventDefault()},t.prototype.onHandleResize=function(e){this.isResized&&(this.j.o.allowResizeY&&this.j.e.fire("setHeight",this.start.h+e.clientY-this.start.y),this.j.o.allowResizeX&&this.j.e.fire("setWidth",this.start.w+e.clientX-this.start.x),this.j.e.fire("resize"))},t.prototype.onHandleResizeEnd=function(){this.isResized&&(this.isResized=!1,this.j.e.off(this.j.ow,"mousemove touchmove",this.onHandleResize),this.j.unlock())},t.prototype.beforeDestruct=function(e){i.Dom.safeRemove(this.handle),this.j.e.off(this.j.ow,"mouseup touchsend",this.onHandleResizeEnd)},t.requires=["size"],r.__decorate([a.autobind],t)}(n.Plugin);t.resizeHandler=s},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.size=void 0;var r=o(7);o(313);var n=o(19),i=o(183),a=o(99),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resizeWorkspaces=t.j.async.debounce(t.resizeWorkspaceImd,t.j.defaultTimeout,!0),t}return r.__extends(t,e),t.prototype.afterInit=function(e){e.e.on("setHeight.size",this.setHeight).on("setWidth.size",this.setWidth).on("afterInit.size changePlace.size",this.initialize,void 0,!0).on(e.ow,"load.size",this.resizeWorkspaces).on("afterInit.size resize.size afterUpdateToolbar.size scroll.size afterResize.size toggleFullSize.size",this.resizeWorkspaces),this.initialize()},t.prototype.initialize=function(){var e=this.j;if(!e.o.inline){var t=e.o.height;if(e.o.saveHeightInStorage&&"auto"!==t){var o=e.storage.get("height");o&&(t=o)}n.css(e.editor,{minHeight:"100%"}),n.css(e.container,{minHeight:e.o.minHeight,maxHeight:e.o.maxHeight,minWidth:e.o.minWidth,maxWidth:e.o.maxWidth}),this.setHeight(t),this.setWidth(e.o.width)}},t.prototype.setHeight=function(e){if(n.isNumber(e)){var t=this.j.o,o=t.minHeight,r=t.maxHeight;n.isNumber(o)&&o>e&&(e=o),n.isNumber(r)&&e>r&&(e=r)}n.css(this.j.container,"height",e),this.j.o.saveHeightInStorage&&this.j.storage.set("height",e),this.resizeWorkspaceImd()},t.prototype.setWidth=function(e){if(n.isNumber(e)){var t=this.j.o,o=t.minWidth,r=t.maxWidth;n.isNumber(o)&&o>e&&(e=o),n.isNumber(r)&&e>r&&(e=r)}n.css(this.j.container,"width",e),this.resizeWorkspaceImd()},t.prototype.getNotWorkHeight=function(){var e,t;return((null===(e=this.j.toolbarContainer)||void 0===e?void 0:e.offsetHeight)||0)+((null===(t=this.j.statusbar)||void 0===t?void 0:t.getHeight())||0)+2},t.prototype.resizeWorkspaceImd=function(){if(this.j&&!this.j.isDestructed&&this.j.o&&!this.j.o.inline&&this.j.container&&this.j.container.parentNode){var e=(n.css(this.j.container,"minHeight")||0)-this.getNotWorkHeight();if(n.isNumber(e)&&e>0&&([this.j.workplace,this.j.iframe,this.j.editor].map((function(t){t&&n.css(t,"minHeight",e)})),this.j.e.fire("setMinHeight",e)),n.isNumber(this.j.o.maxHeight)){var t=this.j.o.maxHeight-this.getNotWorkHeight();[this.j.workplace,this.j.iframe,this.j.editor].map((function(e){e&&n.css(e,"maxHeight",t)})),this.j.e.fire("setMaxHeight",t)}this.j.container&&n.css(this.j.workplace,"height","auto"!==this.j.o.height||this.j.isFullSize?this.j.container.offsetHeight-this.getNotWorkHeight():"auto")}},t.prototype.beforeDestruct=function(e){this.j.e.off(this.j.ow,"load.size",this.resizeWorkspaces).off(".size")},r.__decorate([a.autobind],t)}(i.Plugin);t.size=s},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);o(315),r.__exportStar(o(316),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(9),i=o(9);r.Config.prototype.beautifyHTML=!i.IS_IE,r.Config.prototype.sourceEditor="ace",r.Config.prototype.sourceEditorNativeOptions={showGutter:!0,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},r.Config.prototype.sourceEditorCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"],r.Config.prototype.beautifyHTMLCDNUrlsJS=["https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js","https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify-html.min.js"],r.Config.prototype.controls.source={mode:n.MODE_SPLIT,exec:function(e){e.toggleMode()},isActive:function(e){return e.getRealMode()===n.MODE_SOURCE},tooltip:"Change mode"}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.source=void 0;var r=o(7);o(317);var n=o(9),i=o(9),a=o(183),s=o(32),l=o(19),c=o(318),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"source",group:"source"}],t.__lock=!1,t.__oldMirrorValue="",t.tempMarkerStart="{start-jodit-selection}",t.tempMarkerStartReg=/{start-jodit-selection}/g,t.tempMarkerEnd="{end-jodit-selection}",t.tempMarkerEndReg=/{end-jodit-selection}/g,t.selInfo=[],t.insertHTML=function(e){var o;null===(o=t.sourceEditor)||void 0===o||o.insertRaw(e),t.toWYSIWYG()},t.fromWYSIWYG=function(e){if(void 0===e&&(e=!1),!t.__lock||!0===e){t.__lock=!0;var o=t.j.getEditorValue(!1);o!==t.getMirrorValue()&&t.setMirrorValue(o),t.__lock=!1}},t.toWYSIWYG=function(){if(!t.__lock){var e=t.getMirrorValue();e!==t.__oldMirrorValue&&(t.__lock=!0,t.j.setEditorValue(e),t.__lock=!1,t.__oldMirrorValue=e)}},t.getNormalPosition=function(e,t){for(var o=e;o>0;){if("<"===t[--o]&&void 0!==t[o+1]&&t[o+1].match(/[\w/]+/i))return o;if(">"===t[o])return e}return e},t.__clear=function(e){return e.replace(n.INVISIBLE_SPACE_REG_EXP(),"")},t.selectAll=function(){var e;null===(e=t.sourceEditor)||void 0===e||e.selectAll()},t.onSelectAll=function(e){if("selectall"===e.toLowerCase()&&t.j.getRealMode()===i.MODE_SOURCE)return t.selectAll(),!1},t.getSelectionStart=function(){var e,o;return null!==(o=null===(e=t.sourceEditor)||void 0===e?void 0:e.getSelectionStart())&&void 0!==o?o:0},t.getSelectionEnd=function(){var e,o;return null!==(o=null===(e=t.sourceEditor)||void 0===e?void 0:e.getSelectionEnd())&&void 0!==o?o:0},t.saveSelection=function(){if(t.j.getRealMode()===n.MODE_WYSIWYG)t.selInfo=t.j.s.save()||[],t.j.setEditorValue(),t.fromWYSIWYG(!0);else{if(t.selInfo.length=0,t.j.o.editHTMLDocumentMode)return;var e=t.getMirrorValue();if(t.getSelectionStart()===t.getSelectionEnd()){var o=t.j.s.marker(!0);t.selInfo[0]={startId:o.id,collapsed:!0,startMarker:o.outerHTML};var r=t.getNormalPosition(t.getSelectionStart(),t.getMirrorValue());t.setMirrorValue(e.substr(0,r)+t.__clear(t.selInfo[0].startMarker)+e.substr(r))}else{var i=t.j.s.marker(!0),a=t.j.s.marker(!1);t.selInfo[0]={startId:i.id,endId:a.id,collapsed:!1,startMarker:t.__clear(i.outerHTML),endMarker:t.__clear(a.outerHTML)},r=t.getNormalPosition(t.getSelectionStart(),e);var s=t.getNormalPosition(t.getSelectionEnd(),e);t.setMirrorValue(e.substr(0,r)+t.selInfo[0].startMarker+e.substr(r,s-r)+t.selInfo[0].endMarker+e.substr(s))}t.toWYSIWYG()}},t.removeSelection=function(){if(t.selInfo.length){if(t.j.getRealMode()===n.MODE_WYSIWYG)return t.__lock=!0,t.j.s.restore(t.selInfo),void(t.__lock=!1);var e=t.getMirrorValue(),o=0,r=0;try{if(t.selInfo[0].startMarker&&(e=e.replace(/]+data-jodit-selection_marker="start"[^>]*>[<>]*?<\/span>/gim,t.tempMarkerStart)),t.selInfo[0].endMarker&&(e=e.replace(/]+data-jodit-selection_marker="end"[^>]*>[<>]*?<\/span>/gim,t.tempMarkerEnd)),!t.j.o.editHTMLDocumentMode&&t.j.o.beautifyHTML){var i=t.j.e.fire("beautifyHTML",e);l.isString(i)&&(e=i)}r=o=e.indexOf(t.tempMarkerStart),e=e.replace(t.tempMarkerStartReg,""),t.selInfo[0].collapsed&&-1!==o||(r=e.indexOf(t.tempMarkerEnd),-1===o&&(o=r)),e=e.replace(t.tempMarkerEndReg,"")}finally{e=e.replace(t.tempMarkerEndReg,"").replace(t.tempMarkerStartReg,"")}t.setMirrorValue(e),t.setMirrorSelectionRange(o,r),t.toWYSIWYG(),t.setFocusToMirror()}},t.setMirrorSelectionRange=function(e,o){var r;null===(r=t.sourceEditor)||void 0===r||r.setSelectionRange(e,o)},t.onReadonlyReact=function(){var e;null===(e=t.sourceEditor)||void 0===e||e.setReadOnly(t.j.o.readonly)},t}return r.__extends(t,e),t.prototype.getMirrorValue=function(){var e;return(null===(e=this.sourceEditor)||void 0===e?void 0:e.getValue())||""},t.prototype.setMirrorValue=function(e){var t;null===(t=this.sourceEditor)||void 0===t||t.setValue(e)},t.prototype.setFocusToMirror=function(){var e;null===(e=this.sourceEditor)||void 0===e||e.focus()},t.prototype.initSourceEditor=function(e){var t,o=this;if("area"!==e.o.sourceEditor){var r=c.createSourceEditor(e.o.sourceEditor,e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG);r.onReadyAlways((function(){var t,n;null===(t=o.sourceEditor)||void 0===t||t.destruct(),o.sourceEditor=r,o.fromWYSIWYG(!0),null===(n=e.events)||void 0===n||n.fire("sourceEditorReady",e)}))}else null===(t=this.sourceEditor)||void 0===t||t.onReadyAlways((function(){var t;o.fromWYSIWYG(!0),null===(t=e.events)||void 0===t||t.fire("sourceEditorReady",e)}))},t.prototype.afterInit=function(e){var t=this;if(this.mirrorContainer=e.c.div("jodit-source"),e.workplace.appendChild(this.mirrorContainer),e.e.on("afterAddPlace changePlace afterInit",(function(){e.workplace.appendChild(t.mirrorContainer)})),this.sourceEditor=c.createSourceEditor("area",e,this.mirrorContainer,this.toWYSIWYG,this.fromWYSIWYG),e.e.off("beforeSetMode.source afterSetMode.source").on("beforeSetMode.source",t.saveSelection).on("afterSetMode.source",t.removeSelection),this.onReadonlyReact(),e.e.on("insertHTML.source",(function(o){if(!e.o.readonly&&!t.j.isEditorMode())return t.insertHTML(o),!1})).on("readonly.source",this.onReadonlyReact).on("placeholder.source",(function(e){var o;null===(o=t.sourceEditor)||void 0===o||o.setPlaceHolder(e)})).on("beforeCommand.source",this.onSelectAll).on("change.source",this.fromWYSIWYG),e.e.on("beautifyHTML",(function(e){return e})),e.o.beautifyHTML){var o=function(){var t,o,r=e.ow.html_beautify;return!(!r||e.isInDestruct||(null===(o=null===(t=e.events)||void 0===t?void 0:t.off("beautifyHTML"))||void 0===o||o.on("beautifyHTML",(function(e){return r(e)})),0))};o()||l.loadNext(e,e.o.beautifyHTMLCDNUrlsJS).then(o)}this.fromWYSIWYG(),this.initSourceEditor(e)},t.prototype.beforeDestruct=function(e){this.sourceEditor&&(this.sourceEditor.destruct(),delete this.sourceEditor),s.Dom.safeRemove(this.mirrorContainer)},t}(a.Plugin);t.source=u},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSourceEditor=void 0;var r=o(319);t.createSourceEditor=function(e,t,o,n,i){var a;switch(e){case"ace":if(!t.o.shadowRoot){a=new r.AceEditor(t,o,n,i);break}default:a=new r.TextAreaEditor(t,o,n,i)}return a.init(t),a.onReadyAlways((function(){a.setReadOnly(t.o.readonly)})),a}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(320),t),r.__exportStar(o(322),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextAreaEditor=void 0;var r=o(7),n=o(19),i=o(10),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autosize=t.j.async.debounce((function(){t.instance.style.height="auto",t.instance.style.height=t.instance.scrollHeight+"px"}),t.j.defaultTimeout),t}return r.__extends(t,e),t.prototype.init=function(e){var t=this;this.instance=e.c.element("textarea",{class:"jodit-source__mirror"}),this.container.appendChild(this.instance),e.e.on(this.instance,"mousedown keydown touchstart input",e.async.debounce(this.toWYSIWYG,e.defaultTimeout)).on("setMinHeight.source",(function(e){n.css(t.instance,"minHeight",e)})).on(this.instance,"change keydown mousedown touchstart input",this.autosize).on("afterSetMode.source",this.autosize).on(this.instance,"mousedown focus",(function(t){e.e.fire(t.type,t)})),this.autosize(),this.onReady()},t.prototype.destruct=function(){i.Dom.safeRemove(this.instance)},t.prototype.getValue=function(){return this.instance.value},t.prototype.setValue=function(e){this.instance.value=e},t.prototype.insertRaw=function(e){var t=this.getValue();if(0>this.getSelectionStart())this.setValue(t+e);else{var o=this.getSelectionStart(),r=this.getSelectionEnd();this.setValue(t.substring(0,o)+e+t.substring(r,t.length))}},t.prototype.getSelectionStart=function(){return this.instance.selectionStart},t.prototype.getSelectionEnd=function(){return this.instance.selectionEnd},t.prototype.setSelectionRange=function(e,t){void 0===t&&(t=e),this.instance.setSelectionRange(e,t)},t.prototype.focus=function(){this.instance.focus()},t.prototype.setPlaceHolder=function(e){this.instance.setAttribute("placeholder",e)},t.prototype.setReadOnly=function(e){e?this.instance.setAttribute("readonly","true"):this.instance.removeAttribute("readonly")},t.prototype.selectAll=function(){this.instance.select()},t.prototype.replaceUndoManager=function(){var e=this,t=this.jodit.observer;this.j.e.on(this.instance,"keydown",(function(o){if((o.ctrlKey||o.metaKey)&&"z"===o.key)return o.shiftKey?t.redo():t.undo(),e.setSelectionRange(e.getValue().length),!1}))},t}(o(321).SourceEditor);t.TextAreaEditor=a},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceEditor=void 0;var o=function(){function e(e,t,o,r){this.jodit=e,this.container=t,this.toWYSIWYG=o,this.fromWYSIWYG=r,this.className="",this.isReady=!1}return Object.defineProperty(e.prototype,"j",{get:function(){return this.jodit},enumerable:!1,configurable:!0}),e.prototype.onReady=function(){this.replaceUndoManager(),this.isReady=!0,this.j.e.fire(this,"ready")},e.prototype.onReadyAlways=function(e){var t;this.isReady?e():null===(t=this.j.events)||void 0===t||t.on(this,"ready",e)},e}();t.SourceEditor=o},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AceEditor=void 0;var r=o(7),n=o(9),i=o(19),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.className="jodit_ace_editor",t.proxyOnFocus=function(e){t.j.e.fire("focus",e)},t.proxyOnMouseDown=function(e){t.j.e.fire("mousedown",e)},t}return r.__extends(t,e),t.prototype.aceExists=function(){return void 0!==this.j.ow.ace},t.prototype.getLastColumnIndex=function(e){return this.instance.session.getLine(e).length},t.prototype.getLastColumnIndices=function(){for(var e=this.instance.session.getLength(),t=[],o=0,r=0;e>r;r++)o+=this.getLastColumnIndex(r),r>0&&(o+=1),t[r]=o;return t},t.prototype.getRowColumnIndices=function(e){var t=this.getLastColumnIndices();if(t[0]>=e)return{row:0,column:e};for(var o=1,r=1;t.length>r;r++)e>t[r]&&(o=r+1);return{row:o,column:e-t[o-1]-1}},t.prototype.setSelectionRangeIndices=function(e,t){var o=this.getRowColumnIndices(e),r=this.getRowColumnIndices(t);this.instance.getSelection().setSelectionRange({start:o,end:r})},t.prototype.getIndexByRowColumn=function(e,t){return this.getLastColumnIndices()[e]-this.getLastColumnIndex(e)+t},t.prototype.init=function(e){var t=this,o=function(){if(void 0===t.instance&&t.aceExists()){var o=t.j.c.div("jodit-source__mirror-fake");t.container.appendChild(o),t.instance=e.ow.ace.edit(o),t.instance.setTheme(e.o.sourceEditorNativeOptions.theme),t.instance.renderer.setShowGutter(e.o.sourceEditorNativeOptions.showGutter),t.instance.getSession().setMode(e.o.sourceEditorNativeOptions.mode),t.instance.setHighlightActiveLine(e.o.sourceEditorNativeOptions.highlightActiveLine),t.instance.getSession().setUseWrapMode(!0),t.instance.setOption("indentedSoftWrap",!1),t.instance.setOption("wrap",e.o.sourceEditorNativeOptions.wrap),t.instance.getSession().setUseWorker(!1),t.instance.$blockScrolling=1/0,t.instance.on("change",t.toWYSIWYG),t.instance.on("focus",t.proxyOnFocus),t.instance.on("mousedown",t.proxyOnMouseDown),e.getRealMode()!==n.MODE_WYSIWYG&&t.setValue(t.getValue());var r=t.j.async.debounce((function(){e.isInDestruct||(t.instance.setOption("maxLines","auto"!==e.o.height?e.workplace.offsetHeight/t.instance.renderer.lineHeight:1/0),t.instance.resize())}),2*t.j.defaultTimeout);e.e.on("afterResize afterSetMode",r),r(),t.onReady()}};e.e.on("afterSetMode",(function(){e.getRealMode()!==n.MODE_SOURCE&&e.getMode()!==n.MODE_SPLIT||(t.fromWYSIWYG(),o())})),o(),this.aceExists()||i.loadNext(e,e.o.sourceEditorCDNUrlsJS).then((function(){e.isInDestruct||o()}))},t.prototype.destruct=function(){var e,t;this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),null===(t=null===(e=this.j)||void 0===e?void 0:e.events)||void 0===t||t.off("aceInited.source")},t.prototype.setValue=function(e){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){var t=this.j.e.fire("beautifyHTML",e);i.isString(t)&&(e=t)}this.instance.setValue(e),this.instance.clearSelection()},t.prototype.getValue=function(){return this.instance.getValue()},t.prototype.setReadOnly=function(e){this.instance.setReadOnly(e)},t.prototype.focus=function(){this.instance.focus()},t.prototype.getSelectionStart=function(){var e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.start.row,e.start.column)},t.prototype.getSelectionEnd=function(){var e=this.instance.selection.getRange();return this.getIndexByRowColumn(e.end.row,e.end.column)},t.prototype.selectAll=function(){this.instance.selection.selectAll()},t.prototype.insertRaw=function(e){var t=this.instance.selection.getCursor(),o=this.instance.session.insert(t,e);this.instance.selection.setRange({start:t,end:o},!1)},t.prototype.setSelectionRange=function(e,t){this.setSelectionRangeIndices(e,t)},t.prototype.setPlaceHolder=function(e){},t.prototype.replaceUndoManager=function(){var e=this.jodit.observer;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec:function(){e.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec:function(){e.redo()}})},t}(o(321).SourceEditor);t.AceEditor=a},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stat=void 0;var r=o(7),n=o(8),i=o(9),a=o(183),s=o(32);n.Config.prototype.showCharsCounter=!0,n.Config.prototype.countHTMLChars=!1,n.Config.prototype.showWordsCounter=!0;var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.charCounter=null,t.wordCounter=null,t.reInit=function(){t.j.o.showCharsCounter&&t.charCounter&&t.j.statusbar.append(t.charCounter,!0),t.j.o.showWordsCounter&&t.wordCounter&&t.j.statusbar.append(t.wordCounter,!0),t.j.e.off("change keyup",t.calc).on("change keyup",t.calc),t.calc()},t.calc=t.j.async.throttle((function(){var e=t.j.text;if(t.j.o.showCharsCounter&&t.charCounter){var o=t.j.o.countHTMLChars?t.j.value:e.replace(i.SPACE_REG_EXP(),"");t.charCounter.textContent=t.j.i18n("Chars: %d",o.length)}t.j.o.showWordsCounter&&t.wordCounter&&(t.wordCounter.textContent=t.j.i18n("Words: %d",e.replace(i.INVISIBLE_SPACE_REG_EXP(),"").split(i.SPACE_REG_EXP()).filter((function(e){return e.length})).length))}),t.j.defaultTimeout),t}return r.__extends(t,e),t.prototype.afterInit=function(){this.charCounter=this.j.c.span(),this.wordCounter=this.j.c.span(),this.j.e.on("afterInit changePlace afterAddPlace",this.reInit),this.reInit()},t.prototype.beforeDestruct=function(){s.Dom.safeRemove(this.charCounter),s.Dom.safeRemove(this.wordCounter),this.j.e.off("afterInit changePlace afterAddPlace",this.reInit),this.charCounter=null,this.wordCounter=null},t}(a.Plugin);t.stat=l},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sticky=void 0;var r=o(7);o(325);var n=o(8),i=o(9),a=o(10),s=o(19),l=o(99);n.Config.prototype.toolbarSticky=!0,n.Config.prototype.toolbarDisableStickyForMobile=!0,n.Config.prototype.toolbarStickyOffset=0;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isToolbarSticked=!1,t.createDummy=function(e){i.IS_IE&&!t.dummyBox&&(t.dummyBox=t.j.c.div(),t.dummyBox.classList.add("jodit_sticky-dummy_toolbar"),t.j.container.insertBefore(t.dummyBox,e))},t.addSticky=function(e){t.isToolbarSticked||(t.createDummy(e),t.j.container.classList.add("jodit_sticky"),t.isToolbarSticked=!0),s.css(e,{top:t.j.o.toolbarStickyOffset||null,width:t.j.container.offsetWidth-2}),i.IS_IE&&t.dummyBox&&s.css(t.dummyBox,{height:e.offsetHeight})},t.removeSticky=function(e){t.isToolbarSticked&&(s.css(e,{width:"",top:""}),t.j.container.classList.remove("jodit_sticky"),t.isToolbarSticked=!1)},t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).on("getStickyState.sticky",(function(){return t.isToolbarSticked}))},t.prototype.onScroll=function(){var e=this.jodit,t=e.ow.pageYOffset||e.od.documentElement&&e.od.documentElement.scrollTop||0,o=s.offset(e.container,e,e.od,!0),r=e.getMode()===i.MODE_WYSIWYG&&t+e.o.toolbarStickyOffset>o.top&&o.top+o.height>t+e.o.toolbarStickyOffset&&!(e.o.toolbarDisableStickyForMobile&&this.isMobile());if(e.o.toolbarSticky&&!0===e.o.toolbar&&this.isToolbarSticked!==r){var n=e.toolbarContainer;n&&(r?this.addSticky(n):this.removeSticky(n)),e.e.fire("toggleSticky",r)}},t.prototype.isMobile=function(){return this.j&&this.j.options&&this.j.container&&this.j.o.sizeSM>=this.j.container.offsetWidth},t.prototype.beforeDestruct=function(e){this.dummyBox&&a.Dom.safeRemove(this.dummyBox),e.e.off(e.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.onScroll).off(".sticky")},r.__decorate([l.throttle()],t.prototype,"onScroll",null),t}(a.Plugin);t.sticky=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbols=void 0;var r=o(7);o(327),o(328);var n=o(9),i=o(10),a=o(20),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[{name:"symbol",group:"insert"}],t.countInRow=17,t}return r.__extends(t,e),t.prototype.afterInit=function(e){var t=this;e.e.on("generateSpecialCharactersTable.symbols",(function(){for(var o=e.c.fromHTML('
'),r=o.querySelector(".jodit-symbols__preview"),s=o.querySelector("table").tBodies[0],l=[],c=0;e.o.specialCharacters.length>c;){for(var u=e.c.element("tr"),d=0;t.countInRow>d&&e.o.specialCharacters.length>c;d+=1,c+=1){var p=e.c.element("td"),f=e.c.fromHTML(''+e.o.specialCharacters[c]+"");l.push(f),p.appendChild(f),u.appendChild(p)}s.appendChild(u)}var h=t;return e.e.on(l,"focus",(function(){r.innerHTML=this.innerHTML})).on(l,"mousedown",(function(t){i.Dom.isTag(this,"a")&&(e.s.focus(),e.s.insertHTML(this.innerHTML),e.e.fire(this,"close_dialog"),t&&t.preventDefault(),t&&t.stopImmediatePropagation())})).on(l,"mouseenter",(function(){i.Dom.isTag(this,"a")&&this.focus()})).on(l,"keydown",(function(t){var o=t.target;if(i.Dom.isTag(o,"a")){var r=parseInt(a.attr(o,"-index")||"0",10),s=parseInt(a.attr(o,"data-index-j")||"0",10),c=void 0;switch(t.key){case n.KEY_UP:case n.KEY_DOWN:void 0===l[c=t.key===n.KEY_UP?r-h.countInRow:r+h.countInRow]&&(c=t.key===n.KEY_UP?Math.floor(l.length/h.countInRow)*h.countInRow+s:s)>l.length-1&&(c-=h.countInRow),l[c]&&l[c].focus();break;case n.KEY_RIGHT:case n.KEY_LEFT:void 0===l[c=t.key===n.KEY_LEFT?r-1:r+1]&&(c=t.key===n.KEY_LEFT?l.length-1:0),l[c]&&l[c].focus();break;case n.KEY_ENTER:e.e.fire(o,"mousedown"),t.stopImmediatePropagation(),t.preventDefault()}}})),o}))},t.prototype.beforeDestruct=function(e){e.e.off("generateSpecialCharactersTable.symbols")},t}(i.Plugin);t.symbols=s},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(162);r.Config.prototype.usePopupForSpecialCharacters=!1,r.Config.prototype.specialCharacters=["!",""","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","€","‘","’","“","”","–","—","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","»","¬","®","¯","°","²","³","´","µ","¶","·","¸","¹","º","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","Œ","œ","Ŵ","Ŷ","ŵ","ŷ","‚","‛","„","…","™","►","•","→","⇒","⇔","♦","≈"],r.Config.prototype.controls.symbol={icon:"omega",hotkeys:["ctrl+shift+i","cmd+shift+i"],tooltip:"Insert Special Character",popup:function(e,t,o,r){var i=e.e.fire("generateSpecialCharactersTable.symbols");if(i){if(e.o.usePopupForSpecialCharacters){var a=e.c.div();return a.classList.add("jodit-symbols"),a.appendChild(i),e.e.on(i,"close_dialog",r),a}n.Alert(i,e.i18n("Select Special Character"),void 0,"jodit-symbols").bindDestruct(e);var s=i.querySelector("a");s&&s.focus()}}}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);o(330),r.__exportStar(o(331),t),r.__exportStar(o(333),t),r.__exportStar(o(334),t),r.__exportStar(o(335),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(8),n=o(32),i=o(20),a=o(19);r.Config.prototype.table={allowCellSelection:!0,selectionCellStyle:"border: 1px double #1e88e5 !important;",allowCellResize:!0,useExtraClassesOptions:!1},r.Config.prototype.controls.table={data:{cols:10,rows:10,classList:{"table table-bordered":"Bootstrap Bordered","table table-striped":"Bootstrap Striped","table table-dark":"Bootstrap Dark"}},popup:function(e,t,o,r,s){for(var l=o.data&&o.data.rows?o.data.rows:10,c=o.data&&o.data.cols?o.data.cols:10,u=e.c.fromHTML('
'+function(){if(!e.o.table.useExtraClassesOptions)return"";var t=[];if(o.data){var r=o.data.classList;Object.keys(r).forEach((function(e){t.push('")}))}return t.join("")}()+'
'),d=u.querySelectorAll("span")[0],p=u.querySelectorAll("span")[1],f=u.querySelector(".jodit-form__container"),h=u.querySelector(".jodit-form__options"),m=[],v=l*c,g=0;v>g;g+=1)m[g]||m.push(e.c.element("span",{dataIndex:g}));if(e.e.on(f,"mousemove",(function(e,t){var o=e.target;if(n.Dom.isTag(o,"span")){for(var r=void 0===t||isNaN(t)?parseInt(i.attr(o,"-index")||"0",10):t||0,a=Math.ceil((r+1)/c),s=r%c+1,l=0;m.length>l;l+=1)m[l].className=l%c+1>s||a=y;y+=1){m=d.element("tr");for(var b=1;u>=b;b+=1)v=d.element("td"),g||(g=v),v.appendChild(d.element("br")),m.appendChild(d.text("\n")),m.appendChild(d.text("\t")),m.appendChild(v);p.appendChild(d.text("\n")),p.appendChild(m)}var _=e.s.current();if(_&&e.s.isCollapsed()){var w=n.Dom.closest(_,(function(t){return n.Dom.isBlock(t,e.ew)}),e.editor);w&&w!==e.editor&&!w.nodeName.match(/^TD|TH|TBODY|TABLE|THEADER|TFOOTER$/)&&e.s.setCursorAfter(w)}a.$$("input[type=checkbox]:checked",h).forEach((function(e){e.value.split(/[\s]+/).forEach((function(e){f.classList.add(e)}))})),e.s.insertNode(d.text("\n")),e.s.insertNode(f,!1),g&&(e.s.setCursorIn(g),a.scrollIntoViewIfNeeded(g,e.editor,e.ed)),r()}})),s&&s.parentElement){for(g=0;l>g;g+=1){for(var y=e.c.div(),b=0;c>b;b+=1)y.appendChild(m[g*c+b]);f.appendChild(y)}m[0]&&(m[0].className="hovered")}return u},tooltip:"Insert table"}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeCells=void 0;var r=o(7);o(332);var n=o(9),i=o(10),a=o(19),s=o(99),l="table_processor_observer-resize",c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selectMode=!1,t.resizeDelta=0,t.createResizeHandle=function(){t.resizeHandler||(t.resizeHandler=t.j.c.div("jodit-table-resizer"),t.j.e.on(t.resizeHandler,"mousedown.table touchstart.table",t.onHandleMouseDown).on(t.resizeHandler,"mouseenter.table",(function(){t.j.async.clearTimeout(t.hideTimeout)})))},t.hideTimeout=0,t.drag=!1,t.minX=0,t.maxX=0,t.startX=0,t}return r.__extends(t,e),Object.defineProperty(t.prototype,"module",{get:function(){return this.j.getInstance("Table",this.j.o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRTL",{get:function(){return"rtl"===this.j.o.direction},enumerable:!1,configurable:!0}),t.prototype.showResizeHandle=function(){this.j.async.clearTimeout(this.hideTimeout),this.j.workplace.appendChild(this.resizeHandler)},t.prototype.hideResizeHandle=function(){var e=this;this.hideTimeout=this.j.async.setTimeout((function(){i.Dom.safeRemove(e.resizeHandler)}),{timeout:this.j.defaultTimeout,label:"hideResizer"})},t.prototype.onHandleMouseDown=function(e){var t=this;if(!this.j.isLocked){this.drag=!0,this.j.e.on(this.j.ow,"mouseup.resize-cells touchend.resize-cells",this.onMouseUp).on(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.startX=e.clientX,this.j.lock(l),this.resizeHandler.classList.add("jodit-table-resizer_moved");var o,r=this.workTable.getBoundingClientRect();if(this.minX=0,this.maxX=1e6,null!=this.wholeTable)r=this.workTable.parentNode.getBoundingClientRect(),this.minX=r.left,this.maxX=this.minX+r.width;else{var a=i.Table.formalCoordinate(this.workTable,this.workCell,!0);i.Table.formalMatrix(this.workTable,(function(e,r,i){a[1]===i&&(o=e.getBoundingClientRect(),t.minX=Math.max(o.left+n.NEARBY/2,t.minX)),a[1]+(t.isRTL?-1:1)===i&&(o=e.getBoundingClientRect(),t.maxX=Math.min(o.left+o.width-n.NEARBY/2,t.maxX))}))}return!1}},t.prototype.onMouseMove=function(e){if(this.drag){this.j.e.fire("closeAllPopups");var t=e.clientX,o=a.offset(this.resizeHandler.parentNode||this.j.od.documentElement,this.j,this.j.od,!0);this.minX>t&&(t=this.minX),t>this.maxX&&(t=this.maxX),this.resizeDelta=t-this.startX+(this.j.o.iframe?o.left:0),this.resizeHandler.style.left=t-(this.j.o.iframe?0:o.left)+"px";var r=this.j.s.sel;r&&r.removeAllRanges()}},t.prototype.onMouseUp=function(e){(this.selectMode||this.drag)&&(this.selectMode=!1,this.j.unlock()),this.resizeHandler&&this.drag&&(this.drag=!1,this.j.e.off(this.j.ew,"mousemove.table touchmove.table",this.onMouseMove),this.resizeHandler.classList.remove("jodit-table-resizer_moved"),this.startX!==e.clientX&&(null==this.wholeTable?this.resizeColumns():this.resizeTable()),this.j.setEditorValue(),this.j.s.focus())},t.prototype.resizeColumns=function(){var e=this,t=this.resizeDelta,o=[];i.Table.setColumnWidthByDelta(this.workTable,i.Table.formalCoordinate(this.workTable,this.workCell,!0)[1],t,!0,o);var r=a.call(this.isRTL?i.Dom.prev:i.Dom.next,this.workCell,(function(t){return i.Dom.isCell(t,e.j.ew)}),this.workCell.parentNode);i.Table.setColumnWidthByDelta(this.workTable,i.Table.formalCoordinate(this.workTable,r)[1],-t,!1,o)},t.prototype.resizeTable=function(){var e=this.resizeDelta*(this.isRTL?-1:1),t=this.workTable.offsetWidth,o=a.getContentWidth(this.workTable.parentNode,this.j.ew),r=!this.wholeTable;if(this.isRTL?!r:r)this.workTable.style.width=(t+e)/o*100+"%";else{var n=this.isRTL?"marginRight":"marginLeft",i=parseInt(this.j.ew.getComputedStyle(this.workTable)[n]||"0",10);this.workTable.style.width=(t-e)/o*100+"%",this.workTable.style[n]=(i+e)/o*100+"%"}},t.prototype.setWorkCell=function(e,t){void 0===t&&(t=null),this.wholeTable=t,this.workCell=e,this.workTable=i.Dom.up(e,(function(e){return i.Dom.isTag(e,"table")}),this.j.editor)},t.prototype.calcHandlePosition=function(e,t,o,r){var s=this;void 0===o&&(o=0),void 0===r&&(r=0);var l=a.offset(t,this.j,this.j.ed);if(o>n.NEARBY&&l.width-n.NEARBY>o)this.hideResizeHandle();else{var c=a.offset(this.j.workplace,this.j,this.j.od,!0),u=a.offset(e,this.j,this.j.ed);if(this.resizeHandler.style.left=(o>n.NEARBY?l.left+l.width:l.left)-c.left+r+"px",Object.assign(this.resizeHandler.style,{height:u.height+"px",top:u.top-c.top+"px"}),this.showResizeHandle(),o>n.NEARBY){var d=a.call(this.isRTL?i.Dom.prev:i.Dom.next,t,(function(e){return i.Dom.isCell(e,s.j.ew)}),t.parentNode);this.setWorkCell(t,!!d&&null)}else{var p=a.call(this.isRTL?i.Dom.next:i.Dom.prev,t,(function(e){return i.Dom.isCell(e,s.j.ew)}),t.parentNode);this.setWorkCell(p||t,!p||null)}}},t.prototype.afterInit=function(e){var t=this;e.o.table.allowCellResize&&e.e.off(this.j.ow,".resize-cells").off(".resize-cells").on("change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells",(function(){a.$$("table",e.editor).forEach(t.observe)})).on(this.j.ow,"scroll.resize-cells",(function(){if(t.drag){var o=i.Dom.up(t.workCell,(function(e){return i.Dom.isTag(e,"table")}),e.editor);if(o){var r=o.getBoundingClientRect();t.resizeHandler.style.top=r.top+"px"}}})).on("beforeSetMode.resize-cells",(function(){t.module.getAllSelectedCells().forEach((function(o){t.module.removeSelection(o),i.Table.normalizeTable(i.Dom.closest(o,"table",e.editor))}))}))},t.prototype.observe=function(e){var t=this;a.dataBind(e,l)||(a.dataBind(e,l,!0),this.j.e.on(e,"mouseleave.resize-cells",(function(e){t.resizeHandler&&t.resizeHandler!==e.relatedTarget&&t.hideResizeHandle()})).on(e,"mousemove.resize-cells touchmove.resize-cells",(function(o){if(!t.j.isLocked){var r=i.Dom.up(o.target,(function(e){return i.Dom.isCell(e,t.j.ew)}),e);r&&t.calcHandlePosition(e,r,o.offsetX)}})),this.createResizeHandle())},t.prototype.beforeDestruct=function(e){e.events&&(e.e.off(this.j.ow,".resize-cells"),e.e.off(".resize-cells"))},r.__decorate([s.autobind],t.prototype,"onHandleMouseDown",null),r.__decorate([s.autobind],t.prototype,"onMouseMove",null),r.__decorate([s.autobind],t.prototype,"onMouseUp",null),r.__decorate([s.autobind],t.prototype,"observe",null),t}(i.Plugin);t.resizeCells=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectCells=void 0;var r=o(7),n=o(183),i=o(10),a=o(19),s=o(290),l=o(9),c=o(99),u="table_processor_observer",d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.requires=["select"],t.selectedCell=null,t}return r.__extends(t,e),Object.defineProperty(t.prototype,"module",{get:function(){return this.j.getInstance("Table",this.j.o)},enumerable:!1,configurable:!0}),t.prototype.afterInit=function(e){var t=this;e.o.table.allowCellSelection&&e.e.on("keydown.select-cells",(function(e){e.key===l.KEY_TAB&&t.unselectCells()})).on("beforeCommand.select-cells",this.onExecCommand).on("afterCommand.select-cells",this.onAfterCommand).on(["clickEditor","mousedownTd","mousedownTh","touchstartTd","touchstartTh"].map((function(e){return e+".select-cells"})).join(" "),this.onStartSelection).on("clickTr",(function(){if(t.module.getAllSelectedCells().length)return!1}))},t.prototype.onStartSelection=function(e){if(!this.j.o.readonly&&(this.unselectCells(),e!==this.j.editor)){var t=i.Dom.closest(e,"table",this.j.editor);if(e&&t)return e.firstChild||e.appendChild(this.j.createInside.element("br")),this.selectedCell=e,this.module.addSelection(e),this.j.e.on(t,"mousemove.select-cells touchmove.select-cells",this.onMove.bind(this,t)).on(t,"mouseup.select-cells touchend.select-cells",this.onStopSelection.bind(this,t)),!1}},t.prototype.onOutsideClick=function(e){this.unselectCells()},t.prototype.onMove=function(e,t){var o=this;if(!this.j.o.readonly&&!this.j.isLockedNotBy(u)){var r=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(r){var n=i.Dom.closest(r,["td","th"],e);if(n&&this.selectedCell){n!==this.selectedCell&&this.j.lock(u),this.unselectCells(e);for(var a,s=i.Table.getSelectedBound(e,[n,this.selectedCell]),l=i.Table.formalMatrix(e),c=s[0][0];s[1][0]>=c;c+=1)for(var d=s[0][1];s[1][1]>=d;d+=1)this.module.addSelection(l[c][d]);this.j.e.fire("hidePopup"),t.stopPropagation(),a=o.j.createInside.fromHTML('
 
'),n.appendChild(a),o.j.async.setTimeout((function(){var e;null===(e=a.parentNode)||void 0===e||e.removeChild(a)}),o.j.defaultTimeout/5)}}}},t.prototype.onRemoveSelection=function(e){var t;if(!(null===(t=null==e?void 0:e.buffer)||void 0===t?void 0:t.actionTrigger)&&!this.selectedCell&&this.module.getAllSelectedCells().length)return this.j.unlock(),this.unselectCells(),void this.j.e.fire("hidePopup","cells");this.selectedCell=null},t.prototype.onStopSelection=function(e,t){var o=this;if(this.selectedCell){this.j.unlock();var r=this.j.ed.elementFromPoint(t.clientX,t.clientY);if(r){var n=i.Dom.closest(r,["td","th"],e);if(n){var s=i.Dom.closest(n,"table",e);if(!s||s===e){var l=i.Table.getSelectedBound(e,[n,this.selectedCell]),c=i.Table.formalMatrix(e),u=c[l[1][0]][l[1][1]],d=c[l[0][0]][l[0][1]];this.j.e.fire("showPopup",e,(function(){var e=a.position(d,o.j),t=a.position(u,o.j);return{left:e.left,top:e.top,width:t.left-e.left+t.width,height:t.top-e.top+t.height}}),"cells"),a.$$("table",this.j.editor).forEach((function(e){o.j.e.off(e,"mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells")}))}}}}},t.prototype.unselectCells=function(e,t){var o=this.module,r=o.getAllSelectedCells();r.length&&r.forEach((function(e){t&&t===e||o.removeSelection(e)}))},t.prototype.onExecCommand=function(e){if(/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(e)){e=e.replace("table","");var t=this.module.getAllSelectedCells();if(t.length){var o=t[0];if(!o)return;var r=i.Dom.closest(o,"table",this.j.editor);if(!r)return;switch(e){case"splitv":i.Table.splitVertical(r,this.j);break;case"splitg":i.Table.splitHorizontal(r,this.j);break;case"merge":i.Table.mergeSelected(r,this.j);break;case"empty":t.forEach((function(e){return i.Dom.detach(e)}));break;case"bin":i.Dom.safeRemove(r);break;case"binrow":i.Table.removeRow(r,o.parentNode.rowIndex);break;case"bincolumn":i.Table.removeColumn(r,o.cellIndex);break;case"addcolumnafter":case"addcolumnbefore":i.Table.appendColumn(r,o.cellIndex,"addcolumnafter"===e,this.j.createInside);break;case"addrowafter":case"addrowbefore":i.Table.appendRow(r,o.parentNode,"addrowafter"===e,this.j.createInside)}}return!1}},t.prototype.onAfterCommand=function(e){var t=this;/^justify/.test(e)&&this.module.getAllSelectedCells().forEach((function(o){return s.alignElement(e,o,t.j)}))},t.prototype.beforeDestruct=function(e){this.onRemoveSelection(),e.e.off(".select-cells")},r.__decorate([c.autobind],t.prototype,"onStartSelection",null),r.__decorate([c.watch(":outsideClick")],t.prototype,"onOutsideClick",null),r.__decorate([c.autobind],t.prototype,"onRemoveSelection",null),r.__decorate([c.autobind],t.prototype,"onStopSelection",null),r.__decorate([c.autobind],t.prototype,"onExecCommand",null),r.__decorate([c.autobind],t.prototype,"onAfterCommand",null),t}(n.Plugin);t.selectCells=d},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tableKeyboardNavigation=void 0;var r=o(9),n=o(32),i=o(10);t.tableKeyboardNavigation=function(e){e.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(function(t){var o,a;if((t.key===r.KEY_TAB||t.key===r.KEY_LEFT||t.key===r.KEY_RIGHT||t.key===r.KEY_UP||t.key===r.KEY_DOWN)&&(o=e.s.current(),a=n.Dom.up(o,(function(e){return e&&e.nodeName&&/^td|th$/i.test(e.nodeName)}),e.editor))){var s=e.s.range;if(t.key===r.KEY_TAB||o===a||(t.key!==r.KEY_LEFT&&t.key!==r.KEY_UP||!(n.Dom.prev(o,(function(e){return t.key===r.KEY_UP?n.Dom.isTag(e,"br"):Boolean(e)}),a)||t.key!==r.KEY_UP&&n.Dom.isText(o)&&0!==s.startOffset))&&(t.key!==r.KEY_RIGHT&&t.key!==r.KEY_DOWN||!(n.Dom.next(o,(function(e){return t.key===r.KEY_DOWN?n.Dom.isTag(e,"br"):Boolean(e)}),a)||t.key!==r.KEY_DOWN&&n.Dom.isText(o)&&o.nodeValue&&s.startOffset!==o.nodeValue.length))){var l=n.Dom.up(a,(function(e){return e&&/^table$/i.test(e.nodeName)}),e.editor),c=null;switch(t.key){case r.KEY_TAB:case r.KEY_LEFT:var u=t.key===r.KEY_LEFT||t.shiftKey?"prev":"next";(c=n.Dom[u](a,(function(e){return e&&/^td|th$/i.test(e.tagName)}),l))||(i.Table.appendRow(l,"next"!==u&&l.querySelector("tr"),"next"===u,e.createInside),c=n.Dom[u](a,(function(t){return t&&n.Dom.isCell(t,e.ew)}),l));break;case r.KEY_UP:case r.KEY_DOWN:var d=0,p=0,f=i.Table.formalMatrix(l,(function(e,t,o){e===a&&(d=t,p=o)}));t.key===r.KEY_UP?void 0!==f[d-1]&&(c=f[d-1][p]):void 0!==f[d+1]&&(c=f[d+1][p])}if(c){if(c.firstChild)t.key===r.KEY_TAB?e.s.select(c,!0):e.s.setCursorIn(c,t.key===r.KEY_RIGHT||t.key===r.KEY_DOWN);else{var h=e.createInside.element("br");c.appendChild(h),e.s.setCursorBefore(h)}return!1}}}}))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table=void 0,t.table=function(e){e.registerButton({name:"table",group:"insert"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tooltip=void 0;var r=o(7);o(337);var n=o(19),i=o(183),a=o(32),s=o(30),l=o(99),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOpened=!1,t.delayShowTimeout=0,t}return r.__extends(t,e),t.prototype.afterInit=function(e){var o=this;this.container=e.c.div("jodit-tooltip"),s.getContainer(this.j,t).appendChild(this.container);var r=0;e.e.off(".tooltip").on("showTooltip.tooltip",(function(t,n){e.async.clearTimeout(r),o.open(t,n)})).on("delayShowTooltip.tooltip",this.delayOpen).on("escape.tooltip",this.close).on("hideTooltip.tooltip change.tooltip scroll.tooltip changePlace.tooltip hidePopup.tooltip closeAllPopups.tooltip",(function(){o.j.async.clearTimeout(o.delayShowTimeout),r=e.async.setTimeout(o.close,o.j.defaultTimeout)}))},t.prototype.delayOpen=function(e,t){var o=this,r=this.j.o.showTooltipDelay||this.j.defaultTimeout;this.j.async.clearTimeout(this.delayShowTimeout),this.delayShowTimeout=this.j.async.setTimeout((function(){return o.open(e,t)}),{timeout:r,label:"tooltip"})},t.prototype.open=function(e,t){this.container.classList.add("jodit-tooltip_visible"),this.container.innerHTML=t,this.isOpened=!0,this.setPosition(e)},t.prototype.setPosition=function(e){var t=e();n.css(this.container,{left:t.x,top:t.y})},t.prototype.close=function(){this.j.async.clearTimeout(this.delayShowTimeout),this.isOpened&&(this.isOpened=!1,this.container.classList.remove("jodit-tooltip_visible"),n.css(this.container,{left:-5e3}))},t.prototype.beforeDestruct=function(e){null==e||e.e.off(".tooltip"),this.close(),a.Dom.safeRemove(this.container)},r.__decorate([l.autobind],t.prototype,"delayOpen",null),r.__decorate([l.autobind],t.prototype,"close",null),t}(i.Plugin);t.tooltip=c},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(7);r.__exportStar(o(339),t),r.__exportStar(o(340),t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preview=void 0;var r=o(8),n=o(19),i=o(9);r.Config.prototype.controls.preview={icon:"eye",exec:function(e){var t=e.getInstance("Dialog",{language:e.o.language,theme:e.o.theme}),o=e.c.div();if(n.css(o,{padding:16}),e.iframe){var r=e.create.element("iframe");n.css(r,{minWidth:800,minHeight:600,border:0}),o.appendChild(r),t.open(o,e.i18n("Preview"));var i=r.contentWindow;i&&(e.e.fire("generateDocumentStructure.iframe",i.document,e),i.document.body.innerHTML=e.value)}else n.css(o,{minWidth:1024,minHeight:600,border:0}),o.innerHTML=e.value,t.open(o,e.i18n("Preview"));t.setModal(!0)},mode:i.MODE_SOURCE+i.MODE_WYSIWYG,tooltip:"Preview"},t.preview=function(e){e.registerButton({name:"preview"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=void 0;var r=o(8),n=o(30),i=o(32),a=o(19),s=o(9);r.Config.prototype.controls.print={exec:function(e){var t=e.create.element("iframe");Object.assign(t.style,{position:"fixed",right:0,bottom:0,width:0,height:0,border:0}),n.getContainer(e,r.Config).appendChild(t);var o=function(){e.e.off(e.ow,"mousemove",o),i.Dom.safeRemove(t)},s=t.contentWindow;s&&(e.e.on(s,"onbeforeunload onafterprint",o).on(e.ow,"mousemove",o),e.o.iframe?(e.e.fire("generateDocumentStructure.iframe",s.document,e),s.document.body.innerHTML=e.value):(s.document.write(''+e.value+""),s.document.close()),s.focus(),s.print())},mode:s.MODE_SOURCE+s.MODE_WYSIWYG,tooltip:"Print"},t.print=function(e){e.registerButton({name:"print"})}},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xpath=void 0;var r=o(7);o(342);var n=o(8),i=o(9),a=o(160),s=o(32),l=o(19),c=o(183),u=o(172);n.Config.prototype.showXPathInStatusbar=!0;var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onContext=function(e,o){return t.menu||(t.menu=new a.ContextMenu(t.j)),t.menu.show(o.clientX,o.clientY,[{icon:"bin",title:e===t.j.editor?"Clear":"Remove",exec:function(){e!==t.j.editor?s.Dom.safeRemove(e):t.j.value="",t.j.setEditorValue()}},{icon:"select-all",title:"Select",exec:function(){t.j.s.select(e)}}]),!1},t.onSelectPath=function(e,o){t.j.s.focus();var r=l.attr(o.target,"-path")||"/";if("/"===r)return t.j.execCommand("selectall"),!1;try{var n=t.j.ed.evaluate(r,t.j.editor,null,XPathResult.ANY_TYPE,null).iterateNext();if(n)return t.j.s.select(n),!1}catch(e){}return t.j.s.select(e),!1},t.tpl=function(e,o,r,n){var i=t.j.c.fromHTML(''+l.trim(r)+""),a=i.firstChild;return t.j.e.on(a,"click",t.onSelectPath.bind(t,e)).on(a,"contextmenu",t.onContext.bind(t,e)),i},t.removeSelectAll=function(){t.selectAllButton&&(t.selectAllButton.destruct(),delete t.selectAllButton)},t.appendSelectAll=function(){t.removeSelectAll(),t.selectAllButton=u.makeButton(t.j,r.__assign({name:"selectall"},t.j.o.controls.selectall)),t.selectAllButton.state.size="tiny",t.container&&t.container.insertBefore(t.selectAllButton.container,t.container.firstChild)},t.calcPathImd=function(){if(!t.isDestructed){var e,o,r,n=t.j.s.current();t.container&&(t.container.innerHTML=i.INVISIBLE_SPACE),n&&s.Dom.up(n,(function(n){n&&t.j.editor!==n&&!s.Dom.isText(n)&&(e=n.nodeName.toLowerCase(),o=l.getXPathByElement(n,t.j.editor).replace(/^\//,""),r=t.tpl(n,o,e,t.j.i18n("Select %s",e)),t.container&&t.container.insertBefore(r,t.container.firstChild))}),t.j.editor),t.appendSelectAll()}},t.calcPath=t.j.async.debounce(t.calcPathImd,2*t.j.defaultTimeout),t}return r.__extends(t,e),t.prototype.afterInit=function(){var e=this;this.j.o.showXPathInStatusbar&&(this.container=this.j.c.div("jodit-xpath"),this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath",this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath",(function(){e.j.o.showXPathInStatusbar&&e.container&&(e.j.statusbar.append(e.container),e.j.getRealMode()===i.MODE_WYSIWYG?e.calcPath():(e.container&&(e.container.innerHTML=i.INVISIBLE_SPACE),e.appendSelectAll()))})),this.calcPath())},t.prototype.beforeDestruct=function(){this.j&&this.j.events&&this.j.e.off(".xpath"),this.removeSelectAll(),this.menu&&this.menu.destruct(),s.Dom.safeRemove(this.container),delete this.menu,delete this.container},t}(c.Plugin);t.xpath=d},(e,t,o)=>{"use strict";o.r(t)},(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.paragraph=t.palette=t.outdent=t.omega=t.ol=t.ok=t.merge=t.menu=t.lock=t.link=t.left=t.justify=t.italic=t.info_circle=t.indent=t.image=t.hr=t.fullsize=t.fontsize=t.font=t.folder=t.file=t.eye=t.eraser=t.enter=t.chevron=t.dots=t.dedent=t.cut=t.crop=t.copy=t.copyformat=t.check_square=t.check=t.chain_broken=t.center=t.cancel=t.brush=t.bold=t.bin=t.attachment=t.arrows_h=t.arrows_alt=t.angle_up=t.angle_right=t.angle_left=t.angle_down=t.addrow=t.addcolumn=t.about=void 0,t.video=t.valign=t.upload=t.update=t.unlock=t.unlink=t.undo=t.underline=t.ul=t.th_list=t.th=t.table=t.superscript=t.subscript=t.strikethrough=t.splitv=t.splitg=t.source=t.shrink=t.settings=t.select_all=t.search=t.save=t.right=t.resizer=t.resize=t.redo=t.print=t.plus=t.pencil=t.paste=void 0;var r=o(344);t.about=r;var n=o(345);t.addcolumn=n;var i=o(346);t.addrow=i;var a=o(347);t.angle_down=a;var s=o(348);t.angle_left=s;var l=o(349);t.angle_right=l;var c=o(350);t.angle_up=c;var u=o(351);t.arrows_alt=u;var d=o(352);t.arrows_h=d;var p=o(353);t.attachment=p;var f=o(354);t.bin=f;var h=o(355);t.bold=h;var m=o(356);t.brush=m;var v=o(357);t.cancel=v;var g=o(358);t.center=g;var y=o(359);t.chain_broken=y;var b=o(360);t.check=b;var _=o(361);t.check_square=_;var w=o(362);t.chevron=w;var S=o(363);t.copyformat=S;var C=o(364);t.crop=C;var k=o(365);t.copy=k;var j=o(366);t.cut=j;var E=o(367);t.dedent=E;var I=o(368);t.dots=I;var x=o(369);t.enter=x;var T=o(370);t.eraser=T;var P=o(371);t.eye=P;var D=o(372);t.file=D;var z=o(373);t.folder=z;var A=o(374);t.font=A;var M=o(375);t.fontsize=M;var L=o(376);t.fullsize=L;var O=o(377);t.hr=O;var B=o(378);t.image=B;var N=o(379);t.indent=N;var R=o(380);t.info_circle=R;var q=o(381);t.italic=q;var H=o(382);t.justify=H;var F=o(383);t.left=F;var U=o(384);t.link=U;var V=o(385);t.lock=V;var W=o(386);t.menu=W;var Y=o(387);t.merge=Y;var K=o(388);t.ok=K;var G=o(389);t.ol=G;var J=o(390);t.omega=J;var X=o(391);t.outdent=X;var $=o(392);t.palette=$;var Z=o(393);t.paragraph=Z;var Q=o(394);t.paste=Q;var ee=o(395);t.pencil=ee;var te=o(396);t.plus=te;var oe=o(397);t.print=oe;var re=o(398);t.redo=re;var ne=o(399);t.resize=ne;var ie=o(400);t.resizer=ie;var ae=o(401);t.right=ae;var se=o(402);t.save=se;var le=o(403);t.search=le;var ce=o(404);t.settings=ce;var ue=o(405);t.select_all=ue;var de=o(406);t.shrink=de;var pe=o(407);t.source=pe;var fe=o(408);t.splitg=fe;var he=o(409);t.splitv=he;var me=o(410);t.strikethrough=me;var ve=o(411);t.subscript=ve;var ge=o(412);t.superscript=ge;var ye=o(413);t.table=ye;var be=o(414);t.th=be;var _e=o(415);t.th_list=_e;var we=o(416);t.ul=we;var Se=o(417);t.underline=Se;var Ce=o(418);t.undo=Ce;var ke=o(419);t.unlink=ke;var je=o(420);t.unlock=je;var Ee=o(421);t.update=Ee;var Ie=o(422);t.upload=Ie;var xe=o(423);t.valign=xe;var Te=o(424);t.video=Te},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=''},e=>{e.exports=''},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '},e=>{e.exports=' '}],t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={exports:{}};return e[r].call(n.exports,n,n.exports,o),n.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.Jodit=void 0,o(1),"undefined"!=typeof window&&o(2);var t=o(6),n=o(213),i=o(99),a=o(9),s=o(10),l=o(233),c=o(343);Object.keys(a).forEach((function(e){t.Jodit[e]=a[e]}));var u=function(e){return"__esModule"!==e};Object.keys(c).filter(u).forEach((function(e){s.Icon.set(e.replace("_","-"),c[e])})),Object.keys(s).filter(u).forEach((function(e){t.Jodit.modules[e]=s[e]})),Object.keys(i).filter(u).forEach((function(e){t.Jodit.decorators[e]=i[e]})),["Confirm","Alert","Prompt"].forEach((function(e){t.Jodit[e]=s[e]})),Object.keys(l).filter(u).forEach((function(e){t.Jodit.plugins.add(e,l[e])})),Object.keys(n.default).filter(u).forEach((function(e){t.Jodit.lang[e]=n.default[e]})),e.Jodit=t.Jodit})(),r})()})); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 84deb673b..cfecc1507 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "jodit", - "version": "3.6.2", + "version": "3.6.3", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "3.6.2", + "version": "3.6.3", "license": "MIT", "dependencies": { "autobind-decorator": "^2.4.0" diff --git a/package.json b/package.json index 1d276fafa..2729a286b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jodit", - "version": "3.6.2", + "version": "3.6.3", "description": "Jodit is awesome and usefully wysiwyg editor with filebrowser", "main": "build/jodit.min.js", "types": "index.d.ts",