jodit
Version:
Jodit is awesome and usefully wysiwyg editor with filebrowser
9 lines (8 loc) • 431 kB
JavaScript
/*!
jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
Version: v3.2.53
Url: https://xdsoft.net/jodit/
License(s): GPL-2.0-or-later OR MIT OR Commercial
*/
!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 i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(window,function(){return i={},n.m=o=[function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(2),i=o(4),r=o(9),a=(d.detach=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},d.unwrap=function(e){var t=e.parentNode,o=e;if(t){for(;o.firstChild;)t.insertBefore(o.firstChild,o);d.safeRemove(o)}},d.each=function(e,t){var o=e.firstChild;if(o)for(;o;){if(!1===t.call(o,o)||!d.each(o,t))return!1;o=d.next(o,function(e){return!!e},e)}return!0},d.replace=function(e,t,o,i,n){void 0===o&&(o=!1),void 0===i&&(i=!1);var r="string"==typeof t?n.createElement(t):t;if(!i)for(;e.firstChild;)r.appendChild(e.firstChild);return o&&Array.from(e.attributes).forEach(function(e){r.setAttribute(e.name,e.value)}),e.parentNode&&e.parentNode.replaceChild(r,e),r},d.isEmptyTextNode=function(e){return e&&e.nodeType===Node.TEXT_NODE&&(!e.nodeValue||0===e.nodeValue.replace(n.INVISIBLE_SPACE_REG_EXP,"").length)},d.isEmpty=function(e,t){return void 0===t&&(t=/^(img|svg|canvas|input|textarea|form)$/),!e||(e.nodeType===Node.TEXT_NODE?null===e.nodeValue||0===r.trim(e.nodeValue).length:!e.nodeName.toLowerCase().match(t)&&d.each(e,function(e){if(e&&e.nodeType===Node.TEXT_NODE&&null!==e.nodeValue&&0!==r.trim(e.nodeValue).length||e&&e.nodeType===Node.ELEMENT_NODE&&t.test(e.nodeName.toLowerCase()))return!1}))},d.isNode=function(e,t){return!("object"!=typeof t||!t||"function"!=typeof t.Node&&"object"!=typeof t.Node)&&e instanceof t.Node},d.isCell=function(e,t){return d.isNode(e,t)&&/^(td|th)$/i.test(e.nodeName)},d.isImage=function(e,t){return d.isNode(e,t)&&/^(img|svg|picture|canvas)$/i.test(e.nodeName)},d.isBlock=function(e,t){return e&&"object"==typeof e&&d.isNode(e,t)&&n.IS_BLOCK.test(e.nodeName)},d.isInlineBlock=function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&!!~["inline","inline-block"].indexOf(""+i.css(e,"display"))},d.canSplitBlock=function(e,t){return e&&e instanceof t.HTMLElement&&this.isBlock(e,t)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&void 0!==e.style&&!/^(fixed|absolute)/i.test(e.style.position)},d.prev=function(e,t,o,i){return void 0===i&&(i=!0),d.find(e,t,o,!1,"previousSibling",!!i&&"lastChild")},d.next=function(e,t,o,i){return void 0===i&&(i=!0),d.find(e,t,o,void 0,void 0,i?"firstChild":"")},d.prevWithClass=function(e,t){return this.prev(e,function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.classList.contains(t)},e.parentNode)},d.nextWithClass=function(e,t){return this.next(e,function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.classList.contains(t)},e.parentNode)},d.find=function(e,t,o,i,n,r){if(void 0===i&&(i=!1),void 0===n&&(n="nextSibling"),void 0===r&&(r="firstChild"),i&&t(e))return e;var a,s=e;do{if(t(a=s[n]))return a||!1;if(r&&a&&a[r]){var l=d.find(a[r],t,a,!0,n,r);if(l)return l}s=a=a||s.parentNode}while(s&&s!==o);return!1},d.findWithCurrent=function(e,t,o,i,n){void 0===i&&(i="nextSibling"),void 0===n&&(n="firstChild");var r=e;do{if(t(r))return r||!1;if(n&&r&&r[n]){var a=d.findWithCurrent(r[n],t,r,i,n);if(a)return a}for(;r&&!r[i]&&r!==o;)r=r.parentNode;r&&r[i]&&r!==o&&(r=r[i])}while(r&&r!==o);return!1},d.up=function(e,t,o){var i=e;if(!e)return!1;do{if(t(i))return i;if(i===o||!i.parentNode)break;i=i.parentNode}while(i&&i!==o);return!1},d.closest=function(e,t,o){return d.up(e,"function"==typeof t?t:t instanceof RegExp?function(e){return e&&t.test(e.nodeName)}:function(e){return e&&RegExp("^("+t+")$","i").test(e.nodeName)},o)},d.after=function(e,t){var o=e.parentNode;o&&(o.lastChild===e?o.appendChild(t):o.insertBefore(t,e.nextSibling))},d.moveContent=function(e,t,o){void 0===o&&(o=!1);var i=(e.ownerDocument||document).createDocumentFragment();[].slice.call(e.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&e.nodeValue===n.INVISIBLE_SPACE||i.appendChild(e)}),o&&t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},d.all=function(e,t,o){void 0===o&&(o=!1);var i=e.childNodes?Array.prototype.slice.call(e.childNodes):[];if(t(e))return e;o&&(i=i.reverse()),i.forEach(function(e){d.all(e,t,o)})},d.safeRemove=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},d.wrapInline=function(e,t,o){for(var i,n=e,r=e,a=o.selection.save(),s=!1;s=!1,(i=n.previousSibling)&&!d.isBlock(i,o.editorWindow)&&(s=!0,n=i),s;);for(;s=!1,(i=r.nextSibling)&&!d.isBlock(i,o.editorWindow)&&(s=!0,r=i),s;);var l="string"==typeof t?o.create.inside.element(t):t;n.parentNode&&n.parentNode.insertBefore(l,n);for(var c=n;c&&(c=n.nextSibling,l.appendChild(n),n!==r&&c);)n=c;return o.selection.restore(a),l},d.wrap=function(e,t,o){var i=o.selection.save(),n="string"==typeof t?o.editorDocument.createElement(t):t;return e.parentNode?(e.parentNode.insertBefore(n,e),n.appendChild(e),o.selection.restore(i),n):null},d.findInline=function(e,t,o){var i=e,n=null;do{if(!i)break;if((n=t?i.previousSibling:i.nextSibling)||!i.parentNode||i.parentNode===o||!d.isInlineBlock(i.parentNode))break;i=i.parentNode}while(!n);for(;n&&d.isInlineBlock(n)&&(t?n.lastChild:n.firstChild);)n=t?n.lastChild:n.firstChild;return n},d.contains=function(e,t){for(;t.parentNode;){if(t.parentNode===e)return!0;t=t.parentNode}return!1},d.isOrContains=function(e,t,o){return void 0===o&&(o=!1),t&&e&&(e===t&&!o||d.contains(e,t))},d);function d(){}t.Dom=a},function(e,t,o){"use strict";o.r(t),o.d(t,"__extends",function(){return n}),o.d(t,"__assign",function(){return r}),o.d(t,"__rest",function(){return a}),o.d(t,"__decorate",function(){return s}),o.d(t,"__param",function(){return l}),o.d(t,"__metadata",function(){return c}),o.d(t,"__awaiter",function(){return d}),o.d(t,"__generator",function(){return u}),o.d(t,"__exportStar",function(){return f}),o.d(t,"__values",function(){return p}),o.d(t,"__read",function(){return h}),o.d(t,"__spread",function(){return v}),o.d(t,"__spreadArrays",function(){return m}),o.d(t,"__await",function(){return g}),o.d(t,"__asyncGenerator",function(){return _}),o.d(t,"__asyncDelegator",function(){return b}),o.d(t,"__asyncValues",function(){return y}),o.d(t,"__makeTemplateObject",function(){return w}),o.d(t,"__importStar",function(){return C}),o.d(t,"__importDefault",function(){return E});var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function n(e,t){function o(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var r=function(){return(r=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function a(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&!~t.indexOf(i)&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)!~t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}function s(e,t,o,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(r<3?n(a):3<r?n(t,o,a):n(t,o))||a);return 3<r&&a&&Object.defineProperty(t,o,a),a}function l(o,i){return function(e,t){i(e,t,o)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(r,a,s,l){return new(s=s||Promise)(function(e,t){function o(e){try{n(l.next(e))}catch(e){t(e)}}function i(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(o,i)}n((l=l.apply(r,a||[])).next())})}function u(o,i){var n,r,a,e,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(a=2&t[0]?r.return:t[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,t[1])).done)return a;switch(r=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,r=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||a[0]<t[1]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=i.call(o,s)}catch(e){t=[6,e],r=0}finally{n=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function f(e,t){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],o=0;return t?t.call(e):{next:function(){return e&&e.length<=o&&(e=void 0),{value:e&&e[o++],done:!e}}}}function h(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var i,n,r=o.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(i=r.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}return a}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function m(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<o;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,n++)i[n]=r[a];return i}function g(e){return this instanceof g?(this.v=e,this):new g(e)}function _(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=o.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(i){r[i]&&(n[i]=function(o){return new Promise(function(e,t){1<a.push([i,o,e,t])||s(i,o)})})}function s(e,t){try{(o=r[e](t)).value instanceof g?Promise.resolve(o.value.v).then(l,c):d(a[0][2],o)}catch(e){d(a[0][3],e)}var o}function l(e){s("next",e)}function c(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function b(i){var e,n;return e={},t("next"),t("throw",function(e){throw e}),t("return"),e[Symbol.iterator]=function(){return this},e;function t(t,o){e[t]=i[t]?function(e){return(n=!n)?{value:g(i[t](e)),done:"return"===t}:o?o(e):e}:o}}function y(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=s[Symbol.asyncIterator];return t?t.call(s):(s=p(s),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(a){e[a]=s[a]&&function(r){return new Promise(function(e,t){var o,i,n;o=e,i=t,n=(r=s[a](r)).done,Promise.resolve(r.value).then(function(e){o({value:e,done:n})},i)})}}}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INVISIBLE_SPACE="\ufeff",t.INVISIBLE_SPACE_REG_EXP=/[\uFEFF]/g,t.INVISIBLE_SPACE_REG_EXP_END=/[\uFEFF]+$/g,t.INVISIBLE_SPACE_REG_EXP_START=/^[\uFEFF]+/g,t.SPACE_REG_EXP=/[\s\n\t\r\uFEFF\u200b]+/g,t.SPACE_REG_EXP_START=/^[\s\n\t\r\uFEFF\u200b]+/g,t.SPACE_REG_EXP_END=/[\s\n\t\r\uFEFF\u200b]+$/g,t.IS_BLOCK=/^(PRE|DIV|P|LI|H[1-6]|BLOCKQUOTE|TD|TH|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD)$/i,t.IS_INLINE=/^(STRONG|SPAN|I|EM|B|SUP|SUB)$/,t.MAY_BE_REMOVED_WITH_KEY=/^(IMG|BR|IFRAME|SCRIPT|INPUT|TEXTAREA|HR|JODIT|JODIT-MEDIA)$/,t.KEY_BACKSPACE=8,t.KEY_TAB=9,t.KEY_ENTER=13,t.KEY_ESC=27,t.KEY_LEFT=37,t.KEY_UP=38,t.KEY_RIGHT=39,t.KEY_DOWN=40,t.KEY_DELETE=46,t.KEY_F=70,t.KEY_R=82,t.KEY_H=72,t.KEY_Y=89,t.KEY_V=86,t.KEY_Z=90,t.KEY_F3=114,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&&(!!~navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),t.URL_LIST=t.IS_IE?"url":"text/uri-list",t.TEXT_PLAIN=t.IS_IE?"text":"text/plain",t.TEXT_HTML=t.IS_IE?"text":"text/html",t.MARKER_CLASS="jodit_selection_marker",t.EMULATE_DBLCLICK_TIMEOUT=300,t.JODIT_SELECTED_CELL_MARKER="data-jodit-selected-cell",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.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"}},function(e,t,o){"use strict";var s=this;Object.defineProperty(t,"__esModule",{value:!0});var l=o(1),i=o(2),n=o(17),c=n.Widget.TabsWidget,d=n.Widget.FileSelectorWidget,a=o(0),u=o(4),f=o(6),p=o(14),h=(Object.defineProperty(r,"defaultOptions",{get:function(){return r.__defaultOptions||(r.__defaultOptions=new r),r.__defaultOptions},enumerable:!0,configurable:!0}),r);function r(){this.iframe=!1,this.license="",this.preset="custom",this.presets={inline:{inline:!0,toolbar:!1,toolbarInline:!0,popup:{selection:["bold","underline","italic","ul","ol","outdent","indent","\n","fontsize","brush","paragraph","link","align","cut","dots"]},showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}},this.ownerDocument="undefined"!=typeof document?document:null,this.ownerWindow="undefined"!=typeof window?window: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.saveHeightInStorage=!1,this.spellcheck=!0,this.editorCssClass=!1,this.style=!1,this.triggerChangeEvent=!0,this.width="auto",this.minWidth="200px",this.maxWidth="100%",this.height="auto",this.minHeight=200,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n="en",this.tabIndex=-1,this.toolbar=!0,this.showTooltip=!0,this.showTooltipDelay=500,this.useNativeTooltip=!1,this.enter=i.PARAGRAPH,this.enterBlock=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.extraButtons=[],this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=["source","|","bold","strikethrough","underline","italic","|","superscript","subscript","|","ul","ol","|","outdent","indent","|","font","fontsize","brush","paragraph","|","image","file","video","table","link","|","align","undo","redo","\n","cut","hr","eraser","copyformat","|","symbol","fullsize","selectall","print","about"],this.buttonsMD=["source","|","bold","italic","|","ul","ol","|","font","fontsize","brush","paragraph","|","image","table","link","|","align","|","undo","redo","|","hr","eraser","copyformat","fullsize","dots"],this.buttonsSM=["source","|","bold","italic","|","ul","ol","|","fontsize","brush","paragraph","|","image","table","link","|","align","|","undo","redo","|","eraser","copyformat","fullsize","dots"],this.buttonsXS=["bold","image","|","brush","paragraph","|","align","|","undo","redo","|","eraser","dots"],this.events={},this.textIcons=!1,this.showBrowserColorPicker=!1}t.Config=h,t.OptionsDefault=function(e){var n=this,r=h.defaultOptions,a=this;if(void 0!==(a.plainOptions=e)&&"object"==typeof e){var s=function(e,t){if("preset"===t&&void 0!==r.presets[e.preset]){var o=r.presets[e.preset];Object.keys(o).forEach(s.bind(n,o))}var i=r[t];a[t]="object"!=typeof i||null===i||["ownerWindow","ownerDocument"].includes(t)||Array.isArray(i)?e[t]:p.extend(!0,{},i,e[t])};Object.keys(e).forEach(s.bind(this,e))}},h.prototype.controls={print:{exec:function(e){var t=window.open("","PRINT");t&&(e.options.iframe?(e.events.fire("generateDocumentStructure.iframe",t.document,e),t.document.body.innerHTML=e.value):(t.document.write('<!doctype html><html lang="'+u.defaultLanguage(e.options.language)+'"><head><title></title></head><body>'+e.value+"</body></html>"),t.document.close()),t.focus(),t.print(),t.close())},mode:i.MODE_SOURCE+i.MODE_WYSIWYG},about:{exec:function(e){var t=e.getInstance("Dialog");t.setTitle(e.i18n("About Jodit")),t.setContent('<div class="jodit_about">\t\t\t\t\t\t\t\t\t\t<div>'+e.i18n("Jodit Editor")+" v."+e.getVersion()+" </div><div>"+e.i18n("License: %s",u.isLicense(e.options.license)?u.normalizeLicense(e.options.license):e.i18n("GNU General Public License, version 2 or later"))+'</div><div><a href="https://xdsoft.net/jodit/" target="_blank">http://xdsoft.net/jodit/</a></div><div><a href="https://xdsoft.net/jodit/doc/" target="_blank">'+e.i18n("Jodit User's Guide")+"</a> "+e.i18n("contains detailed help for using")+"</div><div>"+e.i18n("Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.")+"</div></div>"),t.open()},tooltip:"About Jodit",mode:i.MODE_SOURCE+i.MODE_WYSIWYG},hr:{command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},image:{popup:function(n,e,t,r){var a=null;return e&&e.nodeType!==Node.TEXT_NODE&&("IMG"===e.tagName||u.$$("img",e).length)&&(a="IMG"===e.tagName?e:u.$$("img",e)[0]),d(n,{filebrowser:function(o){return l.__awaiter(s,void 0,void 0,function(){var t;return l.__generator(this,function(e){switch(e.label){case 0:if(!o.files||!o.files.length)return[3,4];t=0,e.label=1;case 1:return t<o.files.length?[4,n.selection.insertImage(o.baseurl+o.files[t],null,n.options.imageDefaultWidth)]:[3,4];case 2:e.sent(),e.label=3;case 3:return t+=1,[3,1];case 4:return r(),[2]}})})},upload:function(o){return l.__awaiter(s,void 0,void 0,function(){var t;return l.__generator(this,function(e){switch(e.label){case 0:if(!o.files||!o.files.length)return[3,4];t=0,e.label=1;case 1:return t<o.files.length?[4,n.selection.insertImage(o.baseurl+o.files[t],null,n.options.imageDefaultWidth)]:[3,4];case 2:e.sent(),e.label=3;case 3:return t+=1,[3,1];case 4:return r(),[2]}})})},url:function(o,i){return l.__awaiter(s,void 0,void 0,function(){var t;return l.__generator(this,function(e){switch(e.label){case 0:return(t=a||n.create.inside.element("img")).setAttribute("src",o),t.setAttribute("alt",i),a?[3,2]:[4,n.selection.insertImage(t,null,n.options.imageDefaultWidth)];case 1:e.sent(),e.label=2;case 2:return r(),[2]}})})}},a,r)},tags:["img"],tooltip:"Insert Image"},file:{popup:function(o,e,t,i){function n(e,t){void 0===t&&(t=""),o.selection.insertNode(o.create.inside.fromHTML('<a href="'+e+'" title="'+t+'">'+(t||e)+"</a>"))}var r=null;return e&&("A"===e.nodeName||a.Dom.closest(e,"A",o.editor))&&(r="A"===e.nodeName?e:a.Dom.closest(e,"A",o.editor)),d(o,{filebrowser:function(e){if(e.files&&e.files.length){var t=void 0;for(t=0;t<e.files.length;t+=1)n(e.baseurl+e.files[t])}i()},upload:function(e){var t;if(e.files&&e.files.length)for(t=0;t<e.files.length;t+=1)n(e.baseurl+e.files[t]);i()},url:function(e,t){r?(r.setAttribute("href",e),r.setAttribute("title",t)):n(e,t),i()}},r,i,!1)},tags:["a"],tooltip:"Insert file"},video:{popup:function(t,e,o,i){function n(e){t.selection.restore(l),t.selection.insertHTML(e),i()}var r=t.create.fromHTML('<form class="jodit_form">\n\t\t\t\t\t\t\t\t\t\t\t\t<input required name="code" placeholder="http://" type="url"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="submit">'+t.i18n("Insert")+"</button>\n\t\t\t\t\t\t\t\t\t\t\t\t</form>"),a=t.create.fromHTML('<form class="jodit_form">\n\t\t\t\t\t\t\t\t\t\t\t\t<textarea required name="code" placeholder="'+t.i18n("Embed code")+'"></textarea>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="submit">'+t.i18n("Insert")+"</button>\n\t\t\t\t\t\t\t\t\t\t\t\t</form>"),s={},l=t.selection.save();return t.options.textIcons?(s[t.i18n("Link")]=r,s[t.i18n("Code")]=a):(s[f.ToolbarIcon.getIcon("link")+" "+t.i18n("Link")]=r,s[f.ToolbarIcon.getIcon("source")+" "+t.i18n("Code")]=a),a.addEventListener("submit",function(e){return e.preventDefault(),u.trim(u.val(a,"textarea[name=code]"))?n(u.val(a,"textarea[name=code]")):(a.querySelector("textarea[name=code]").focus(),a.querySelector("textarea[name=code]").classList.add("jodit_error")),!1}),r.addEventListener("submit",function(e){return e.preventDefault(),u.isURL(u.val(r,"input[name=code]"))?n(u.convertMediaURLToVideoEmbed(u.val(r,"input[name=code]"))):(r.querySelector("input[name=code]").focus(),r.querySelector("input[name=code]").classList.add("jodit_error")),!1}),c(t,s)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(1);i.__exportStar(o(29),t),i.__exportStar(o(5),t),i.__exportStar(o(14),t),i.__exportStar(o(43),t),i.__exportStar(o(82),t),i.__exportStar(o(46),t),i.__exportStar(o(19),t),i.__exportStar(o(23),t),i.__exportStar(o(9),t),i.__exportStar(o(50),t),i.__exportStar(o(101),t),i.__exportStar(o(102),t),i.__exportStar(o(10),t),i.__exportStar(o(53),t),i.__exportStar(o(103),t),i.__exportStar(o(54),t),i.__exportStar(o(24),t),i.__exportStar(o(51),t),i.__exportStar(o(104),t),i.__exportStar(o(31),t),i.__exportStar(o(30),t),i.__exportStar(o(52),t),i.__exportStar(o(105),t),i.__exportStar(o(11),t),i.__exportStar(o(32),t),i.__exportStar(o(106),t)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(1);i.__exportStar(o(41),t),i.__exportStar(o(18),t),i.__exportStar(o(76),t)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=(n.exists=function(e){return void 0!==n.icons[e]},n.getIcon=function(e,t){return void 0===t&&(t="<span></span>"),n.icons[e]||n.icons[e.replace(/-/g,"_")]||n.icons[e.toLowerCase()]||t},n.icons={},n);function n(){}t.ToolbarIcon=i},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,n=o(1),r=o(8),a=(n.__extends(s,i=r.Component),s);function s(e){var t=i.call(this,e)||this;return t.destruct=function(){t.isDestructed||(t.jodit.events&&t.jodit.events.off("beforeDestruct",t.destruct),t.beforeDestruct(t.jodit),i.prototype.destruct.call(t))},e.events.on("afterInit",t.afterInit.bind(t,e)).on("beforeDestruct",t.destruct),t}t.Plugin=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(15),n=(Object.defineProperty(r.prototype,"isDestructed",{get:function(){return this.__isDestructed},enumerable:!0,configurable:!0}),r.prototype.destruct=function(){this.jodit&&(this.jodit=void 0),this.__isDestructed=!0},r);function r(e){this.__isDestructed=!1,e&&e instanceof r&&i.isJoditObject(this.jodit=e)&&e.components.push(this)}t.Component=n},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(1);i.__exportStar(o(47),t),i.__exportStar(o(48),t),i.__exportStar(o(86),t),i.__exportStar(o(33),t)},function(e,p,t){"use strict";Object.defineProperty(p,"__esModule",{value:!0});var h=t(21),v=t(22),m=t(49),g=t(47),_=t(48);p.css=function(e,t,o,i){void 0===i&&(i=!1);var n=/^left|top|bottom|right|width|min|max|height|margin|padding|font-size/i;if(h.isPlainObject(t)||void 0!==o){var r=function(e,t,o){null!=o&&n.test(t)&&v.isNumeric(""+o)&&(o=parseInt(""+o,10)+"px"),void 0!==o&&p.css(e,t,void 0,!0)!==m.normilizeCSSValue(t,o)&&(e.style[t]=o)};if(h.isPlainObject(t))for(var a=Object.keys(t),s=0;s<a.length;s+=1)r(e,g.camelCase(a[s]),t[a[s]]);else r(e,g.camelCase(t),o);return""}var l=_.fromCamelCase(t),c=e.ownerDocument||document,d=!!c&&(c.defaultView||c.parentWindow),u=e.style[t],f=void 0!==u&&""!==u?u:d&&!i?d.getComputedStyle(e).getPropertyValue(l):"";return n.test(t)&&/^[\-+]?[0-9.]+px$/.test(""+f)&&(f=parseInt(""+f,10)),m.normilizeCSSValue(t,f)}},function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t(2),a=1;i.$$=function(e,t){var o;if(!/:scope/.test(e)||!r.IS_IE||t&&t.nodeType===Node.DOCUMENT_NODE)o=t.querySelectorAll(e);else{var i=t.id,n=i||"_selector_id_"+(""+Math.random()).slice(2)+a++;e=e.replace(/:scope/g,"#"+n),i||t.setAttribute("id",n),o=t.parentNode.querySelectorAll(e),i||t.removeAttribute("id")}return[].slice.call(o)},i.getXPathByElement=function(t,e){if(!t||1!==t.nodeType)return"";if(!t.parentNode||e===t)return"";if(t.id)return"//*[@id='"+t.id+"']";var o=[].filter.call(t.parentNode.childNodes,function(e){return e.nodeName===t.nodeName});return i.getXPathByElement(t.parentNode,e)+"/"+t.nodeName.toLowerCase()+(1<o.length?"["+(1+Array.from(o).indexOf(t))+"]":"")}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=o(1),u=o(3),s=o(2),l=o(0),f=o(4),i=o(31),n=o(30),c=o(55),d=o(58),p=o(108),h=o(59),v=o(34),r=o(60),m=o(115),Jodit=function(r){function Jodit(t,i){var n=r.call(this)||this;if(n.__defaultStyleDisplayKey="data-jodit-default-style-display",n.__defaultClassesKey="data-jodit-default-classes",n.commands={},n.__selectionLocked=null,n.__wasReadOnly=!1,n.storage=new v.Storage(new h.LocalStorageProvider),n.iframe=null,n.__plugins={},n.mode=s.MODE_WYSIWYG,n.__callChangeCount=0,n.isInited=!1,n.options=new u.OptionsDefault(i),n.editorDocument=n.options.ownerDocument,n.editorWindow=n.options.ownerWindow,n.ownerDocument=n.options.ownerDocument,n.ownerWindow=n.options.ownerWindow,"string"==typeof t)try{n.element=n.ownerDocument.querySelector(t)}catch(e){throw Error('String "'+t+'" should be valid HTML selector')}else n.element=t;if(!n.element||"object"!=typeof n.element||n.element.nodeType!==Node.ELEMENT_NODE||!n.element.cloneNode)throw Error('Element "'+t+'" should be string or HTMLElement instance');n.element.attributes&&Array.from(n.element.attributes).forEach(function(e){var t=e.name,o=e.value;void 0===Jodit.defaultOptions[t]||i&&void 0!==i[t]||(~["readonly","disabled"].indexOf(t)&&(o=""===o||"true"===o),/^[0-9]+(\.)?([0-9]+)?$/.test(""+o)&&(o=+o),n.options[t]=o)}),n.options.events&&Object.keys(n.options.events).forEach(function(e){n.events.on(e,n.options.events[e])}),n.container.classList.add("jodit_container"),n.container.setAttribute("contenteditable","false"),n.selection=new d.Select(n),n.events.on("removeMarkers",function(){n.selection&&n.selection.removeMarkers()}),n.observer=new c.Observer(n);var o=null;n.options.inline&&(~["TEXTAREA","INPUT"].indexOf(n.element.nodeName)||(n.container=n.element,n.element.setAttribute(n.__defaultClassesKey,""+n.element.className),o=n.container.innerHTML,n.container.innerHTML=""),n.container.classList.add("jodit_inline"),n.container.classList.add("jodit_container")),n.element!==n.container&&(n.element.style.display&&n.element.setAttribute(n.__defaultStyleDisplayKey,n.element.style.display),n.element.style.display="none"),n.container.classList.add("jodit_"+(n.options.theme||"default")+"_theme"),n.options.zIndex&&(n.container.style.zIndex=""+parseInt(""+n.options.zIndex,10)),n.workplace=n.create.div("jodit_workplace",{contenteditable:!1}),n.options.toolbar&&n.toolbar.build(f.splitArray(n.options.buttons).concat(n.options.extraButtons),n.container);var e=n.options.toolbarButtonSize.toLowerCase();return n.container.classList.add("jodit_toolbar_size-"+(~["middle","large","small"].indexOf(e)?e:"middle")),n.options.textIcons&&n.container.classList.add("jodit_text_icons"),n.events.on(n.ownerWindow,"resize",function(){n.events&&n.events.fire("resize")}),n.container.appendChild(n.workplace),n.statusbar=new p.StatusBar(n,n.container),n.workplace.appendChild(n.progress_bar),n.element.parentNode&&n.element!==n.container&&n.element.parentNode.insertBefore(n.container,n.element),n.id=n.element.getAttribute("id")||""+(new Date).getTime(),n.editor=n.create.div("jodit_wysiwyg",{contenteditable:!0,"aria-disabled":!1,tabindex:n.options.tabIndex}),n.workplace.appendChild(n.editor),n.setNativeEditorValue(n.getElementValue()),a.__awaiter(n,void 0,void 0,function(){return a.__generator(this,function(e){switch(e.label){case 0:return[4,this.events.fire("beforeInit",this)];case 1:return e.sent(),this.__initPlugines(),[4,this.__initEditor(o)];case 2:return e.sent(),this.isDestructed?[2]:(this.options.enableDragAndDropFileToEditor&&this.options.uploader&&(this.options.uploader.url||this.options.uploader.insertImageAsBase64URI)&&this.uploader.bind(this.editor),this.isInited=!0,[4,this.events.fire("afterInit",this)]);case 3:return e.sent(),this.events.fire("afterConstructor",this),[2]}})}),n}return a.__extends(Jodit,r),Object.defineProperty(Jodit.prototype,"value",{get:function(){return this.getEditorValue()},set:function(e){this.setEditorValue(e)},enumerable:!0,configurable:!0}),Object.defineProperty(Jodit.prototype,"defaultTimeout",{get:function(){return this.options&&this.options.observer?this.options.observer.timeout:Jodit.defaultOptions.observer.timeout},enumerable:!0,configurable:!0}),Jodit.Array=function(e){return new i.JoditArray(e)},Jodit.Object=function(e){return new n.JoditObject(e)},Jodit.fireEach=function(i){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];Object.keys(Jodit.instances).forEach(function(e){var t,o=Jodit.instances[e];!o.isDestructed&&o.events&&(t=o.events).fire.apply(t,[i].concat(n))})},Object.defineProperty(Jodit.prototype,"uploader",{get:function(){return this.getInstance("Uploader")},enumerable:!0,configurable:!0}),Object.defineProperty(Jodit.prototype,"filebrowser",{get:function(){return this.getInstance("FileBrowser")},enumerable:!0,configurable:!0}),Jodit.prototype.getElementValue=function(){return void 0!==this.element.value?this.element.value:this.element.innerHTML},Jodit.prototype.getNativeEditorValue=function(){return this.editor?this.editor.innerHTML:this.getElementValue()},Jodit.prototype.setNativeEditorValue=function(e){this.editor&&(this.editor.innerHTML=e)},Jodit.prototype.getEditorValue=function(e){var t;if(void 0===e&&(e=!0),void 0!==(t=this.events.fire("beforeGetValueFromEditor")))return t;t=this.getNativeEditorValue().replace(s.INVISIBLE_SPACE_REG_EXP,""),e&&(t=t.replace(/<span[^>]+id="jodit_selection_marker_[^>]+><\/span>/g,"")),"<br>"===t&&(t="");var o={value:t};return this.events.fire("afterGetValueFromEditor",o),o.value},Jodit.prototype.getEditorText=function(){if(this.editor)return this.editor.innerText;var e=this.create.inside.div();return e.innerHTML=this.getElementValue(),e.innerText},Jodit.prototype.setElementValue=function(e){if("string"!=typeof e&&void 0!==e)throw 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.setEditorValue=function(e){var t=this.events.fire("beforeSetValueToEditor",e);if(!1!==t)if("string"==typeof t&&(e=t),this.editor){if("string"!=typeof e&&void 0!==e)throw Error("value must be string");void 0!==e&&this.editor.innerHTML!==e&&this.setNativeEditorValue(e);var o=this.getElementValue(),i=this.getEditorValue();if(o!==i&&this.__callChangeCount<10){this.setElementValue(i),this.__callChangeCount+=1;try{this.events.fire("change",i,o)}finally{this.__callChangeCount=0}}}else void 0!==e&&this.setElementValue(e)},Jodit.prototype.registerCommand=function(e,t){var o=e.toLowerCase();if(void 0===this.commands[o]&&(this.commands[o]=[]),this.commands[o].push(t),"function"!=typeof t){var i=this.options.commandToHotkeys[o]||this.options.commandToHotkeys[e]||t.hotkeys;i&&this.registerHotkeyToCommand(i,o)}return this},Jodit.prototype.registerHotkeyToCommand=function(e,t){var o=this,i=f.asArray(e).map(f.normalizeKeyAliases).map(function(e){return e+".hotkey"}).join(" ");this.events.off(i).on(i,function(){return o.execCommand(t)})},Jodit.prototype.execCommand=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=null),!this.options.readonly||"selectall"===e){var i;if(e=e.toLowerCase(),!1!==(i=this.events.fire("beforeCommand",e,t,o))&&(i=this.execCustomCommands(e,t,o)),!1!==i)if(this.selection.focus(),"selectall"===e)this.selection.select(this.editor,!0);else try{i=this.editorDocument.execCommand(e,t,o)}catch(e){}return this.events.fire("afterCommand",e,t,o),this.setEditorValue(),i}},Jodit.prototype.execCustomCommands=function(e,t,o){var i,n;if(void 0===t&&(t=!1),void 0===o&&(o=null),e=e.toLowerCase(),void 0!==this.commands[e]){for(var r,a=0;a<this.commands[e].length;a+=1)void 0!==(n=("function"==typeof(i=this.commands[e][a])?i:i.exec).call(this,e,t,o))&&(r=n);return r}},Jodit.prototype.lock=function(e){return void 0===e&&(e="any"),!!r.prototype.lock.call(this,e)&&(this.__selectionLocked=this.selection.save(),this.editor.classList.add("jodit_disabled"),!0)},Jodit.prototype.unlock=function(){return!!r.prototype.unlock.call(this)&&(this.editor.classList.remove("jodit_disabled"),this.__selectionLocked&&this.selection.restore(this.__selectionLocked),!0)},Jodit.prototype.getMode=function(){return this.mode},Jodit.prototype.isEditorMode=function(){return this.getRealMode()===s.MODE_WYSIWYG},Jodit.prototype.getRealMode=function(){if(this.getMode()!==s.MODE_SPLIT)return this.getMode();var e=this.ownerDocument.activeElement;return e&&(l.Dom.isOrContains(this.editor,e)||l.Dom.isOrContains(this.toolbar.container,e))?s.MODE_WYSIWYG:s.MODE_SOURCE},Jodit.prototype.setMode=function(e){var t=this,o=this.getMode(),i={mode:parseInt(""+e,10)},n=["jodit_wysiwyg_mode","jodit_source_mode","jodit_split_mode"];!1!==this.events.fire("beforeSetMode",i)&&(this.mode=f.inArray(i.mode,[s.MODE_SOURCE,s.MODE_WYSIWYG,s.MODE_SPLIT])?i.mode:s.MODE_WYSIWYG,this.options.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.events.fire("afterSetMode"))},Jodit.prototype.toggleMode=function(){var e=this.getMode();f.inArray(e+1,[s.MODE_SOURCE,s.MODE_WYSIWYG,this.options.useSplitMode?s.MODE_SPLIT:9])?e+=1:e=s.MODE_WYSIWYG,this.setMode(e)},Jodit.prototype.i18n=function(e){for(var t=this,o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];function n(e){return o.length?f.sprintf.apply(t,[e].concat(o)):e}var r,a=void 0!==this.options&&this.options.debugLanguage,s="auto"===u.Config.defaultOptions.language?f.defaultLanguage(u.Config.defaultOptions.language):u.Config.defaultOptions.language,l=f.defaultLanguage(this.options?this.options.language:s);if(r=void 0!==this.options&&void 0!==Jodit.lang[l]?Jodit.lang[l]:void 0!==Jodit.lang[s]?Jodit.lang[s]:Jodit.lang.en,void 0!==this.options&&void 0!==this.options.i18n[l]&&this.options.i18n[l][e])return n(this.options.i18n[l][e]);if("string"==typeof r[e]&&r[e])return n(r[e]);var c=e.toLowerCase();if("string"==typeof r[c]&&r[c])return n(r[c]);var d=m.ucfirst(e);return"string"==typeof r[d]&&r[d]?n(r[d]):a?"{"+e+"}":n("string"==typeof Jodit.lang.en[e]&&Jodit.lang.en[e]?Jodit.lang.en[e]:e)},Jodit.prototype.setDisabled=function(e){this.options.disabled=e;var t=this.__wasReadOnly;this.setReadOnly(e||t),this.__wasReadOnly=t,this.editor&&(this.editor.setAttribute("aria-disabled",""+e),this.container.classList.toggle("jodit_disabled",e),this.events.fire("disabled",e))},Jodit.prototype.getDisabled=function(){return this.options.disabled},Jodit.prototype.setReadOnly=function(e){this.__wasReadOnly!==e&&(this.__wasReadOnly=e,(this.options.readonly=e)?this.editor&&this.editor.removeAttribute("contenteditable"):this.editor&&this.editor.setAttribute("contenteditable","true"),this.events&&this.events.fire("readonly",e))},Jodit.prototype.getReadOnly=function(){return this.options.readonly},Jodit.prototype.__initPlugines=function(){var t=this,e=this.options.disablePlugins,o=Array.isArray(e)?e.map(function(e){return e.toLowerCase()}):e.toLowerCase().split(/[\s,]+/);Object.keys(Jodit.plugins).forEach(function(e){~o.indexOf(e.toLowerCase())||(t.__plugins[e]=new Jodit.plugins[e](t))})},Jodit.prototype.__initEditor=function(i){return a.__awaiter(this,void 0,void 0,function(){var t,o;return a.__generator(this,function(e){switch(e.label){case 0:return[4,this.__createEditor()];case 1:if(e.sent(),this.isDestructed)return[2];this.element!==this.container?this.setElementValue():null!==i&&this.setEditorValue(i),t=(Jodit.instances[this.id]=this).options.defaultMode,this.options.saveModeInStorage&&null!==(o=this.storage.get("jodit_default_mode"))&&(t=parseInt(o,10)),this.setMode(t),this.options.readonly&&this.setReadOnly(!0),this.options.disabled&&this.setDisabled(!0);try{this.editorDocument.execCommand("defaultParagraphSeparator",!1,this.options.enter.toLowerCase())}catch(e){}try{this.editorDocument.execCommand("enableObjectResizing",!1,"false")}catch(e){}try{this.editorDocument.execCommand("enableInlineTableEditing",!1,"false")}catch(e){}return[2]}})})},Jodit.prototype.__createEditor=function(){return a.__awaiter(this,void 0,void 0,function(){var t,o,i,n=this;return a.__generator(this,function(e){switch(e.label){case 0:return t=this.editor,[4,this.events.fire("createEditor",this)];case 1:return o=e.sent(),this.isDestructed||(!1===o&&l.Dom.safeRemove(t),this.options.editorCssClass&&this.editor.classList.add(this.options.editorCssClass),this.options.style&&f.css(this.editor,this.options.style),this.events.on("synchro",function(){n.setEditorValue()}).on(this.editor,"selectionchange selectionstart keydown keyup keypress mousedown mouseup mousepress click copy cut dragstart drop dragover paste resize touchstart touchend focus blur",function(e){if(!n.options.readonly&&n.events&&n.events.fire){if(!1===n.events.fire(e.type,e))return!1;n.setEditorValue()}}),this.options.spellcheck&&this.editor.setAttribute("spellcheck","true"),this.options.direction&&(i="rtl"==this.options.direction.toLowerCase()?"rtl":"ltr",this.editor.style.direction=i,this.container.style.direction=i,this.editor.setAttribute("dir",i),this.container.setAttribute("dir",i),this.toolbar.setDirection(i)),this.options.triggerChangeEvent&&this.events.on("change",f.debounce(function(){n.events&&n.events.fire(n.element,"change")},this.defaultTimeout))),[2]}})})},Jodit.prototype.destruct=function(){var o=this;if(!this.isDestructed&&!1!==this.events.fire("beforeDestruct")&&this.editor){var e=this.getEditorValue();this.element!==this.container?this.element.hasAttribute(this.__defaultStyleDisplayKey)?(this.element.style.display=this.element.getAttribute(this.__defaultStyleDisplayKey),this.element.removeAttribute(this.__defaultStyleDisplayKey)):this.element.style.display="":this.element.hasAttribute(this.__defaultClassesKey)&&(this.element.className=this.element.getAttribute(this.__defaultClassesKey)||"",this.element.removeAttribute(this.__defaultClassesKey)),this.element.hasAttribute("style")&&!this.element.getAttribute("style")&&this.element.removeAttribute("style"),Object.keys(this.__plugins).forEach(function(e){var t=o.__plugins[e];void 0!==t&&void 0!==t.destruct&&"function"==typeof t.destruct&&t.destruct(),delete o.__plugins[e]}),this.observer.destruct(),this.statusbar.destruct(),delete this.observer,delete this.statusbar,delete this.storage,this.components.forEach(function(e){void 0===e.destruct||"function"!=typeof e.destruct||e.isDestructed||e.destruct()}),this.components.length=0,this.commands={},delete this.selection,this.__selectionLocked=null,this.events.off(this.ownerWindow),this.events.off(this.ownerDocument),this.events.off(this.ownerDocument.body),this.events.off(this.element),this.events.off(this.editor),l.Dom.safeRemove(this.workplace),l.Dom.safeRemove(this.editor),l.Dom.safeRemove(this.progress_bar),l.Dom.safeRemove(this.iframe),this.container!==this.element&&l.Dom.safeRemove(this.container),delete this.workplace,delete this.editor,delete this.progress_bar,delete this.iframe,this.container===this.element&&(this.element.innerHTML=e),delete Jodit.instances[this.id],r.prototype.destruct.call(this),delete this.container}},Jodit.plugins={},Jodit.modules={},Jodit.instances={},Jodit.lang={},Jodit}(r.ViewWithToolbar);t.Jodit=Jodit},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(16);t.Dialog=i.Dialog;var n=o(133);t.Alert=n.Alert;var r=o(64);t.Promt=r.Promt;var a=o(65);t.Confirm=a.Confirm},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h=o(30),v=o(31),m=o(32),g=o(21);t.extend=function e(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var i,n,r,a,s,l,c,d=t.length,u=t[0]||{},f=1,p=!1;for("boolean"==typeof u&&(p=u,u=t[f]||{},f+=1),"object"!=typeof u&&"function"===m.type(u)&&(u={}),f===d&&(u=this,f+=1);f<d;f+=1)if(null!=(i=t[f]))for(c=Object.keys(i),l=0;l<c.length;l+=1)r=u[n=c[l]],u!==(a=i[n])&&(p&&a&&(g.isPlainObject(a)&&!(a instanceof h.JoditObject)||Array.isArray(a)&&!(a instanceof v.JoditArray))?(s=Array.isArray(a)?r&&Array.isArray(r)?r:[]:r&&g.isPlainObject(r)?r:{},u[n]=e(p,s,a)):void 0!==a&&(u[n]=a));return u}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isJoditObject=function(e){return!!(e&&e instanceof Object&&"function"==typeof e.constructor&&"Jodit"===e.constructor.name)}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(1),a=o(3),s=o(2),l=o(4),i=o(61),n=o(0),c=o(15);a.Config.prototype.dialog={resizable:!0,draggable:!0,buttons:["dialog.close"],removeButtons:[]},a.Config.prototype.controls.dialog={close:{icon:"cancel",exec:function(e){e.close()}},fullsize:{icon:"fullsize",getLabel:function(e,t,o){if(a.Config.prototype.controls.fullsize&&a.Config.prototype.controls.fullsize.getLabel&&"function"==typeof a.Config.prototype.controls.fullsize.getLabel)return a.Config.prototype.controls.fullsize.getLabel(e,t,o)},exec:function(e){e.toggleFullSize()}}};var d,u=(r.__extends(f,d=i.View),f.prototype.setElements=function(o,e){var i=this,n=[];l.asArray(e).forEach(function(e){var t="string"==typeof e?i.create.fromHTML(e):e;n.push(t),t.parentNode!==o&&o.appendChild(t)}),Array.from(o.childNodes).forEach(function(e){~n.indexOf(e)||o.removeChild(e)})},f.prototype.onResizerMouseDown=function(e){this.resizable=!0,this.startX=e.clientX,this.startY=e.clientY,this.startPoint.w=this.dialog.offsetWidth,this.startPoint.h=this.dialog.offsetHeight,this.lockSelect(),this.jodit.events&&this.jodit.events.fire(this,"startResize")},f.prototype.setSize=function(e,t){e&&l.css(this.dialog,"width",e),t&&l.css(this.dialog,"height",t)},f.prototype.setPosition=function(e,t){var o=this.window.innerWidth/2-this.dialog.offsetWidth/2,i=this.window.innerHeight/2-this.dialog.offsetHeight/2;o<0&&(o=0),i<0&&(i=0),void 0!==e&&void 0!==t&&(this.offsetX=e,this.offsetY=t,this.moved=100<Math.abs(e-o)||100<Math.abs(t-i)),this.dialog.style.left=(e||o)+"px",this.dialog.style.top=(t||i)+"px"},f.prototype.setTitle=function(e){this.setElements(this.dialogbox_header,e)},f.prototype.setContent=function(e){this.setElements(this.dialogbox_content,e)},f.prototype.setFooter=function(e){this.setElements(this.dialogbox_footer,e),this.dialog.classList.toggle("with_footer",!!e)},f.prototype.getZIndex=function(){return parseInt(this.container.style.zIndex||"0",10)},f.prototype.getMaxZIndexDialog=function(){var t,o,i=0,n=this;return l.$$(".jodit_dialog_box",this.destination).forEach(function(e){t=e.__jodit_dialog,o=parseInt(l.css(e,"zIndex"),10),t.isOpened()&&!isNaN(o)&&i<o&&(n=t,i=o)}),n},f.prototype.setMaxZIndex=function(){var t=0,o=0;l.$$(".jodit_dialog_box",this.destination).forEach(function(e){o=parseInt(l.css(e,"zIndex"),10),t=Math.max(isNaN(o)?0:o,t)}),this.container.style.zIndex=""+(t+1)},f.prototype.maximization=function(t){return"boolean"!=typeof t&&(t=!this.container.classList.contains("jodit_dialog_box-fullsize")),this.container.classList.toggle("jodit_dialog_box-fullsize",t),[this.destination,this.destination.parentNode].forEach(function(e){e&&e.classList&&e.classList.toggle("jodit_fullsize_box",t)}),this.iSetMaximization=t},f.prototype.open=function(e,t,o,i){this.jodit&&this.jodit.events&&!1===this.jodit.events.fire(this,"beforeOpen")||(this.destroyAfterClose=!0===o,void 0!==t&&this.setTitle(t),e&&this.setContent(e),this.container.classList.add("active"),i&&this.container.classList.add("jodit_modal"),this.setPosition(this.offsetX,this.offsetY),this.setMaxZIndex(),this.options.fullsize&&this.maximization(!0),this.jodit&&this.jodit.events&&this.jodit.events.fire("afterOpen",this))},f.prototype.isOpened=function(){return!this.isDestructed&&this.container&&this.container.classList.contains("active")},f.prototype.destruct=function(){this.isDestructed||(this.toolbar&&(this.toolbar.destruct(),delete this.toolbar),this.events&&this.events.off(this.window,"mousemove",this.onMouseMove).off(this.window,"mouseup",this.onMouseUp).off(this.window,"keydown",this.onKeyDown).off(this.window,"resize",this.onResize),!this.jodit&&this.events&&(this.events.destruct(),delete this.events),this.container&&(n.Dom.safeRemove(this.container),delete this.container),d.prototype.destruct.call(this))},f);function f(e,t){void 0===t&&(t=a.Config.prototype.dialog);var o=d.call(this,e,t)||this;o.destination=document.body,o.destroyAfterClose=!1,o.moved=!1,o.iSetMaximization=!1,o.resizable=!1,o.draggable=!1,o.startX=0,o.startY=0,o.startPoint={x:0,y:0,w:0,h:0},o.lockSelect=function(){o.container.classList.add("jodit_dialog_box-moved")},o.unlockSelect=function(){o.container.classList.remove("jodit_dialog_box-moved")},o.onMouseUp=function(){(o.draggable||o.resizable)&&(o.draggable=!1,o.resizable=!1,o.unlockSelect(),o.jodit&&o.jodit.events&&o.jodit.events.fire(o,"endResize endMove"))},o.onHeaderMouseDown=function(e){var t=e.target;!o.options.draggable||t&&t.nodeName.match(/^(INPUT|SELECT)$/)||(o.draggable=!0,o.startX=e.clientX,o.startY=e.clientY,o.startPoint.x=l.css(o.dialog,"left"),o.startPoint.y=l.css(o.dialog,"top"),o.setMaxZIndex(),e.preventDefault(),o.lockSelect(),o.jodit&&o.jodit.events&&o.jodit.events.fire(o,"startMove"))},o.onMouseMove=function(e){o.draggable&&o.options.draggable&&(o.setPosition(o.startPoint.x+e.clientX-o.startX,o.startPoint.y+e.clientY-o.startY),o.jodit&&o.jodit.events&&o.jodit.events.fire(o,"move",e.clientX-o.startX,e.clientY-o.startY),e.stopImmediatePropagation(),e.preventDefault()),o.resizable&&o.options.resizable&&(o.setSize(o.startPoint.w+e.clientX-o.startX,o.startPoint.h+e.clientY-o.startY),o.jodit&&o.jodit.events&&o.jodit.events.fire(o,"resizeDialog",e.clientX-o.startX,e.clientY-o.startY),e.stopImmediatePropagation(),e.preventDefault())},o.onKeyDown=function(e){if(o.isOpened()&&e.which===s.KEY_ESC){var t=o.getMaxZIndexDialog();t?t.close():o.close(),e.stopImmediatePropagation()}},o.onResize=function(){o.options&&o.options.resizable&&!o.moved&&o.isOpened()&&!o.offsetX&&!o.offsetY&&o.setPosition()},o.document=document,o.window=window,o.close=function(e){o.isDestructed||(e&&(e.stopImmediatePropagation(),e.preventDefault()),o.jodit&&o.jodit.events&&o.jodit.events.fire("beforeClose",o),o.container&&o.container.classList&&o.container.classList.remove("active"),o.iSetMaximization&&o.maximization(!1),o.destroyAfterClose&&o.destruct(),o.jodit&&o.jodit.events&&(o.jodit.events.fire(o,"afterClose"),o.jodit.events.fire(o.ownerWindow,"jodit_close_dialog")))},c.isJoditObject(e)&&(o.window=e.ownerWindow,o.document=e.ownerDocument,e.events.on("beforeDestruct",function(){o.destruct()}));var i=o;i.options=r.__assign({},e&&e.options?e.options.dialog:a.Config.prototype.dialog,i.options),i.container=o.create.fromHTML('<div style="z-index:'+i.options.zIndex+'" class="jodit jodit_dialog_box"><div class="jodit_dialog_overlay"></div><div class="jodit_dialog"><div class="jodit_dialog_header non-selected"><div class="jodit_dialog_header-title"></div><div class="jodit_dialog_header-toolbar"></div></div><div class="jodit_dialog_content"></div><div class="jodit_dialog_footer"></div>'+(i.options.resizable?'<div class="jodit_dialog_resizer"></div>':"")+"</div></div>"),e&&e.id&&i.container.setAttribute("data-editor_id",e.id),Object.defineProperty(i.container,"__jodit_dialog",{value:i}),i.dialog=i.container.querySelector(".jodit_dialog"),i.resizer=i.container.querySelector(".jodit_dialog_resizer"),i.jodit&&i.jodit.options&&i.jodit.options.textIcons&&i.container.classList.add("jodit_text_icons"),i.dialogbox_header=i.container.querySelector(".jodit_dialog_header>.jodit_dialog_header-title"),i.dialogbox_content=i.container.querySelector(".jodit_dialog_content"),i.dialogbox_footer=i.container.querySelector(".jodit_dialog_footer"),i.dialogbox_toolbar=i.container.querySelector(".jodit_dialog_header>.jodit_dialog_header-toolbar"),i.destination.appendChild(i.container),i.container.addEventListener("close_dialog",i.