diff --git a/build/jodit.min.css b/build/jodit.min.css index e7baaf72b..613299a42 100644 --- a/build/jodit.min.css +++ b/build/jodit.min.css @@ -2,7 +2,7 @@ * * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.1.16 + * Version: v3.1.17 * Url: https://xdsoft.net/jodit/ * License(s): SEE LICENSE IN * diff --git a/build/jodit.min.js b/build/jodit.min.js index ce3d6b436..f905a7a81 100644 --- a/build/jodit.min.js +++ b/build/jodit.min.js @@ -2,9 +2,9 @@ * * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser * Author: Chupurnov (https://xdsoft.net/) - * Version: v3.1.16 + * Version: v3.1.17 * Url: https://xdsoft.net/jodit/ * License(s): SEE LICENSE IN * */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Jodit=t():e.Jodit=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,i){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/build/",t(t.s=20)}([function(e,t,o){"use strict";t.__esModule=!0;var i=o(2),n=o(3),r={},s=r.toString,a=r.hasOwnProperty;t.isIE=function(){return-1!=navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)};var l=1;t.$$=function(e,o){var i;if(!/:scope/.test(e)||!t.isIE()||"undefined"!=typeof HTMLDocument&&o instanceof HTMLDocument)i=o.querySelectorAll(e);else{var n=o.id,r=n||"_selector_id_"+(""+Math.random()).slice(2)+l++;e=e.replace(/:scope/g,"#"+r),!n&&o.setAttribute("id",r),i=o.parentNode.querySelectorAll(e),n||o.removeAttribute("id")}return[].slice.call(i)},t.isWindow=function(e){return null!==e&&e===e.window},t.type=function(e){return null===e?"null":"object"==typeof e||"function"==typeof e?r[s.call(e)]||"object":typeof e},t.each=function(e,t){var o,i,n;if(Array.isArray(e)){for(o=e.length,n=0;o>n;n+=1)if(!1===t.call(e[n],n,e[n]))return!1}else for(i=Object.keys(e),n=0;i.length>n;n+=1)if(!1===t.call(e[i[n]],i[n],e[i[n]]))return!1;return e},t.each(["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error","Symbol","HTMLDocument","Window","HTMLElement","HTMLBodyElement","Text","DocumentFragment"],function(e,t){r["[object "+t+"]"]=t.toLowerCase()}),t.inArray=function(e,t){return-1!==t.indexOf(e)},t.isPlainObject=function(e){return!("object"!=typeof e||e.nodeType||t.isWindow(e)||e.constructor&&!a.call(e.constructor.prototype,"isPrototypeOf"))},t.extend=function(){for(var e=[],o=0;arguments.length>o;o++)e[o]=arguments[o];var i,n,r,s,a,l,d,c,u=e[0]||{},p=1,f=e.length,h=!1;for("boolean"==typeof u&&(h=u,u=e[p]||{},p+=1),"object"!=typeof u&&"function"===t.type(u)&&(u={}),p===f&&(u=this,p+=1),p;f>p;p+=1)if(null!==(i=e[p])&&void 0!==i)for(c=Object.keys(i),d=0;c.length>d;d+=1)n=c[d],r=u[n],s=i[n],u!==s&&(h&&s&&(t.isPlainObject(s)||Array.isArray(s))?(a=Array.isArray(s),a?(a=!1,l=r&&Array.isArray(r)?r:[]):l=r&&t.isPlainObject(r)?r:{},u[n]=t.extend(h,l,s)):void 0!==s&&(u[n]=s));return u},t.trim=function(e){return e.replace(i.SPACE_REG_EXP_START,"").replace(i.SPACE_REG_EXP_END,"")},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,o,i,n,r,s=/([\s\n\t\r]*?)rgb\((\d+), (\d+), (\d+)\)/.exec(e)||/([\s\n\t\r]*?)rgba\((\d+), (\d+), (\d+), ([\d.]+)\)/.exec(e);if(!s)return"#000000";for(o=parseInt(s[2],10),i=parseInt(s[3],10),n=parseInt(s[4],10),r=n|i<<8|o<<16,t=r.toString(16).toUpperCase();6>t.length;)t="0"+t;return s[1]+"#"+t},t.normalizeColor=function(e){var o,i=["#"],n=t.colorToHex(e);if(!n)return!1;if(n=t.trim(n.toUpperCase()),n=n.substr(1),3===n.length){for(o=0;3>o;o+=1)i.push(n[o]),i.push(n[o]);return i.join("")}return n.length>6&&(n=n.substr(0,6)),"#"+n},t.normalizeSize=function(e){return/^[0-9]+$/.test(""+e)?e+"px":""+e},t.getContentWidth=function(e,t){var o=function(e){return parseInt(e,10)},i=t.getComputedStyle(e);return e.offsetWidth-o(i.getPropertyValue("padding-left")||"0")-o(i.getPropertyValue("padding-right")||"0")},t.ctrlKey=function(e){if(-1!==navigator.userAgent.indexOf("Mac OS X")){if(e.metaKey&&!e.altKey)return!0}else if(e.ctrlKey&&!e.altKey)return!0;return!1};var d=function(e){return"file:"===window.location.protocol&&/^\/\//.test(e)&&(e="https:"+e),e};t.appendScript=function(e,t,o,i){void 0===o&&(o="");var n=i.createElement("script");n.className=o,n.type="text/javascript",n.charset="utf-8",n.src=d(e),void 0!==t&&(n.onload=t),i.body.appendChild(n)},t.dom=function(e,t){if(e instanceof t.defaultView.HTMLElement)return e;var o=t.createElement("div");return o.innerHTML=e,o.firstChild===o.lastChild&&o.firstChild?o.firstChild:o},t.hexToRgb=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,o,i){return t+t+o+o+i+i});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},t.clear=function(e,o){return void 0===o&&(o=!1),e=t.trim(e).replace(i.INVISIBLE_SPACE_REG_EXP,"").replace(/[\s]*class=""/g,""),o&&(e=e.replace(/]*>[\s\n\r\t]*( |
|)?[\s\n\r\t]*<\/p>[\n\r]*/g,"")),e},t.htmlentities=function(e){return e.replace(//gi,">").replace(/"/gi,""").replace(/'/gi,"'")},t.isURL=function(e){return 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)},t.pathNormalize=function(e){return e.replace(/([^:])[\\\/]+/g,"$1/")},t.urlNormalize=function(e){return e.replace(/([^:])[\\\/]+/g,"$1/")},t.isHTML=function(e){return/<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(e)},t.isHTMLFromWord=function(e){return-1!==e.search(//)||-1!==e.search(//)||-1!==e.search(/style="[^"]*mso-/)&&-1!==e.search(/t;t+=1)o=n[t].split("="),i[decodeURIComponent(o[0])]=decodeURIComponent(o[1]||"");return i},t.convertMediaURLToVideoEmbed=function(e,o,i){if(void 0===o&&(o=400),void 0===i&&(i=345),!t.isURL(e))return e;var n=document.createElement("a"),r=/(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;switch(n.href=e,o||(o=400),i||(i=345),n.hostname){case"www.vimeo.com":case"vimeo.com":return r.test(e)?e.replace(r,''):e;case"youtube.com":case"www.youtube.com":case"youtu.be":case"www.youtu.be":var s=n.search?t.parseQuery(n.search):{v:n.pathname.substr(1)};return s.v?'':e}return e},t.browser=function(e){var t=navigator.userAgent.toLowerCase(),o=/(firefox)[\s\/]([\w.]+)/.exec(t)||/(chrome)[\s\/]([\w.]+)/.exec(t)||/(webkit)[\s\/]([\w.]+)/.exec(t)||/(opera)(?:.*version)[\s\/]([\w.]+)/.exec(t)||/(msie)[\s]([\w.]+)/.exec(t)||/(trident)\/([\w.]+)/.exec(t)||0>t.indexOf("compatible")||[];return"version"===e?o[2]:"webkit"===e?"chrome"===o[1]||"webkit"===o[1]:"ff"===e?"firefox"===o[1]:"msie"===e?"trident"===o[1]||"msie"===o[1]:o[1]===e},t.offset=function(e,o,i){void 0===i&&(i=!1);var n,r,s=e.getBoundingClientRect(),a=e.ownerDocument,l=a.body,d=a.documentElement,c=a.defaultView||a.parentWindow,u=c.pageYOffset||d.scrollTop||l.scrollTop,p=c.pageXOffset||d.scrollLeft||l.scrollLeft,f=d.clientTop||l.clientTop||0,h=d.clientLeft||l.clientLeft||0;if(!i&&o.options.iframe){var m=t.offset(o.iframe,o,!0),v=m.top,g=m.left;n=s.top+v,r=s.left+g}else n=s.top+u-f,r=s.left+p-h;return{top:Math.round(n),left:Math.round(r),width:s.width,height:s.height}},t.camelCase=function(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})},t.fromCamelCase=function(e){return e.replace(/([A-Z]+)/g,function(e,t){return"-"+t.toLowerCase()})},t.htmlspecialchars=function(e){var t=document.createElement("div");return t.innerText=e,t.innerHTML},t.debounce=function(e,t,o,i){3===arguments.length&&"boolean"!=typeof o&&(i=o,o=!1);var n;return function(){var r=arguments;i=i||this,!o&&t||e.apply(i,r),clearTimeout(n),t&&(n=window.setTimeout(function(){o||e.apply(i,r),n=0},t))}},t.throttle=function(e,t,o){var i,n,r,s=null;return function(){i=arguments,n=!0,o=o||this,s||(r=function(){n?(e.apply(o,i),n=!1,s=setTimeout(r,t)):s=null})()}},t.normilizeCSSValue=function(e,t){switch(e){case"font-weight":return"bold"===t?700:t}return t},t.css=function(e,o,i){var n=/^left|top|bottom|right|width|min|max|height|margin|padding|font-size/i;if(t.isPlainObject(o)||void 0!==i){var r=function(e,o,i){void 0!==i&&null!==i&&n.test(o)&&/^[\-+]?[0-9.]+$/.test(""+i)&&(i=parseInt(""+i,10)+"px"),void 0!==i&&t.css(e,o)!==t.normilizeCSSValue(o,i)&&(e.style[o]=i)};if(t.isPlainObject(o)){var s=Object.keys(o),a=void 0;for(a=0;s.length>a;a+=1)r(e,t.camelCase(s[a]),o[s[a]])}else r(e,t.camelCase(o),i);return""}var l=t.fromCamelCase(o),d=e.ownerDocument,c=!!d&&(d.defaultView||d.parentWindow),u=e.style[o],p=void 0!==u&&""!==u?u:c?c.getComputedStyle(e).getPropertyValue(l):"";return n.test(o)&&/^[\-+]?[0-9.]+px$/.test(""+p)&&(p=parseInt(p,10)),t.normilizeCSSValue(o,p)},t.asArray=function(e){return Array.isArray(e)?e:[e]},t.sprintf=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];var o=/%%|%(\d+\$)?([-+#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g,i=e,n=0,r=i[n++],s=function(e,t,o,i){var n=t>e.length?Array(1+t-e.length>>>0).join(o):"";return i?e+n:n+e},a=function(e,t,o,i,n){var r=i-e.length;return r>0&&(e=o||!n?s(e,i," ",o):e.slice(0,t.length)+s("",r,"0",!0)+e.slice(t.length)),e},l=function(e,t,o,i,n,r,l){var d=e>>>0;o=o&&d&&{2:"0b",8:"0",16:"0x"}[t]||"";var c=o+s(d.toString(t),r||0,"0",!1);return a(c,o,i,n,l)},d=function(e,t,o,i,n){return null!=i&&(e=e.slice(0,i)),a(e,"",t,o,n)};return r.replace(o,function(e,t,o,r,c,u,p){if("%%"==e)return"%";for(var f=!1,h="",m=!1,v=!1,g=0;o&&o.length>g;g++)switch(o.charAt(g)){case" ":h=" ";break;case"+":h="+";break;case"-":f=!0;break;case"0":m=!0;break;case"#":v=!0}if(r=r?"*"===r?+i[n++]:"*"===(""+r)[0]?+i[(""+r).slice(1,-1)]:+r:0,0>r&&(r=-r,f=!0),!isFinite(r))throw Error("sprintf: (minimum-)width must be finite");u=u?"*"===u?+i[n++]:"*"===u[0]?+i[u.slice(1,-1)]:+u:"fFeE".indexOf(p)>-1?6:"d"==p?0:void 0;var _=t?i[t.slice(0,-1)]:i[n++];switch(p){case"s":return d(_+"",f,r,u,m);case"c":return d(String.fromCharCode(+_),f,r,u,m);case"b":return l(_,2,v,f,r,u,m);case"o":return l(_,8,v,f,r,u,m);case"x":return l(_,16,v,f,r,u,m);case"X":return l(_,16,v,f,r,u,m).toUpperCase();case"u":return l(_,10,v,f,r,u,m);case"i":case"d":var b=parseInt(""+_,10),y=0>b?"-":h;return _=y+s(Math.abs(b)+"",u,"0",!1),a(_,y,f,r,m);case"e":case"E":case"f":case"F":case"g":case"G":var b=+_,y=0>b?"-":h,w=["toExponential","toFixed","toPrecision"]["efg".indexOf(p.toLowerCase())],C=["toString","toUpperCase"]["eEfFgG".indexOf(p)%2];return _=y+Math.abs(b)[w](u),a(_,y,f,r,m)[C]();default:return e}})},t.val=function(e,t,o){var i=e.querySelector(t);return i?(o&&(i.value=o),i.value):""},t.defaultLanguage=function(e){return"auto"===e||void 0===e?document.documentElement.lang||navigator.language&&navigator.language.substr(0,2)||!!navigator.browserLanguage&&navigator.browserLanguage.substr(0,2)||"en":e},t.normalizeNode=function(e){if(e){if(e.nodeType===Node.TEXT_NODE&&null!==e.nodeValue&&e.parentNode)for(;e.nextSibling&&3==e.nextSibling.nodeType;)null!==e.nextSibling.nodeValue&&(e.nodeValue+=e.nextSibling.nodeValue),e.parentNode.removeChild(e.nextSibling);else t.normalizeNode(e.firstChild);t.normalizeNode(e.nextSibling)}},t.cleanFromWord=function(e){-1!==e.indexOf("")+7));var t="";try{var o=document.createElement("div");o.innerHTML=e;var i=[];o.firstChild&&n.Dom.all(o,function(e){switch(e.nodeType){case Node.ELEMENT_NODE:"FONT"===e.nodeName?n.Dom.unwrap(e):[].slice.call(e.attributes).forEach(function(t){-1===["src","href","rel","content"].indexOf(t.name.toLowerCase())&&e.removeAttribute(t.name)});break;case Node.TEXT_NODE:break;default:i.push(e)}}),i.forEach(function(e){return e.parentNode&&e.parentNode.removeChild(e)}),t=o.innerHTML}catch(e){}return t&&(e=t),e.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(/<\!--[^>]*>/g,"")},t.applyStyles=function(e){if(-1===e.indexOf("")+7);var o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o);var i="",n=[],r=[];try{var s=o.contentDocument||o.contentWindow.document;s.open(),s.write(e),s.close(),s.styleSheets.length&&(r=s.styleSheets[s.styleSheets.length-1].cssRules);for(var a=0;r.length>a;a+=1)!function(e){if(""===r[e].selectorText)return"continue";n=t.$$(r[e].selectorText,s.body),n.forEach(function(t){t.style.cssText+=r[e].style.cssText.replace(/mso-[a-z\-]+:[\s]*[^;]+;/g,"").replace(/border[a-z\-]*:[\s]*[^;]+;/g,"")})}(a);i=s.firstChild?s.body.innerHTML:""}catch(e){}finally{o.parentNode&&o.parentNode.removeChild(o)}return i&&(e=i),e.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(/<\!--[^>]*>/g,"")}},function(e,t,o){"use strict";t.__esModule=!0;var i=o(2),n=o(0),r=o(5),s=o(9),a=s.Widget.TabsWidget,l=s.Widget.ImageSelectorWidget,d=function(){function e(){this.ownerDocument=document,this.ownerWindow=window,this.zIndex=0,this.readonly=!1,this.activeButtonsInReadOnly=["source","fullsize","print","about","dots"],this.toolbarButtonSize="middle",this.theme="default",this.saveModeInCookie=!1,this.spellcheck=!0,this.editorCssClass=!1,this.triggerChangeEvent=!0,this.width="auto",this.height="auto",this.minHeight=100,this.direction="",this.language="auto",this.debugLanguage=!1,this.i18n="en",this.tabIndex=-1,this.toolbar=!0,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.extraButtons=[],this.sizeLG=900,this.sizeMD=700,this.sizeSM=400,this.buttons=["source","|","bold","strikethrough","underline","italic","|","ul","ol","|","outdent","indent","|","font","fontsize","brush","paragraph","|","image","video","table","link","|","align","undo","redo","|","hr","eraser","copyformat","|","symbol","fullsize","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}return e}();t.Config=d,d.prototype.controls={print:{exec:function(e){var t=window.open("","PRINT");t&&(e.options.iframe?(e.events.fire("generateDocumentStructure.iframe",t.document),t.document.body.innerHTML=e.getEditorValue()):(t.document.write(""+e.getEditorValue()+""),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('
'+e.i18n("Jodit Editor")+" v."+e.getVersion()+" "+e.i18n("Free Non-commercial Version")+'
'+e.i18n("Jodit User's Guide")+" "+e.i18n("contains detailed help for using")+"
"+e.i18n("For information about the license, please go to our website:")+'
"+e.i18n("Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.")+"
"),t.open()},tooltip:"About Jodit",mode:i.MODE_SOURCE+i.MODE_WYSIWYG},hr:{command:"insertHorizontalRule",tags:["hr"],tooltip:"Insert Horizontal Line"},image:{popup:function(e,t,o,i){var r=function(t){e.selection.insertNode(n.dom('',e.editorDocument))},s=null;return t&&t.nodeType!==Node.TEXT_NODE&&("IMG"===t.tagName||n.$$("img",t).length)&&(s="IMG"===t.tagName?t:n.$$("img",t)[0]),l(e,{filebrowser:function(e){if(e.files&&e.files.length){var t=void 0;for(t=0;e.files.length>t;t+=1)r(e.baseurl+e.files[t])}i()},upload:function(e){var t;if(e.files&&e.files.length)for(t=0;e.files.length>t;t+=1)r(e.baseurl+e.files[t]);i()},url:function(t,o){var r=s||n.dom('',e.editorDocument);r.setAttribute("src",t),r.setAttribute("alt",o),s||e.selection.insertNode(r),i()}},s,i)},tags:["img"],tooltip:"Insert Image"},video:{popup:function(e){var t=n.dom('
\n \n \n
",e.ownerDocument),o=n.dom('
\n \n \n
",e.ownerDocument),i={},s=e.selection.save(),l=function(t){e.selection.restore(s),e.selection.insertHTML(t)};return i[r.Toolbar.getIcon("link")+" "+e.i18n("Link")]=t,i[r.Toolbar.getIcon("source")+" "+e.i18n("Code")]=o,o.addEventListener("submit",function(e){return e.preventDefault(),n.trim(n.val(o,"textarea[name=code]"))?(l(n.val(o,"textarea[name=code]")),!1):(o.querySelector("textarea[name=code]").focus(),o.querySelector("textarea[name=code]").classList.add("jodit_error"),!1)}),t.addEventListener("submit",function(e){return e.preventDefault(),n.isURL(n.val(t,"input[name=code]"))?(l(n.convertMediaURLToVideoEmbed(n.val(t,"input[name=code]"))),!1):(t.querySelector("input[name=code]").focus(),t.querySelector("input[name=code]").classList.add("jodit_error"),!1)}),a(e,i)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"}}},function(e,t,o){"use strict";t.__esModule=!0,t.INVISIBLE_SPACE="\ufeff",t.INVISIBLE_SPACE_REG_EXP=/[\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)$/i,t.KEY_BACKSPACE=8,t.KEY_TAB=9,t.KEY_ENTER=13,t.KEY_ESC=27,t.KEY_LEFT=37,t.KEY_TOP=38,t.KEY_RIGHT=39,t.KEY_BOTTOM=40,t.KEY_DELETE=46,t.KEY_F=70,t.KEY_R=82,t.KEY_Y=89,t.KEY_Z=90,t.KEY_F3=114,t.NEARBY=5,t.ACCURACY=10,t.BR="br",t.PARAGRAPH="P",t.MODE_WYSIWYG=1,t.MODE_SOURCE=2,t.MODE_SPLIT=3,t.TEXT_PLAIN=-1!=navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)?"text":"text/plain",t.TEXT_HTML=-1!=navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)?"text":"text/html",t.MARKER_CLASS="jodit_selection_marker",t.EMULATE_DBLCLICK_TIMEOUT=300,t.JODIT_SELECTED_CELL_MARKER="data-jodit-selected-cell"},function(e,t,o){"use strict";t.__esModule=!0;var i=o(2),n=o(0);t.Dom=function(){function e(){}return e.unwrap=function(e){var t=e.parentNode,o=e;if(t){for(;o.firstChild;)t.insertBefore(o.firstChild,o);t.removeChild(o)}},e.each=function(t,o){var i=t.firstChild;if(i)for(;i;){if(!1===o.call(i,i)||!1===e.each(i,o))return!1;i=e.next(i,function(e){return!!e},t)}return!0},e.create=function(e,t,o){var i;return e=e.toLowerCase(),"text"===e?i=o.createTextNode("string"==typeof t?t:""):(i=o.createElement(e),void 0!==t&&(i.innerHTML=t)),i},e.replace=function(t,o,i,r,s){void 0===i&&(i=!1),void 0===r&&(r=!1);var a="string"==typeof o?e.create(o,"",s):o;if(!r)for(;t.firstChild;)a.appendChild(t.firstChild);return i&&n.each(t.attributes,function(e,t){a.setAttribute(t.name,t.nodeValue)}),t.parentNode&&t.parentNode.replaceChild(a,t),a},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(e){return!!e&&"string"==typeof e.nodeName&&i.IS_BLOCK.test(e.nodeName)},e.canSplitBlock=function(e,t){return e&&e instanceof t.HTMLElement&&this.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&void 0!==e.style&&!/^(fixed|absolute)/i.test(e.style.position)},e.prev=function(t,o,i,n){return void 0===n&&(n=!0),e.find(t,o,i,!1,"previousSibling",!!n&&"lastChild")},e.next=function(t,o,i,n){return void 0===n&&(n=!0),e.find(t,o,i,void 0,void 0,n?"firstChild":"")},e.find=function(t,o,i,n,r,s){if(void 0===n&&(n=!1),void 0===r&&(r="nextSibling"),void 0===s&&(s="firstChild"),n&&o(t))return t;var a,l=t;do{if(a=l[r],o(a))return a||!1;if(s&&a&&a[s]){var d=e.find(a[s],o,a,!0,r,s);if(d)return d}a||(a=l.parentNode),l=a}while(l&&l!==i);return!1},e.findWithCurrent=function(t,o,i,n,r){void 0===n&&(n="nextSibling"),void 0===r&&(r="firstChild");var s=t;do{if(o(s))return s||!1;if(r&&s&&s[r]){var a=e.findWithCurrent(s[r],o,s,n,r);if(a)return a}for(;s&&!s[n]&&s!==i;)s=s.parentNode;s&&s[n]&&s!==i&&(s=s[n])}while(s&&s!==i);return!1},e.isEmptyTextNode=function(e){return e&&e.nodeType===Node.TEXT_NODE&&(!e.nodeValue||0===e.nodeValue.replace(i.INVISIBLE_SPACE_REG_EXP,"").length)},e.isEmpty=function(t){return!t||(t.nodeType===Node.TEXT_NODE?!t.nodeValue||0===n.trim(t.nodeValue).length:e.each(t,function(e){if(e&&e.nodeType===Node.TEXT_NODE&&e.nodeValue&&0!==n.trim(e.nodeValue).length||e&&e.nodeType===Node.ELEMENT_NODE&&e.nodeName.match(/^(img|table)$/i))return!1}))},e.isNode=function(e,t){return"object"==typeof t?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},e.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},e.closest=function(t,o,i){var n;return n="function"==typeof o?o:o instanceof RegExp?function(e){return o.test(e.nodeName)}:function(e){return RegExp("^("+o+")$","i").test(e.nodeName)},e.up(t,n,i)},e.after=function(e,t){var o=e.parentNode;o&&(o.lastChild===e?o.appendChild(t):o.insertBefore(t,e.nextSibling))},e.all=function(t,o,i){void 0===i&&(i=!1);var n=t.childNodes?Array.prototype.slice.call(t.childNodes):[];if(o(t))return t;i&&(n=n.reverse()),n.forEach(function(t){e.all(t,o,i)})},e.wrap=function(t,o,i){var n,r=t,s=t,a=i.selection.save(),l=!1;do{l=!1,(n=e.prev(r,function(e){return!!e},i.editor,!1))&&!e.isBlock(n)&&(l=!0,r=n)}while(l);do{l=!1,(n=e.next(s,function(e){return!!e},i.editor,!1))&&!e.isBlock(n)&&(l=!0,s=n)}while(l);var d="string"==typeof o?e.create(o,"",i.editorDocument):o;r.parentNode&&r.parentNode.insertBefore(d,r);for(var c=r;c&&(c=r.nextSibling,d.appendChild(r),r!==s&&c);)r=c;return i.selection.restore(a),d},e.contains=function(e,t){for(;t.parentNode;){if(t.parentNode===e)return!0;t=t.parentNode}return!1},e.isOrContains=function(t,o){return t===o||e.contains(t,o)},e}()},function(e,t,o){"use strict";t.__esModule=!0;var i=o(6);t.Component=function(){function e(e){e&&e instanceof i.Jodit&&(this.jodit=e,e.components&&e.components.push(this))}return e.prototype.destruct=function(){},e}()},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(4),s=o(0),a=o(2),l=o(3);t.Toolbar=function(e){function t(t){var o=e.call(this,t)||this;return o.__popapOpened=!1,o.__listOpened=!1,o.closeAll=function(){o.list.innerHTML="",o.popup.innerHTML="",o.popup.style.display="none",o.list.style.display="none",s.$$(".jodit_dropdown_open, .jodit_popap_open",o.container).forEach(function(e){e.classList.remove("jodit_dropdown_open","jodit_popap_open")}),o.__popapOpened&&o.jodit.selection&&o.jodit.selection.removeMarkers(),o.__popapOpened=!1,o.__listOpened=!1},o.defaultControl={template:function(e,t,i){return o.jodit.i18n(i)}},o.buttonList=[],o.initEvents=function(){var e;o.jodit.events.on(o.popup,"mousedown touchstart",function(e){e.stopPropagation()}).on(o.list,"mousedown touchstart",function(e){e.stopPropagation()}).on(o.jodit.ownerWindow,"mousedown touchstart",function(){(o.__popapOpened||o.__listOpened)&&o.closeAll()}).on("afterOpenPopup afterOpenList",function(e){var t=s.offset(o.jodit.container,o.jodit,!0),i=s.offset(e,o.jodit,!0),n=s.css(e,"marginLeft"),r=0;if(i.left+i.width>t.left+t.width&&(r=-(i.left+i.width-(t.left+t.width)),s.css(e,{marginLeft:r+n}),i=s.offset(e,o.jodit,!0)),t.left>i.left&&(i.left+i.width>t.left+t.width?s.css(e,{width:t.width}):(r=t.left-i.left,s.css(e,{marginLeft:r+n}))),r){var a=e.querySelector(".jodit_popup_triangle");a&&(a.style.marginLeft=-r+"px")}}).on("hidePopup",function(){o.closeAll()}).on("mousedown mouseup keydown change afterSetMode focus afterInit readonly",function(){var t=function(){o.jodit.selection&&o.checkActiveButtons(o.jodit.selection.current())};o.jodit.options.observer.timeout?(clearTimeout(e),e=window.setTimeout(t,o.jodit.options.observer.timeout)):t()})},o.container=s.dom('
',t.ownerDocument),o.popup=s.dom('
',t.ownerDocument),o.list=s.dom('
    ',t.ownerDocument),o.initEvents(),o}return i(t,e),t.getIcon=function(e,o){return void 0===o&&(o=""),void 0!==t.icons[e]?t.icons[e]:o},t.prototype.openPopup=function(e,t,o){this.closeAll(),t&&(e.classList.add("jodit_popup_open"),e.appendChild(this.popup),this.__popapOpened=!0,this.popup.innerHTML='',this.popup.appendChild(s.dom(t,this.jodit.ownerDocument)),this.popup.style.display="block",this.popup.style.marginLeft=null,void 0!==o&&this.popup.classList.toggle("jodit_right",o),this.jodit.events.fire("afterOpenPopup",this.popup,this.container))},t.prototype.openList=function(e,t,o){var i=this;e.classList.add("jodit_dropdown_open"),this.closeAll(),this.__listOpened=!0,s.each(t.list,function(e,n){var r;r=void 0!==i.jodit.options.controls[n]?i.addButton(n,i.jodit.options.controls[n],"",o):void 0!==i.jodit.options.controls[e]?i.addButton(e,s.extend({},i.jodit.options.controls[e],n),"",o):i.addButton(e,{exec:t.exec,command:t.command,args:[t.args&&t.args[0]||e,t.args&&t.args[1]||n]},t.template&&t.template(i.jodit,e,n),o),i.list.appendChild(r)}),this.list.style.display="block",this.list.style.marginLeft=null,e.appendChild(this.list),this.jodit.events.fire("afterOpenList",this.list,this.container)},t.__toggleButton=function(e,t){e.classList.toggle("jodit_disabled",!t),t?e.hasAttribute("disabled")&&e.removeAttribute("disabled"):e.hasAttribute("disabled")||e.setAttribute("disabled","disabled")},t.prototype.checkActiveButtons=function(e){var o=this,i=function(e,t){return""+o.jodit.editorWindow.getComputedStyle(e).getPropertyValue(t)},n=function(e,t,n){var r=0,s=0;Object.keys(t).forEach(function(e){var a=t[e];"function"==typeof a?a(o.jodit,i(n,e).toLowerCase())&&(r+=1):-1!==a.indexOf(i(n,e).toLowerCase())&&(r+=1),s+=1}),s===r&&e.btn.classList.add("jodit_active")};this.buttonList.forEach(function(i){i.btn.classList.remove("jodit_active");var r=void 0===i.control||void 0===i.control.mode?a.MODE_WYSIWYG:i.control.mode,s=r===a.MODE_SPLIT||r===o.jodit.getRealMode();if("function"==typeof i.control.isDisable&&(s=s&&!i.control.isDisable(o.jodit,i.control,i)),o.jodit.options.readonly&&-1===o.jodit.options.activeButtonsInReadOnly.indexOf(i.name)&&(s=!1),t.__toggleButton(i.btn,s),"function"==typeof i.control.getLabel&&i.control.getLabel(o.jodit,i.control,i),"function"==typeof i.control.isActive)i.btn.classList.toggle("jodit_active",i.control.isActive(o.jodit,i.control,i));else{if(!e)return;var d,c,u=void 0;(i.control.tags||i.control.options&&i.control.options.tags)&&(d=i.control.tags||i.control.options&&i.control.options.tags,u=e,l.Dom.up(u,function(e){if(e&&-1!==d.indexOf(e.nodeName.toLowerCase()))return i.btn.classList.add("jodit_active"),!0},o.jodit.editor)),(i.control.css||i.control.options&&i.control.options.css)&&(c=i.control.css||i.control.options&&i.control.options.css,u=e,l.Dom.up(u,function(e){e&&e.nodeType!==Node.TEXT_NODE&&n(i,c,e)},o.jodit.editor))}}),this.jodit.events.fire("updateToolbar")},t.prototype.setLabel=function(e,o,i,n,r,a){var l,d="string"==typeof e?e:e.name||"empty";this.jodit.options.textIcons?l=""+d+"":(l=t.getIcon(n,""),""===l&&"string"==typeof r.icon&&(l=t.getIcon(r.icon,"")),""===l&&(l=t.getIcon("string"==typeof r.name?r.name:"empty","")));var c=s.dom(l,this.jodit.ownerDocument);c&&c.nodeType!==Node.TEXT_NODE&&c.classList.add("jodit_icon","jodit_icon_"+i),o&&o.appendChild(c),void 0!==a&&""!==a&&o&&(o.innerHTML=a),r.iconURL&&o&&(o.style.backgroundImage="url("+r.iconURL+")")},t.prototype.addButton=function(e,o,i,n){var r=this,a=s.extend(!0,{},this.defaultControl,o),l=s.dom('
  • ',this.jodit.ownerDocument),d="string"==typeof e?e:e.name||"empty",c="string"==typeof e?e:e.icon||e.name||"empty",u=l.querySelector("a"),p=d.replace(/[^a-zA-Z0-9]/g,"_");this.setLabel(e,u.firstChild,p,c,a,i),l.classList.add("jodit_toolbar_btn-"+p);var f=function(e){r.jodit.options.readonly&&-1===r.jodit.options.activeButtonsInReadOnly.indexOf(d)&&(e=!1),void 0!==e&&t.__toggleButton(l,e)};f(),this.jodit.events.on(s.camelCase("can-"+p),f);var h=null;if(a.hotkeys){var m=Array.isArray(a.hotkeys)?a.hotkeys:a.hotkeys.split(/[\s,]/);h=function(e){return r.jodit.events.fire(l,"mousedown"),!1},this.jodit.events.on(m.join(" "),h)}if(void 0!==a&&"object"==typeof a||(a={command:d}),a.list&&u&&(l.classList.add("jodit_with_dropdownlist"),u.appendChild(s.dom('',this.jodit.ownerDocument))),l){var v=l.querySelector(".jodit_tooltip");v&&(a.tooltip?v.innerHTML=this.jodit.i18n(a.tooltip)+(a.hotkeys?"
    "+s.asArray(a.hotkeys).join(" "):""):l.removeChild(v))}return this.jodit.events.on(l,"mousedown touchend",function(e){if(e.stopImmediatePropagation(),e.preventDefault(),l.classList.contains("jodit_disabled"))return!1;a.list?r.openList(l,a,n):void 0!==a.exec&&"function"==typeof a.exec?(a.exec(r.jodit,n||r.jodit.selection.current(),a,e,l),r.checkActiveButtons(!1),r.jodit.setEditorValue(),r.jodit.events.fire("hidePopup")):void 0!==a.popup&&"function"==typeof a.popup?r.openPopup(l,a.popup(r.jodit,n||r.jodit.selection.current(),a,function(){r.closeAll(),r.jodit.selection.removeMarkers()})):(a.command||d)&&(r.jodit.execCommand(a.command||d,a.args&&a.args[0]||!1,a.args&&a.args[1]||null),r.closeAll())}),this.buttonList.push({control:a,btn:l,container:u.firstChild,name:d,canActionCallback:f,hotKeyCallback:h||void 0}),l},t.prototype.build=function(e,t,o){var i=this,r=!1;this.clear(),"string"==typeof e&&(e=e.split(/[\s,]+/)),e.forEach(function(e){var t="string"==typeof e?e:e.name||"";if(-1===i.jodit.options.removeButtons.indexOf(t))switch(t){case"\n":i.container.appendChild(s.dom('
  • ',i.jodit.ownerDocument));break;case"|":r||(r=!0,i.container.appendChild(s.dom('
  • ',i.jodit.ownerDocument)));break;default:var a=e;r=!1,"object"!=typeof a&&void 0!==i.jodit.options.controls[a]&&(a=i.jodit.options.controls[a]),"object"==typeof a&&a.name&&void 0!==i.jodit.options.controls[a.name]&&(a=n({},i.jodit.options.controls[a.name],a)),"object"!=typeof a&&(a={name:a,command:a,tooltip:a}),i.container.appendChild(i.addButton(e,a,"",o))}}),this.container.parentNode!==t&&t.appendChild(this.container),this.checkActiveButtons(!1)},t.prototype.clear=function(){var e=this;this.buttonList.forEach(function(t){t.btn.parentNode&&t.btn.parentNode.removeChild(t.btn),e.jodit.events.off(t.btn),delete t.btn;var o=t.name.replace(/[^a-zA-Z0-9]/g,"_");if(e.jodit.events.off(s.camelCase("can-"+o),t.canActionCallback),t.control.hotkeys&&t.hotKeyCallback){var i=Array.isArray(t.control.hotkeys)?t.control.hotkeys:t.control.hotkeys.split(/[\s,]/);e.jodit.events.off(i.join(" "),t.hotKeyCallback)}}),this.buttonList.length=0,this.container.innerHTML=""},t.icons={},t}(r.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(13),s=o(5),a=o(10),l=o(11),d=o(3),c=o(12),u=o(2),p=o(0),f=o(0);t.Jodit=function(e){function t(o,i){var n=e.call(this)||this;n.version="3.1.16",n.buffer={},n.components=[],n.__modulesInstances={},n.__plugins={},n.__defaultStyleDisplayKey="data-jodit-default-style-display",n.commands={},n.__whoLocked="",n.isLocked=function(){return""!==n.__whoLocked},n.isLockedNotBy=function(e){return n.isLocked()&&n.__whoLocked!==e},n.mode=u.MODE_WYSIWYG,n.getVersion=function(){return n.version},n.events=new c.EventsNative;var a=function(){};if(a.prototype=t.defaultOptions,n.options=new a,void 0!==i&&"object"==typeof i&&Object.keys(i).forEach(function(e){n.options[e]="object"!=typeof t.defaultOptions[e]||Array.isArray(t.defaultOptions[e])?i[e]:p.extend(!0,{},t.defaultOptions[e],i[e])}),n.editorDocument=n.options.ownerDocument,n.editorWindow=n.options.ownerWindow,n.ownerDocument=n.options.ownerDocument,n.ownerWindow=n.options.ownerWindow,!(void 0!==(n.element="string"==typeof o?n.ownerDocument.querySelector(o):o)&&"object"==typeof n.element&&"nodeType"in n.element&&n.element.nodeType===Node.ELEMENT_NODE&&n.element.cloneNode))throw Error('Element "'+o+'" should be string or HTMLElement instance');n.selection=new r.Select(n),n.uploader=new l.Uploader(n),n.container=p.dom('
    ',n.ownerDocument),n.container.classList.add("jodit_"+(n.options.theme||"default")+"_theme"),n.options.zIndex&&(n.container.style.zIndex=""+parseInt(""+n.options.zIndex,10)),n.workplace=p.dom('
    ',n.ownerDocument),n.progress_bar=p.dom('
    ',n.ownerDocument),n.toolbar=new s.Toolbar(n),n.toolbar.build(n.options.buttons.concat(n.options.extraButtons),n.container),n.container.classList.add("jodit_toolbar_size-"+(-1!==["middle","large","small"].indexOf(n.options.toolbarButtonSize.toLowerCase())?n.options.toolbarButtonSize.toLowerCase():"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.workplace.appendChild(n.progress_bar),n.element.parentNode&&n.element.parentNode.insertBefore(n.container,n.element),n.helper=f,n.options.events&&p.each(n.options.events,function(e,t){n.events.on(e,t)}),n.id=n.element.getAttribute("id")||""+(new Date).getTime(),n.initPlugines(),n.__createEditor(),n.setElementValue(),t.instances[n.id]=n;try{n.editorDocument.execCommand("enableObjectResizing",!1,!1),n.editorDocument.execCommand("enableInlineTableEditing",!1,!1)}catch(e){}return n.setMode(n.options.defaultMode),n.options.readonly&&n.setReadOnly(!0),n.events.fire("afterInit"),n}return i(t,e),t.prototype.getInstance=function(e,o){if(void 0===t.modules[e])throw Error("Need real module name");return void 0===this.__modulesInstances[e]&&(this.__modulesInstances[e]=new t.modules[e](this,o)),this.__modulesInstances[e]},t.prototype.initPlugines=function(){var e=this,o=Array.isArray(this.options.disablePlugins)?this.options.disablePlugins.map(function(e){return e.toLowerCase()}):this.options.disablePlugins.toLowerCase().split(/[\s,]+/);Object.keys(t.plugins).forEach(function(i){-1===o.indexOf(i.toLowerCase())&&(e.__plugins[i]=new t.plugins[i](e))})},t.prototype.__createEditor=function(){var e=this;!1!==this.events.fire("createEditor")&&(this.editor=p.dom('
    ',this.ownerDocument),this.workplace.appendChild(this.ownerDocument.createTextNode("\n")),this.workplace.appendChild(this.editor),this.workplace.appendChild(this.ownerDocument.createTextNode("\n"))),this.options.editorCssClass&&this.editor.classList.add(this.options.editorCssClass),this.events.on(this.editor,"keydown keyup keypress mousedown mouseup mousepress paste resize touchstart touchend focus blur",function(t){if(!e.options.readonly&&e.events&&e.events.fire){if(!1===e.events.fire(t.type,t))return!1;e.setEditorValue()}}),this.options.spellcheck&&this.editor.setAttribute("spellcheck","true"),this.options.direction&&(this.editor.style.direction="rtl"===this.options.direction.toLowerCase()?"rtl":"ltr"),this.element.style.display&&this.element.setAttribute(this.__defaultStyleDisplayKey,this.element.style.display),this.element.style.display="none",this.options.triggerChangeEvent&&this.events.on("change",p.debounce(function(){e.events.fire(e.element,"change")},this.options.observer.timeout))},t.prototype.destruct=function(){var e=this;!1!==this.events.fire("beforeDestruct")&&this.editor&&(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("style")&&!this.element.getAttribute("style")&&this.element.removeAttribute("style"),Object.keys(this.__plugins).forEach(function(t){void 0!==e.__plugins&&void 0!==e.__plugins[t]&&void 0!==e.__plugins[t].destruct&&"function"==typeof e.__plugins[t].destruct&&e.__plugins[t].destruct(),delete e.__plugins[t]}),this.components.forEach(function(e){void 0!==e.destruct&&"function"==typeof e.destruct&&e.destruct()}),delete this.selection,this.events.off(this.events),this.events.off(this.ownerWindow),this.events.off(this.element),this.events.off(this.editor),delete this.events,this.container.parentNode&&this.container.parentNode.removeChild(this.container),delete this.container,delete this.editor,delete this.workplace,delete t.instances[this.id])},t.prototype.getElementValue=function(){return void 0!==this.element.value?this.element.value:this.element.innerHTML},t.prototype.getEditorValue=function(){var e;if(void 0!==(e=this.events.fire("beforeGetValueFromEditor")))return e;"
    "===(e=this.editor?this.editor.innerHTML.replace(u.INVISIBLE_SPACE_REG_EXP,""):this.getElementValue())&&(e="");var t={value:e};return this.events.fire("afterGetValueFromEditor",t),t.value},t.prototype.setElementValue=function(e){if("string"!=typeof e&&void 0!==e)throw Error("value must be string");void 0!==e?void 0!==this.element.value?this.element.value=e:this.element.innerHTML=e:e=this.getElementValue(),e!==this.getEditorValue()&&this.setEditorValue(e)},t.prototype.setEditorValue=function(e){if(this.editor){if("string"!=typeof e&&void 0!==e)throw Error("value must be string");void 0!==e&&this.editor.innerHTML!==e&&(this.editor.innerHTML=e);var t=this.getElementValue(),o=this.getEditorValue();t!==o&&(this.setElementValue(o),this.events.fire("change",t,o))}},t.prototype.execCustomCommands=function(e,t,o){var i=this;if(void 0===t&&(t=!1),void 0===o&&(o=null),e=e.toLowerCase(),void 0!==this.commands[e]){var n;return this.commands[e].forEach(function(r){var s;s="function"==typeof r?r:r.exec;var a=s.call(i,e,t,o);void 0!==a&&(n=a)}),n}},t.prototype.registerCommand=function(e,t){var o=this;if(e=e.toLowerCase(),void 0===this.commands[e]&&(this.commands[e]=[]),this.commands[e].push(t),"function"!=typeof t){var i=this.options.commandToHotkeys[e]||t.hotkeys;i&&this.events.on(p.asArray(i).map(function(e){return e+".hotkey"}).join(" "),function(){return o.execCommand(e)})}},t.prototype.execCommand=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=null),!this.options.readonly){var i;if(e=e.toLowerCase(),i=this.events.fire("beforeCommand",e,t,o),!1!==i&&(i=this.execCustomCommands(e,t,o)),!1!==i)switch(this.selection.focus(),e){case"selectall":this.selection.select(this.editor,!0);break;default:try{i=this.editorDocument.execCommand(e,t,o)}catch(e){}}return this.events.fire("afterCommand",e,t,o),this.setEditorValue(),i}},t.prototype.lock=function(e){this.__whoLocked=e,this.editor.classList.add("jodit_disabled")},t.prototype.unlock=function(){this.__whoLocked="",this.editor.classList.remove("jodit_disabled")},t.prototype.getMode=function(){return this.mode},t.prototype.getRealMode=function(){return this.getMode()!==u.MODE_SPLIT?this.getMode():d.Dom.isOrContains(this.editor,this.ownerDocument.activeElement)||d.Dom.isOrContains(this.toolbar.container,this.ownerDocument.activeElement)?u.MODE_WYSIWYG:u.MODE_SOURCE},t.prototype.setMode=function(e){var t=this,o={mode:e},i=["jodit_wysiwyg_mode","jodit_source_mode","jodit_split_mode"];!1!==this.events.fire("beforeSetMode",o)&&(this.mode=p.inArray(o.mode,[u.MODE_SOURCE,u.MODE_WYSIWYG,u.MODE_SPLIT])?o.mode:u.MODE_WYSIWYG,this.options.saveModeInCookie&&a.Cookie.set("jodit_default_mode",this.mode,31),i.forEach(function(e){t.container.classList.remove(e)}),this.container.classList.add(i[this.mode-1]),this.events.fire("afterSetMode"))},t.prototype.toggleMode=function(){var e=this.getMode();p.inArray(e+1,[u.MODE_SOURCE,u.MODE_WYSIWYG,this.options.useSplitMode?u.MODE_SPLIT:9])?e+=1:e=u.MODE_WYSIWYG,this.setMode(e)},t.prototype.i18n=function(e){for(var o=this,i=[],n=1;arguments.length>n;n++)i[n-1]=arguments[n];if(void 0!==this.options&&this.options.debugLanguage)return"{"+e+"}";var r;return r=void 0!==this.options&&void 0!==t.lang[p.defaultLanguage(this.options.language)]?t.lang[p.defaultLanguage(this.options.language)]:void 0!==t.lang[p.defaultLanguage(t.defaultOptions.language)]?t.lang[p.defaultLanguage(t.defaultOptions.language)]:t.lang.en,function(e){return p.sprintf.apply(o,[e].concat(i))}(void 0!==this.options&&void 0!==this.options.i18n[p.defaultLanguage(this.options.language)]&&this.options.i18n[p.defaultLanguage(this.options.language)][e]?this.options.i18n[p.defaultLanguage(this.options.language)][e]:"string"==typeof r[e]&&r[e]?r[e]:"string"==typeof t.lang.en[e]&&t.lang.en[e]?t.lang.en[e]:e)},t.prototype.setReadOnly=function(e){this.options.readonly=e,e?this.editor&&this.editor.removeAttribute("contenteditable"):this.editor&&this.editor.setAttribute("contenteditable","true"),this.events&&this.events.fire("readonly",e)},t.prototype.getReadOnly=function(){return this.options.readonly},t.plugins={},t.modules={},t.instances={},t.lang={},t}(n.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(6),s=o(4),a=o(1),l=o(0),d=o(5),c=o(2),u=o(12);a.Config.prototype.dialog={zIndex:100002,resizable:!0,draggable:!0,fullsize:!1,fullsizeButton:!1};var p=function(e){function t(t,o){void 0===o&&(o={});var i=e.call(this,t)||this;i.events=new u.EventsNative,i.lockSelect=function(){i.dialogbox.classList.add("jodit_dialog_box-moved")},i.unlockSelect=function(){i.dialogbox.classList.remove("jodit_dialog_box-moved")},i.destinition=document.body,i.document=document,i.window=window,i.destroyAfterClose=!1,i.moved=!1,i.iSetMaximization=!1,i.resizeble=!1,i.draggable=!1,i.startX=0,i.startY=0,i.startPoint={x:0,y:0,w:0,h:0},i.__isDestructed=!1,i.close=function(e){i.__isDestructed||(e&&(e.stopImmediatePropagation(),e.preventDefault()),i.jodit&&i.jodit.events&&i.jodit.events.fire(i,"beforeClose"),i.dialogbox.classList&&i.dialogbox.classList.remove("active"),i.iSetMaximization&&i.maximization(!1),i.destroyAfterClose&&i.destruct(),i.jodit&&i.jodit.events.fire(i,"afterClose"))},t&&t instanceof r.Jodit&&(i.window=t.ownerWindow,i.document=t.ownerDocument,t.events.on("beforeDestruct",function(){i.destruct()}));var s=i;s.options=t&&t.options?t.options.dialog:a.Config.prototype.dialog,s.options=n({},s.options,o),s.dialogbox=l.dom('",i.document),t&&t instanceof r.Jodit&&s.dialogbox.setAttribute("data-editor_id",t.id),Object.defineProperty(s.dialogbox,"__jodit_dialog",{value:s}),s.dialog=s.dialogbox.querySelector(".jodit_dialog"),s.resizer=s.dialogbox.querySelector(".jodit_dialog_resizer"),s.jodit&&s.jodit.options&&s.jodit.options.textIcons&&s.dialogbox.classList.add("jodit_text_icons"),s.dialogbox_header=s.dialogbox.querySelector(".jodit_dialog_header>h4"),s.dialogbox_content=s.dialogbox.querySelector(".jodit_dialog_content"),s.dialogbox_footer=s.dialogbox.querySelector(".jodit_dialog_footer"),s.dialogbox_close=s.dialogbox.querySelector(".jodit_dialog_header>a.jodit_close"),s.dialogbox_fullsize=l.dom(''+(r.Jodit.modules.Toolbar.getIcon?r.Jodit.modules.Toolbar.getIcon(o.fullsize?"fullsize":"shrink"):"")+"",i.document),s.destinition.appendChild(s.dialogbox),s.dialogbox.addEventListener("close_dialog",s.close),s.dialogbox_close.addEventListener("mousedown",s.close),s.dialogbox_fullsize.addEventListener("click",function(){var e=s.maximization();r.Jodit.modules.Toolbar&&(s.dialogbox_fullsize.innerHTML=r.Jodit.modules.Toolbar.getIcon(e?"shrink":"fullsize"))}),s.events.on(i.window,"mousemove",s.onMouseMove.bind(s)).on(i.window,"mouseup",s.onMouseUp.bind(s)).on(i.window,"keydown",s.onKeyDown.bind(s)).on(i.window,"resize",s.onResize.bind(s));var d=s.dialogbox.querySelector(".jodit_dialog_header");return d&&d.addEventListener("mousedown",s.onHeaderMouseDown.bind(s)),s.options.resizable&&s.resizer.addEventListener("mousedown",s.onResizerMouseDown.bind(s)),i}return i(t,e),t.prototype.setSize=function(e,t){e&&l.css(this.dialog,"width",e),t&&l.css(this.dialog,"height",t)},t.prototype.setPosition=function(e,t){var o=this.window.innerWidth,i=this.window.innerHeight,n=o/2-this.dialog.offsetWidth/2,r=i/2-this.dialog.offsetHeight/2;void 0!==e&&void 0!==t&&(this.offsetX=e,this.offsetY=t,this.moved=Math.abs(e-n)>100||Math.abs(t-r)>100),this.dialog.style.left=(e||n)+"px",this.dialog.style.top=(t||r)+"px"},t.prototype.setElements=function(e,t){var o=this,i=[];l.asArray(t).forEach(function(t){var n=l.dom(t,o.document);i.push(n),n.parentNode!==e&&e.appendChild(n)}),[].slice.call(e.childNodes).forEach(function(t){-1===i.indexOf(t)&&e.removeChild(t)})},t.prototype.setTitle=function(e){this.setElements(this.dialogbox_header,e)},t.prototype.setContent=function(e){this.setElements(this.dialogbox_content,e)},t.prototype.setFooter=function(e){this.setElements(this.dialogbox_footer,e),this.dialog.classList.toggle("with_footer",!!e)},t.prototype.getMaxZIndexDialog=function(){var e,t,o=0,i=this;return l.$$(".jodit_dialog_box",this.destinition).forEach(function(n){e=n.__jodit_dialog,t=parseInt(l.css(n,"zIndex"),10),e.isOpened()&&!isNaN(t)&&t>o&&(i=e,o=t)}),i},t.prototype.setMaxZIndex=function(){var e=0,t=0;l.$$(".jodit_dialog_box",this.destinition).forEach(function(o){t=parseInt(l.css(o,"zIndex"),10),e=Math.max(isNaN(t)?0:t,e)}),this.dialogbox.style.zIndex=""+(e+1)},t.prototype.maximization=function(e){return"boolean"!=typeof e&&(e=!this.dialogbox.classList.contains("jodit_dialog_box-fullsize")),this.dialogbox.classList.toggle("jodit_dialog_box-fullsize",e),[this.destinition,this.destinition.parentNode].forEach(function(t){t&&t.classList&&t.classList.toggle("jodit_fullsize_box",e)}),this.iSetMaximization=e,e},t.prototype.open=function(e,t,o,i){this.jodit&&this.jodit.events&&!1===this.jodit.events.fire(this,"beforeOpen")||(this.destroyAfterClose=!0===o,this.options.fullsizeButton&&this.dialogbox_close.parentNode&&this.dialogbox_close.parentNode.appendChild(this.dialogbox_fullsize),void 0!==t&&this.setTitle(t),e&&this.setContent(e),this.dialogbox.classList.add("active"),i&&this.dialogbox.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(this,"afterOpen"))},t.prototype.isOpened=function(){return!this.__isDestructed&&this.dialogbox.classList.contains("active")},t.prototype.onMouseUp=function(){(this.draggable||this.resizeble)&&(this.draggable=!1,this.resizeble=!1,this.unlockSelect(),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"endResize endMove"))},t.prototype.onHeaderMouseDown=function(e){this.options.draggable&&(this.draggable=!0,this.startX=e.clientX,this.startY=e.clientY,this.startPoint.x=l.css(this.dialog,"left"),this.startPoint.y=l.css(this.dialog,"top"),this.setMaxZIndex(),e.preventDefault(),this.lockSelect(),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"startMove"))},t.prototype.onMouseMove=function(e){this.draggable&&this.options.draggable&&(this.setPosition(this.startPoint.x+e.clientX-this.startX,this.startPoint.y+e.clientY-this.startY),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"move",e.clientX-this.startX,e.clientY-this.startY),e.stopImmediatePropagation(),e.preventDefault()),this.resizeble&&this.options.resizable&&(this.setSize(this.startPoint.w+e.clientX-this.startX,this.startPoint.h+e.clientY-this.startY),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"resizeDialog",e.clientX-this.startX,e.clientY-this.startY),e.stopImmediatePropagation(),e.preventDefault())},t.prototype.onKeyDown=function(e){if(this.isOpened()&&e.which===c.KEY_ESC){var t=this.getMaxZIndexDialog();t?t.close():this.close(),e.stopImmediatePropagation()}},t.prototype.onResize=function(){!this.options.resizable||this.moved||!this.isOpened()||this.offsetX||this.offsetY||this.setPosition()},t.prototype.destruct=function(){this.dialogbox&&this.dialogbox.parentNode&&this.dialogbox.parentNode.removeChild(this.dialogbox),delete this.dialogbox,this.events.destruct(),this.__isDestructed=!0},t.prototype.onResizerMouseDown=function(e){this.resizeble=!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")},t}(s.Component);t.Dialog=p,t.Alert=function(e,t,o,i){void 0===i&&(i="jodit_alert"),"function"==typeof t&&(o=t,t=void 0);var n=new p,s=l.dom('
    ',n.document),a=l.dom(''+d.Toolbar.getIcon("cancel")+""+r.Jodit.prototype.i18n("Ok")+"",n.document);return s.appendChild(l.dom(e,n.document)),a.addEventListener("click",function(){o&&"function"==typeof o&&!1===o(n)||n.close()}),n.setFooter([a]),n.open(s,t||" ",!0,!0),a.focus(),n},r.Jodit.Alert=t.Alert,t.Promt=function(e,t,o,i){var n=new p,s=l.dom(''+d.Toolbar.getIcon("cancel")+""+r.Jodit.prototype.i18n("Cancel")+"",n.document),a=l.dom(''+d.Toolbar.getIcon("check")+""+r.Jodit.prototype.i18n("Ok")+"",n.document),c=l.dom('
    ',n.document),u=l.dom("",n.document),f=l.dom("",n.document);"function"==typeof t&&(o=t,t=void 0),i&&u.setAttribute("placeholder",i),f.appendChild(l.dom(e,n.document)),c.appendChild(f),c.appendChild(u),s.addEventListener("click",n.close,!1);var h=function(){o&&"function"==typeof o&&!1===o(u.value)||n.close()};return a.addEventListener("click",h),c.addEventListener("submit",function(){return h(),!1}),n.setFooter([a,s]),n.open(c,t||" ",!0,!0),u.focus(),n},r.Jodit.Promt=t.Promt,t.Confirm=function(e,t,o){var i=new p,n=l.dom('
    ',i.document),s=l.dom("",i.document);"function"==typeof t&&(o=t,t=void 0),s.appendChild(l.dom(e,i.document)),n.appendChild(s);var a=l.dom(''+d.Toolbar.getIcon("cancel")+""+r.Jodit.prototype.i18n("Cancel")+"",i.document);a.addEventListener("click",function(){o&&o(!1),i.close()});var c=function(){o&&o(!0),i.close()},u=l.dom(''+d.Toolbar.getIcon("check")+""+r.Jodit.prototype.i18n("Yes")+"",i.document);return u.addEventListener("click",c),n.addEventListener("submit",function(){return c(),!1}),i.setFooter([u,a]),i.open(n,t||" ",!0,!0),u.focus(),i},r.Jodit.Confirm=t.Confirm},function(e,t,o){"use strict";t.__esModule=!0,t.Component=o(4).Component,t.ContextMenu=o(16).ContextMenu,t.Cookie=o(10).Cookie;var i=o(7);t.Dialog=i.Dialog,t.Alert=i.Alert,t.Confirm=i.Confirm,t.Promt=i.Promt,t.Dom=o(3).Dom,t.EventsNative=o(12).EventsNative,t.FileBrowser=o(50).FileBrowser,t.Helpers=o(0),t.ImageEditor=o(51).ImageEditor,t.Observer=o(17).Observer,t.Select=o(13).Select,t.Snapshot=o(18).Snapshot,t.Table=o(15).Table,t.Toolbar=o(5).Toolbar,t.Stack=o(19).Stack,t.Uploader=o(11).Uploader},function(e,t,o){"use strict";t.__esModule=!0;var i=o(6),n=o(0),r=o(3);!function(e){e.ColorPickerWidget=function(e,t,o){var s=n.normalizeColor(o),a=n.dom('
    ',e.ownerDocument),l=function(e){var t=[];return n.isPlainObject(e)?Object.keys(e).forEach(function(o){t.push('
    '),t.push(l(e[o])),t.push("
    ")}):Array.isArray(e)&&e.forEach(function(e){t.push("'+(s===e?i.Jodit.modules.Toolbar.getIcon("eye"):"")+"")}),t.join("")};return a.appendChild(n.dom("
    "+l(e.options.colors)+"
    ",e.ownerDocument)),a.appendChild(n.dom(''+i.Jodit.modules.Toolbar.getIcon("eraser")+"",e.ownerDocument)),e.events.on(a,"mousedown touchstart",function(o){o.stopPropagation();var s=o.target;if("SVG"!==s.tagName.toUpperCase()&&"PATH"!==s.tagName.toUpperCase()||!s.parentNode||(s=r.Dom.closest(s.parentNode,"A",e.editor)),"A"===s.tagName.toUpperCase()){var l=a.querySelector("a.active");l&&(l.classList.remove("active"),l.innerHTML="");var d=s.getAttribute("data-color")||"";if(d){s.innerHTML=i.Jodit.modules.Toolbar.getIcon("eye"),s.classList.add("active");var c=n.hexToRgb(d);c&&(s.firstChild.style.fill="rgb("+(255-c.r)+","+(255-c.g)+","+(255-c.b)+")")}t&&"function"==typeof t&&t(d),o.preventDefault()}}),a},e.TabsWidget=function(e,t,o){var i=n.dom('
    ',e.ownerDocument),r=n.dom('
    ',e.ownerDocument),s=n.dom('
    ',e.ownerDocument),a={},l="",d=0;return i.appendChild(s),i.appendChild(r),n.each(t,function(t,i){var c=n.dom('
    ',e.ownerDocument),u=n.dom('',e.ownerDocument);l||(l=t),u.innerHTML=e.i18n(t),s.appendChild(u),c.appendChild("function"!=typeof i?n.dom(i,e.ownerDocument):n.dom('
    ',e.ownerDocument)),r.appendChild(c),e.events.on(u,"mousedown touchstart",function(a){return n.$$("a",s).forEach(function(e){e.classList.remove("active")}),n.$$(".jodit_tab",r).forEach(function(e){e.classList.remove("active")}),u.classList.add("active"),c.classList.add("active"),"function"==typeof i&&i.call(e),a.stopPropagation(),o&&(o.__activeTab=t),!1}),a[t]={button:u,tab:c},d+=1}),d?(n.$$("a",s).forEach(function(e){e.style.width=(100/d).toFixed(10)+"%"}),o&&o.__activeTab&&a[o.__activeTab]?(a[o.__activeTab].button.classList.add("active"),a[o.__activeTab].tab.classList.add("active")):(a[l].button.classList.add("active"),a[l].tab.classList.add("active")),i):i},e.ImageSelectorWidget=function(t,o,r,s){var a,l={};if(o.upload&&t.options.uploader&&t.options.uploader.url){var d=n.dom('
    '+t.i18n("Drop image")+"
    "+t.i18n("or click")+'
    ',t.ownerDocument);t.getInstance("Uploader").bind(d,function(e){"function"==typeof o.upload&&o.upload.call(t,{baseurl:e.baseurl,files:e.files})},function(e){t.events.fire("errorMessage",e.message)}),l[i.Jodit.modules.Toolbar.getIcon("upload")+t.i18n("Upload")]=d}if(o.filebrowser&&(t.options.filebrowser.ajax.url||t.options.filebrowser.items.url)&&(l[i.Jodit.modules.Toolbar.getIcon("folder")+t.i18n("Browse")]=function(){s&&s(),o.filebrowser&&t.getInstance("FileBrowser").open(o.filebrowser)}),o.url){var c=n.dom('
    ",t.ownerDocument),u=c.querySelector("button"),p=c.querySelector("input[name=url]");a=null,r&&r.nodeType!==Node.TEXT_NODE&&("IMG"===r.tagName||n.$$("img",r).length)&&(a="IMG"===r.tagName?r:n.$$("img",r)[0],n.val(c,"input[name=url]",a.getAttribute("src")),n.val(c,"input[name=text]",a.getAttribute("alt")),u.innerText=t.i18n("Update")),c.addEventListener("submit",function(e){return e.preventDefault(),e.stopPropagation(),n.val(c,"input[name=url]")?("function"==typeof o.url&&o.url.call(t,n.val(c,"input[name=url]"),n.val(c,"input[name=text]")),!1):(p.focus(),p.classList.add("jodit_error"),!1)},!1),l[i.Jodit.modules.Toolbar.getIcon("link")+" URL"]=c}return e.TabsWidget(t,l)}}(t.Widget||(t.Widget={}))},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4);t.Cookie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.set=function(e,t,o){var i,n;o?(n=new Date,n.setTime(n.getTime()+24*o*60*60*1e3),i="; expires="+n.toUTCString()):i="",document.cookie=e+"="+t+i+"; path=/"},t.get=function(e){var t,o,i=e+"=",n=document.cookie.split(";");for(t=0;n.length>t;t+=1){for(o=n[t];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(i))return o.substring(i.length,o.length)}return null},t.remove=function(e){t.set(e,"",-1)},t}(n.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(14),s=o(1),a=o(0),l=o(2),d=o(3);s.Config.prototype.enableDragAndDropFileToEditor=!0,s.Config.prototype.uploader={url:"",headers:null,data:null,format:"json",prepareData:function(e){return e},isSuccess:function(e){return e.success},getMessage:function(e){return void 0!==e.data.messages&&Array.isArray(e.data.messages)?e.data.messages.join(" "):""},process:function(e){return e.data},error:function(e){this.jodit.events.fire("errorMessage",e.message,"error",4e3)},defaultHandlerSuccess:function(e){var t=this;e.files&&e.files.length&&e.files.forEach(function(o){t.jodit.selection.insertImage(e.baseurl+o)})},defaultHandlerError:function(e){this.jodit.events.fire("errorMessage",e.message)}},t.Uploader=function(e){function t(t,o){var i=e.call(this,t)||this;return i.path="",i.source="default",i.options=a.extend(!0,{},s.Config.prototype.uploader,t.options.uploader,o),t.options.enableDragAndDropFileToEditor&&t.options.uploader&&t.options.uploader.url&&t.events.on("afterInit",function(){i.bind(t.editor)}),i}return i(t,e),t.prototype.buildData=function(e){if(void 0!==this.jodit.ownerWindow.FormData){if(e instanceof FormData)return e;if("string"==typeof e)return e;var t=new FormData;return Object.keys(e).forEach(function(o){t.append(o,e[o])}),t}return e},t.prototype.send=function(e,t){var o=this;this.__ajax=new r.Ajax(this.jodit,{xhr:function(){var e=new XMLHttpRequest;return void 0!==o.jodit.ownerWindow.FormData?e.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=e.loaded/e.total;t*=100,o.jodit.progress_bar.style.display="block",o.jodit.progress_bar.style.width=t+"%",100===t&&(o.jodit.progress_bar.style.display="none")}},!1):o.jodit.progress_bar.style.display="none",e},method:"POST",data:this.buildData(e),url:this.options.url,headers:this.options.headers,contentType:(void 0===this.jodit.ownerWindow.FormData||"string"==typeof e)&&"application/x-www-form-urlencoded; charset=UTF-8",dataType:this.options.format||"json"}),this.__ajax.send().then(t).catch(function(e){o.options.error.call(o,e)})},t.prototype.sendFiles=function(e,t,o,i){var n=this;if(e){var r,s,l,d,c=e.length,u=this;if(!c)return!1;s=new FormData,s.append("path",u.path),s.append("source",u.source);var p;for(r=0;c>r;r+=1)if((p=e[r])&&p.type){var f=p.type.match(/\/([a-z0-9]+)/i);l=f[1]?f[1].toLowerCase():"",s.append("files["+r+"]",e[r],e[r].name||(""+Math.random()).replace(".","")+"."+l)}if(u.options.prepareData(s),i&&i(s),u.options.data&&a.isPlainObject(u.options.data))for(d=Object.keys(u.options.data),r=0;d.length>r;r+=1)s.append(d[r],u.options.data[d[r]]);u.send(s,function(e){if(!n.options.isSuccess.call(u,e))return void(o||u.options.defaultHandlerError).call(u,Error(u.options.getMessage(e)));"function"==typeof(t||u.options.defaultHandlerSuccess)&&(t||u.options.defaultHandlerSuccess).call(u,u.options.process.call(u,e))})}},t.prototype.setPath=function(e){this.path=e},t.prototype.setSource=function(e){this.source=e},t.dataURItoBlob=function(e){var t,o=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(o.length),r=new Uint8Array(n);for(t=0;o.length>t;t+=1)r[t]=o.charCodeAt(t);return new Blob([r],{type:i})},t.prototype.bind=function(e,o,i){var n=this,r=this,s=function(e){var s,c,u,p,f=function(e){c&&(e.append("extension",u),e.append("mimetype",c.type))};if(e.clipboardData&&e.clipboardData.files&&e.clipboardData.files.length)return n.sendFiles(e.clipboardData.files,o,i),!1;if(a.browser("ff"))return void(e.clipboardData.types.length||e.clipboardData.types[0]===l.TEXT_PLAIN||(p=d.Dom.create("div","",n.jodit.editorDocument),n.jodit.selection.insertNode(p),p.focus(),setTimeout(function(){var e=p.firstChild;if(e&&e.hasAttribute("src")){var n=e.getAttribute("src")||"";p.parentNode&&p.parentNode.removeChild(p),r.sendFiles([t.dataURItoBlob(n)],o,i)}},200)));if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length)for(s=0;e.clipboardData.items.length>s;s+=1)if("file"===e.clipboardData.items[s].kind&&"image/png"===e.clipboardData.items[s].type){if(c=e.clipboardData.items[s].getAsFile()){var h=c.type.match(/\/([a-z0-9]+)/i);u=h[1]?h[1].toLowerCase():"",n.sendFiles([c],o,i,f)}e.preventDefault();break}};this.jodit.editor!==e?r.jodit.events.on(e,"paste",s):r.jodit.events.on("processPaste",s),r.jodit.events.on(e,"dragover",function(t){e.classList.add("draghover"),t.preventDefault()}).on(e,"dragleave dragend",function(t){e.classList.remove("draghover"),t.preventDefault()}).on(e,"drop",function(t){if(e.classList.remove("draghover"),t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length)t.preventDefault(),n.sendFiles(t.dataTransfer.files,o,i);else if(t.dataTransfer&&t.dataTransfer.getData(l.TEXT_PLAIN)&&"-"!==t.dataTransfer.getData(l.TEXT_PLAIN)&&e===r.jodit.editor){if(t.preventDefault(),t.stopPropagation(),!n.jodit.selection.insertCursorAtPoint(t.clientX,t.clientY))return!1;if(o||n.options.defaultHandlerSuccess){var s={baseurl:"",files:[]};s.files=[t.dataTransfer.getData(l.TEXT_PLAIN)],(o||n.options.defaultHandlerSuccess).call(n,s)}t.preventDefault()}});var c=e.querySelector("input[type=file]");c&&r.jodit.events.on(c,"change",function(){r.sendFiles(this.files,o,i)})},t.prototype.uploadRemoteImage=function(e,t,o){var i=this,n=this;n.send({action:"fileUploadRemote",url:e},function(e){if(n.options.isSuccess.call(n,e))"function"==typeof t?t.call(n,i.options.process(e)):i.options.defaultHandlerSuccess.call(n,i.options.process(e));else if("function"==typeof(o||n.options.defaultHandlerError))return void(o||i.options.defaultHandlerError).call(n,Error(n.options.getMessage(e)))})},t}(n.Component)},function(e,t,o){"use strict";t.__esModule=!0;var i=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 i=this.get(e,t);if(i)for(var n=0;i.length>n;n+=1)if(i[n].originalCallback===o)return n;return!1},e.prototype.namespaces=function(){return Object.keys(this.__store)},e.prototype.events=function(e){return this.__store[e]?Object.keys(this.__store[e]):[]},e.prototype.set=function(e,t,o,i){void 0===i&&(i=!1),void 0===this.__store[t]&&(this.__store[t]={}),void 0===this.__store[t][e]&&(this.__store[t][e]=[]),i?this.__store[t][e].unshift(o):this.__store[t][e].push(o)},e}();t.EventsNative=function(){function e(e){var t=this;this.__defaultNameSpace="JoditEventDefaultNamespace",this.__key="__JoditEventsNativeNamespaces",this.current="",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],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},enumerable:!0}))},this.__stopped=[],e&&(this.doc=e)}return e.prototype.eachEvent=function(e,t){var o=this;e.split(/[\s,]+/).forEach(function(e){var i=e.split(".");t.call(o,i[0],i[1]||o.__defaultNameSpace)})},e.prototype.getStore=function(e){if(void 0===e[this.__key]){var t=new i;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.on=function(e,t,o,i,n){var r=this;void 0===n&&(n=!1);var s="string"==typeof e?this:e,a="string"==typeof t?t:e,l=o;void 0===l&&"function"==typeof t&&(l=t);var d=this.getStore(s);if("string"!=typeof a||""===a)throw Error("Need events names");if("function"!=typeof l)throw Error("Need event handler");if(Array.isArray(s))return s.forEach(function(e){r.on(e,a,l,i)}),this;var c="function"==typeof s.addEventListener,u=this,p=function(){return l&&l.apply(this,arguments)};return c&&(p=function(e){if(u.prepareEvent(e),l&&!1===l.call(this,e))return e.preventDefault(),e.stopImmediatePropagation(),!1},i&&(p=function(e){u.prepareEvent(e);for(var t=e.target;t&&t!==this;){if(t.matches(i)){if(l&&!1===l.call(t,e))return e.preventDefault(),!1;return}t=t.parentNode}})),this.eachEvent(a,function(e,t){if(""===e)throw Error("Need event name");if(!1===d.indexOf(e,t,l)){var o={event:e,originalCallback:l,syntheticCallback:p};d.set(e,t,o,n),t!==r.__defaultNameSpace&&d.set(e,r.__defaultNameSpace,o,n),c&&s.addEventListener(e,p,!1)}}),this},e.prototype.off=function(e,t,o){var i=this,n="string"==typeof e?this:e,r="string"==typeof t?t:e,s=this.getStore(n),a=o;if("string"!=typeof r||!r)return s.namespaces().forEach(function(e){i.off(n,"."+e)}),this.clearStore(n),this;void 0===a&&"function"==typeof t&&(a=t);var l="function"==typeof n.removeEventListener,d=function(e){l&&n.removeEventListener(e.event,e.syntheticCallback,!1)},c=function(e,t){if(""!==e){var o=s.get(e,t);if(o&&o.length){var n=!1;if("function"!=typeof a)o.forEach(d),o.length=0,n=!0;else{var r=s.indexOf(e,t,a);!1!==r&&(d(o[r]),o.splice(r,1),n=!0)}n&&t!==i.__defaultNameSpace&&c(e,i.__defaultNameSpace)}}else s.events(t).forEach(function(e){""!==e&&c(e,t)})};return this.eachEvent(r,function(e,t){t===i.__defaultNameSpace?s.namespaces().forEach(function(t){c(e,t)}):c(e,t)}),this},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)},e.prototype.stopPropagation=function(e,t){var o=this,i="string"==typeof e?this:e,n="string"==typeof e?e:t;if("string"!=typeof n)throw Error("Need event names");var r=this.getStore(i);this.eachEvent(n,function(e,t){var i=r.get(e,t);i&&o.__stopped.push(i)})},e.prototype.removeStop=function(e){if(e){var t=this.__stopped.indexOf(e);-1!==t&&this.__stopped.splice(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=this,i=[],n=2;arguments.length>n;n++)i[n-2]=arguments[n];var r,s=void 0,a="string"==typeof e?this:e,l="string"==typeof e?e:t,d="string"==typeof e?[t].concat(i):i,c="function"==typeof a.dispatchEvent;if(!c&&"string"!=typeof l)throw Error("Need events names");var u=this.getStore(a);return"string"!=typeof l&&c?this.triggerNativeEvent(a,t):this.eachEvent(l,function(e,t){if(c)o.triggerNativeEvent(a,e);else{var i=u.get(e,t);if(i){o.current=e;try{i.every(function(e){return!o.isStopped(i)&&(r=e.syntheticCallback.apply(a,d),void 0!==r&&(s=r),!0)})}finally{o.removeStop(i)}}}}),s},e.prototype.destruct=function(){this.off(this)},e}()},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(2),r=o(4),s=o(0),a=o(3);t.Select=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isMarker=function(e){return a.Dom.isNode(e,t.jodit.editorWindow)&&"SPAN"===e.tagName&&e.hasAttribute("data-"+n.MARKER_CLASS)},t.marker=function(e,o){void 0===e&&(e=!1);var i=null;o&&(i=o.cloneRange(),i.collapse(e));var r=t.jodit.editorDocument.createElement("span");return r.id=n.MARKER_CLASS+"_"+ +new Date+"_"+(""+Math.random()).slice(2),r.style.lineHeight="0",r.style.display="none",r.setAttribute("data-"+n.MARKER_CLASS,e?"start":"end"),r.appendChild(t.jodit.editorDocument.createTextNode(n.INVISIBLE_SPACE)),i&&i.insertNode(r),r},t.focus=function(){var e=t.jodit;if(!t.isFocused()){if(e.options.iframe&&s.isIE())for(var o=0;1e5>o&&"complete"!==e.editorDocument.readyState;)o++;e.iframe&&e.iframe.focus(),e.editorWindow.focus(),e.editor.focus();var i=e.editorWindow.getSelection(),r=e.editorDocument.createRange();if(!i.rangeCount||!t.current()){var a=e.editor.firstChild;a||(a=e.editorDocument.createTextNode(n.INVISIBLE_SPACE),e.editor.appendChild(a)),r.selectNodeContents(a),r.collapse(!0),i.removeAllRanges(),i.addRange(r)}return!0}return!1},t.eachSelection=function(e){var o=t.jodit.editorWindow.getSelection();if(o.rangeCount){var i=o.getRangeAt(0),n=[],r=i.endContainer===t.jodit.editor?t.jodit.editor.childNodes[i.endOffset-1]:i.endContainer;a.Dom.find(i.startContainer===t.jodit.editor?t.jodit.editor.childNodes[i.startOffset]:i.startContainer,function(e){return!e||a.Dom.isEmptyTextNode(e)||t.isMarker(e)||n.push(e),e===r},t.jodit.editor,!0,"nextSibling",!1),n.forEach(function(t){e(t)})}},t.applyCSS=function(e,o,i){void 0===o&&(o="span");var r,l=function(e){return null!==e&&!a.Dom.isEmptyTextNode(e)&&!t.isMarker(e)},d=function(e){return"FONT"!==e.nodeName&&e.nodeType===Node.ELEMENT_NODE&&(s.isPlainObject(i)&&!1!==s.each(i,function(t,o){return-1!==o.indexOf((""+s.css(e,t)).toLowerCase())})||"function"==typeof i&&i(t.jodit,e))},c=function(e){return(RegExp("^"+e.nodeName+"$","i").test(o)||!(!i||!d(e)))&&l(e)},u=function(t){c(t)&&("SPAN"===t.nodeName&&e&&Object.keys(e).forEach(function(o){0===r||s.css(t,o)==s.normilizeCSSValue(o,e[o])?(s.css(t,o,""),void 0===r&&(r=0)):(s.css(t,o,e[o]),void 0===r&&(r=1))}),t.getAttribute("style")&&"SPAN"===t.nodeName||(a.Dom.unwrap(t),void 0===r&&(r=0)))};if(t.isCollapsed()){var p=!1;if(t.current()&&a.Dom.closest(t.current(),o,t.jodit.editor)){p=!0;var f=a.Dom.closest(t.current(),o,t.jodit.editor);f&&t.setCursorAfter(f)}if("SPAN"===o.toUpperCase()||!p){var h=a.Dom.create(o,n.INVISIBLE_SPACE,t.jodit.editorDocument);t.insertNode(h),"SPAN"===o.toUpperCase()&&e&&s.css(h,e),t.setCursorIn(h)}}else{var m=t.save();s.normalizeNode(t.jodit.editor.firstChild),t.jodit.editorDocument.execCommand("fontsize",!1,7),s.$$('font[size="7"]',t.jodit.editor).forEach(function(i){if(a.Dom.next(i,l,i.parentNode)||a.Dom.prev(i,l,i.parentNode)||!c(i.parentNode))if(i.firstChild&&!a.Dom.next(i.firstChild,l,i)&&!a.Dom.prev(i.firstChild,l,i)&&c(i.firstChild))u(i.firstChild);else if(a.Dom.closest(i,c,t.jodit.editor)){var n=t.jodit.editorDocument.createRange(),d=a.Dom.closest(i,c,t.jodit.editor);n.setStartBefore(d),n.setEndBefore(i);var p=n.extractContents();p.textContent&&s.trim(p.textContent).length||!p.firstChild||a.Dom.unwrap(p.firstChild),d.parentNode&&d.parentNode.insertBefore(p,d),n.setStartAfter(i),n.setEndAfter(d);var f=n.extractContents();f.textContent&&s.trim(f.textContent).length||!f.firstChild||a.Dom.unwrap(f.firstChild),a.Dom.after(d,f),u(d)}else{var h=[],m=void 0;i.firstChild&&a.Dom.find(i.firstChild,function(e){return e&&c(e)?(void 0===m&&(m=!0),h.push(e)):void 0===m&&(m=!1),!1},i,!0),h.forEach(a.Dom.unwrap),m||(void 0===r&&(r=1),1===r&&s.css(a.Dom.replace(i,o,!1,!1,t.jodit.editorDocument),e&&"SPAN"===o.toUpperCase()?e:{}))}else u(i.parentNode);i.parentNode&&a.Dom.unwrap(i)}),t.restore(m)}},t}return i(t,e),t.prototype.insertCursorAtPoint=function(e,t){var o,i=this.jodit.editorDocument;this.removeMarkers();try{var n=i.createRange();if(i.caretPositionFromPoint?(o=i.caretPositionFromPoint(e,t),n.setStart(o.offsetNode,o.offset)):this.jodit.editorDocument.caretRangeFromPoint&&(o=this.jodit.editorDocument.caretRangeFromPoint(e,t),n=this.jodit.editorDocument.createRange(),n.setStart(o.startContainer,o.startOffset)),n&&void 0!==this.jodit.editorWindow.getSelection){n.collapse(!0);var r=this.jodit.editorWindow.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==i.body.createTextRange){var s=i.body.createTextRange();s.moveToPoint(e,t),s.select()}return!0}catch(e){}return!1},t.prototype.removeMarkers=function(){s.$$("span[data-"+n.MARKER_CLASS+"]",this.jodit.editor).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})},t.prototype.restore=function(e){var t=this;if(void 0===e&&(e=[]),Array.isArray(e)){var o=this.jodit.editorWindow.getSelection();o.removeAllRanges(),e.forEach(function(e){var i=t.jodit.editorDocument.createRange(),n=t.jodit.editor.querySelector("#"+e.endId),r=t.jodit.editor.querySelector("#"+e.startId);if(r){if(e.collapsed||!n){var s=r.previousSibling;s&&s.nodeType===Node.TEXT_NODE?i.setStart(s,s.nodeValue?s.nodeValue.length:0):i.setStartBefore(r),r.parentNode&&r.parentNode.removeChild(r),i.collapse(!0)}else i.setStartAfter(r),r.parentNode&&r.parentNode.removeChild(r),i.setEndBefore(n),n.parentNode&&n.parentNode.removeChild(n);o.addRange(i)}})}},t.prototype.save=function(){var e=this.jodit.editorWindow.getSelection();if(!e.rangeCount)return[];var t,o,i,n=[],r=e.rangeCount,s=[];for(t=0;r>t;t+=1)s[t]=e.getRangeAt(t),s[t].collapsed?(o=this.marker(!0,s[t]),n[t]={startId:o.id,collapsed:!0,startMarker:o.outerHTML}):(o=this.marker(!0,s[t]),i=this.marker(!1,s[t]),n[t]={startId:o.id,endId:i.id,collapsed:!1,startMarker:o.outerHTML,endMarker:i.outerHTML});for(e.removeAllRanges(),t=r-1;t>=0;--t){var a=this.jodit.editorDocument.getElementById(n[t].startId);if(a)if(n[t].collapsed)s[t].setStartAfter(a),s[t].collapse(!0);else if(s[t].setStartBefore(a),n[t].endId){var l=this.jodit.editorDocument.getElementById(n[t].endId);l&&s[t].setEndAfter(l)}try{e.addRange(s[t].cloneRange())}catch(e){}}return n},t.prototype.isCollapsed=function(){var e,t=this.jodit.editorWindow.getSelection();for(e=0;t.rangeCount>e;e+=1)if(!t.getRangeAt(e).collapsed)return!1;return!0},t.prototype.isFocused=function(){return this.jodit.editorDocument.hasFocus&&this.jodit.editorDocument.hasFocus()&&this.jodit.editor===this.jodit.editorDocument.activeElement},t.prototype.current=function(){if(this.jodit.getRealMode()===n.MODE_WYSIWYG&&void 0!==this.jodit.editorWindow.getSelection){var e=this.jodit.editorWindow.getSelection();if(e.rangeCount>0){var t=e.getRangeAt(0),o=t.startContainer;if(t.startContainer.nodeType!==Node.TEXT_NODE&&t.startContainer===t.endContainer&&t.startOffset!==t.endOffset&&(o=t.startContainer.childNodes[t.startOffset]),a.Dom.isOrContains(this.jodit.editor,o))return o}}return!1},t.prototype.insertNode=function(e,t){if(void 0===t&&(t=!0),!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(this.focus(),!this.jodit.editorWindow.getSelection)throw Error("Jodit does'n support this browser");var o=this.jodit.editorWindow.getSelection();if(this.isCollapsed()||this.jodit.execCommand("Delete"),o.rangeCount){var i=o.getRangeAt(0);!function(e,t){for(var o=t;o;){if(o===e)return!0;o=o.parentNode}return!1}(this.jodit.editor,i.commonAncestorContainer)?this.jodit.editor.appendChild(e):(i.deleteContents(),i.insertNode(e))}else this.jodit.editor.appendChild(e);t&&this.setCursorAfter(e),this.jodit.setEditorValue()},t.prototype.insertHTML=function(e){if(""!==e){var t,o,i=this.jodit.editorDocument.createElement("div"),n=this.jodit.editorDocument.createDocumentFragment();for(this.isFocused()||this.jodit.editor.focus(),e instanceof this.jodit.editorWindow.Node?a.Dom.isNode(e,this.jodit.editorWindow)&&i.appendChild(e):i.innerHTML=""+e,t=i.lastChild;i.firstChild;)t=i.firstChild,n.appendChild(i.firstChild);for(this.insertNode(n,!1),t?this.setCursorAfter(t):this.setCursorIn(n),o=this.jodit.editor.lastChild;o&&o.nodeType===Node.TEXT_NODE&&o.previousSibling&&o.nodeValue&&/^\s*$/.test(o.nodeValue);)o=o.previousSibling;t&&(o&&t===o&&t.nodeType===Node.ELEMENT_NODE&&this.jodit.editor.appendChild(this.jodit.editorDocument.createElement("br")),this.setCursorAfter(t))}},t.prototype.insertImage=function(e,t){void 0===t&&(t={});var o,i="string"==typeof e?s.dom('',this.jodit.editorDocument):s.dom(e,this.jodit.editorDocument);this.isCollapsed()||this.jodit.execCommand("Delete"),"string"==typeof e&&i.setAttribute("src",e),o=""+this.jodit.options.imageDefaultWidth,o&&"auto"!==o&&0>(o+"").indexOf("px")&&0>(o+"").indexOf("%")&&(o+="px"),t.width=o,t&&"object"==typeof t&&s.each(t,function(e,t){i.style[t]=e});var n=function(){(i.offsetHeight>i.naturalHeight||i.offsetWidth>i.naturalWidth)&&(i.style.width="",i.style.height=""),i.removeEventListener("load",n)};i.addEventListener("load",n),i.complete&&n(),this.insertNode(i),this.jodit.events.fire("afterInsertImage",i)},t.prototype.setCursorAfter=function(e){var t=this;if(!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===t.jodit.editor||e&&e.parentNode===t.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var o=this.jodit.editorWindow.getSelection(),i=this.jodit.editorDocument.createRange(),r=this.jodit.editorDocument.createTextNode(n.INVISIBLE_SPACE);return e.nodeType!==Node.TEXT_NODE?(i.setStartAfter(e),i.insertNode(r),i.selectNode(r)):i.setStart(e,e.nodeValue?e.nodeValue.length:0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.jodit.events.fire("changeSelection"),r},t.prototype.cursorInTheEdge=function(e,t,o){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===o&&(o=!1);var i=this.jodit.editorWindow.getSelection(),n=function(e){return e&&!a.Dom.isEmptyTextNode(e)},r=t;if(!i.rangeCount)return!1;var s=i.getRangeAt(0),l=function(){return!1===o?e:!e}()?s.startContainer:s.endContainer;if(!1===t)r=a.Dom.up(l,a.Dom.isBlock,this.jodit.editor);else if("function"==typeof t)r=a.Dom.up(l,t,this.jodit.editor);else if(!a.Dom.isOrContains(t,s.startContainer))return null;return!(!r||(l===r?e?0!==s.startOffset:s.endOffset!==[].slice.call(r.childNodes).filter(n).length:e?l.nodeType===Node.TEXT_NODE&&0!==s.startOffset||a.Dom.prev(l,n,r):l.nodeType===Node.TEXT_NODE&&(!s.startContainer.nodeValue||s.endOffset!==s.startContainer.nodeValue.length)||a.Dom.next(l,n,r)))},t.prototype.setCursorBefore=function(e){var t=this;if(!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===t.jodit.editor||e&&e.parentNode===t.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var o=this.jodit.editorWindow.getSelection(),i=this.jodit.editorDocument.createRange(),r=this.jodit.editorDocument.createTextNode(n.INVISIBLE_SPACE);return e.nodeType!==Node.TEXT_NODE?(i.setStartBefore(e),i.insertNode(r),i.selectNode(r)):i.setStart(e,e.nodeValue?e.nodeValue.length:0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.jodit.events.fire("changeSelection"),r},t.prototype.setCursorIn=function(e,t){var o=this;if(void 0===t&&(t=!1),!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===o.jodit.editor||e&&e.parentNode===o.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var i=this.jodit.editorWindow.getSelection(),n=this.jodit.editorDocument.createRange(),r=e,s=e;do{if(r.nodeType===Node.TEXT_NODE)break;s=r,r=r[t?"firstChild":"lastChild"]}while(r);n.selectNodeContents(r||s),n.collapse(t),i.removeAllRanges(),i.addRange(n),this.jodit.events.fire("changeSelection")},t.prototype.selectRange=function(e){var t=this.jodit.editorWindow.getSelection();t.removeAllRanges(),t.addRange(e),this.jodit.events.fire("changeSelection")},t.prototype.select=function(e,t){var o=this;if(void 0===t&&(t=!1),!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===o.jodit.editor||e&&e.parentNode===o.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var i=this.jodit.editorWindow.getSelection(),n=this.jodit.editorDocument.createRange();n[t?"selectNodeContents":"selectNode"](e),i.removeAllRanges(),i.addRange(n)},t}(r.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(1),r=o(0),s=o(4);n.Config.prototype.defaultAjaxOptions={dataType:"json",method:"GET",url:"",data:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8",headers:{"X-REQUESTED-WITH":"XMLHttpRequest"},withCredentials:!0,xhr:function(){return new("undefined"==typeof XDomainRequest?XMLHttpRequest:XDomainRequest)}},t.Ajax=function(e){function t(t,o){var i=e.call(this,t)||this;return i.options=r.extend(!0,{},n.Config.prototype.defaultAjaxOptions,o),i.options.xhr&&(i.xhr=i.options.xhr()),i}return i(t,e),t.prototype.__buildParams=function(e,t){if("string"==typeof e||this.jodit.ownerWindow.FormData&&e instanceof this.jodit.ownerWindow.FormData)return e;var o,i,n,r=[];for(o in e)e.hasOwnProperty(o)&&(i=t?t+"["+o+"]":o,n=e[o],r.push("object"==typeof n?this.__buildParams(n,i):encodeURIComponent(i)+"="+encodeURIComponent(n)));return r.join("&")},t.prototype.abort=function(){return this.xhr.abort(),this},t.prototype.send=function(){var e=this;return new Promise(function(t,o){var i=function(t){switch(e.options.dataType){case"json":try{t=JSON.parse(t)}catch(t){return void o.call(e.xhr,t)}}return t};if(e.xhr.onabort=function(){o(Error(e.xhr.statusText))},e.xhr.onerror=function(){o(Error(e.xhr.statusText))},e.xhr.ontimeout=function(){o(Error(e.xhr.statusText))},e.xhr.onload=function(){e.response=e.xhr.responseText,e.status=e.xhr.status,t.call(e.xhr,i(e.response))},e.xhr.onreadystatechange=function(){if(e.xhr.readyState===XMLHttpRequest.DONE){var n=e.xhr.responseText;e.response=n,e.status=e.xhr.status,200===e.xhr.status?t.call(e.xhr,i(n)):o.call(e.xhr,Error(e.xhr.statusText||e.jodit.i18n("Connection error!")))}},e.xhr.withCredentials=e.options.withCredentials||!1,!e.options.url)throw Error("Need URL for AJAX request");e.xhr.open(e.options.method||"get",e.options.url,!0),e.options.contentType&&e.xhr.setRequestHeader&&e.xhr.setRequestHeader("Content-type",e.options.contentType),e.options.headers&&e.xhr.setRequestHeader&&r.each(e.options.headers,function(t,o){e.xhr.setRequestHeader(t,o)}),setTimeout(function(){e.xhr.send(e.options.data?e.__buildParams(e.options.data):void 0)},0)})},t}(s.Component)},function(e,t,o){"use strict";t.__esModule=!0;var i=o(0),n=o(2),r=o(3);t.Table=function(){function e(){}return e.addSelected=function(e){e.setAttribute(n.JODIT_SELECTED_CELL_MARKER,"1")},e.restoreSelection=function(e){e.removeAttribute(n.JODIT_SELECTED_CELL_MARKER)},e.getAllSelectedCells=function(e){return e?i.$$("td["+n.JODIT_SELECTED_CELL_MARKER+"],th["+n.JODIT_SELECTED_CELL_MARKER+"]",e):[]},e.getRowsCount=function(e){return e.rows.length},e.getColumnsCount=function(t){return e.formalMatrix(t).reduce(function(e,t){return Math.max(e,t.length)},0)},e.formalMatrix=function(e,t){for(var o=[[]],i=Array.prototype.slice.call(e.rows),n=0,r=void 0;i.length>n;n+=1){var s=Array.prototype.slice.call(i[n].cells);for(r=0;s.length>r;r+=1)if(!1===function(e,i){void 0===o[i]&&(o[i]=[]);for(var n,r,s=e.colSpan,a=e.rowSpan,l=0;o[i][l];)l+=1;for(r=0;a>r;r+=1)for(n=0;s>n;n+=1){if(void 0===o[i+r]&&(o[i+r]=[]),t&&!1===t(e,i+r,l+n,s,a))return!1;o[i+r][l+n]=e}}(s[r],n))return o}return o},e.formalCoordinate=function(t,o,i){void 0===i&&(i=!1);var n=0,r=0,s=1,a=1;return e.formalMatrix(t,function(e,t,l,d,c){if(o===e)return n=t,r=l,s=d||1,a=c||1,i&&(r+=(d||1)-1,n+=(c||1)-1),!1}),[n,r,s,a]},e.appendRow=function(t,o,n){void 0===o&&(o=!1),void 0===n&&(n=!0);var s,a=e.getColumnsCount(t),l=r.Dom.create("tr","",t.ownerDocument);for(s=0;a>s;s+=1)l.appendChild(r.Dom.create("td","",t.ownerDocument));n&&o&&o.nextSibling?o.parentNode&&o.parentNode.insertBefore(l,o.nextSibling):!n&&o?o.parentNode&&o.parentNode.insertBefore(l,o):(i.$$(":scope>tbody",t)[0]||t).appendChild(l)},e.removeRow=function(t,o){var n,s=e.formalMatrix(t),a=t.rows[o];i.each(s[o],function(e,i){if(n=!1,0>o-1||s[o-1][e]!==i)if(s[o+1]&&s[o+1][e]===i){if(i.parentNode===a&&i.parentNode.nextSibling){n=!0;for(var l=e+1;s[o+1][l]===i;)l+=1;var d=r.Dom.next(i.parentNode,function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&"TR"===e.nodeName},t);s[o+1][l]?d.insertBefore(i,s[o+1][l]):d.appendChild(i)}}else i.parentNode&&i.parentNode.removeChild(i);else n=!0;if(n&&(i.parentNode===a||i!==s[o][e-1])){var c=i.rowSpan;c-1>1?i.setAttribute("rowspan",""+(c-1)):i.removeAttribute("rowspan")}}),a&&a.parentNode&&a.parentNode.removeChild(a)},e.appendColumn=function(t,o,i){void 0===i&&(i=!0);var n,s=e.formalMatrix(t);for(void 0===o&&(o=e.getColumnsCount(t)-1),n=0;s.length>n;n+=1){var a=r.Dom.create("td","",t.ownerDocument),l=s[n][o],d=!1;i?(s[n]&&l&&o+1>=s[n].length||l!==s[n][o+1])&&(l.nextSibling?l.parentNode&&l.parentNode.insertBefore(a,l.nextSibling):l.parentNode&&l.parentNode.appendChild(a),d=!0):(0>o-1||s[n][o]!==s[n][o-1]&&s[n][o].parentNode)&&(l.parentNode&&l.parentNode.insertBefore(a,s[n][o]),d=!0),d||s[n][o].setAttribute("colspan",""+(parseInt(s[n][o].getAttribute("colspan")||"1",10)+1))}},e.removeColumn=function(t,o){var n,r=e.formalMatrix(t);i.each(r,function(e,t){var i=t[o];if(n=!1,0>o-1||r[e][o-1]!==i?t.length>o+1&&r[e][o+1]===i?n=!0:i.parentNode&&i.parentNode.removeChild(i):n=!0,n&&(0>e-1||i!==r[e-1][o])){var s=i.colSpan;s-1>1?i.setAttribute("colspan",""+(s-1)):i.removeAttribute("colspan")}})},e.getSelectedBound=function(t,o){var i,n,r,s=[[1/0,1/0],[0,0]],a=e.formalMatrix(t);for(i=0;a.length>i;i+=1)for(n=0;a[i].length>n;n+=1)-1!==o.indexOf(a[i][n])&&(s[0][0]=Math.min(i,s[0][0]),s[0][1]=Math.min(n,s[0][1]),s[1][0]=Math.max(i,s[1][0]),s[1][1]=Math.max(n,s[1][1]));for(i=s[0][0];s[1][0]>=i;i+=1)for(r=1,n=s[0][1];s[1][1]>=n;n+=1){for(;a[i][n-r]&&a[i][n]===a[i][n-r];)s[0][1]=Math.min(n-r,s[0][1]),s[1][1]=Math.max(n-r,s[1][1]),r+=1;for(r=1;a[i][n+r]&&a[i][n]===a[i][n+r];)s[0][1]=Math.min(n+r,s[0][1]),s[1][1]=Math.max(n+r,s[1][1]),r+=1;for(r=1;a[i-r]&&a[i][n]===a[i-r][n];)s[0][0]=Math.min(i-r,s[0][0]),s[1][0]=Math.max(i-r,s[1][0]),r+=1;for(r=1;a[i+r]&&a[i][n]===a[i+r][n];)s[0][0]=Math.min(i+r,s[0][0]),s[1][0]=Math.max(i+r,s[1][0]),r+=1}return s},e.normalizeTable=function(t){var o,i,n,r,s=[],a=e.formalMatrix(t);for(i=0;a[0].length>i;i+=1){for(n=1e6,r=!1,o=0;a.length>o;o+=1)if(void 0!==a[o][i]){if(2>a[o][i].colSpan){r=!0;break}n=Math.min(n,a[o][i].colSpan)}if(!r)for(o=0;a.length>o;o+=1)void 0!==a[o][i]&&e.__mark(a[o][i],"colspan",a[o][i].colSpan-n+1,s)}for(o=0;a.length>o;o+=1){for(n=1e6,r=!1,i=0;a[o].length>i;i+=1)if(void 0!==a[o][i]){if(2>a[o][i].rowSpan){r=!0;break}n=Math.min(n,a[o][i].rowSpan)}if(!r)for(i=0;a[o].length>i;i+=1)void 0!==a[o][i]&&e.__mark(a[o][i],"rowspan",a[o][i].rowSpan-n+1,s)}for(o=0;a.length>o;o+=1)for(i=0;a[o].length>i;i+=1)void 0!==a[o][i]&&(a[o][i].hasAttribute("rowspan")&&1===a[o][i].rowSpan&&a[o][i].removeAttribute("rowspan"),a[o][i].hasAttribute("colspan")&&1===a[o][i].colSpan&&a[o][i].removeAttribute("colspan"),a[o][i].hasAttribute("class")&&!a[o][i].getAttribute("class")&&a[o][i].removeAttribute("class"));e.__unmark(s)},e.mergeSelected=function(t){var o,r=e.getSelectedBound(t,e.getAllSelectedCells(t)),s=0,a=null,l=0,d=[],c=0,u=0,p=[];r&&(r[0][0]-r[1][0]||r[0][1]-r[1][1])&&(e.formalMatrix(t,function(t,n,f,h,m){if(!(r[0][0]>n||n>r[1][0]||r[0][1]>f||f>r[1][1])){if(o=t,o.__i_am_already_was)return;o.__i_am_already_was=!0,n===r[0][0]&&o.style.width&&(s+=o.offsetWidth),""!==i.trim(t.innerHTML.replace(//g,""))&&d.push(t.innerHTML),h>1&&(c+=h-1),m>1&&(u+=m-1),a?e.__mark(o,"remove",1,p):(a=t,l=f)}}),c=r[1][1]-r[0][1]+1,u=r[1][0]-r[0][0]+1,a&&(c>1&&e.__mark(a,"colspan",c,p),u>1&&e.__mark(a,"rowspan",u,p),s&&(e.__mark(a,"width",(s/t.offsetWidth*100).toFixed(n.ACCURACY)+"%",p),l&&e.setColumnWidthByDelta(t,l,0,!0,p)),a.innerHTML=d.join("
    "),delete a.__i_am_already_was,e.__unmark(p),e.normalizeTable(t),i.each([].slice.call(t.rows),function(e,t){t.cells.length||t.parentNode.removeChild(t)})))},e.splitHorizontal=function(t){var o,i,n,s,a,l=[];e.getAllSelectedCells(t).forEach(function(d){i=r.Dom.create("td","",t.ownerDocument),i.appendChild(r.Dom.create("br","",t.ownerDocument)),n=r.Dom.create("tr","",t.ownerDocument),o=e.formalCoordinate(t,d),2>d.rowSpan?(e.formalMatrix(t,function(t,i,n){o[0]===i&&o[1]!==n&&t!==d&&e.__mark(t,"rowspan",t.rowSpan+1,l)}),r.Dom.after(r.Dom.closest(d,"tr",t),n),n.appendChild(i)):(e.__mark(d,"rowspan",d.rowSpan-1,l),e.formalMatrix(t,function(e,i,n){i>o[0]&&o[0]+d.rowSpan>i&&o[1]>n&&e.parentNode.rowIndex===i&&(a=e),i>o[0]&&e===d&&(s=t.rows[i])}),a?r.Dom.after(a,i):s.insertBefore(i,s.firstChild)),d.colSpan>1&&e.__mark(i,"colspan",d.colSpan,l),e.__unmark(l),e.restoreSelection(d)}),this.normalizeTable(t)},e.splitVertical=function(t){var o,i,s,a=[];e.getAllSelectedCells(t).forEach(function(l){o=e.formalCoordinate(t,l),2>l.colSpan?e.formalMatrix(t,function(t,i,n){o[1]===n&&o[0]!==i&&t!==l&&e.__mark(t,"colspan",t.colSpan+1,a)}):e.__mark(l,"colspan",l.colSpan-1,a),i=r.Dom.create("td","",t.ownerDocument),i.appendChild(r.Dom.create("br","",t.ownerDocument)),l.rowSpan>1&&e.__mark(i,"rowspan",l.rowSpan,a);var d=l.offsetWidth;r.Dom.after(l,i),s=d/t.offsetWidth/2,e.__mark(l,"width",(100*s).toFixed(n.ACCURACY)+"%",a),e.__mark(i,"width",(100*s).toFixed(n.ACCURACY)+"%",a),e.__unmark(a),e.restoreSelection(l)}),e.normalizeTable(t)},e.__mark=function(e,t,o,i){i.push(e),e.__marked_value||(e.__marked_value={}),e.__marked_value[t]=void 0===o?1:o},e.__unmark=function(e){e.forEach(function(e){e.__marked_value&&(i.each(e.__marked_value,function(t,o){switch(t){case"remove":e.parentNode&&e.parentNode.removeChild(e);break;case"rowspan":o>1?e.setAttribute("rowspan",o):e.removeAttribute("rowspan");break;case"colspan":o>1?e.setAttribute("colspan",o):e.removeAttribute("colspan");break;case"width":e.style.width=o}delete e.__marked_value[t]}),delete e.__marked_value)})},e.setColumnWidthByDelta=function(t,o,i,r,s){var a,l,d,c=e.formalMatrix(t);for(a=0;c.length>a;a+=1)l=c[a][o].offsetWidth,d=(l+i)/t.offsetWidth*100,e.__mark(c[a][o],"width",d.toFixed(n.ACCURACY)+"%",s);r||e.__unmark(s)},e}()},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(0),s=o(5);t.ContextMenu=function(e){function t(t){var o=e.call(this,t)||this;return o.hide=function(){o.context.classList.remove("jodit_context_menu-show"),o.jodit.ownerWindow.removeEventListener("mouseup",o.hide)},o.context=r.dom('
    ',t.ownerDocument),o.jodit.ownerDocument.body.appendChild(o.context),o}return i(t,e),t.prototype.show=function(e,t,o){var i=this,n=this;Array.isArray(o)&&(this.context.innerHTML="",o.forEach(function(e){if(e){var t=r.dom(''+(e.icon?s.Toolbar.getIcon(e.icon):"")+"",i.jodit.ownerDocument),o=t.querySelector("span");t.addEventListener("click",function(t){return e.exec&&e.exec.call(n,t),n.hide(),!1}),o.innerText=n.jodit.i18n(e.title||""),n.context.appendChild(t)}}),r.css(n.context,{left:e,top:t}),this.jodit.ownerWindow.addEventListener("mouseup",n.hide),this.context.classList.add("jodit_context_menu-show"))},t}(n.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(1),r=o(4),s=o(18),a=o(2),l=o(19),d=o(0);n.Config.prototype.observer={timeout:100};var c=function(){function e(e,t,o){this.observer=o,this.oldValue=e,this.newValue=t}return e.prototype.execute=function(){},e.prototype.undo=function(){this.observer.snapshot.restore(this.oldValue)},e.prototype.redo=function(){this.observer.snapshot.restore(this.newValue)},e}();t.Command=c,t.Observer=function(e){function t(t){var o=e.call(this,t)||this;o.onChangeStack=function(){o.__newValue=o.snapshot.make(),s.Snapshot.equal(o.__newValue,o.__startValue)||(o.stack.execute(new c(o.__startValue,o.__newValue,o)),o.__startValue=o.__newValue)},o.stack=new l.Stack,o.stack.changed=function(){o.changed()},o.snapshot=new s.Snapshot(t),o.__startValue=o.snapshot.make(),o.stack.changed();var i=d.debounce(o.onChangeStack,o.jodit.options.observer.timeout);return t.events.on("updateToolbar",function(){o.stack.changed()}).on("change",function(){o.snapshot.isBlocked||i()}),o}return i(t,e),t.prototype.changed=function(){this.jodit.getMode()===a.MODE_WYSIWYG&&(this.jodit.events.fire("canRedo",this.stack.canRedo()),this.jodit.events.fire("canUndo",this.stack.canUndo()))},t.prototype.redo=function(){this.stack.redo()},t.prototype.undo=function(){this.stack.undo()},t}(r.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4);t.Snapshot=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isBlocked=!1,t}return i(t,e),t.__countElementsBefore=function(e){if(!e||!e.parentNode)return 0;var t,o=e.parentNode.childNodes,i=0,n=null;for(t=0;o.length>t;t+=1){if(!n||o[t].nodeType===Node.TEXT_NODE&&""===o[t].textContent||n.nodeType===Node.TEXT_NODE&&o[t].nodeType===Node.TEXT_NODE||(i+=1),o[t]===e)return i;n=o[t]}return 0},t.prototype.__decomposeHierarchyNodes=function(e){var o=[];if(!e||!e.parentNode)return[];for(;e&&e!==this.jodit.editor;)e&&o.push(t.__countElementsBefore(e)),e=e.parentNode;return o.reverse()},t.__strokeOffset=function(e,t){for(;e&&e.nodeType===Node.TEXT_NODE;)(e=e.previousSibling)&&e.nodeType===Node.TEXT_NODE&&null!==e.textContent&&(t+=e.textContent.length);return t},t.prototype.make=function(){var e={html:"",range:{startContainer:[],startOffset:0,endContainer:[],endOffset:0}};e.html=this.jodit.getEditorValue();var o=this.jodit.editorWindow.getSelection();if(o.rangeCount){var i=o.getRangeAt(0);e.range={startContainer:this.__decomposeHierarchyNodes(i.startContainer),startOffset:t.__strokeOffset(i.startContainer,i.startOffset),endContainer:this.__decomposeHierarchyNodes(i.endContainer),endOffset:t.__strokeOffset(i.endContainer,i.endOffset)}}return e},t.prototype.__restoreElementByLadder=function(e){var t,o=this.jodit.editor;for(t=0;o&&e.length>t;t+=1)o=o.childNodes[e[t]];return o},t.equal=function(e,t){return e.html===t.html&&JSON.stringify(e.range)===JSON.stringify(t.range)},t.prototype.restore=function(e){this.isBlocked=!0,this.jodit.setEditorValue(e.html);try{if(e.range){var t=this.jodit.editorWindow.getSelection(),o=this.jodit.editorDocument.createRange();o.setStart(this.__restoreElementByLadder(e.range.startContainer),e.range.startOffset),o.setEnd(this.__restoreElementByLadder(e.range.endContainer),e.range.endOffset),t.removeAllRanges(),t.addRange(o)}}catch(e){}this.isBlocked=!1},t}(n.Component)},function(e,t,o){"use strict";t.__esModule=!0,t.Stack=function(){function e(){this.commands=[],this.stackPosition=-1,this.savePosition=-1}return e.prototype.execute=function(e){this.__clearRedo(),e.execute(),this.commands.push(e),this.stackPosition+=1,this.changed()},e.prototype.undo=function(){this.commands[this.stackPosition]&&this.commands[this.stackPosition].undo(),this.stackPosition-=1,this.changed()},e.prototype.canUndo=function(){return this.stackPosition>=0},e.prototype.redo=function(){this.stackPosition+=1,this.commands[this.stackPosition]&&this.commands[this.stackPosition].redo(),this.changed()},e.prototype.canRedo=function(){return this.commands.length-1>this.stackPosition},e.prototype.save=function(){this.savePosition=this.stackPosition,this.changed()},e.prototype.__clearRedo=function(){this.commands.length=this.stackPosition+1},e.prototype.changed=function(){},e}()},function(e,t,o){"use strict";o(21),o(22);var i=o(6),n=o(5),r=o(2),s=o(28),a=o(8),l=o(64),d=o(69),c=o(1);Object.keys(r).forEach(function(e){i.Jodit[e]=r[e]});var u=function(e){return"__esModule"!==e};Object.keys(d).filter(u).forEach(function(e){n.Toolbar.icons[e.replace("_","-")]=d[e]}),Object.keys(a).filter(u).forEach(function(e){i.Jodit.modules[e]=a[e]}),Object.keys(s).filter(u).forEach(function(e){i.Jodit.plugins[e]=s[e]}),Object.keys(l).filter(u).forEach(function(e){i.Jodit.lang[e]=l[e]}),i.Jodit.defaultOptions=new c.Config,e.exports=i.Jodit},function(e,t){},function(e,t,o){"use strict";t.__esModule=!0,o(23),o(24),function(e){e.matches||(e.matches=void 0!==e.matchesSelector?e.matchesSelector:function(e){var t=this.ownerDocument.querySelectorAll(e),o=this;return Array.prototype.some.call(t,function(e){return e===o})})}(Element.prototype)},function(e,t){"document"in window.self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){"use strict";if("Element"in e){var t=e.Element.prototype,o=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},n=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},r=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},s=function(e,t){if(""===t)throw new r("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new r("INVALID_CHARACTER_ERR","String contains an invalid character");return n.call(e,t)},a=function(e){for(var t=i.call(e.getAttribute("class")||""),o=t?t.split(/\s+/):[],n=0,r=o.length;r>n;n++)this.push(o[n]);this._updateClassName=function(){e.setAttribute("class",""+this)}},l=a.prototype=[],d=function(){return new a(this)};if(r.prototype=Error.prototype,l.item=function(e){return this[e]||null},l.contains=function(e){return e+="",-1!==s(this,e)},l.add=function(){var e,t=arguments,o=0,i=t.length,n=!1;do{e=t[o]+"",-1===s(this,e)&&(this.push(e),n=!0)}while(++oo;o++)e=arguments[o],t.call(this,e)}};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}())},function(e,t,o){"use strict";e.exports=o(25).polyfill()},function(e,t,o){(function(t){!function(t,i){e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function i(e){return"function"==typeof e}function n(e){W=e}function r(e){F=e}function s(){return void 0!==H?function(){H(l)}:a()}function a(){var e=setTimeout;return function(){return e(l,1)}}function l(){for(var e=0;R>e;e+=2)(0,K[e])(K[e+1]),K[e]=void 0,K[e+1]=void 0;R=0}function d(e,t){var o=this,i=new this.constructor(u);void 0===i[J]&&k(i);var n=o._state;if(n){var r=arguments[n-1];F(function(){return T(n,i,r,o._result)})}else j(o,i,e,t);return i}function c(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var o=new t(u);return b(o,e),o}function u(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function f(){return new TypeError("A promises callback cannot return that same promise.")}function h(e){try{return e.then}catch(e){return te.error=e,te}}function m(e,t,o,i){try{e.call(t,o,i)}catch(e){return e}}function v(e,t,o){F(function(e){var i=!1,n=m(o,t,function(o){i||(i=!0,t!==o?b(e,o):w(e,o))},function(t){i||(i=!0,C(e,t))},"Settle: "+(e._label||" unknown promise"));!i&&n&&(i=!0,C(e,n))},e)}function g(e,t){t._state===Q?w(e,t._result):t._state===ee?C(e,t._result):j(t,void 0,function(t){return b(e,t)},function(t){return C(e,t)})}function _(e,t,o){t.constructor===e.constructor&&o===d&&t.constructor.resolve===c?g(e,t):o===te?(C(e,te.error),te.error=null):void 0===o?w(e,t):i(o)?v(e,t,o):w(e,t)}function b(t,o){t===o?C(t,p()):e(o)?_(t,o,h(o)):w(t,o)}function y(e){e._onerror&&e._onerror(e._result),x(e)}function w(e,t){e._state===Z&&(e._result=t,e._state=Q,0!==e._subscribers.length&&F(x,e))}function C(e,t){e._state===Z&&(e._state=ee,e._result=t,F(y,e))}function j(e,t,o,i){var n=e._subscribers,r=n.length;e._onerror=null,n[r]=t,n[r+Q]=o,n[r+ee]=i,0===r&&e._state&&F(x,e)}function x(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var i=void 0,n=void 0,r=e._result,s=0;t.length>s;s+=3)i=t[s],n=t[s+o],i?T(o,i,n,r):n(r);e._subscribers.length=0}}function q(){this.error=null}function E(e,t){try{return e(t)}catch(e){return oe.error=e,oe}}function T(e,t,o,n){var r=i(o),s=void 0,a=void 0,l=void 0,d=void 0;if(r){if(s=E(o,n),s===oe?(d=!0,a=s.error,s.error=null):l=!0,t===s)return void C(t,f())}else s=n,l=!0;t._state!==Z||(r&&l?b(t,s):d?C(t,a):e===Q?w(t,s):e===ee&&C(t,s))}function D(e,t){try{t(function(t){b(e,t)},function(t){C(e,t)})}catch(t){C(e,t)}}function S(){return ie++}function k(e){e[J]=ie++,e._state=void 0,e._result=void 0,e._subscribers=[]}function L(){return Error("Array Methods must be provided an Array")}function L(){return Error("Array Methods must be provided an Array")}function I(e){return new ne(this,e).promise}function M(e){var t=this;return new t(B(e)?function(o,i){for(var n=e.length,r=0;n>r;r++)t.resolve(e[r]).then(o,i)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function A(e){var t=this,o=new t(u);return C(o,e),o}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function z(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function O(){var e=void 0;if(void 0!==t)e=t;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw Error("polyfill failed because global object is unavailable in this environment")}var o=e.Promise;if(o){var i=null;try{i=Object.prototype.toString.call(o.resolve())}catch(e){}if("[object Promise]"===i&&!o.cast)return}e.Promise=re}var P=void 0;P=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var B=P,R=0,H=void 0,W=void 0,F=function(e,t){K[R]=e,K[R+1]=t,2===(R+=2)&&(W?W(l):G())},V="undefined"!=typeof window?window:void 0,Y=V||{},U=Y.MutationObserver||Y.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,K=Array(1e3),G=void 0;G=X?function(){return function(){return process.nextTick(l)}}():U?function(){var e=0,t=new U(l),o=document.createTextNode("");return t.observe(o,{characterData:!0}),function(){o.data=e=++e%2}}():$?function(){var e=new MessageChannel;return e.port1.onmessage=l,function(){return e.port2.postMessage(0)}}():void 0===V?function(){try{var e=o(27);return H=e.runOnLoop||e.runOnContext,s()}catch(e){return a()}}():a();var J=Math.random().toString(36).substring(16),Z=void 0,Q=1,ee=2,te=new q,oe=new q,ie=0,ne=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(u),this.promise[J]||k(this.promise),B(t)?(this.length=t.length,this._remaining=t.length,this._result=Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&w(this.promise,this._result))):C(this.promise,L())}return e.prototype._enumerate=function(e){for(var t=0;this._state===Z&&e.length>t;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var o=this._instanceConstructor,i=o.resolve;if(i===c){var n=h(e);if(n===d&&e._state!==Z)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(o===re){var r=new o(u);_(r,e,n),this._willSettleAt(r,t)}else this._willSettleAt(new o(function(t){return t(e)}),t)}else this._willSettleAt(i(e),t)},e.prototype._settledAt=function(e,t,o){var i=this.promise;i._state===Z&&(this._remaining--,e===ee?C(i,o):this._result[t]=o),0===this._remaining&&w(i,this._result)},e.prototype._willSettleAt=function(e,t){var o=this;j(e,void 0,function(e){return o._settledAt(Q,t,e)},function(e){return o._settledAt(ee,t,e)})},e}(),re=function(){function e(t){this[J]=S(),this._result=this._state=void 0,this._subscribers=[],u!==t&&("function"!=typeof t&&N(),this instanceof e?D(this,t):z())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this,o=t.constructor;return t.then(function(t){return o.resolve(e()).then(function(){return t})},function(t){return o.resolve(e()).then(function(){throw t})})},e}();return re.prototype.then=d,re.all=I,re.race=M,re.resolve=c,re.reject=A,re._setScheduler=n,re._setAsap=r,re._asap=F,re.polyfill=O,re.Promise=re,re}()}()}).call(t,o(26))},function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},function(e,t){},function(e,t,o){"use strict";t.__esModule=!0,t.addNewLine=o(29).addNewLine,t.autofocus=o(30).autofocus,t.backspace=o(31).backspace,t.bold=o(32).bold,t.cleanHTML=o(33).cleanHTML,t.color=o(34).color,t.copyformat=o(35).copyformat,t.enter=o(36).enter,t.errorMessages=o(37).errorMessages,t.font=o(38).font,t.formatBlock=o(39).formatBlock,t.fullsize=o(40).fullsize,t.iframe=o(41).iframe,t.indent=o(42).indent,t.imageInlineToolbar=o(43).imageInlineToolbar,t.imageProcessor=o(44).imageProcessor,t.imageProperties=o(45).imageProperties,t.inlinePopup=o(46).inlinePopup,t.justify=o(47).justify,t.link=o(48).link,t.mobile=o(49).mobile,t.orderedlist=o(52).orderedlist,t.paste=o(53).paste,t.placeholder=o(54).placeholder,t.redoundo=o(55).redoundo,t.resizer=o(56).resizer,t.size=o(57).size,t.source=o(58).source,t.symbols=o(59).symbols,t.hotkeys=o(60).hotkeys,t.table=o(61).TableProcessor,t.tableKeyboardNavigation=o(62).tableKeyboardNavigation,t.search=o(63).search},function(e,t,o){"use strict";function i(e){if(e.options.addNewLine){var t,o,i=r.dom('
    '+s.Toolbar.getIcon("enter")+"
    ",e.ownerDocument),n=i.querySelector("span"),d=RegExp("^("+e.options.addNewLineTagsTriggers.join("|")+")$","i"),c=!1,u=!1,p=function(){e.options.readonly||e.container.classList.contains("jodit_popup_active")||(clearTimeout(t),i.classList.toggle("jodit-add-new-line_after",!u),i.style.display="block",i.style.width=e.editor.clientWidth+"px",c=!1)},f=function(){clearTimeout(t),i.style.display="none",c=!0},h=function(e){return null!==e&&l.Dom.isBlock(e)&&!/^(img|table|iframe|hr)$/i.test(e.nodeName)},m=function(){c||(clearTimeout(t),t=window.setTimeout(f,500))};e.events.on("afterInit",function(){e.container.appendChild(i),e.events.on(i,"mousemove",function(e){e.stopPropagation()}).on(n,"mousedown touchstart",function(t){var i=e.editorDocument.createElement(e.options.enter);i.appendChild(e.editorDocument.createTextNode(a.INVISIBLE_SPACE)),u&&o?e.editor.insertBefore(i,o):e.editor.appendChild(i),e.selection.setCursorIn(i),e.setEditorValue(),f(),t.preventDefault()})}).on("change afterInit afterSetMode",r.debounce(function(){e.events.on(e.editor,"scroll",function(){f()}).on(e.container,"mouseleave",function(){m()}).on(e.editor,"mousemove",r.debounce(function(t){var n=e.editorDocument.elementFromPoint(t.pageX-e.editorWindow.pageXOffset,t.pageY-e.editorWindow.pageYOffset);if(n&&n!==i&&l.Dom.isOrContains(e.editor,n)){if(!((o=n)&&o.nodeName.match(d)&&l.Dom.isOrContains(e.editor,o)||(o=l.Dom.closest(o,d,e.editor))))return void m();var s=r.offset(o,e),a=!1;10>Math.abs(t.pageY-s.top)&&(a=s.top,u=!0),10>Math.abs(t.pageY-(s.top+s.height))&&(a=s.top+s.height,u=!1),!1!==a&&(u&&!l.Dom.prev(o,h,e.editor)||!u&&!l.Dom.next(o,h,e.editor))?(i.style.top=a+"px",p()):(o=!1,m())}},e.options.observer.timeout))},e.options.observer.timeout))}}t.__esModule=!0;var n=o(1),r=o(0),s=o(5),a=o(2),l=o(3);n.Config.prototype.addNewLine=!0,n.Config.prototype.addNewLineTagsTriggers=["table","iframe","img","hr","jodit"],t.addNewLine=i},function(e,t,o){"use strict";function i(e){var t;e.events.on("afterInit",function(){e.options.autofocus&&(e.options.observer.timeout?t=window.setTimeout(e.selection.focus,300):e.selection.focus())}).on("beforeDestruct",function(){clearTimeout(t)})}t.__esModule=!0,o(1).Config.prototype.autofocus=!1,t.autofocus=i},function(e,t,o){"use strict";function i(e){e.events.on("afterCommand",function(t){if("delete"===t){var o=e.selection.current();o&&o.firstChild&&"BR"===o.firstChild.nodeName&&o.removeChild(o.firstChild),r.trim(e.editor.innerText)||e.editor.querySelector("img")||(e.editor.innerHTML="",e.selection.setCursorIn(e.editor))}}),e.events.on("keydown",function(t){if(t.which===n.KEY_BACKSPACE||t.keyCode===n.KEY_DELETE){var o=t.which===n.KEY_BACKSPACE;if(!e.selection.isCollapsed())return e.execCommand("Delete"),!1;var i=e.editorWindow.getSelection(),r=!!i.rangeCount&&i.getRangeAt(0);if(r){var a=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer:r.startContainer.childNodes[r.startOffset];if(a&&a.nodeType===Node.TEXT_NODE&&a.nodeValue){for(var l=a.nodeValue,d=r.startOffset,c=o?-1:1;d>=0&&l.length>=d&&l[d+c]===n.INVISIBLE_SPACE;)d+=c;if(d!==r.startOffset){var u=r.startOffset;if(l=o?l.substr(0,d)+l.substr(u):l.substr(0,u)+l.substr(d),a.nodeValue=l,l)return void r.setStart(a,d)}}if(0===r.startOffset&&o&&a){var p=s.Dom.prev(a,s.Dom.isBlock,e.editor);p&&e.selection.setCursorIn(p,!1);var f=s.Dom.up(r.startContainer,s.Dom.isBlock,e.editor);if(f){var h=f.innerHTML.replace(n.INVISIBLE_SPACE_REG_EXP,"");if((!h.length||"
    "==h)&&!s.Dom.isCell(f,e.editorWindow)&&f.parentNode&&f!==e.editor)return f.parentNode.removeChild(f),!1}}}}})}t.__esModule=!0;var n=o(2),r=o(0),s=o(3);t.backspace=i},function(e,t,o){"use strict";function i(e){var t=function(t){var o=n({},r.Jodit.defaultOptions.controls[t].css),i={};Object.keys(o).forEach(function(e){i[e]=Array.isArray(o[e])?o[e][0]:o[e]});var s=r.Jodit.defaultOptions.controls[t];return e.selection.applyCSS(i,s.tags?s.tags[0]:void 0,s.css),e.setEditorValue(),!1};e.registerCommand("bold",{exec:t,hotkeys:"ctrl+b"}),e.registerCommand("italic",{exec:t,hotkeys:"ctrl+i"}),e.registerCommand("underline",{exec:t,hotkeys:"ctrl+u"}),e.registerCommand("strikethrough",{exec:t})}var n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(6),s=o(1);s.Config.prototype.controls.bold={tagRegExp:/^(strong|b)$/i,tags:["strong","b"],css:{"font-weight":["bold","700"]},tooltip:"Bold"},s.Config.prototype.controls.italic={tagRegExp:/^(em|i)$/i,tags:["em","i"],css:{"font-style":"italic"},tooltip:"Italic"},s.Config.prototype.controls.underline={tagRegExp:/^(u)$/i,tags:["u"],css:{"text-decoration":"underline"},tooltip:"Underline"},s.Config.prototype.controls.strikethrough={tagRegExp:/^(s)$/i,tags:["s"],css:{"text-decoration":"line-through"},tooltip:"Strike through"},t.bold=i},function(e,t,o){"use strict";function i(e){if(e.options.cleanHTML.cleanOnPaste&&e.events.on("processPaste",function(e,t){return s.cleanFromWord(t)}),e.options.cleanHTML.allowTags){var t=/([^\[]*)\[([^\]]+)]/,o=/[\s]*,[\s]*/,i=/^(.*)[\s]*=[\s]*(.*)$/,n={};"string"==typeof e.options.cleanHTML.allowTags?e.options.cleanHTML.allowTags.split(o).map(function(e){e=s.trim(e);var r=t.exec(e),a={},l=function(e){e=s.trim(e);var t=i.exec(e);t?a[t[1]]=t[2]:a[e]=!0};if(r){var d=r[2].split(o);r[1]&&(d.map(l),n[r[1].toUpperCase()]=a)}else n[e.toUpperCase()]=!0}):n=e.options.cleanHTML.allowTags,e.events.on("beforeSetElementValue",function(t){if(e.getRealMode()===r.MODE_WYSIWYG){var o=a.Dom.create("div","",e.editorDocument),i=null,s=[],l=void 0,d=0;for(o.innerHTML=t.value,o.firstChild&&(i=o.firstChild);i;){if(i&&i.nodeName)if(n[i.nodeName]){if(!0!==n[i.nodeName]&&i.attributes&&i.attributes.length){for(l=[],d=0;i.attributes.length>d;d+=1)(!n[i.nodeName][i.attributes[d].name]||!0!==n[i.nodeName][i.attributes[d].name]&&n[i.nodeName][i.attributes[d].name]!==i.attributes[d].value)&&l.push(i.attributes[d].name);for(d=0;l.length>=d;d+=1)i.removeAttribute(l[d])}}else s.push(i);i=a.Dom.next(i,function(e){return!!e},o,!0)}var c;for(d=0;s.length>d;d+=1)c=s[d].parentNode,s[d]&&c&&c.removeChild(s[d]);t.value=o.innerHTML}})}e.events.on("afterCommand",function(t){var o,i,n=e.selection;switch(t.toLowerCase()){case"inserthorizontalrule":(o=e.editor.querySelector("hr[id=null]"))&&(i=a.Dom.next(o,a.Dom.isBlock,e.editor,!1),i||(i=a.Dom.create(e.options.enter,"",e.editorDocument))&&a.Dom.after(o,i),n.setCursorIn(i));break;case"removeformat":i=n.current();var l=function(t){switch(t.nodeType){case Node.ELEMENT_NODE:a.Dom.each(t,l),"FONT"===t.nodeName?a.Dom.unwrap(t):([].slice.call(t.attributes).forEach(function(e){-1===["src","href","rel","content"].indexOf(e.name.toLowerCase())&&t.removeAttribute(e.name)}),s.normalizeNode(t));break;case Node.TEXT_NODE:e.options.cleanHTML.replaceNBSP&&t.nodeType===Node.TEXT_NODE&&null!==t.nodeValue&&t.nodeValue.match(r.SPACE_REG_EXP)&&(t.nodeValue=t.nodeValue.replace(r.SPACE_REG_EXP," "));break;default:t.parentNode&&t.parentNode.removeChild(t)}};if(n.isCollapsed())for(;i&&i.nodeType!==Node.ELEMENT_NODE&&i!==e.editor;)l(i),i&&(i=i.parentNode);else e.selection.eachSelection(function(e){l(e)})}})}t.__esModule=!0;var n=o(1),r=o(2),s=o(0),a=o(3);n.Config.prototype.cleanHTML={replaceNBSP:!0,cleanOnPaste:!0,allowTags:!1},n.Config.prototype.controls.eraser={command:"removeFormat",tooltip:"Clear Formatting"},t.cleanHTML=i},function(e,t,o){"use strict";function i(e){var t=function(t,o,i){var r=n.normalizeColor(i);switch(t){case"background":e.selection.applyCSS({backgroundColor:r||""});break;case"forecolor":e.selection.applyCSS({color:r||""})}return e.setEditorValue(),!1};e.registerCommand("forecolor",t),e.registerCommand("background",t)}t.__esModule=!0;var n=o(0),r=o(1),s=o(9),a=s.Widget.TabsWidget,l=s.Widget.ColorPickerWidget,d=o(3);r.Config.prototype.controls.brush={isActive:function(e,t,o){var i=e.selection.current(),r=o.btn.querySelector("svg");if(i){var s=d.Dom.closest(i,function(t){return d.Dom.isBlock(t)||d.Dom.isNode(t,e.editorWindow)&&t.nodeType===Node.ELEMENT_NODE},e.editor)||e.editor,a=""+n.css(s,"color"),l=""+n.css(s,"background-color");if(a!==""+n.css(e.editor,"color"))return r&&(r.style.fill=a),!0;if(l!==""+n.css(e.editor,"background-color"))return r&&(r.style.fill=l),!0}return r&&r.style.fill&&(r.style.fill=null),!1},popup:function(e,t,o,i){var r,s="",c="",u=null;t&&d.Dom.isNode(t,e.editorWindow)&&t.nodeType===Node.ELEMENT_NODE&&(s=""+n.css(t,"color"),c=""+n.css(t,"background-color"),u=t);var p=l(e,function(t){u?u.style.backgroundColor=t:e.execCommand("background",!1,t),i()},c),f=l(e,function(t){u?u.style.color=t:e.execCommand("forecolor",!1,t),i()},s);return r="background"===e.options.colorPickerDefaultTab?{Background:p,Text:f}:{Text:f,Background:p},a(e,r,u)},tooltip:"Fill color or set the text color"},t.color=i},function(e,t,o){"use strict";function i(e){e.buffer[a]={active:!1,format:{}},e.events.on("mouseup",function(){e.buffer[a].active&&(e.buffer[a].active=!1,e.selection.applyCSS(e.buffer[a].format))})}t.__esModule=!0;var n=o(1),r=o(3),s=o(0),a="copyformat",l=function(e,t){var o=r.Dom.up(t,function(e){return e&&e.nodeType!==Node.TEXT_NODE},e.editor)||e.editor;if(o)return{fontSize:s.css(o,"fontSize"),fontWeight:s.css(o,"fontWeight"),fontStyle:s.css(o,"fontStyle"),color:s.css(o,"color"),backgroundColor:s.css(o,"backgroundColor")}};n.Config.prototype.controls.copyformat={exec:function(e,t){t&&(e.buffer[a].active?e.buffer[a].active=!1:(e.buffer[a].format=l(e,t))&&(e.buffer[a].active=!0))},isActive:function(e){return void 0!==e.buffer[a]&&e.buffer[a].active},tooltip:"Paint format"},t.copyformat=i},function(e,t,o){"use strict";function i(e){e.events.on("keyup",function(){if(!e.options.readonly){var t=e.selection.current();if(!1!==t){var o=s.Dom.up(t,function(t){return t.tagName===e.options.enter.toUpperCase()},e.editor);o&&s.Dom.all(o,function(o){o.nodeType===Node.TEXT_NODE&&o.nodeValue&&r.INVISIBLE_SPACE_REG_EXP.test(o.nodeValue)&&0!==o.nodeValue.replace(r.INVISIBLE_SPACE_REG_EXP,"").length&&(o.nodeValue=o.nodeValue.replace(r.INVISIBLE_SPACE_REG_EXP,""),o===t&&e.selection.setCursorAfter(o))})}}}),e.events.on("keydown",function(o){if(o.which===r.KEY_ENTER||o.keyCode===r.KEY_ENTER){e.selection.isCollapsed()||e.execCommand("Delete"),e.selection.focus();var i=e.selection.current(),a=e.editorWindow.getSelection(),l=a.rangeCount?a.getRangeAt(0):e.editorDocument.createRange();i&&i!==e.editor||(i=s.Dom.create("text",r.INVISIBLE_SPACE,e.editorDocument),a.rangeCount?l.insertNode(i):e.editor.appendChild(i),l.selectNode(i),l.collapse(!1),a.removeAllRanges(),a.addRange(l));var d=void 0,c=!!i&&s.Dom.up(i,s.Dom.isBlock,e.editor);if(e.options.enter===r.BR||o.shiftKey||s.Dom.closest(i,"PRE|BLOCKQUOTE",e.editor)){var u=s.Dom.create("br",void 0,e.editorDocument);return e.selection.insertNode(u),u.scrollIntoView(),!1}if(c||!i||s.Dom.prev(i,function(t){return s.Dom.isBlock(t)||!!t&&s.Dom.isImage(t,e.ownerWindow)},e.editor)||(c=s.Dom.wrap(i,e.options.enter,e),l=a.rangeCount?a.getRangeAt(0):e.editorDocument.createRange()),c){if(!s.Dom.canSplitBlock(c,e.editorWindow)){var u=e.editorDocument.createElement("br");return e.selection.insertNode(u,!1),e.selection.setCursorAfter(u),!1}if("LI"===c.nodeName&&s.Dom.isEmpty(c)){var p=s.Dom.closest(c,"ol|ul",e.editor);if(s.Dom.prev(c,function(e){return e&&"LI"===e.nodeName},p))if(s.Dom.next(c,function(e){return e&&"LI"===e.nodeName},p)){var f=e.editorDocument.createRange();f.setStartBefore(p),f.setEndAfter(c);var h=f.extractContents();p.parentNode&&p.parentNode.insertBefore(h,p),d=e.selection.setCursorBefore(p)}else d=e.selection.setCursorAfter(p);else d=e.selection.setCursorBefore(p);return c.parentNode&&c.parentNode.removeChild(c),t.insertParagraph(e,d),!n.$$("li",p).length&&p.parentNode&&p.parentNode.removeChild(p),!1}if(e.selection.cursorInTheEdge(!0,c))d=e.selection.setCursorBefore(c),t.insertParagraph(e,d,"LI"===c.nodeName?"li":e.options.enter),e.selection.setCursorIn(c,!0);else if(e.selection.cursorInTheEdge(!1,c))d=e.selection.setCursorAfter(c),t.insertParagraph(e,d,"LI"===c.nodeName?"li":e.options.enter);else{var f=e.editorDocument.createRange();f.setStartBefore(c),f.setEnd(l.startContainer,l.startOffset);var h=f.extractContents();c.parentNode&&c.parentNode.insertBefore(h,c),e.selection.setCursorIn(c,!0)}}else t.insertParagraph(e);return!1}})}t.__esModule=!0;var n=o(0),r=o(2),s=o(3);t.insertParagraph=function(e,t,o){o||(o=e.options.enter);var i=e.editorDocument.createElement(o);return i.appendChild(e.editorDocument.createTextNode(r.INVISIBLE_SPACE)),e.selection.insertNode(i,!1),e.selection.setCursorIn(i),t&&t.parentNode&&t.parentNode.removeChild(t),i.scrollIntoView(),i},t.enter=i},function(e,t,o){"use strict";function i(e){if(e.options.showMessageErrors){var t,o=r.dom('
    ',e.ownerDocument),i=function(){t=5,[].slice.call(o.childNodes).forEach(function(i){r.css(o,"bottom",t+"px"),t+=i.offsetWidth+e.options.showMessageErrorOffsetPx})};e.workplace.appendChild(o),e.events.on("errorMessage",function(t,n,s){var a=r.dom('
    '+t+"
    ",e.ownerDocument);o.appendChild(a),i(),setTimeout(function(){a.classList.remove("active"),setTimeout(function(){o.removeChild(a),i()},300)},s||e.options.showMessageErrorTime)})}}t.__esModule=!0;var n=o(1),r=o(0);n.Config.prototype.showMessageErrors=!0,n.Config.prototype.showMessageErrorTime=3e3,n.Config.prototype.showMessageErrorOffsetPx=3,t.errorMessages=i},function(e,t,o){"use strict";function i(e){var t=function(t,o,i){switch(t){case"fontsize":e.selection.applyCSS({fontSize:n.normalizeSize(i)});break;case"fontname":e.selection.applyCSS({fontFamily:i})}return e.setEditorValue(),!1};e.registerCommand("fontsize",t),e.registerCommand("fontname",t)}t.__esModule=!0;var n=o(0),r=o(1),s=o(3);r.Config.prototype.controls.fontsize={command:"fontSize",list:["8","9","10","11","12","14","18","24","30","36","48","60","72","96"],template:function(e,t,o){return o},tooltip:"Font size",isActive:function(e){var t=e.selection.current();if(t){var o=s.Dom.closest(t,function(t){return s.Dom.isBlock(t)||s.Dom.isNode(t,e.editorWindow)&&t.nodeType===Node.ELEMENT_NODE},e.editor)||e.editor;return""+n.css(o,"font-size")!=""+n.css(e.editor,"font-size")}return!1}},r.Config.prototype.controls.font={command:"fontname",exec:function(e,t,o){e.execCommand(o.command,!1,o.args?o.args[0]:void 0)},list:{"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"},template:function(e,t,o){return''+o+""},tooltip:"Font family"},t.font=i},function(e,t,o){"use strict";function i(e){e.registerCommand("formatblock",function(t,o,i){e.selection.focus();var s=!1;if(e.selection.eachSelection(function(t){var o=e.selection.save(),r=!!t&&n.Dom.up(t,n.Dom.isBlock,e.editor);if(!r&&t&&(r=n.Dom.wrap(t,e.options.enter,e)),!r)return e.selection.restore(o),!1;r.tagName.match(/TD|TH|TBODY|TABLE|THEAD/i)?e.selection.isCollapsed()?n.Dom.wrap(t,i,e):e.selection.applyCSS({},i):n.Dom.replace(r,i,!0,!1,e.editorDocument),s=!0,e.selection.restore(o)}),!s){var a=n.Dom.create(i,r.INVISIBLE_SPACE,e.editorDocument);e.selection.insertNode(a,!1),e.selection.setCursorIn(a)}return e.setEditorValue(),!1})}t.__esModule=!0;var n=o(3),r=o(2);o(1).Config.prototype.controls.paragraph={command:"formatBlock",getLabel:function(e,t,o){var i=e.selection.current();if(i&&e.options.textIcons){var r=n.Dom.closest(i,n.Dom.isBlock,e.editor)||e.editor,s=r.nodeName.toLowerCase();t.data&&t.data.currentValue!==s&&t.list&&t.list[s]&&(o.container.innerHTML=""+t.list[s]+"",o.container.firstChild.classList.add("jodit_icon"),t.data.currentValue=s)}return!1},exec:function(e,t,o){e.execCommand(o.command,!1,o.args?o.args[0]:void 0)},data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote",pre:"Code"},template:function(e,t,o){return"<"+t+' class="jodit_list_element">'+e.i18n(o)+""},tooltip:"Insert format block"},t.formatBlock=i},function(e,t,o){"use strict";function i(e){var t=!1,o=0,i=0,n=!1,a=function(){e.events&&(t?(o=r.css(e.container,"height"),i=r.css(e.container,"width"),r.css(e.container,{height:e.ownerWindow.innerHeight,width:e.ownerWindow.innerWidth}),n=!0):n&&r.css(e.container,{height:o||"auto",width:i||"auto"}))},l=function(o){if(void 0===o&&(o=!e.container.classList.contains("jodit_fullsize")),t=o,e.container.classList.toggle("jodit_fullsize",o),e.toolbar){r.css(e.toolbar.container,"width","auto");var i=r.dom(s.Toolbar.getIcon(o?"shrink":"fullsize"),e.ownerDocument),n=e.toolbar.container.querySelector(".jodit_toolbar_btn-fullsize a");n&&(i.classList.add("jodit_icon"),n.innerHTML="",n.appendChild(i))}if(e.options.globalFullsize){for(var l=e.container.parentNode;l&&!(l instanceof Document);)l.classList.toggle("jodit_fullsize_box",o),l=l.parentNode;a()}e.events.fire("afterResize")};e.options.fullsize&&e.events.on("afterInit",function(){l(!0)}),e.options.globalFullsize&&e.events.on(e.ownerWindow,"resize",a),e.events.on("toggleFullsize",l),e.events.on("beforeDestruct",function(){l(!1)})}t.__esModule=!0;var n=o(1),r=o(0),s=o(5),a=o(2);n.Config.prototype.fullsize=!1,n.Config.prototype.globalFullsize=!0,n.Config.prototype.controls.fullsize={exec:function(e){e.events.fire("toggleFullsize")},tooltip:"Open editor in fullsize",mode:a.MODE_SOURCE+a.MODE_WYSIWYG},t.fullsize=i},function(e,t,o){"use strict";function i(e){e.events.on("generateDocumentStructure.iframe",function(t){if(t.open(),t.write('\n \n \n '+(e.options.iframeBaseUrl?'':"")+'\n \n \n '),t.close(),e.options.iframeCSSLinks&&e.options.iframeCSSLinks.forEach(function(e){var o=r.dom('',t);t.head.appendChild(o)}),e.options.iframeStyle){var o=t.createElement("style");o.innerHTML=e.options.iframeStyle,t.head.appendChild(o)}}).on("createEditor",function(){if(e.options.iframe){e.iframe=e.ownerDocument.createElement("iframe"),e.iframe.style.display="block",e.iframe.src="about:blank",e.iframe.className="jodit_wysiwyg_iframe",e.iframe.frameBorder="0",e.iframe.setAttribute("allowtransparency","true"),e.iframe.setAttribute("tabindex","0"),e.iframe.setAttribute("frameborder","0"),e.workplace.appendChild(e.iframe);var t=e.iframe.contentWindow.document;if(e.events.fire("generateDocumentStructure.iframe",t),e.editorDocument=t,e.editorWindow=e.iframe.contentWindow,e.editor=t.body,"auto"===e.options.height){t.documentElement.style.overflowY="hidden";var o=function(){e.editor&&r.css(e.iframe,"height",e.editor.offsetHeight)};e.events.on("change afterInit afterSetMode resize",o).on([e.iframe,e.editorWindow,t.documentElement],"load",o).on(t,"readystatechange DOMContentLoaded",o)}return r.css(e.editor,"minHeight",e.options.minHeight),function(e){e.matches||(e.matches=Element.prototype.matches)}(e.editorWindow.Element.prototype),e.events.on(e.editorWindow,"mousedown click mouseup mousemove scroll",function(t){e.events&&e.events.fire&&e.events.fire(window,t)}),!1}})}t.__esModule=!0;var n=o(1),r=o(0);n.Config.prototype.iframe=!1,n.Config.prototype.iframeBaseUrl=!1,n.Config.prototype.iframeStyle='html{margin: 0px;}body{padding:10px;background:transparent;color:#000;position:relative;z-index: 2;user-select:auto;margin:0px;overflow:auto;}body:after{content:"";clear:both;display:block}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}td[data-jodit-selected-cell],th[data-jodit-selected-cell]{border: 1px double #1e88e5}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.Config.prototype.iframeCSSLinks=[],t.iframe=i},function(e,t,o){"use strict";function i(e){var t=function(t){return e.selection.eachSelection(function(o){var i=e.selection.save(),n=!!o&&r.Dom.up(o,r.Dom.isBlock,e.editor);if(!n&&o&&(n=r.Dom.wrap(o,e.options.enter,e)),!n)return e.selection.restore(i),!1;if(n&&n.style){var s=n.style.marginLeft?parseInt(n.style.marginLeft,10):0;s+=e.options.indentMargin*("outdent"===t?-1:1),n.style.marginLeft=s>0?s+"px":"",n.getAttribute("style")||n.removeAttribute("style")}e.selection.restore(i)}),e.setEditorValue(),!1};e.registerCommand("indent",{exec:t,hotkeys:"ctrl+]"}),e.registerCommand("outdent",{exec:t,hotkeys:"ctrl+["})}t.__esModule=!0;var n=o(1),r=o(3);n.Config.prototype.controls.indent={tooltip:"Increase Indent"},n.Config.prototype.controls.outdent={isDisable:function(e,t,o){var i=e.selection.current();if(i){var n=r.Dom.closest(i,r.Dom.isBlock,e.editor);if(n&&n.style&&n.style.marginLeft)return 0>=parseInt(n.style.marginLeft,10)}return!0},tooltip:"Decrease Indent"},n.Config.prototype.indentMargin=10,t.indent=i},function(e,t,o){"use strict";function i(e){e.events.on("click",function(e){})}t.__esModule=!0,t.imageInlineToolbar=i},function(e,t,o){"use strict";function i(e){var t,o=function(o){e.events.off(o,".imageProcessor").on(o,"dragstart.imageProcessor",function(e){t=o,e.preventDefault()}).on(o,"mousedown.imageProcessor",function(){t=o})};e.events.on("afterInit",function(){e.events.on(e.editor,"mousemove",n.throttle(function(o){t&&e.selection.insertCursorAtPoint(o.clientX,o.clientY)},e.options.observer.timeout)).on(window,"mouseup",function(){t=!1}).on(e.editor,"mouseup",function(o){var i,n=t;if(n&&o.target!==n){if(!1===e.selection.insertCursorAtPoint(o.clientX,o.clientY))return!1;i=!n.parentNode||"A"!==n.parentNode.tagName||n.parentNode.textContent&&n.parentNode.textContent.length?n:n.parentNode,i.parentNode&&i.parentNode.removeChild(i),i&&e.selection.insertImage(i),e.selection.select(i)}})}),e.events.on("change afterInit",n.debounce(function(){e.editor&&n.$$("img",e.editor).forEach(function(t){t[r]||(t[r]=!0,o(t),t.complete||t.addEventListener("load",function o(){e.events&&e.events.fire&&e.events.fire("resize"),t.removeEventListener("load",o)}))})},e.options.observer.timeout))}t.__esModule=!0;var n=o(0),r="__jodit_imageprocessor_binded";t.imageProcessor=i},function(e,t,o){"use strict";function i(e){var t=function(t){if(!e.options.readonly){var o,i=this,r=new a.Dialog(e),c=s.dom(''+l.Toolbar.getIcon("cancel")+""+e.i18n("Cancel")+"",e.ownerDocument),f=s.dom(''+l.Toolbar.getIcon("check")+""+e.i18n("Ok")+"",e.ownerDocument),h={remove:s.dom(''+l.Toolbar.getIcon("bin")+" "+e.i18n("Delete")+"",e.ownerDocument)},m=s.dom('
    ',e.ownerDocument),v=s.dom('
    ",e.ownerDocument),g=s.dom('
    '+(e.options.filebrowser.ajax.url||e.options.uploader.url?'
    '+(e.options.filebrowser.ajax.url||e.options.uploader.url?''+l.Toolbar.getIcon("image")+"":"")+(e.options.image.useImageEditor&&void 0!==n.Jodit.modules.ImageEditor&&e.options.filebrowser.ajax.url?''+l.Toolbar.getIcon("crop")+"":"")+"
    ":"")+'
    '+e.i18n("Open link in new tab")+"
    ",e.ownerDocument),_=i.naturalWidth/i.naturalHeight||1,b=m.querySelector("#imageWidth"),y=m.querySelector("#imageHeight"),w=function(){i.style.cssFloat&&-1!==["left","right"].indexOf(i.style.cssFloat.toLowerCase())?s.val(m,"#align",s.css(i,"float")):"block"===s.css(i,"display")&&"auto"===i.style.marginLeft&&"auto"===i.style.marginRight&&s.val(m,"#align","center")},C=function(){s.val(m,"#id",i.getAttribute("id")||"")},j=function(){s.val(m,"#style",i.getAttribute("style")||"")},x=function(){s.val(m,"#classes",(i.getAttribute("class")||"").replace(/jodit_focused_image[\s]*/,""))},q=function(){if(e.options.image.editMargins){var t=!1;s.$$(".margins",m).forEach(function(e){var o=i.style[e.id];o&&(/^[0-9]+(px)?$/.test(o)&&(o=parseInt(o,10)),e.value=""+o||"",t||"marginTop"===e.id||e.value===s.val(m,"#marginTop")||(t=!0))}),L=!t;var o=m.querySelector(".jodit_lock_margin");o&&(o.innerHTML=l.Toolbar.getIcon(L?"lock":"unlock")),s.$$(".margins:not(#marginTop)",m).forEach(function(e){return L?e.setAttribute("disabled","true"):e.removeAttribute("disabled")})}},E=function(){b.value=""+i.offsetWidth,y.value=""+i.offsetHeight},T=function(){i.hasAttribute("title")&&s.val(m,"#imageTitle",i.getAttribute("title")||""),i.hasAttribute("alt")&&s.val(m,"#imageAlt",i.getAttribute("alt")||"");var t=d.Dom.closest(i,"a",e.editor);t&&(s.val(m,"#imageLink",t.getAttribute("href")||""),m.querySelector("#imageLinkOpenInNewTab").checked="_blank"===t.getAttribute("target"))},D=function(){s.val(m,"#imageSrc",i.getAttribute("src")||"");var e=m.querySelector("#imageViewSrc");e&&e.setAttribute("src",i.getAttribute("src")||"")},S=function(){D(),T(),E(),q(),x(),C(),w(),j()},k=!0,L=!0,I={},M=m.querySelector("#tabsbox");I[e.i18n("Image")]=g,I[e.i18n("Advansed")]=v,M&&M.appendChild(u(e,I)),S(),e.events.on(r,"afterClose",function(){r.destruct(),i.parentNode&&e.options.image.selectImageAfterClose&&e.selection.select(i)}),h.remove.addEventListener("click",function(){i.parentNode&&i.parentNode.removeChild(i),r.close()}),e.options.image.useImageEditor&&s.$$(".jodit_use_image_editor",g).forEach(function(t){e.events.on(t,"mousedown touchstart",function(){var t=i.getAttribute("src")||"",o=e.ownerDocument.createElement("a"),n=function(){if(o.host!==location.host)return void a.Confirm(e.i18n("You can only edit your own images. Download this image on the host?"),function(t){t&&e.uploader&&e.uploader.uploadRemoteImage(""+o.href,function(t){a.Alert(e.i18n("The image has been successfully uploaded to the host!"),function(){"string"==typeof t.newfilename&&(i.setAttribute("src",t.baseurl+t.newfilename),D())})},function(t){a.Alert(e.i18n("There was an error loading %s",t.message))})})};o.href=t,e.getInstance("FileBrowser").getPathByUrl(""+o.href,function(n,r,s){e.getInstance("FileBrowser").openImageEditor(o.href,r,n,s,function(){var e=(new Date).getTime();i.setAttribute("src",t+(-1!==t.indexOf("?")?"":"?")+"&_tmp="+e),D()},function(e){a.Alert(e.message)})},function(e){a.Alert(e.message,n)})})}),s.$$(".jodit_rechange",g).forEach(function(t){t.addEventListener("mousedown",function(o){t.classList.toggle("active"),e.toolbar.openPopup(t,p(e,{upload:function(t){t.files&&t.files.length&&i.setAttribute("src",t.baseurl+t.files[0]),S(),e.toolbar.closeAll()},filebrowser:function(t){t&&t.files&&Array.isArray(t.files)&&t.files.length&&(i.setAttribute("src",t.files[0]),e.toolbar.closeAll(),S())}},i,e.toolbar.closeAll),!0),o.stopPropagation()})});var A=m.querySelector(".jodit_lock_helper.jodit_lock_size"),N=m.querySelector(".jodit_lock_helper.jodit_lock_margin");return A&&A.addEventListener("click",function(){k=!k,this.innerHTML=l.Toolbar.getIcon(k?"lock":"unlock"),e.events.fire(b,"change")}),N&&N.addEventListener("click",function(){L=!L,this.innerHTML=l.Toolbar.getIcon(L?"lock":"unlock"),L?s.$$(".margins",m).forEach(function(e){e.matches("#marginTop")||e.setAttribute("disabled","true")}):s.$$(".margins",m).forEach(function(e){e.matches("#marginTop")||e.removeAttribute("disabled")})}),e.events.on(s.$$("#imageWidth,#imageHeight",m),"change keydown mousedown paste",function(e){k&&(clearTimeout(o),o=window.setTimeout(function(){var t=parseInt(b.value,10),o=parseInt(y.value,10);"imageWidth"===e.target.getAttribute("id")?y.value=""+Math.round(t/_):b.value=""+Math.round(o*_)},100))}),r.setTitle([e.i18n("Image properties"),h.remove]),r.setContent(m),c.addEventListener("click",function(){r.close()}),f.addEventListener("click",function(){if(e.options.image.editStyle&&(s.val(m,"#style")?i.setAttribute("style",s.val(m,"#style")):i.removeAttribute("style")),!s.val(m,"#imageSrc"))return i.parentNode&&i.parentNode.removeChild(i),void r.close();i.setAttribute("src",s.val(m,"#imageSrc")),s.val(m,"#imageTitle")?i.setAttribute("title",s.val(m,"#imageTitle")):i.removeAttribute("title"),s.val(m,"#imageAlt")?i.setAttribute("alt",s.val(m,"#imageAlt")):i.removeAttribute("alt");var t=d.Dom.closest(i,"a",e.editor);s.val(m,"#imageLink")?(t||(t=d.Dom.wrap(i,"a",e)),t.setAttribute("href",s.val(m,"#imageLink")),m.querySelector("#imageLinkOpenInNewTab").checked?t.setAttribute("target","_blank"):t.removeAttribute("target")):t&&t.parentNode&&t.parentNode.replaceChild(i,t);var o=function(e){return e=s.trim(e),/^[0-9]+$/.test(e)?e+"px":e};s.css(i,{width:s.trim(b.value)?o(b.value):null,height:s.trim(y.value)?o(y.value):null}),e.options.image.editMargins&&(L?s.css(i,"margin",o(s.val(m,"#marginTop"))):s.$$(".margins",m).forEach(function(e){s.css(i,e.id,o(e.value))})),e.options.image.editClass&&(s.val(m,"#classes")?i.setAttribute("class",s.val(m,"#classes")):i.removeAttribute("class")),e.options.image.editId&&(s.val(m,"#id")?i.setAttribute("id",s.val(m,"#id")):i.removeAttribute("id"));var n=function(){"block"===s.css(i,"display")&&s.css(i,"display",""),"auto"===i.style.marginLeft&&"auto"===i.style.marginRight&&(i.style.marginLeft="",i.style.marginRight="")};e.options.image.editAlign&&(s.val(m,"#align")?-1!==["right","left"].indexOf(s.val(m,"#align").toLowerCase())?(s.css(i,"float",s.val(m,"#align")),n()):(s.css(i,"float",""),s.css(i,{display:"block","margin-left":"auto","margin-right":"auto"})):(s.css(i,"float")&&-1!==["right","left"].indexOf((""+s.css(i,"float")).toLowerCase())&&s.css(i,"float",""),n())),i.getAttribute("style")||i.removeAttribute("style"),e.setEditorValue(),r.close()}),r.setFooter([f,c]),r.setSize(500),r.open(),t&&t.preventDefault(),!1}};e.events.on("afterInit",function(){e.options.image.openOnDblClick?e.events.on(e.editor,"dblclick",t,"img"):e.events.on(e.editor,"dblclick",function(){e.selection.select(this)},"img")}).on("openImageProperties",function(e){t.call(e)})}t.__esModule=!0;var n=o(6),r=o(1),s=o(0),a=o(7),l=o(5),d=o(3),c=o(9),u=c.Widget.TabsWidget,p=c.Widget.ImageSelectorWidget;r.Config.prototype.image={openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0},t.imageProperties=i},function(e,t,o){"use strict";function i(e){var t,o=new n.Toolbar(e),i=s.dom('
    ',e.ownerDocument),r=function(t){e.container&&e.container.classList&&e.container.classList.toggle("jodit_popup_active",t)},l=function(){i.classList&&i.classList.remove("active"),r(!1)},d=function(t,n,a){var l=t.tagName.toLowerCase();void 0!==e.options.popup[l]&&(i.innerHTML='',o.build(e.options.popup[l],i,t),i.classList.add("active"),s.css(i,{left:n+"px",top:a+"px"}),i.style.marginLeft=-Math.round(i.offsetWidth/2)+"px",r(!0),e.events.fire("afterOpenPopup",i,e.container))},c=function(o,i,n){e.options.readonly||(clearTimeout(t),e.options.observer.timeout?t=setTimeout(d.bind(e,o,i,n),e.options.observer.timeout):d(o,i,n))};e.events.on("hidePopup afterCommand keydown resize",l).on("showPopap",c).on("afterInit",function(){e.editorDocument.body.appendChild(i);var t=!1;e.events.on([e.ownerWindow,e.editor],"scroll",l).on(i,"mousedown",function(e){e.stopPropagation()}).on(e.editor,"mousedown",function(o){if("IMG"===o.target.tagName||a.Dom.closest(o.target,"table|a",e.editor)){var i="IMG"===o.target.tagName?o.target:a.Dom.closest(o.target,"table|a",e.editor),n=s.offset(i,e);c(i,Math.round(n.left+i.offsetWidth/2),Math.round(n.top+i.offsetHeight)),t=!0}else t=!1}).on(e.ownerWindow,"mousedown",function(){t||l(),t=!1})}).on("beforeDestruct",function(){i.parentNode&&i.parentNode.removeChild(i),clearTimeout(t)})}t.__esModule=!0;var n=o(5),r=o(1),s=o(0),a=o(3),l=o(15),d=o(9),c=d.Widget.ColorPickerWidget,u=d.Widget.TabsWidget;r.Config.prototype.popup={a:[{name:"eye",tooltip:"Open link",exec:function(e,t){var o=t.getAttribute("href");t&&o&&e.ownerWindow.open(o)}},{name:"link",tooltip:"Edit link",icon:"pencil"},"unlink","brush"],img:[{name:"bin",tooltip:"Delete",exec:function(e,t){t.parentNode&&t.parentNode.removeChild(t)}},{name:"pencil",exec:function(e,t){"img"===t.tagName.toLowerCase()&&e.events.fire("openImageProperties",t)},tooltip:"Edit"},{name:"valign",list:["Top","Middle","Bottom"],tooltip:"Vertical align",exec:function(e,t,o){if("img"===t.tagName.toLowerCase()){var i=o.args&&"string"==typeof o.args[1]?o.args[1].toLowerCase():"";s.css(t,"vertical-align",i)}}},{name:"left",list:["Left","Right","Center","Normal"],exec:function(e,t,o){if("img"===t.tagName.toLowerCase()){var i=function(){"block"===s.css(t,"display")&&s.css(t,"display",""),"auto"===t.style.marginLeft&&"auto"===t.style.marginRight&&(t.style.marginLeft="",t.style.marginRight="")},n=o.args&&"string"==typeof o.args[1]?o.args[1].toLowerCase():"";"normal"!==n?-1!==["right","left"].indexOf(n)?(s.css(t,"float",n),i()):(s.css(t,"float",""),s.css(t,{display:"block","margin-left":"auto","margin-right":"auto"})):(s.css(t,"float")&&-1!==["right","left"].indexOf(s.css(t,"float").toLowerCase())&&s.css(t,"float",""),i())}},tooltip:"Horizontal align"}],table:[{name:"brush",popup:function(e,t,o,i){var n,r,a,d,p,f,h=l.Table.getAllSelectedCells(t);return!!h.length&&(d=s.css(h[0],"color"),f=s.css(h[0],"background-color"),p=s.css(h[0],"border-color"),n=c(e,function(e){h.forEach(function(t){s.css(t,"background-color",e)}),i()},f),r=c(e,function(e){h.forEach(function(t){s.css(t,"color",e)}),i()},d),a=c(e,function(e){h.forEach(function(t){s.css(t,"border-color",e)}),i()},p),u(e,{Background:n,Text:r,Border:a}))},tooltip:"Background"},{name:"valign",list:["Top","Middle","Bottom"],exec:function(e,t,o){var i=o.args&&"string"==typeof o.args[1]?o.args[1].toLowerCase():"";l.Table.getAllSelectedCells(t).forEach(function(e){s.css(e,"vertical-align",i)})},tooltip:"Vertical align"},{name:"splitv",command:"tablesplitv",tooltip:"Split vertical"},{name:"splitg",command:"tablesplitg",tooltip:"Split horizontal"},"\n",{name:"merge",command:"tablemerge",tooltip:"Merge"},{name:"addcolumn",list:{tableaddcolumnbefore:"Insert column before",tableaddcolumnafter:"Insert column after"},exec:function(e,t,o){e.execCommand(o.args&&"string"==typeof o.args[0]?o.args[0].toLowerCase():"",!1,t)},tooltip:"Add column"},{name:"addrow",list:{tableaddrowbefore:"Insert row above",tableaddrowafter:"Insert row below"},exec:function(e,t,o){e.execCommand(o.args&&"string"==typeof o.args[0]?o.args[0].toLowerCase():"",!1,t)},tooltip:"Add row"},{name:"bin",list:{tablebin:"Delete table",tablebinrow:"Delete row",tablebincolumn:"Delete column",tableempty:"Empty cell"},exec:function(e,t,o){e.execCommand(o.args&&"string"==typeof o.args[0]?o.args[0].toLowerCase():"",!1,t)},tooltip:"Delete"}]},t.inlinePopup=i},function(e,t,o){"use strict";function i(e){var t=function(t){var o=function(o){if(o instanceof e.editorWindow.HTMLElement)switch(t.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"}};return e.selection.focus(),e.selection.eachSelection(function(t){if(!t&&e.editor.querySelector(".jodit_selected_cell"))return n.$$(".jodit_selected_cell",e.editor).forEach(o),!1;if(t instanceof e.editorWindow.Node){var i=!!t&&r.Dom.up(t,r.Dom.isBlock,e.editor);!i&&t&&(i=r.Dom.wrap(t,e.options.enter,e)),o(i)}}),!1};e.registerCommand("justifyfull",t),e.registerCommand("justifyright",t),e.registerCommand("justifyleft",t),e.registerCommand("justifycenter",t)}t.__esModule=!0;var n=o(0),r=o(3),s=o(1),a=o(5);s.Config.prototype.controls.align={name:"left",tooltip:"Align",getLabel:function(e,t,o){var i=e.selection.current();if(i){var s=r.Dom.closest(i,r.Dom.isBlock,e.editor)||e.editor,l=""+n.css(s,"text-align");t.data&&t.data.currentValue!==l&&t.list&&-1!==t.list.indexOf(l)&&(o.container.innerHTML=e.options.textIcons?""+l+"":a.Toolbar.getIcon(l,""),o.container.firstChild.classList.add("jodit_icon"),t.data.currentValue=l)}return!1},isActive:function(e,t){var o=e.selection.current();if(o&&t.defaultValue){var i=r.Dom.closest(o,r.Dom.isBlock,e.editor)||e.editor;return-1===t.defaultValue.indexOf(""+n.css(i,"text-align"))}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},s.Config.prototype.controls.center={command:"justifyCenter",tags:["center"],css:{"text-align":"center"},tooltip:"Align Center"},s.Config.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},s.Config.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},s.Config.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"},t.justify=i},function(e,t,o){"use strict";function i(e){e.options.link.followOnDblClick&&e.events.on("afterInit",function(){e.events.on(e.editor,"dblclick",function(e){var t=this.getAttribute("href");t&&(location.href=t,e.preventDefault())},"a")}),e.options.link.processPastedLink&&e.events.on("processPaste",function(t,o){if(r.isURL(o)){var i=r.convertMediaURLToVideoEmbed(o);if(i!==o)return r.dom(i,e.editorDocument);var n=e.editorDocument.createElement("a");return n.setAttribute("href",o),n.innerText=o,e.options.link.openLinkDialogAfterPost&&setTimeout(function(){},100),n}}),e.options.link.removeLinkAfterFormat&&e.events.on("afterCommand",function(t){var o,i,n=e.selection;"removeFormat"===t&&(i=n.current(),i&&"A"!==i.nodeName&&(i=s.Dom.closest(i,"A",e.editor)),i&&"A"===i.nodeName&&(o=i.innerHTML===i.innerText?s.Dom.create("text",i.innerText,e.editorDocument):s.Dom.create("span",i.innerHTML,e.editorDocument),i.parentNode&&(i.parentNode.replaceChild(o,i),e.selection.setCursorIn(o,!0))))})}t.__esModule=!0;var n=o(1),r=o(0),s=o(3);n.Config.prototype.link={followOnDblClick:!0,processVideoLink:!0,processPastedLink:!0,openLinkDialogAfterPost:!0,removeLinkAfterFormat:!0},n.Config.prototype.controls.unlink={exec:function(e,t){var o=s.Dom.closest(t,"A",e.editor);o&&s.Dom.unwrap(o),e.events.fire("hidePopup")}},n.Config.prototype.controls.link={popup:function(e,t,o,i){var n=e.editorWindow.getSelection(),a=r.dom('
      
    ',e.ownerDocument);t=!(!t||!s.Dom.closest(t,"A",e.editor))&&s.Dom.closest(t,"A",e.editor);var l=a.querySelector(".jodit_link_insert_button"),d=a.querySelector(".jodit_unlink_button");t?(r.val(a,"input[name=url]",t.getAttribute("href")||""),r.val(a,"input[name=text]",t.innerText),a.querySelector("input[name=target]").checked="_blank"===t.getAttribute("target"),a.querySelector("input[name=nofollow]").checked="nofollow"===t.getAttribute("rel"),l&&(l.innerHTML=e.i18n("Update"))):(d&&(d.style.display="none"),r.val(a,"input[name=text]",""+n),l&&(l.innerHTML=e.i18n("Insert")));var c=e.selection.save();return d&&d.addEventListener("mousedown",function(o){t&&s.Dom.unwrap(t),e.selection.restore(c),i(),o.preventDefault()}),a.addEventListener("submit",function(o){o.preventDefault(),e.selection.restore(c);var n=t||s.Dom.create("a","",e.editorDocument);return r.val(a,"input[name=url]")?(n.setAttribute("href",r.val(a,"input[name=url]")),n.innerText=r.val(a,"input[name=text]"),a.querySelector("input[name=target]").checked?n.setAttribute("target","_blank"):n.removeAttribute("target"),a.querySelector("input[name=nofollow]").checked?n.setAttribute("rel","nofollow"):n.removeAttribute("rel"),t||e.selection.insertNode(n),i(),!1):(a.querySelector("input[name=url]").focus(),a.querySelector("input[name=url]").classList.add("jodit_error"),!1)}),a},tags:["a"],tooltip:"Insert link"},t.link=i},function(e,t,o){"use strict";function i(e){var t,o=0,i=e.options.buttons;e.events.on("touchend",function(i){i.changedTouches.length&&(t=(new Date).getTime())-o>e.options.mobileTapTimeout&&(o=t,e.selection.insertCursorAtPoint(i.changedTouches[0].clientX,i.changedTouches[0].clientY))}).on("getDiffButtons.mobile",function(){return e.options.buttons.filter(function(e){return 0>i.indexOf(e)})}).on("resize afterInit",function(){var t=e.container.offsetWidth;i=e.options.sizeLG>t?e.options.sizeMD>t?e.options.sizeSM>t?e.options.buttonsXS:e.options.buttonsSM:e.options.buttonsMD:e.options.buttons,e.toolbar.build(i.concat(e.options.extraButtons),e.container)})}t.__esModule=!0;var n=o(1),r=o(8),s=o(2);n.Config.prototype.mobileTapTimeout=300,n.Config.prototype.controls.dots={mode:s.MODE_SOURCE+s.MODE_WYSIWYG,popup:function(e,t,o,i){var n=o.data;return void 0===n&&(n={container:e.ownerDocument.createElement("div"),toolbar:new r.Toolbar(e),rebuild:function(){var t=e.events.fire("getDiffButtons.mobile");t&&n&&n.toolbar.build(t,n.container)}},n.container.style.width="100px",o.data=n),n.rebuild(),n.container}},t.mobile=i},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(6),s=o(4),a=o(7),l=o(1),d=o(0),c=o(5),u=o(16),p=o(11),f=o(14),h=o(2),m=o(10);l.Config.prototype.filebrowser={filter:function(e,t){return t=t.toLowerCase(),"string"==typeof e?-1!==e.toLowerCase().indexOf(t):"string"==typeof e.name?-1!==e.name.toLowerCase().indexOf(t):"string"!=typeof e.file||-1!==e.file.toLowerCase().indexOf(t)},sortBy:"changed",sort:function(e,t,o){var i,n,r=function(e,t){return t>e?-1:e>t?1:0};if("string"==typeof e)return r(e.toLowerCase(),t.toLowerCase());if(void 0===e[o]||"name"===o)return"string"==typeof e.name?r(e.name.toLowerCase(),t.name.toLowerCase()):"string"==typeof e.file?r(e.file.toLowerCase(),t.file.toLowerCase()):0;switch(o){case"changed":return i=new Date(e.changed),n=new Date(t.changed),n.getTime()-i.getTime();case"size":return d.humanSizeToBytes(e.size)-d.humanSizeToBytes(t.size)}return 0},editImage:!0,preview:!0,showPreviewNavigation:!0,showSelectButtonInPreview:!0,contextMenu:!0,howLongShowMsg:3e3,createNewFolder:!0,deleteFolder:!0,moveFolder:!0,moveFile:!0,showFoldersPanel:!0,width:763,height:400,buttons:["upload","remove","update","select","edit","tiles","list","filter","sort"],view:"tiles",isSuccess:function(e){return e.success},getMessage:function(e){return void 0!==e.data.messages&&Array.isArray(e.data.messages)?e.data.messages.join(" "):""},showFileName:!0,showFileSize:!0,showFileChangeTime:!0,getThumbTemplate:function(e,t,o){var i,n="",r="",s=""+(new Date).getTime();return"string"==typeof e?(n=e,r=e):(void 0!==e.file&&(n=e.file,r=e.file),e.thumb&&(r=e.thumb)),i='
    \n '+(this.options.showFileName?''+n+"":"")+"\n "+(this.options.showFileSize&&e.size?''+e.size+"":"")+"\n "+(this.options.showFileChangeTime&&e.changed?''+e.changed+"":"")+"\n
    ",'\n '+n+'\n '+(this.options.showFileName||this.options.showFileSize&&e.size||this.options.showFileChangeTime&&e.changed?i:"")+"\n "},ajax:{url:"",async:!0,data:{},cache:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",method:"POST",processData:!0,dataType:"json",headers:{},prepareData:function(e){return e},process:function(e){return e}},create:{data:{action:"folderCreate"}},getLocalFileByUrl:{data:{action:"getLocalFileByUrl"}},resize:{data:{action:"imageResize"}},crop:{data:{action:"imageCrop"}},move:{data:{action:"fileMove"}},remove:{data:{action:"fileRemove"}},items:{data:{action:"files"}},folder:{data:{action:"folders"}},permissions:{data:{action:"permissions"}},uploader:null};var v="default",g="jodit_filebrowser_files_item";t.FileBrowser=function(e){function t(t){var o=e.call(this,t)||this;o.currentPath="",o.currentSource=v,o.currentBaseUrl="",o.__currentPerpissions=null,o.view="tiles",o.sortBy="changed",o.dragger=!1,o.filterWord="",o.getPathByUrl=function(e,t,i){var n=o;o.options.getLocalFileByUrl.data.url=e,o.send("getLocalFileByUrl",function(e){n.options.isSuccess(e)?t(e.data.path,e.data.name,e.data.source):i(Error(o.options.getMessage(e)))},function(e){i(e)})},o.loadItems=function(e,t){var i=o;i.options.items.data.path=e,i.options.items.data.source=t,i.options.items.url&&(i.files.classList.add("active"),i.files.appendChild(i.loader.cloneNode(!0)),i.__ajax2&&i.__ajax2.abort&&i.__ajax2.abort(),i.__ajax2=i.send("items",function(e){var t=i.options.items.process;if(t||(t=o.options.ajax.process),t){var n=t.call(i,e);i.generateItemsBox(n.data.sources),i.someSelectedWasChanged()}},function(e){a.Alert(e.message),i.errorHandler(e)}))},o.create=function(e,t,i){o.options.create.data.source=i,o.options.create.data.path=t,o.options.create.data.name=e,o.send("create",function(e){o.options.isSuccess(e)?(o.currentPath=t,o.currentSource=i,o.loadTree(t,i)):o.status(o.options.getMessage(e))},function(e){o.status(e.message)})},o.move=function(e,t,i){o.options.move.data.from=e,o.options.move.data.path=t,o.options.move.data.source=i,o.send("move",function(e){o.options.isSuccess(e)?o.loadTree(t,i):o.status(o.options.getMessage(e))},function(e){o.status(e.message)})},o.close=function(){o.dialog.close()},o.open=function(e){if(o.options.items.url){var t=0;o.jodit.events.off(o.files,"dblclick").on(o.files,"dblclick",o.onSelect(e),"a").on(o.files,"touchstart",function(){var i=(new Date).getTime();h.EMULATE_DBLCLICK_TIMEOUT>i-t&&o.onSelect(e)(),t=i},"a").off(o.buttons.select,"click").on(o.buttons.select,"click",o.onSelect(e)),o.loadTree(o.currentPath,o.currentSource);var i=[d.dom(''+o.jodit.i18n("File Browser")+"      ",o.jodit.ownerDocument)],n=void 0,s=void 0;for(n=0;o.options.buttons.length>n;n+=1){var a=o.options.buttons[n];"string"==typeof a&&void 0!==o.buttons[a]&&(o.options.editImage&&void 0!==r.Jodit.modules.ImageEditor||"edit"!==a)?i.push(o.buttons[a]):"function"==typeof a?i.push(a.call(o)):d.isPlainObject(a)&&a.exec&&a.name&&(s=d.dom('
    '+c.Toolbar.getIcon(a.icon||a.name||"")+"
    ",o.jodit.ownerDocument),i.push(s),s.addEventListener("click",a.exec))}o.dialog.open(o.browser,i)}},o.errorHandler=function(e){o.status(e instanceof Error?o.jodit.i18n(e.message):o.options.getMessage(e))},o.uploadHandler=function(){o.loadItems(o.currentPath,o.currentSource)},o.openImageEditor=function(e,t,i,n,r,s){o.jodit.getInstance("ImageEditor").open(e,function(e,a,l,d){void 0===o.options[a.action]&&(o.options[a.action]={}),void 0===o.options[a.action].data&&(o.options[a.action].data={action:a.action}),o.options[a.action].data.newname=e||t,o.options[a.action].data.box=a.box,o.options[a.action].data.path=i,o.options[a.action].data.name=t,o.options[a.action].data.source=n,o.send(a.action,function(e){o.options.isSuccess(e)?(o.loadTree(o.currentPath,o.currentSource),l(),r&&r()):(d(Error(o.options.getMessage(e))),s&&s(Error(o.options.getMessage(e))))},function(e){d(e),s&&s(e)})})},o.draggable=!1,o.start={top:0,left:0},o.client={x:0,y:0};var i=o,s=t.ownerDocument;i.options=d.extend(!0,{},l.Config.prototype.filebrowser,i.jodit.options.filebrowser),i.dialog=new a.Dialog(t,{fullsizeButton:!0}),i.loader=d.dom('
    ',s),i.browser=d.dom('
    '+(i.options.showFoldersPanel?'
    ':"")+'
    ',s),i.status_line=i.browser.querySelector(".jodit_filebrowser_status"),i.buttons={upload:d.dom('
    '+c.Toolbar.getIcon("plus")+'
    ',s),remove:d.dom('
    '+c.Toolbar.getIcon("bin")+"
    ",s),update:d.dom('
    '+c.Toolbar.getIcon("update")+"
    ",s),select:d.dom('
    '+c.Toolbar.getIcon("check")+"
    ",s),edit:d.dom('
    '+c.Toolbar.getIcon("pencil")+"
    ",s),tiles:d.dom('
    '+c.Toolbar.getIcon("th")+"
    ",s),list:d.dom('
    '+c.Toolbar.getIcon("th-list")+"
    ",s),filter:d.dom('',s),sort:d.dom('",s)},i.tree=i.browser.querySelector(".jodit_filebrowser_tree"),i.files=i.browser.querySelector(".jodit_filebrowser_files"),i.jodit.events.on([i.buttons.tiles,i.buttons.list],"click",function(e){var t=e.currentTarget;t.classList.contains("jodit_button_tiles")?(i.view="tiles",i.buttons.list.classList.add("disabled")):(i.view="list",i.buttons.tiles.classList.add("disabled")),t.classList.remove("disabled"),i.files.classList.remove("jodit_filebrowser_files_view-tiles"),i.files.classList.remove("jodit_filebrowser_files_view-list"),i.files.classList.add("jodit_filebrowser_files_view-"+i.view),m.Cookie.set("jodit_filebrowser_view",i.view,31)}).on(i.buttons.sort,"change",function(){i.sortBy=i.buttons.sort.value,m.Cookie.set("jodit_filebrowser_sortby",i.sortBy,31),i.loadItems(i.currentPath,i.currentSource)}).on(i.buttons.sort,"click mousedown",function(e){e.stopPropagation()}).on(i.buttons.filter,"click mousedown",function(e){e.stopPropagation()}).on(i.buttons.filter,"keydown",d.debounce(function(){i.filterWord=i.buttons.filter.value,i.loadItems(i.currentPath,i.currentSource)},300)).on(i.buttons.remove,"click",function(){o.__getActiveElements().length&&a.Confirm(t.i18n("Are you shure?"),"",function(e){e&&(o.__getActiveElements().forEach(function(e){i.remove(i.currentPath,e.getAttribute("data-name")||"",e.getAttribute("data-source")||"")}),i.someSelectedWasChanged(),i.loadTree(i.currentPath,i.currentSource))})}).on(i.buttons.edit,"click",function(){var e=o.__getActiveElements();1===e.length&&i.openImageEditor(e[0].getAttribute("href")||"",e[0].getAttribute("data-name")||"",e[0].getAttribute("data-path")||"",e[0].getAttribute("data-source")||"")}).on(i.buttons.update,"click",function(){i.loadTree(o.currentPath,o.currentSource)}).on(i.tree,"click",function(e){var o=this.parentNode,n=o.getAttribute("data-path")||"";return a.Confirm(t.i18n("Are you shure?"),"",function(e){e&&(i.remove(n,o.getAttribute("data-name")||"",o.getAttribute("data-source")||""),i.loadTree(i.currentPath,i.currentSource))}),e.stopImmediatePropagation(),!1},"a>i.remove").on(i.tree,"click",function(){var e=this;this.classList.contains("addfolder")?a.Promt(i.jodit.i18n("Enter Directory name"),i.jodit.i18n("Create directory"),function(t){i.create(t,e.getAttribute("data-path")||"",e.getAttribute("data-source")||"")},i.jodit.i18n("type name")):(i.currentPath=this.getAttribute("data-path")||"",i.currentSource=this.getAttribute("data-source")||"",i.loadTree(i.currentPath,i.currentSource))},"a").on(o.tree,"dragstart",function(){i.dragger=this},"a").on(o.tree,"drop",function(){if(i.options.moveFolder&&i.dragger){var e=i.dragger.getAttribute("data-path")||"";if(!i.options.moveFolder&&i.dragger.classList.contains("jodit_filebrowser_tree_item"))return!1;if(i.dragger.classList.contains(g)&&(e+=i.dragger.getAttribute("data-name"),!i.options.moveFile))return!1;i.move(e,this.getAttribute("data-path")||"",this.getAttribute("data-source")||"")}},"a");var f=new u.ContextMenu(o.jodit);return i.jodit.events.on(i.files,"mousedown",function(e){i.client.x=e.clientX,i.client.y=e.clientY,i.start=d.offset(this,i.jodit),i.draggable=this.cloneNode(!0),d.css(i.draggable,{"z-index":1e14,position:"fixed",display:"none",left:i.start.left,top:i.start.top,width:this.offsetWidth,height:this.offsetHeight}),s.body.appendChild(i.draggable)},"a>img").on(i.files,"dragstart",function(e){i.dragger=this,e.dataTransfer.setData(h.TEXT_PLAIN,this.getAttribute("href")||""),e.stopPropagation()},"a").on(i.files,"contextmenu",function(e){var t=this;if(i.options.contextMenu){var o=this;return f.show(e.pageX,e.pageY,[!(!i.options.editImage||!i.canI("ImageResize")&&!i.canI("ImageCrop"))&&{icon:"pencil",title:"Edit",exec:function(){i.openImageEditor(o.getAttribute("href")||"",o.getAttribute("data-name")||"",o.getAttribute("data-path")||"",o.getAttribute("data-source")||"")}},!!i.canI("FileRemove")&&{icon:"bin",title:"Delete",exec:function(){i.remove(i.currentPath,o.getAttribute("data-name")||"",o.getAttribute("data-source")||""),i.someSelectedWasChanged(),i.loadTree(i.currentPath,i.currentSource)}},!!i.options.preview&&{icon:"eye",title:"Preview",exec:function(){var e=o.getAttribute("href")||"",n=new a.Dialog(i.jodit),r=d.dom('
    ',s),l=i.buttons.select.cloneNode(!0),u=s.createElement("img"),p=function(){var a=function(){if(t.removeEventListener("load",a),r.innerHTML="",i.options.showPreviewNavigation){var l=d.dom(''+c.Toolbar.getIcon("angle-right")+"",s),f=d.dom(''+c.Toolbar.getIcon("angle-left")+"",s);o.previousSibling&&o.previousSibling.classList&&o.previousSibling.classList.contains(g)&&r.appendChild(f),o.nextSibling&&o.nextSibling.classList&&o.nextSibling.classList.contains(g)&&r.appendChild(l),i.jodit.events.on([l,f],"click",function(){o=this.classList.contains("jodit_filebrowser_preview_navigation-next")?o.nextSibling:o.previousSibling,r.innerHTML='',e=o.getAttribute("href")||"",u.setAttribute("src",e),p()})}r.appendChild(u),n.setPosition()};u.addEventListener("load",a),u.complete&&a.call(u)};p(),u.setAttribute("src",e),n.setContent(r),i.options.showSelectButtonInPreview&&(l.removeAttribute("disabled"),n.setTitle(l),l.addEventListener("click",function(){d.$$("a.active",i.files).forEach(function(e){return e.classList.add("active")}),o.classList.add("active"),i.jodit.events.fire(i.buttons.select,"click"),n.close()})),n.open()}},{icon:"upload",title:"Download",exec:function(){o.getAttribute("href")&&i.jodit.ownerWindow.open()}}]),e.stopPropagation(),e.preventDefault(),!1}},"a").on(i.files,"click",function(e){d.ctrlKey(e)||(o.__getActiveElements().forEach(function(e){e.classList.remove("active")}),i.someSelectedWasChanged())}).on(i.files,"click",function(e){return d.ctrlKey(e)||i.__getActiveElements().forEach(function(e){e.classList.remove("active")}),this.classList.toggle("active"),i.someSelectedWasChanged(),e.stopPropagation(),!1},"a").on(i.jodit.ownerDocument,"dragover",function(e){i.isOpened()&&i.draggable&&void 0!==e.clientX&&d.css(i.draggable,{left:e.clientX+20,top:e.clientY+20,display:"block"})}).on(i.jodit.ownerWindow,"keydown",function(e){i.isOpened()&&e.which===h.KEY_DELETE&&i.jodit.events.fire(i.buttons.remove,"click")}).on(i.jodit.ownerWindow,"mouseup dragend",function(){i.draggable&&(i.draggable.parentNode&&i.draggable.parentNode.removeChild(i.draggable),i.draggable=!1)}),o.dialog.setSize(o.options.width,o.options.height),o.options.getLocalFileByUrl=d.extend(!0,{},o.options.ajax,o.options.getLocalFileByUrl),o.options.crop=d.extend(!0,{},o.options.ajax,o.options.crop),o.options.resize=d.extend(!0,{},o.options.ajax,o.options.resize),o.options.create=d.extend(!0,{},o.options.ajax,o.options.create),o.options.move=d.extend(!0,{},o.options.ajax,o.options.move),o.options.remove=d.extend(!0,{},o.options.ajax,o.options.remove),o.options.folder=d.extend(!0,{},o.options.ajax,o.options.folder),o.options.items=d.extend(!0,{},o.options.ajax,o.options.items),o.options.permissions=d.extend(!0,{},o.options.ajax,o.options.permissions),o.view="list"===o.options.view?"list":"tiles",m.Cookie.get("jodit_filebrowser_view")&&(o.view="list"===m.Cookie.get("jodit_filebrowser_view")?"list":"tiles"),o.buttons[o.view].classList.remove("disabled"),o.files.classList.add("jodit_filebrowser_files_view-"+o.view),o.sortBy=-1!==["changed","name","size"].indexOf(o.options.sortBy)?o.options.sortBy:"changed",m.Cookie.get("jodit_filebrowser_sortby")&&(o.sortBy=-1!==["changed","name","size"].indexOf(m.Cookie.get("jodit_filebrowser_sortby")||"")?m.Cookie.get("jodit_filebrowser_sortby")||"":"changed"),o.buttons.sort.value=o.sortBy,o.currentBaseUrl=d.$$("base",o.jodit.editorDocument).length?d.$$("base",o.jodit.editorDocument)[0].getAttribute("href")||"":location.protocol+"//"+location.host,void 0!==r.Jodit.modules.Uploader&&(o.uploader=new p.Uploader(o.jodit,n({},o.jodit.options.uploader,o.options.uploader?o.options.uploader:{})),o.uploader.setPath(o.currentPath),o.uploader.setSource(o.currentSource),o.uploader.bind(o.browser,o.uploadHandler,o.errorHandler),o.uploader.bind(o.buttons.upload,o.uploadHandler,o.errorHandler)),o}return i(t,e),t.prototype.canI=function(e){return null!==this.__currentPerpissions&&(void 0===this.__currentPerpissions["allow"+e]||this.__currentPerpissions["allow"+e])},t.prototype.toggleButtonsByPermissions=function(){this.buttons.upload.classList.toggle("jodit_hidden",!this.canI("FileUpload")),this.buttons.remove.classList.toggle("jodit_hidden",!this.canI("FileRemove")),this.buttons.edit.classList.toggle("jodit_hidden",!this.canI("ImageResize")&&!this.canI("ImageCrop"))},t.prototype.isOpened=function(){return this.dialog.isOpened()&&"none"!==this.browser.style.display},t.prototype.status=function(e,t){var o=this;clearTimeout(this.statustimer),this.status_line.classList.remove("success"),this.status_line.classList.add("active"),this.status_line.innerHTML=e,t&&this.status_line.classList.add("success"),this.statustimer=window.setTimeout(function(){o.status_line.classList.remove("active")},this.options.howLongShowMsg)},t.prototype.generateFolderTree=function(e){var t=this,o=[];d.each(e,function(e,i){e&&e!==v&&o.push('
    '+e+"
    "),i.folders.forEach(function(n){var r=''+n+"";t.options.deleteFolder&&".."!==n&&"."!==n&&(r+='×'),r+="",o.push(r)}),t.options.createNewFolder&&t.canI("FolderCreate")&&o.push(''+c.Toolbar.getIcon("plus")+" "+t.jodit.i18n("Add folder")+"")}),this.tree.innerHTML=o.join("")},t.prototype.generateItemsBox=function(e){var t=this,o=[];d.each(e,function(e,i){e&&e!==v&&o.push('
    '+e+(i.path?" - "+i.path:"")+"
    "),i.files&&i.files.length?("function"==typeof t.options.sort&&i.files.sort(function(e,o){return t.options.sort(e,o,t.sortBy,t.jodit)}),i.files.forEach(function(n){(void 0===t.options.filter||t.options.filter(n,t.filterWord))&&o.push(t.options.getThumbTemplate.call(t,n,i,e))})):o.push("
    "+t.jodit.i18n("There are no files")+"
    ")}),this.files.innerHTML=o.join("")},t.prototype.__getActiveElements=function(){return d.$$(":scope>a.active",this.files)},t.prototype.someSelectedWasChanged=function(){var e=this.__getActiveElements();this.buttons.remove.classList.toggle("disabled",!e.length),this.buttons.select.classList.toggle("disabled",!e.length),this.buttons.edit.classList.toggle("disabled",1!==e.length)},t.prototype.send=function(e,t,o){var i,n=d.extend(!0,{},this.options.ajax,void 0!==this.options[e]?this.options[e]:this.options.ajax);return n.prepareData&&(n.data=n.prepareData.call(this,n.data)),i=new f.Ajax(this.jodit,n),i.send().then(t).catch(o),i},t.prototype.loadPermissions=function(e,t,o){var i=this,n=this;n.options.permissions.data.path=e,n.options.permissions.data.source=t,n.options.permissions.url?(n.__permissions&&n.__permissions.abort&&n.__permissions.abort(),n.__permissions=n.send("permissions",function(e){var t=n.options.permissions.process;if(t||(t=i.options.ajax.process),t){var r=t.call(n,e);r.data.permissions&&(i.__currentPerpissions=r.data.permissions,i.toggleButtonsByPermissions(),o())}},function(e){a.Alert(e.message),n.errorHandler(e),o()})):o()},t.prototype.loadTree=function(e,t){var o=this;this.loadPermissions(e,t,function(){var i=o;i.options.folder.data.path=e,i.options.folder.data.source=t,i.uploader&&(i.uploader.setPath(e),i.uploader.setSource(t)),i.options.showFoldersPanel&&(i.options.folder.url?(i.tree.classList.add("active"),i.tree.innerHTML="",i.tree.appendChild(i.loader.cloneNode(!0)),i.__ajax&&i.__ajax.abort&&i.__ajax.abort(),i.__ajax=o.send("folder",function(e){var t=i.options.folder.process;if(t||(t=o.options.ajax.process),t){var n=t.call(i,e);i.generateFolderTree(n.data.sources)}},function(){i.errorHandler(Error(i.jodit.i18n("Error on load folders")))})):i.tree.classList.remove("active")),o.loadItems(e,t)})},t.prototype.remove=function(e,t,o){var i=this;this.options.remove.data.path=e,this.options.remove.data.name=t,this.options.remove.data.source=o,this.send("remove",function(e){i.options.remove.process&&(e=i.options.remove.process.call(i,e)),i.options.isSuccess(e)?(i.someSelectedWasChanged(),i.status(i.options.getMessage(e),!0)):i.status(i.options.getMessage(e))},function(e){i.status(e.message)})},t.prototype.onSelect=function(e){var t=this;return function(){var o=t.__getActiveElements();if(o.length){var i=[];o.forEach(function(e){var t=e.getAttribute("data-url");t&&i.push(t)}),t.close(),"function"==typeof e&&e({baseurl:"",files:i})}return!1}},t}(s.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(1),s=o(0),a=o(5),l=o(7);r.Config.prototype.imageeditor={closeAfterSave:!1,width:"85%",height:"85%",crop:!0,resize:!0,resizeUseRatio:!0,resizeMinWidth:20,resizeMinHeight:20,cropUseRatio:!0,cropDefaultWidth:"70%",cropDefaultHeight:"70%"},t.ImageEditor=function(e){function t(t){var o=e.call(this,t)||this;return o.resizeUseRatio=!0,o.cropUseRatio=!0,o.clicked=!1,o.activeTab="resize",o.hide=function(){o.dialog.close()},o.calcValueByPercent=function(e,t){var o,i=""+t,n=parseFloat(""+e);return(o=/^[\-+]?[0-9]+(px)?$/.exec(i))?parseInt(i,10):(o=/^([\-+]?[0-9.]+)%$/.exec(i),o?Math.round(n*(parseFloat(o[1])/100)):n||0)},o.calcCropBox=function(){var e=.8*o.crop_box.parentNode.offsetWidth,t=.8*o.crop_box.parentNode.offsetHeight,i=e,n=t;e>o.naturalWidth&&t>o.naturalHeight?(i=o.naturalWidth,n=o.naturalHeight):o.ratio>e/t?(i=e,n=o.naturalHeight*(e/o.naturalWidth)):(i=o.naturalWidth*(t/o.naturalHeight),n=t),s.css(o.crop_box,{width:i,height:n})},o.showCrop=function(){o.cropImage&&(o.calcCropBox(),o.new_w=o.calcValueByPercent(o.cropImage.offsetWidth||o.image.offsetWidth,o.options.cropDefaultWidth),o.new_h=o.cropUseRatio?o.new_w/o.ratio:o.calcValueByPercent(o.cropImage.offsetHeight||o.image.offsetHeight,o.options.cropDefaultHeight),s.css(o.cropHandler,{backgroundImage:"url("+o.cropImage.getAttribute("src")+")",width:o.new_w,height:o.new_h,left:(o.cropImage.offsetWidth||o.image.offsetWidth)/2-o.new_w/2,top:(o.cropImage.offsetHeight||o.image.offsetHeight)/2-o.new_h/2}),o.jodit.events.fire(o.cropHandler,"updatesize"))},o.cropBox={x:0,y:0,w:0,h:0},o.updateCropBox=function(){if(o.cropImage){var e=o.cropImage.offsetWidth/o.naturalWidth,t=o.cropImage.offsetHeight/o.naturalHeight;o.cropBox.x=s.css(o.cropHandler,"left")/e,o.cropBox.y=s.css(o.cropHandler,"top")/t,o.cropBox.w=o.cropHandler.offsetWidth/e,o.cropBox.h=o.cropHandler.offsetHeight/t,o.sizes.innerText=o.cropBox.w.toFixed(0)+"x"+o.cropBox.h.toFixed(0)}},o.resizeBox={w:0,h:0},o.updateResizeBox=function(){o.resizeBox.w=o.image.offsetWidth||o.naturalWidth,o.resizeBox.h=o.image.offsetHeight||o.naturalHeight},o.open=function(e,t){var i=(new Date).getTime();o.image=o.jodit.ownerDocument.createElement("img"),s.$$("img,.jodit_icon-loader",o.resize_box).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),s.$$("img,.jodit_icon-loader",o.crop_box).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),s.css(o.cropHandler,"background","transparent"),o.onSave=t,o.resize_box.appendChild(s.dom('',o.jodit.ownerDocument)),o.crop_box.appendChild(s.dom('',o.jodit.ownerDocument)),/\?/.test(e)?e+="&_tst="+i:e+="?_tst="+i,o.image.setAttribute("src",e),o.dialog.open();var n=function(){o.image.removeEventListener("load",n),o.naturalWidth=o.image.naturalWidth,o.naturalHeight=o.image.naturalHeight,o.widthInput.value=""+o.naturalWidth,o.heightInput.value=""+o.naturalHeight,o.ratio=o.naturalWidth/o.naturalHeight,o.resize_box.appendChild(o.image),o.cropImage=o.image.cloneNode(),o.crop_box.appendChild(o.cropImage),s.$$(".jodit_icon-loader",o.editor).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),"crop"===o.activeTab&&o.showCrop(),o.jodit.events.fire(o.resizeHandler,"updatesize"),o.jodit.events.fire(o.cropHandler,"updatesize"),o.dialog.setPosition(),o.jodit.events.fire("afterImageEditor")};o.image.addEventListener("load",n),o.image.complete&&n()},o.setHandlers=function(){var e=o;e.jodit.events.on([e.editor.querySelector(".jodit_bottomright"),e.cropHandler],"mousedown",function(t){e.target=t.target||t.srcElement,t.preventDefault(),t.stopImmediatePropagation(),e.clicked=!0,e.start_x=t.clientX,e.start_y=t.clientY,"crop"===e.activeTab?(e.top_x=s.css(e.cropHandler,"left"),e.top_y=s.css(e.cropHandler,"top"),e.width=e.cropHandler.offsetWidth,e.height=e.cropHandler.offsetHeight):(e.width=e.image.offsetWidth,e.height=e.image.offsetHeight)}).off(o.jodit.ownerWindow,".jodit_image_editor"+e.jodit.id).on(o.jodit.ownerWindow,"mousemove.jodit_image_editor"+e.jodit.id,s.throttle(function(t){e.clicked&&(e.diff_x=t.clientX-e.start_x,e.diff_y=t.clientY-e.start_y,"resize"===e.activeTab&&e.resizeUseRatio||"crop"===e.activeTab&&e.cropUseRatio?e.diff_x?(e.new_w=e.width+e.diff_x,e.new_h=Math.round(e.new_w/e.ratio)):(e.new_h=e.height+e.diff_y,e.new_w=Math.round(e.new_h*e.ratio)):(e.new_w=e.width+e.diff_x,e.new_h=e.height+e.diff_y),"resize"===e.activeTab?(e.new_w>e.options.resizeMinWidth&&(s.css(e.image,"width",e.new_w+"px"),e.widthInput.value=""+e.new_w),e.new_h>e.options.resizeMinHeight&&(s.css(e.image,"height",e.new_h+"px"),e.heightInput.value=""+e.new_h),o.jodit.events.fire(e.resizeHandler,"updatesize")):(e.target!==e.cropHandler?(e.top_x+e.new_w>e.cropImage.offsetWidth&&(e.new_w=e.cropImage.offsetWidth-e.top_x),e.top_y+e.new_h>e.cropImage.offsetHeight&&(e.new_h=e.cropImage.offsetHeight-e.top_y),s.css(e.cropHandler,{width:e.new_w,height:e.new_h})):(e.top_x+e.diff_x+e.cropHandler.offsetWidth>e.cropImage.offsetWidth&&(e.diff_x=e.cropImage.offsetWidth-e.top_x-e.cropHandler.offsetWidth),s.css(e.cropHandler,"left",e.top_x+e.diff_x),e.top_y+e.diff_y+e.cropHandler.offsetHeight>e.cropImage.offsetHeight&&(e.diff_y=e.cropImage.offsetHeight-e.top_y-e.cropHandler.offsetHeight),s.css(e.cropHandler,"top",e.top_y+e.diff_y)),o.jodit.events.fire(e.cropHandler,"updatesize")),t.stopImmediatePropagation())},5)).on(o.jodit.ownerWindow,"resize.jodit_image_editor"+e.jodit.id,function(){o.jodit.events.fire(e.resizeHandler,"updatesize"),e.showCrop(),o.jodit.events.fire(e.cropHandler,"updatesize")}).on(o.jodit.ownerWindow,"mouseup.jodit_image_editor"+e.jodit.id+" keydown.jodit_image_editor"+e.jodit.id,function(t){e.clicked&&(e.clicked=!1,t.stopImmediatePropagation())}),s.$$(".jodit_btn_group",e.editor).forEach(function(t){var o=t.querySelector("input");e.jodit.events.on(t,"click change",function(){var i=this;s.$$("button",t).forEach(function(e){return e.classList.remove("active")}),i.classList.add("active"),o.checked=!!i.getAttribute("data-yes"),e.jodit.events.fire(o,"change")},"button")}),e.jodit.events.on(o.editor,"click",function(){s.$$(".jodit_image_editor_slider,.jodit_image_editor_area",e.editor).forEach(function(e){return e.classList.remove("active")});var t=this.parentNode;t.classList.add("active"),e.activeTab=t.getAttribute("data-area")||"";var o=e.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_"+e.activeTab);o&&o.classList.add("active"),"crop"===e.activeTab&&e.showCrop()},".jodit_image_editor_slider-title").on(e.widthInput,"change mousedown keydown",s.debounce(function(){var t,i=parseInt(e.widthInput.value,10);i>e.jodit.options.resizer.min_width&&(s.css(e.image,"width",i+"px"),e.resizeUseRatio&&(t=Math.round(i/e.ratio))>e.jodit.options.resizer.min_height&&(s.css(e.image,"height",t+"px"),e.heightInput.value=""+t)),o.jodit.events.fire(e.resizeHandler,"updatesize")},200)).on(e.heightInput,"change mousedown keydown",s.debounce(function(){var t,i=parseInt(e.heightInput.value,10);i>e.jodit.options.resizer.min_height&&(s.css(e.image,"height",i+"px"),e.resizeUseRatio&&(t=Math.round(i*e.ratio))>e.jodit.options.resizer.min_width&&(s.css(e.image,"width",t+"px"),e.widthInput.value=""+t)),o.jodit.events.fire(e.resizeHandler,"updatesize")},200));var t=e.editor.querySelector(".jodit_image_editor_keep_spect_ratio");t&&t.addEventListener("change",function(){e.resizeUseRatio=t.checked});var i=e.editor.querySelector(".jodit_image_editor_keep_spect_ratio_crop");i&&i.addEventListener("change",function(){e.cropUseRatio=i.checked}),e.jodit.events.on(e.resizeHandler,"updatesize",function(){s.css(e.resizeHandler,{top:0,left:0,width:(e.image.offsetWidth||e.naturalWidth)+"px",height:(e.image.offsetHeight||e.naturalHeight)+"px"}),o.updateResizeBox()}).on(e.cropHandler,"updatesize",function(){if(e.cropImage){var t=s.css(e.cropHandler,"left"),o=s.css(e.cropHandler,"top"),i=e.cropHandler.offsetWidth,n=e.cropHandler.offsetHeight;0>t&&(t=0),0>o&&(o=0),t+i>e.cropImage.offsetWidth&&(i=e.cropImage.offsetWidth-t,e.cropUseRatio&&(n=i/e.ratio)),o+n>e.cropImage.offsetHeight&&(n=e.cropImage.offsetHeight-o,e.cropUseRatio&&(i=n*e.ratio)),s.css(e.cropHandler,{width:i,height:n,left:t,top:o,backgroundPosition:-t-1+"px "+(-o-1)+"px",backgroundSize:e.cropImage.offsetWidth+"px "+e.cropImage.offsetHeight+"px"}),e.updateCropBox()}}),e.buttons.forEach(function(t){t.addEventListener("mousedown",function(e){e.stopImmediatePropagation()}),t.addEventListener("click",function(){var o={action:e.activeTab,box:"resize"===e.activeTab?e.resizeBox:e.cropBox};switch(t.getAttribute("data-action")){case"saveas":l.Promt(e.jodit.i18n("Enter new name"),e.jodit.i18n("Save in new file"),function(t){if(!s.trim(t))return l.Alert(e.jodit.i18n("The name should not be empty")),!1;e.onSave(t,o,e.hide,function(e){l.Alert(e)})});break;case"save":e.onSave(void 0,o,e.hide,function(e){l.Alert(e)});break;case"reset":"resize"===e.activeTab?(s.css(e.image,{width:null,height:null}),e.widthInput.value=""+e.naturalWidth,e.heightInput.value=""+e.naturalHeight,e.jodit.events.fire(e.resizeHandler,"updatesize")):e.showCrop()}})})},o.options=t.options.imageeditor,o.resizeUseRatio=o.options.resizeUseRatio,o.cropUseRatio=o.options.cropUseRatio,o.buttons=[s.dom('",t.ownerDocument),s.dom('",t.ownerDocument),s.dom('",t.ownerDocument)],o.activeTab=o.options.resize?"resize":"crop",o.editor=s.dom('
    '+(o.options.resize?'
    ':"")+(o.options.crop?'
    ':"")+'
    '+(o.options.resize?'
    '+a.Toolbar.getIcon("resize")+t.i18n("Resize")+'
    ":"")+(o.options.crop?'
    '+a.Toolbar.getIcon("crop")+t.i18n("Crop")+'
    ":"")+"
    ",t.ownerDocument),o.widthInput=o.editor.querySelector(".jodit_image_editor_width"),o.heightInput=o.editor.querySelector(".jodit_image_editor_height"),o.resize_box=o.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_resize .jodit_image_editor_box"),o.crop_box=o.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_crop .jodit_image_editor_box"),o.sizes=o.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_crop .jodit_sizes"),o.resizeHandler=o.editor.querySelector(".jodit_image_editor_resizer"),o.cropHandler=o.editor.querySelector(".jodit_image_editor_croper"),o.dialog=new l.Dialog(t),o.dialog.setContent(o.editor),o.dialog.setSize(o.options.width,o.options.height),o.dialog.setTitle(o.buttons),o.setHandlers(),o}return i(t,e),t}(n.Component)},function(e,t,o){"use strict";function i(e){e.events.on("afterCommand",function(t){if(/insert(un)?orderedlist/i.test(t)){var o=n.Dom.up(e.selection.current(),function(e){return e&&/^UL|OL$/i.test(e.nodeName)},e.editor);if(o&&o.parentNode&&"P"===o.parentNode.nodeName){var i=e.selection.save();n.Dom.unwrap(o.parentNode),[].slice.call(o.childNodes).forEach(function(e){e.lastChild&&e.lastChild.nodeType===Node.ELEMENT_NODE&&"BR"===e.lastChild.nodeName&&e.removeChild(e.lastChild)}),e.selection.restore(i)}e.setEditorValue()}})}t.__esModule=!0;var n=o(3),r=o(1);r.Config.prototype.controls.ul={command:"insertUnorderedList",controlName:"ul",tags:["ul"],tooltip:"Insert Unordered List"},r.Config.prototype.controls.ol={command:"insertOrderedList",controlName:"ol",tags:["ol"],tooltip:"Insert Ordered List"},t.orderedlist=i},function(e,t,o){"use strict";function i(e){e.events.on("paste",function(t){if(!1===e.events.fire("beforePaste",t))return t.preventDefault(),!1;if(t&&t.clipboardData&&t.clipboardData.getData){var o=void 0,i=t.clipboardData.types,n="",r="";if(Array.isArray(i))for(o=0;i.length>o;o+=1)n+=i[o]+";";else n=i;/text\/html/.test(n)?r=t.clipboardData.getData("text/html"):/text\/rtf/.test(n)&&s.browser("safari")?r=t.clipboardData.getData("text/rtf"):/text\/plain/.test(n)&&!s.browser("mozilla")&&(r=s.htmlentities(t.clipboardData.getData(l.TEXT_PLAIN)).replace(/\n/g,"
    ")),(""!==r||r instanceof e.editorWindow.Node)&&(r=e.events.fire("processPaste",t,r),("string"==typeof r||r instanceof e.editorWindow.Node)&&e.selection.insertHTML(r),t.preventDefault(),t.stopPropagation())}return!1!==e.events.fire("afterPaste",t)&&void 0});var t=function(e){var t=document.createElement("div");return t.innerHTML=e,t.innerText},o=function(t,o,i,a,l){void 0===a&&(a="Clean"),void 0===l&&(l="Insert only Text");var d=r.Confirm('
    '+t+"
    ",o,i),c=s.dom(''+n.Jodit.prototype.i18n("Keep")+"",d.document),u=s.dom(''+n.Jodit.prototype.i18n(a)+"",d.document),p=s.dom(''+n.Jodit.prototype.i18n(l)+"",d.document),f=s.dom(''+n.Jodit.prototype.i18n("Cancel")+"",d.document);return e.events.on(c,"click",function(){d.close(),i&&i(!0)}),e.events.on(u,"click",function(){d.close(),i&&i(!1)}),e.events.on(p,"click",function(){d.close(),i&&i(0)}),e.events.on(f,"click",function(){d.close()}),d.setFooter([c,u,l?p:"",f]),d},i=function(i){if(s.isHTML(i))return o(e.i18n("Your code is similar to HTML. Keep as HTML?"),e.i18n("Paste as HTML"),function(o){!1===o&&(i=s.htmlspecialchars(i)),0===o&&(i=t(i)),e.selection.insertHTML(i),e.setEditorValue()},"Insert as Text"),!1};e.options.askBeforePasteHTML&&e.events.on("beforePaste",function(e){if(e&&e.clipboardData&&e.clipboardData.getData&&e.clipboardData.getData(l.TEXT_PLAIN)){var t=e.clipboardData.getData(l.TEXT_PLAIN);return i(t)}}),e.options.askBeforePasteFromWord&&e.events.on("beforePaste",function(n){if(n&&n.clipboardData&&n.clipboardData.getData&&n.clipboardData.getData(l.TEXT_HTML)){var r=function(n){if(s.isHTML(n))return s.isHTMLFromWord(n)?o(e.i18n("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?"),e.i18n("Word Paste Detected"),function(o){!0===o&&(n=s.applyStyles(n),e.options.beautifyHTML&&e.ownerWindow.html_beautify&&(n=e.ownerWindow.html_beautify(n))),!1===o&&(n=s.cleanFromWord(n)),0===o&&(n=t(s.cleanFromWord(n))),e.selection.insertHTML(n),e.setEditorValue()}):i(n),!1};if(n.clipboardData.types&&-1!==n.clipboardData.types.indexOf("text/html")){var a=n.clipboardData.getData(l.TEXT_HTML);return r(a)}var d=s.dom('
    ',e.ownerDocument);e.container.appendChild(d),d.focus();var c=0,u=function(){if(c+=1,d.childNodes&&d.childNodes.length>0){var t=d.innerHTML;d.parentNode&&d.parentNode.removeChild(d),!1!==r(t)&&e.selection.insertHTML(t)}else 5>c?setTimeout(function(){u()},20):d.parentNode&&d.parentNode.removeChild(d)};u()}})}t.__esModule=!0;var n=o(6),r=o(7),s=o(0),a=o(1),l=o(2);a.Config.prototype.askBeforePasteHTML=!0,a.Config.prototype.askBeforePasteFromWord=!0,t.paste=i},function(e,t,o){"use strict";function i(e){if(e.options.showPlaceholder){this.destruct=function(){n.parentNode&&n.parentNode.removeChild(n)};var t=function(){if(n.parentNode&&!e.options.readonly){var t=0,o=0,i=e.editorWindow.getComputedStyle(e.editor);if(e.editor.firstChild&&e.editor.firstChild.nodeType===Node.ELEMENT_NODE){var r=e.editorWindow.getComputedStyle(e.editor.firstChild);t=parseInt(r.getPropertyValue("margin-top"),10),o=parseInt(r.getPropertyValue("margin-left"),10),n.style.fontSize=parseInt(r.getPropertyValue("font-size"),10)+"px",n.style.lineHeight=r.getPropertyValue("line-height")}else n.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",n.style.lineHeight=i.getPropertyValue("line-height");s.css(n,{display:"block",marginTop:Math.max(parseInt(i.getPropertyValue("margin-top"),10),t),marginLeft:Math.max(parseInt(i.getPropertyValue("margin-left"),10),o)})}},o=function(){n.parentNode&&(n.style.display="none")},i=s.debounce(function(){if(e.editor)return e.getRealMode()!==r.MODE_WYSIWYG?o():void(e.getEditorValue()?o():t())},e.options.observer.timeout/100),n=s.dom('",e.ownerDocument);"rtl"===e.options.direction&&(n.style.right="0px",n.style.direction="rtl"),e.options.useInputsPlaceholder&&e.element.hasAttribute("placeholder")&&(n.innerHTML=e.element.getAttribute("placeholder")||""),e.events.on("readonly",function(e){e?o():i()}).on("afterInit",function(){e.workplace.appendChild(n),i(),e.events.fire("placeholder",n.innerHTML),e.events.on("change keyup mouseup keydown mousedown afterSetMode",function(){null!==n.parentNode&&i()})})}}t.__esModule=!0;var n=o(1),r=o(2),s=o(0);n.Config.prototype.showPlaceholder=!0,n.Config.prototype.useInputsPlaceholder=!0,n.Config.prototype.placeholder="Type something",t.placeholder=i},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(17),r=o(2),s=o(1),a=o(4);s.Config.prototype.controls.redo={mode:r.MODE_SPLIT,tooltip:"Redo"},s.Config.prototype.controls.undo={mode:r.MODE_SPLIT,tooltip:"Undo"},t.redoundo=function(e){function t(t){var o=e.call(this,t)||this;o.observer=new n.Observer(o.jodit);var i=function(){t.events.fire("canRedo",o.observer.stack.canRedo()),t.events.fire("canUndo",o.observer.stack.canUndo())};t.events.on("afterSetMode",function(){t.getRealMode()===r.MODE_WYSIWYG&&i()});var s=function(e){return t.getRealMode()===r.MODE_WYSIWYG&&(o.observer.stack["can"+e.substr(0,1).toUpperCase()+e.substr(1)]()&&o.observer.stack[e](),i()),!1};return t.registerCommand("redo",{exec:s,hotkeys:"ctrl+y"}),t.registerCommand("undo",{exec:s,hotkeys:"ctrl+z"}),o}return i(t,e),t.prototype.destruct=function(){this.observer.destruct()},t}(a.Component)},function(e,t,o){"use strict";function i(e){var t,o,i,n,a,l,d,c,u,p,f,h=!1,m=!1,v=!1,g=s.dom('',e.ownerDocument),_=function(){m=!1,v=!1,o=null,g.style.display="none"},b=function(){if(v&&o&&g){var t=s.offset(o,e),i=parseInt(g.style.left||"0",10),n=parseInt(g.style.top||"0",10),r=g.offsetWidth,a=g.offsetHeight;n===t.top-1&&i===t.left-1&&r===o.offsetWidth&&a===o.offsetHeight||(g.style.top=t.top-1+"px",g.style.left=t.left-1+"px",g.style.width=o.offsetWidth+"px",g.style.height=o.offsetHeight+"px",e.events&&(e.events.fire(o,"changesize"),isNaN(i)||e.events.fire("resize")))}},y=function(){e.options.readonly||(v=!0,g.style.display="block",b())},w=function(t){var i;if("IFRAME"===t.tagName)if(t.parentNode&&t.parentNode.getAttribute("data-jodit_iframe_wrapper"))t=t.parentNode;else{i=s.dom('',e.editorDocument),i.style.display="inline-block"===t.style.display?"inline-block":"block",i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px",t.parentNode&&t.parentNode.insertBefore(i,t),i.appendChild(t);var n=t;e.events.on(i,"changesize",function(){n.setAttribute("width",i.offsetWidth+"px"),n.setAttribute("height",i.offsetHeight+"px")}),t=i}var r;e.events.on(t,"dragstart",_).on(t,"mousedown",function(e){s.isIE()&&e.preventDefault()}).on(t,"mousedown touchstart",function(){h||(h=!0,o=t,y(),"IMG"!==o.tagName||o.complete||o.addEventListener("load",function e(){b(),o&&o.removeEventListener("load",e)}),clearTimeout(r)),r=window.setTimeout(function(){h=!1},400)})};s.$$("i",g).forEach(function(r){e.events.on(r,"mousedown touchstart",function(s){if(!o||!o.parentNode)return _(),!1;t=r,s.preventDefault(),s.stopImmediatePropagation(),a=o.offsetWidth,l=o.offsetHeight,d=a/l,m=!0,i=s.clientX,n=s.clientY,e.lock("resizer")})}),e.events.on("readonly",function(e){e&&_()}).on("beforeDestruct",function(){g.parentNode&&g.parentNode.removeChild(g)}).on("afterInit",function(){e.editorDocument.body.appendChild(g),e.events.on(e.editor,"keydown",function(t){v&&t.keyCode===r.KEY_DELETE&&o&&"table"!==o.tagName.toLowerCase()&&("JODIT"!==o.tagName?e.selection.select(o):(o.parentNode&&o.parentNode.removeChild(o),_(),t.preventDefault()))}).on(e.ownerWindow,"mousemove touchmove",function(r){if(m){if(p=r.clientX-i,f=r.clientY-n,!o)return;"IMG"===o.tagName?p?(u=a+(t.className.match(/left/)?-1:1)*p,c=Math.round(u/d)):(c=l+(t.className.match(/top/)?-1:1)*f,u=Math.round(c*d)):(u=a+(t.className.match(/left/)?-1:1)*p,c=l+(t.className.match(/top/)?-1:1)*f),u>e.options.resizer.min_width&&(o.style.width=g.parentNode.offsetWidth>u?u+"px":"100%"),c>e.options.resizer.min_height&&(o.style.height=c+"px"),b(),r.stopImmediatePropagation()}}).on(e.ownerWindow,"resize",function(){v&&b()}).on(e.ownerWindow,"mouseup keydown touchend",function(t){v&&!h&&(m?(e.unlock(),m=!1,e.setEditorValue(),t.stopImmediatePropagation()):_())}).on([e.ownerWindow,e.editor],"scroll",function(){v&&!m&&_()})}).on("afterGetValueFromEditor",function(e){e.value=e.value.replace(/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>[\s\n\r]*<\/iframe>.*?)<\/jodit>/gi,"$1")}).on("change afterInit afterSetMode",s.debounce(function(){v&&(o&&o.parentNode?b():_()),s.$$("img, table, iframe",e.editor).forEach(function(t){e.getMode()!==r.MODE_SOURCE&&!t.__jodit_resizer_binded&&("IFRAME"===t.tagName&&e.options.useIframeResizer||"IMG"===t.tagName&&e.options.useImageResizer||"TABLE"===t.tagName&&e.options.useTableResizer)&&(t.__jodit_resizer_binded=!0,w(t))})},e.options.observer.timeout))}t.__esModule=!0;var n=o(1),r=o(2),s=o(0);n.Config.prototype.useIframeResizer=!0,n.Config.prototype.useTableResizer=!0,n.Config.prototype.useImageResizer=!0,n.Config.prototype.resizer={min_width:10,min_height:10},t.resizer=i},function(e,t,o){"use strict";function i(e){if("auto"!==e.options.height&&(e.options.allowResizeX||e.options.allowResizeY)){var t=n.dom('
    ',e.ownerDocument),o={x:0,y:0,w:0,h:0},i=!1;e.events.on(t,"mousedown touchstart",function(t){i=!0,o.x=t.clientX,o.y=t.clientY,o.w=e.container.offsetWidth,o.h=e.container.offsetHeight,t.preventDefault()}).on(e.ownerWindow,"mousemove touchmove",n.throttle(function(t){i&&(n.css(e.container,{width:e.options.allowResizeX?o.w+t.clientX-o.x:o.w,height:e.options.allowResizeY?o.h+t.clientY-o.y:o.h}),e.events.fire("resize"))},e.options.observer.timeout)).on(e.ownerWindow,"mouseup touchsend",function(){i&&(i=!1)}).on("afterInit",function(){e.container.appendChild(t)})}e.events.on("afterInit",function(){n.css(e.editor,{minHeight:e.options.minHeight}),n.css(e.workplace,{width:e.options.width,height:e.options.height,minHeight:e.options.minHeight}),"auto"!==e.options.height&&(n.css(e.editor,{minHeight:"100%"}),n.css(e.workplace,{height:"",minHeight:""}),n.css(e.container,{height:e.options.height})),"auto"!==e.options.width&&(n.css(e.workplace,{width:""}),n.css(e.container,{width:e.options.width}))},void 0,void 0,!0)}t.__esModule=!0;var n=o(0),r=o(1);r.Config.prototype.allowResizeX=!1,r.Config.prototype.allowResizeY=!0,t.size=i},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(1),r=o(2),s=o(0),a=o(4);n.Config.prototype.beautifyHTML=!0,n.Config.prototype.useAceEditor=!0,n.Config.prototype.sourceEditorNativeOptions={showGutter:!1,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},n.Config.prototype.sourceEditorCDNUrlsJS=["//cdnjs.cloudflare.com/ajax/libs/ace/1.2.8/ace.js","//cdnjs.cloudflare.com/ajax/libs/ace/1.2.8/ext-emmet.js"],n.Config.prototype.beautifyHTMLCDNUrlsJS=["//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.14/beautify.min.js","//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.14/beautify-html.min.js"],n.Config.prototype.controls.source={mode:r.MODE_SPLIT,exec:function(e){e.toggleMode()},tooltip:"Change mode"},t.source=function(e){function t(t){var o=e.call(this,t)||this;return o.className="jodit_ace_editor",o.loadNext=function(e,t,i,n){if(void 0===i&&(i="aceReady"),void 0===n&&(n=o.className),i&&void 0===t[e]&&o.jodit&&o.jodit.events)return o.jodit.events&&o.jodit.events.fire(i),void(o.jodit.events&&o.jodit.events.fire(o.jodit.ownerWindow,i));void 0!==t[e]&&s.appendScript(t[e],function(){o.loadNext(e+1,t,i,n)},n,o.jodit.ownerDocument)},o.fromWYSIWYG=function(e){if(void 0===e&&(e=!1),!o.__lock||!0===e){o.__lock=!0;var t=o.jodit.getEditorValue();t!==o.getMirrorValue()&&o.setMirrorValue(t),o.__lock=!1}},o.__lock=!1,o.toWYSIWYG=function(){o.__lock||(o.__lock=!0,o.jodit.setEditorValue(o.getMirrorValue()),o.__lock=!1)},o.autosize=function(){o.mirror.style.height="auto",o.mirror.style.height=o.mirror.scrollHeight+"px"},o.getNormalPosition=function(e,t){for(var o=e;o>0;){if(o--,"<"===t[o]&&void 0!==t[o+1]&&t[o+1].match(/[\w\/]+/i))return o;if(">"===t[o])return e}return e},o.tempMarkerStart="{start-jodit-selection}",o.tempMarkerEnd="{end-jodit-selection}",o.__clear=function(e){return e.replace(r.INVISIBLE_SPACE_REG_EXP,"")},o.selInfo=[],o.getSelectionStart=function(){return o.mirror.selectionStart},o.getSelectionEnd=function(){return o.mirror.selectionEnd},o.setMirrorSelectionRange=function(e,t){o.mirror.setSelectionRange(e,t)},o.saveSelection=function(){if(o.jodit.getRealMode()===r.MODE_WYSIWYG)o.selInfo=o.jodit.selection.save()||[],o.jodit.setEditorValue(),o.fromWYSIWYG(!0);else{o.selInfo.length=0;var e=o.getMirrorValue();if(o.getSelectionStart()===o.getSelectionEnd()){var t=o.jodit.selection.marker(!0);o.selInfo[0]={startId:t.id,collapsed:!0,startMarker:t.outerHTML};var i=o.getNormalPosition(o.getSelectionStart(),o.getMirrorValue());o.setMirrorValue(e.substr(0,i)+o.__clear(o.selInfo[0].startMarker)+e.substr(i))}else{var n=o.jodit.selection.marker(!0),s=o.jodit.selection.marker(!1);o.selInfo[0]={startId:n.id,endId:s.id,collapsed:!1,startMarker:o.__clear(n.outerHTML),endMarker:o.__clear(s.outerHTML)};var i=o.getNormalPosition(o.getSelectionStart(),e),a=o.getNormalPosition(o.getSelectionEnd(),e);o.setMirrorValue(e.substr(0,i)+o.selInfo[0].startMarker+e.substr(i,a-i)+o.selInfo[0].endMarker+e.substr(a))}o.toWYSIWYG()}},o.restoreSelection=function(){if(o.selInfo.length){if(o.jodit.getRealMode()===r.MODE_WYSIWYG)return o.__lock=!0,o.jodit.selection.restore(o.selInfo),void(o.__lock=!1);var e=o.getMirrorValue();o.selInfo[0].startMarker&&(e=e.replace(/]+data-jodit_selection_marker="start"[^>]*>[<>]*?<\/span>/gim,o.tempMarkerStart)),o.selInfo[0].endMarker&&(e=e.replace(/]+data-jodit_selection_marker="end"[^>]*>[<>]*?<\/span>/gim,o.tempMarkerEnd)),o.jodit.ownerWindow.html_beautify&&o.jodit.options.beautifyHTML&&(e=o.jodit.ownerWindow.html_beautify(e));var t=e.indexOf(o.tempMarkerStart),i=t;e=e.replace(o.tempMarkerStart,""),o.selInfo[0].collapsed&&-1!==t||(i=e.indexOf(o.tempMarkerEnd),-1===t&&(t=i)),e=e.replace(o.tempMarkerEnd,""),o.setMirrorValue(e),o.setMirrorSelectionRange(t,i),o.toWYSIWYG(),o.setFocusToMirror()}},o.mirrorContainer=s.dom('
    ',o.jodit.ownerDocument),o.mirror=s.dom('\n \n ",e.ownerDocument),i={},s=e.selection.save(),l=function(t){e.selection.restore(s),e.selection.insertHTML(t)};return i[r.Toolbar.getIcon("link")+" "+e.i18n("Link")]=t,i[r.Toolbar.getIcon("source")+" "+e.i18n("Code")]=o,o.addEventListener("submit",function(e){return e.preventDefault(),n.trim(n.val(o,"textarea[name=code]"))?(l(n.val(o,"textarea[name=code]")),!1):(o.querySelector("textarea[name=code]").focus(),o.querySelector("textarea[name=code]").classList.add("jodit_error"),!1)}),t.addEventListener("submit",function(e){return e.preventDefault(),n.isURL(n.val(t,"input[name=code]"))?(l(n.convertMediaURLToVideoEmbed(n.val(t,"input[name=code]"))),!1):(t.querySelector("input[name=code]").focus(),t.querySelector("input[name=code]").classList.add("jodit_error"),!1)}),a(e,i)},tags:["iframe"],tooltip:"Insert youtube/vimeo video"}}},function(e,t,o){"use strict";t.__esModule=!0,t.INVISIBLE_SPACE="\ufeff",t.INVISIBLE_SPACE_REG_EXP=/[\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)$/i,t.KEY_BACKSPACE=8,t.KEY_TAB=9,t.KEY_ENTER=13,t.KEY_ESC=27,t.KEY_LEFT=37,t.KEY_TOP=38,t.KEY_RIGHT=39,t.KEY_BOTTOM=40,t.KEY_DELETE=46,t.KEY_F=70,t.KEY_R=82,t.KEY_Y=89,t.KEY_Z=90,t.KEY_F3=114,t.NEARBY=5,t.ACCURACY=10,t.BR="br",t.PARAGRAPH="P",t.MODE_WYSIWYG=1,t.MODE_SOURCE=2,t.MODE_SPLIT=3,t.TEXT_PLAIN=-1!=navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)?"text":"text/plain",t.TEXT_HTML=-1!=navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)?"text":"text/html",t.MARKER_CLASS="jodit_selection_marker",t.EMULATE_DBLCLICK_TIMEOUT=300,t.JODIT_SELECTED_CELL_MARKER="data-jodit-selected-cell"},function(e,t,o){"use strict";t.__esModule=!0;var i=o(2),n=o(0);t.Dom=function(){function e(){}return e.unwrap=function(e){var t=e.parentNode,o=e;if(t){for(;o.firstChild;)t.insertBefore(o.firstChild,o);t.removeChild(o)}},e.each=function(t,o){var i=t.firstChild;if(i)for(;i;){if(!1===o.call(i,i)||!1===e.each(i,o))return!1;i=e.next(i,function(e){return!!e},t)}return!0},e.create=function(e,t,o){var i;return e=e.toLowerCase(),"text"===e?i=o.createTextNode("string"==typeof t?t:""):(i=o.createElement(e),void 0!==t&&(i.innerHTML=t)),i},e.replace=function(t,o,i,r,s){void 0===i&&(i=!1),void 0===r&&(r=!1);var a="string"==typeof o?e.create(o,"",s):o;if(!r)for(;t.firstChild;)a.appendChild(t.firstChild);return i&&n.each(t.attributes,function(e,t){a.setAttribute(t.name,t.nodeValue)}),t.parentNode&&t.parentNode.replaceChild(a,t),a},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(e){return!!e&&"string"==typeof e.nodeName&&i.IS_BLOCK.test(e.nodeName)},e.canSplitBlock=function(e,t){return e&&e instanceof t.HTMLElement&&this.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&void 0!==e.style&&!/^(fixed|absolute)/i.test(e.style.position)},e.prev=function(t,o,i,n){return void 0===n&&(n=!0),e.find(t,o,i,!1,"previousSibling",!!n&&"lastChild")},e.next=function(t,o,i,n){return void 0===n&&(n=!0),e.find(t,o,i,void 0,void 0,n?"firstChild":"")},e.find=function(t,o,i,n,r,s){if(void 0===n&&(n=!1),void 0===r&&(r="nextSibling"),void 0===s&&(s="firstChild"),n&&o(t))return t;var a,l=t;do{if(a=l[r],o(a))return a||!1;if(s&&a&&a[s]){var d=e.find(a[s],o,a,!0,r,s);if(d)return d}a||(a=l.parentNode),l=a}while(l&&l!==i);return!1},e.findWithCurrent=function(t,o,i,n,r){void 0===n&&(n="nextSibling"),void 0===r&&(r="firstChild");var s=t;do{if(o(s))return s||!1;if(r&&s&&s[r]){var a=e.findWithCurrent(s[r],o,s,n,r);if(a)return a}for(;s&&!s[n]&&s!==i;)s=s.parentNode;s&&s[n]&&s!==i&&(s=s[n])}while(s&&s!==i);return!1},e.isEmptyTextNode=function(e){return e&&e.nodeType===Node.TEXT_NODE&&(!e.nodeValue||0===e.nodeValue.replace(i.INVISIBLE_SPACE_REG_EXP,"").length)},e.isEmpty=function(t){return!t||(t.nodeType===Node.TEXT_NODE?!t.nodeValue||0===n.trim(t.nodeValue).length:e.each(t,function(e){if(e&&e.nodeType===Node.TEXT_NODE&&e.nodeValue&&0!==n.trim(e.nodeValue).length||e&&e.nodeType===Node.ELEMENT_NODE&&e.nodeName.match(/^(img|table)$/i))return!1}))},e.isNode=function(e,t){return"object"==typeof t?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},e.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},e.closest=function(t,o,i){var n;return n="function"==typeof o?o:o instanceof RegExp?function(e){return o.test(e.nodeName)}:function(e){return RegExp("^("+o+")$","i").test(e.nodeName)},e.up(t,n,i)},e.after=function(e,t){var o=e.parentNode;o&&(o.lastChild===e?o.appendChild(t):o.insertBefore(t,e.nextSibling))},e.all=function(t,o,i){void 0===i&&(i=!1);var n=t.childNodes?Array.prototype.slice.call(t.childNodes):[];if(o(t))return t;i&&(n=n.reverse()),n.forEach(function(t){e.all(t,o,i)})},e.wrap=function(t,o,i){var n,r=t,s=t,a=i.selection.save(),l=!1;do{l=!1,(n=e.prev(r,function(e){return!!e},i.editor,!1))&&!e.isBlock(n)&&(l=!0,r=n)}while(l);do{l=!1,(n=e.next(s,function(e){return!!e},i.editor,!1))&&!e.isBlock(n)&&(l=!0,s=n)}while(l);var d="string"==typeof o?e.create(o,"",i.editorDocument):o;r.parentNode&&r.parentNode.insertBefore(d,r);for(var c=r;c&&(c=r.nextSibling,d.appendChild(r),r!==s&&c);)r=c;return i.selection.restore(a),d},e.contains=function(e,t){for(;t.parentNode;){if(t.parentNode===e)return!0;t=t.parentNode}return!1},e.isOrContains=function(t,o){return t===o||e.contains(t,o)},e}()},function(e,t,o){"use strict";t.__esModule=!0;var i=o(6);t.Component=function(){function e(e){e&&e instanceof i.Jodit&&(this.jodit=e,e.components&&e.components.push(this))}return e.prototype.destruct=function(){},e}()},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(4),s=o(0),a=o(2),l=o(3);t.Toolbar=function(e){function t(t){var o=e.call(this,t)||this;return o.__popapOpened=!1,o.__listOpened=!1,o.closeAll=function(){o.list.innerHTML="",o.popup.innerHTML="",o.popup.style.display="none",o.list.style.display="none",s.$$(".jodit_dropdown_open, .jodit_popap_open",o.container).forEach(function(e){e.classList.remove("jodit_dropdown_open","jodit_popap_open")}),o.__popapOpened&&o.jodit.selection&&o.jodit.selection.removeMarkers(),o.__popapOpened=!1,o.__listOpened=!1},o.defaultControl={template:function(e,t,i){return o.jodit.i18n(i)}},o.buttonList=[],o.initEvents=function(){var e;o.jodit.events.on(o.popup,"mousedown touchstart",function(e){e.stopPropagation()}).on(o.list,"mousedown touchstart",function(e){e.stopPropagation()}).on(o.jodit.ownerWindow,"mousedown touchstart",function(){(o.__popapOpened||o.__listOpened)&&o.closeAll()}).on("afterOpenPopup afterOpenList",function(e){var t=s.offset(o.jodit.container,o.jodit,!0),i=s.offset(e,o.jodit,!0),n=s.css(e,"marginLeft"),r=0;if(i.left+i.width>t.left+t.width&&(r=-(i.left+i.width-(t.left+t.width)),s.css(e,{marginLeft:r+n}),i=s.offset(e,o.jodit,!0)),t.left>i.left&&(i.left+i.width>t.left+t.width?s.css(e,{width:t.width}):(r=t.left-i.left,s.css(e,{marginLeft:r+n}))),r){var a=e.querySelector(".jodit_popup_triangle");a&&(a.style.marginLeft=-r+"px")}}).on("hidePopup",function(){o.closeAll()}).on("mousedown mouseup keydown change afterSetMode focus afterInit readonly",function(){var t=function(){o.jodit.selection&&o.checkActiveButtons(o.jodit.selection.current())};o.jodit.options.observer.timeout?(clearTimeout(e),e=window.setTimeout(t,o.jodit.options.observer.timeout)):t()})},o.container=s.dom('
    ',t.ownerDocument),o.popup=s.dom('
    ',t.ownerDocument),o.list=s.dom('
      ',t.ownerDocument),o.initEvents(),o}return i(t,e),t.getIcon=function(e,o){return void 0===o&&(o=""),void 0!==t.icons[e]?t.icons[e]:o},t.prototype.openPopup=function(e,t,o){this.closeAll(),t&&(e.classList.add("jodit_popup_open"),e.appendChild(this.popup),this.__popapOpened=!0,this.popup.innerHTML='',this.popup.appendChild(s.dom(t,this.jodit.ownerDocument)),this.popup.style.display="block",this.popup.style.marginLeft=null,void 0!==o&&this.popup.classList.toggle("jodit_right",o),this.jodit.events.fire("afterOpenPopup",this.popup,this.container))},t.prototype.openList=function(e,t,o){var i=this;e.classList.add("jodit_dropdown_open"),this.closeAll(),this.__listOpened=!0,s.each(t.list,function(e,n){var r;r=void 0!==i.jodit.options.controls[n]?i.addButton(n,i.jodit.options.controls[n],"",o):void 0!==i.jodit.options.controls[e]?i.addButton(e,s.extend({},i.jodit.options.controls[e],n),"",o):i.addButton(e,{exec:t.exec,command:t.command,args:[t.args&&t.args[0]||e,t.args&&t.args[1]||n]},t.template&&t.template(i.jodit,e,n),o),i.list.appendChild(r)}),this.list.style.display="block",this.list.style.marginLeft=null,e.appendChild(this.list),this.jodit.events.fire("afterOpenList",this.list,this.container)},t.__toggleButton=function(e,t){e.classList.toggle("jodit_disabled",!t),t?e.hasAttribute("disabled")&&e.removeAttribute("disabled"):e.hasAttribute("disabled")||e.setAttribute("disabled","disabled")},t.prototype.checkActiveButtons=function(e){var o=this,i=function(e,t){return""+o.jodit.editorWindow.getComputedStyle(e).getPropertyValue(t)},n=function(e,t,n){var r=0,s=0;Object.keys(t).forEach(function(e){var a=t[e];"function"==typeof a?a(o.jodit,i(n,e).toLowerCase())&&(r+=1):-1!==a.indexOf(i(n,e).toLowerCase())&&(r+=1),s+=1}),s===r&&e.btn.classList.add("jodit_active")};this.buttonList.forEach(function(i){i.btn.classList.remove("jodit_active");var r=void 0===i.control||void 0===i.control.mode?a.MODE_WYSIWYG:i.control.mode,s=r===a.MODE_SPLIT||r===o.jodit.getRealMode();if("function"==typeof i.control.isDisable&&(s=s&&!i.control.isDisable(o.jodit,i.control,i)),o.jodit.options.readonly&&-1===o.jodit.options.activeButtonsInReadOnly.indexOf(i.name)&&(s=!1),t.__toggleButton(i.btn,s),"function"==typeof i.control.getLabel&&i.control.getLabel(o.jodit,i.control,i),"function"==typeof i.control.isActive)i.btn.classList.toggle("jodit_active",i.control.isActive(o.jodit,i.control,i));else{if(!e)return;var d,c,u=void 0;(i.control.tags||i.control.options&&i.control.options.tags)&&(d=i.control.tags||i.control.options&&i.control.options.tags,u=e,l.Dom.up(u,function(e){if(e&&-1!==d.indexOf(e.nodeName.toLowerCase()))return i.btn.classList.add("jodit_active"),!0},o.jodit.editor)),(i.control.css||i.control.options&&i.control.options.css)&&(c=i.control.css||i.control.options&&i.control.options.css,u=e,l.Dom.up(u,function(e){e&&e.nodeType!==Node.TEXT_NODE&&n(i,c,e)},o.jodit.editor))}}),this.jodit.events.fire("updateToolbar")},t.prototype.setLabel=function(e,o,i,n,r,a){var l,d="string"==typeof e?e:e.name||"empty";this.jodit.options.textIcons?l=""+d+"":(l=t.getIcon(n,""),""===l&&"string"==typeof r.icon&&(l=t.getIcon(r.icon,"")),""===l&&(l=t.getIcon("string"==typeof r.name?r.name:"empty","")));var c=s.dom(l,this.jodit.ownerDocument);c&&c.nodeType!==Node.TEXT_NODE&&c.classList.add("jodit_icon","jodit_icon_"+i),o&&o.appendChild(c),void 0!==a&&""!==a&&o&&(o.innerHTML=a),r.iconURL&&o&&(o.style.backgroundImage="url("+r.iconURL+")",o.style.display="inline-block")},t.prototype.addButton=function(e,o,i,n){var r=this,a=s.extend(!0,{},this.defaultControl,o),l=s.dom('
    • ',this.jodit.ownerDocument),d="string"==typeof e?e:e.name||"empty",c="string"==typeof e?e:e.icon||e.name||"empty",u=l.querySelector("a"),p=d.replace(/[^a-zA-Z0-9]/g,"_");this.setLabel(e,u.firstChild,p,c,a,i),l.classList.add("jodit_toolbar_btn-"+p);var f=function(e){r.jodit.options.readonly&&-1===r.jodit.options.activeButtonsInReadOnly.indexOf(d)&&(e=!1),void 0!==e&&t.__toggleButton(l,e)};f(),this.jodit.events.on(s.camelCase("can-"+p),f);var h=null;if(a.hotkeys){var m=Array.isArray(a.hotkeys)?a.hotkeys:a.hotkeys.split(/[\s,]/);h=function(e){return r.jodit.events.fire(l,"mousedown"),!1},this.jodit.events.on(m.join(" "),h)}if(void 0!==a&&"object"==typeof a||(a={command:d}),a.list&&u&&(l.classList.add("jodit_with_dropdownlist"),u.appendChild(s.dom('',this.jodit.ownerDocument))),l){var v=l.querySelector(".jodit_tooltip");v&&(a.tooltip?v.innerHTML=this.jodit.i18n(a.tooltip)+(a.hotkeys?"
      "+s.asArray(a.hotkeys).join(" "):""):l.removeChild(v))}return this.jodit.events.on(l,"mousedown touchend",function(e){if(e.stopImmediatePropagation(),e.preventDefault(),l.classList.contains("jodit_disabled"))return!1;a.list?r.openList(l,a,n):void 0!==a.exec&&"function"==typeof a.exec?(a.exec(r.jodit,n||r.jodit.selection.current(),a,e,l),r.checkActiveButtons(!1),r.jodit.setEditorValue(),r.jodit.events.fire("hidePopup")):void 0!==a.popup&&"function"==typeof a.popup?r.openPopup(l,a.popup(r.jodit,n||r.jodit.selection.current(),a,function(){r.closeAll(),r.jodit.selection.removeMarkers()})):(a.command||d)&&(r.jodit.execCommand(a.command||d,a.args&&a.args[0]||!1,a.args&&a.args[1]||null),r.closeAll())}),this.buttonList.push({control:a,btn:l,container:u.firstChild,name:d,canActionCallback:f,hotKeyCallback:h||void 0}),l},t.prototype.build=function(e,t,o){var i=this,r=!1;this.clear(),"string"==typeof e&&(e=e.split(/[\s,]+/)),e.forEach(function(e){var t="string"==typeof e?e:e.name||"";if(-1===i.jodit.options.removeButtons.indexOf(t))switch(t){case"\n":i.container.appendChild(s.dom('
    • ',i.jodit.ownerDocument));break;case"|":r||(r=!0,i.container.appendChild(s.dom('
    • ',i.jodit.ownerDocument)));break;default:var a=e;r=!1,"object"!=typeof a&&void 0!==i.jodit.options.controls[a]&&(a=i.jodit.options.controls[a]),"object"==typeof a&&a.name&&void 0!==i.jodit.options.controls[a.name]&&(a=n({},i.jodit.options.controls[a.name],a)),"object"!=typeof a&&(a={name:a,command:a,tooltip:a}),i.container.appendChild(i.addButton(e,a,"",o))}}),this.container.parentNode!==t&&t.appendChild(this.container),this.checkActiveButtons(!1)},t.prototype.clear=function(){var e=this;this.buttonList.forEach(function(t){t.btn.parentNode&&t.btn.parentNode.removeChild(t.btn),e.jodit.events.off(t.btn),delete t.btn;var o=t.name.replace(/[^a-zA-Z0-9]/g,"_");if(e.jodit.events.off(s.camelCase("can-"+o),t.canActionCallback),t.control.hotkeys&&t.hotKeyCallback){var i=Array.isArray(t.control.hotkeys)?t.control.hotkeys:t.control.hotkeys.split(/[\s,]/);e.jodit.events.off(i.join(" "),t.hotKeyCallback)}}),this.buttonList.length=0,this.container.innerHTML=""},t.icons={},t}(r.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(13),s=o(5),a=o(10),l=o(11),d=o(3),c=o(12),u=o(2),p=o(0),f=o(0);t.Jodit=function(e){function t(o,i){var n=e.call(this)||this;n.version="3.1.17",n.buffer={},n.components=[],n.__modulesInstances={},n.__plugins={},n.__defaultStyleDisplayKey="data-jodit-default-style-display",n.commands={},n.__whoLocked="",n.isLocked=function(){return""!==n.__whoLocked},n.isLockedNotBy=function(e){return n.isLocked()&&n.__whoLocked!==e},n.mode=u.MODE_WYSIWYG,n.getVersion=function(){return n.version},n.events=new c.EventsNative;var a=function(){};if(a.prototype=t.defaultOptions,n.options=new a,void 0!==i&&"object"==typeof i&&Object.keys(i).forEach(function(e){n.options[e]="object"!=typeof t.defaultOptions[e]||Array.isArray(t.defaultOptions[e])?i[e]:p.extend(!0,{},t.defaultOptions[e],i[e])}),n.editorDocument=n.options.ownerDocument,n.editorWindow=n.options.ownerWindow,n.ownerDocument=n.options.ownerDocument,n.ownerWindow=n.options.ownerWindow,!(void 0!==(n.element="string"==typeof o?n.ownerDocument.querySelector(o):o)&&"object"==typeof n.element&&"nodeType"in n.element&&n.element.nodeType===Node.ELEMENT_NODE&&n.element.cloneNode))throw Error('Element "'+o+'" should be string or HTMLElement instance');n.selection=new r.Select(n),n.uploader=new l.Uploader(n),n.container=p.dom('
      ',n.ownerDocument),n.container.classList.add("jodit_"+(n.options.theme||"default")+"_theme"),n.options.zIndex&&(n.container.style.zIndex=""+parseInt(""+n.options.zIndex,10)),n.workplace=p.dom('
      ',n.ownerDocument),n.progress_bar=p.dom('
      ',n.ownerDocument),n.toolbar=new s.Toolbar(n),n.toolbar.build(n.options.buttons.concat(n.options.extraButtons),n.container),n.container.classList.add("jodit_toolbar_size-"+(-1!==["middle","large","small"].indexOf(n.options.toolbarButtonSize.toLowerCase())?n.options.toolbarButtonSize.toLowerCase():"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.workplace.appendChild(n.progress_bar),n.element.parentNode&&n.element.parentNode.insertBefore(n.container,n.element),n.helper=f,n.options.events&&p.each(n.options.events,function(e,t){n.events.on(e,t)}),n.id=n.element.getAttribute("id")||""+(new Date).getTime(),n.initPlugines(),n.__createEditor(),n.setElementValue(),t.instances[n.id]=n;try{n.editorDocument.execCommand("enableObjectResizing",!1,!1),n.editorDocument.execCommand("enableInlineTableEditing",!1,!1)}catch(e){}return n.setMode(n.options.defaultMode),n.options.readonly&&n.setReadOnly(!0),n.events.fire("afterInit",n),n}return i(t,e),t.prototype.getInstance=function(e,o){if(void 0===t.modules[e])throw Error("Need real module name");return void 0===this.__modulesInstances[e]&&(this.__modulesInstances[e]=new t.modules[e](this,o)),this.__modulesInstances[e]},t.prototype.initPlugines=function(){var e=this,o=Array.isArray(this.options.disablePlugins)?this.options.disablePlugins.map(function(e){return e.toLowerCase()}):this.options.disablePlugins.toLowerCase().split(/[\s,]+/);Object.keys(t.plugins).forEach(function(i){-1===o.indexOf(i.toLowerCase())&&(e.__plugins[i]=new t.plugins[i](e))})},t.prototype.__createEditor=function(){var e=this;!1!==this.events.fire("createEditor")&&(this.editor=p.dom('
      ',this.ownerDocument),this.workplace.appendChild(this.ownerDocument.createTextNode("\n")),this.workplace.appendChild(this.editor),this.workplace.appendChild(this.ownerDocument.createTextNode("\n"))),this.options.editorCssClass&&this.editor.classList.add(this.options.editorCssClass),this.events.on(this.editor,"keydown keyup keypress mousedown mouseup mousepress paste resize touchstart touchend focus blur",function(t){if(!e.options.readonly&&e.events&&e.events.fire){if(!1===e.events.fire(t.type,t))return!1;e.setEditorValue()}}),this.options.spellcheck&&this.editor.setAttribute("spellcheck","true"),this.options.direction&&(this.editor.style.direction="rtl"===this.options.direction.toLowerCase()?"rtl":"ltr"),this.element.style.display&&this.element.setAttribute(this.__defaultStyleDisplayKey,this.element.style.display),this.element.style.display="none",this.options.triggerChangeEvent&&this.events.on("change",p.debounce(function(){e.events.fire(e.element,"change")},this.options.observer.timeout))},t.prototype.destruct=function(){var e=this;!1!==this.events.fire("beforeDestruct")&&this.editor&&(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("style")&&!this.element.getAttribute("style")&&this.element.removeAttribute("style"),Object.keys(this.__plugins).forEach(function(t){void 0!==e.__plugins&&void 0!==e.__plugins[t]&&void 0!==e.__plugins[t].destruct&&"function"==typeof e.__plugins[t].destruct&&e.__plugins[t].destruct(),delete e.__plugins[t]}),this.components.forEach(function(e){void 0!==e.destruct&&"function"==typeof e.destruct&&e.destruct()}),delete this.selection,this.events.off(this.events),this.events.off(this.ownerWindow),this.events.off(this.element),this.events.off(this.editor),delete this.events,this.container.parentNode&&this.container.parentNode.removeChild(this.container),delete this.container,delete this.editor,delete this.workplace,delete t.instances[this.id])},t.prototype.getElementValue=function(){return void 0!==this.element.value?this.element.value:this.element.innerHTML},t.prototype.getEditorValue=function(){var e;if(void 0!==(e=this.events.fire("beforeGetValueFromEditor")))return e;"
      "===(e=this.editor?this.editor.innerHTML.replace(u.INVISIBLE_SPACE_REG_EXP,""):this.getElementValue())&&(e="");var t={value:e};return this.events.fire("afterGetValueFromEditor",t),t.value},t.prototype.setElementValue=function(e){if("string"!=typeof e&&void 0!==e)throw Error("value must be string");void 0!==e?void 0!==this.element.value?this.element.value=e:this.element.innerHTML=e:e=this.getElementValue(),e!==this.getEditorValue()&&this.setEditorValue(e)},t.prototype.setEditorValue=function(e){if(this.editor){if("string"!=typeof e&&void 0!==e)throw Error("value must be string");void 0!==e&&this.editor.innerHTML!==e&&(this.editor.innerHTML=e);var t=this.getElementValue(),o=this.getEditorValue();t!==o&&(this.setElementValue(o),this.events.fire("change",t,o))}},t.prototype.execCustomCommands=function(e,t,o){var i=this;if(void 0===t&&(t=!1),void 0===o&&(o=null),e=e.toLowerCase(),void 0!==this.commands[e]){var n;return this.commands[e].forEach(function(r){var s;s="function"==typeof r?r:r.exec;var a=s.call(i,e,t,o);void 0!==a&&(n=a)}),n}},t.prototype.registerCommand=function(e,t){var o=this;if(e=e.toLowerCase(),void 0===this.commands[e]&&(this.commands[e]=[]),this.commands[e].push(t),"function"!=typeof t){var i=this.options.commandToHotkeys[e]||t.hotkeys;i&&this.events.on(p.asArray(i).map(function(e){return e+".hotkey"}).join(" "),function(){return o.execCommand(e)})}},t.prototype.execCommand=function(e,t,o){if(void 0===t&&(t=!1),void 0===o&&(o=null),!this.options.readonly){var i;if(e=e.toLowerCase(),i=this.events.fire("beforeCommand",e,t,o),!1!==i&&(i=this.execCustomCommands(e,t,o)),!1!==i)switch(this.selection.focus(),e){case"selectall":this.selection.select(this.editor,!0);break;default:try{i=this.editorDocument.execCommand(e,t,o)}catch(e){}}return this.events.fire("afterCommand",e,t,o),this.setEditorValue(),i}},t.prototype.lock=function(e){this.__whoLocked=e,this.editor.classList.add("jodit_disabled")},t.prototype.unlock=function(){this.__whoLocked="",this.editor.classList.remove("jodit_disabled")},t.prototype.getMode=function(){return this.mode},t.prototype.getRealMode=function(){return this.getMode()!==u.MODE_SPLIT?this.getMode():d.Dom.isOrContains(this.editor,this.ownerDocument.activeElement)||d.Dom.isOrContains(this.toolbar.container,this.ownerDocument.activeElement)?u.MODE_WYSIWYG:u.MODE_SOURCE},t.prototype.setMode=function(e){var t=this,o={mode:e},i=["jodit_wysiwyg_mode","jodit_source_mode","jodit_split_mode"];!1!==this.events.fire("beforeSetMode",o)&&(this.mode=p.inArray(o.mode,[u.MODE_SOURCE,u.MODE_WYSIWYG,u.MODE_SPLIT])?o.mode:u.MODE_WYSIWYG,this.options.saveModeInCookie&&a.Cookie.set("jodit_default_mode",this.mode,31),i.forEach(function(e){t.container.classList.remove(e)}),this.container.classList.add(i[this.mode-1]),this.events.fire("afterSetMode"))},t.prototype.toggleMode=function(){var e=this.getMode();p.inArray(e+1,[u.MODE_SOURCE,u.MODE_WYSIWYG,this.options.useSplitMode?u.MODE_SPLIT:9])?e+=1:e=u.MODE_WYSIWYG,this.setMode(e)},t.prototype.i18n=function(e){for(var o=this,i=[],n=1;arguments.length>n;n++)i[n-1]=arguments[n];if(void 0!==this.options&&this.options.debugLanguage)return"{"+e+"}";var r;return r=void 0!==this.options&&void 0!==t.lang[p.defaultLanguage(this.options.language)]?t.lang[p.defaultLanguage(this.options.language)]:void 0!==t.lang[p.defaultLanguage(t.defaultOptions.language)]?t.lang[p.defaultLanguage(t.defaultOptions.language)]:t.lang.en,function(e){return p.sprintf.apply(o,[e].concat(i))}(void 0!==this.options&&void 0!==this.options.i18n[p.defaultLanguage(this.options.language)]&&this.options.i18n[p.defaultLanguage(this.options.language)][e]?this.options.i18n[p.defaultLanguage(this.options.language)][e]:"string"==typeof r[e]&&r[e]?r[e]:"string"==typeof t.lang.en[e]&&t.lang.en[e]?t.lang.en[e]:e)},t.prototype.setReadOnly=function(e){this.options.readonly=e,e?this.editor&&this.editor.removeAttribute("contenteditable"):this.editor&&this.editor.setAttribute("contenteditable","true"),this.events&&this.events.fire("readonly",e)},t.prototype.getReadOnly=function(){return this.options.readonly},t.plugins={},t.modules={},t.instances={},t.lang={},t}(n.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(6),s=o(4),a=o(1),l=o(0),d=o(5),c=o(2),u=o(12);a.Config.prototype.dialog={zIndex:100002,resizable:!0,draggable:!0,fullsize:!1,fullsizeButton:!1};var p=function(e){function t(t,o){void 0===o&&(o={});var i=e.call(this,t)||this;i.events=new u.EventsNative,i.lockSelect=function(){i.dialogbox.classList.add("jodit_dialog_box-moved")},i.unlockSelect=function(){i.dialogbox.classList.remove("jodit_dialog_box-moved")},i.destinition=document.body,i.document=document,i.window=window,i.destroyAfterClose=!1,i.moved=!1,i.iSetMaximization=!1,i.resizeble=!1,i.draggable=!1,i.startX=0,i.startY=0,i.startPoint={x:0,y:0,w:0,h:0},i.__isDestructed=!1,i.close=function(e){i.__isDestructed||(e&&(e.stopImmediatePropagation(),e.preventDefault()),i.jodit&&i.jodit.events&&i.jodit.events.fire(i,"beforeClose"),i.dialogbox.classList&&i.dialogbox.classList.remove("active"),i.iSetMaximization&&i.maximization(!1),i.destroyAfterClose&&i.destruct(),i.jodit&&i.jodit.events.fire(i,"afterClose"))},t&&t instanceof r.Jodit&&(i.window=t.ownerWindow,i.document=t.ownerDocument,t.events.on("beforeDestruct",function(){i.destruct()}));var s=i;s.options=t&&t.options?t.options.dialog:a.Config.prototype.dialog,s.options=n({},s.options,o),s.dialogbox=l.dom('",i.document),t&&t instanceof r.Jodit&&s.dialogbox.setAttribute("data-editor_id",t.id),Object.defineProperty(s.dialogbox,"__jodit_dialog",{value:s}),s.dialog=s.dialogbox.querySelector(".jodit_dialog"),s.resizer=s.dialogbox.querySelector(".jodit_dialog_resizer"),s.jodit&&s.jodit.options&&s.jodit.options.textIcons&&s.dialogbox.classList.add("jodit_text_icons"),s.dialogbox_header=s.dialogbox.querySelector(".jodit_dialog_header>h4"),s.dialogbox_content=s.dialogbox.querySelector(".jodit_dialog_content"),s.dialogbox_footer=s.dialogbox.querySelector(".jodit_dialog_footer"),s.dialogbox_close=s.dialogbox.querySelector(".jodit_dialog_header>a.jodit_close"),s.dialogbox_fullsize=l.dom(''+(r.Jodit.modules.Toolbar.getIcon?r.Jodit.modules.Toolbar.getIcon(o.fullsize?"fullsize":"shrink"):"")+"",i.document),s.destinition.appendChild(s.dialogbox),s.dialogbox.addEventListener("close_dialog",s.close),s.dialogbox_close.addEventListener("mousedown",s.close),s.dialogbox_fullsize.addEventListener("click",function(){var e=s.maximization();r.Jodit.modules.Toolbar&&(s.dialogbox_fullsize.innerHTML=r.Jodit.modules.Toolbar.getIcon(e?"shrink":"fullsize"))}),s.events.on(i.window,"mousemove",s.onMouseMove.bind(s)).on(i.window,"mouseup",s.onMouseUp.bind(s)).on(i.window,"keydown",s.onKeyDown.bind(s)).on(i.window,"resize",s.onResize.bind(s));var d=s.dialogbox.querySelector(".jodit_dialog_header");return d&&d.addEventListener("mousedown",s.onHeaderMouseDown.bind(s)),s.options.resizable&&s.resizer.addEventListener("mousedown",s.onResizerMouseDown.bind(s)),i}return i(t,e),t.prototype.setSize=function(e,t){e&&l.css(this.dialog,"width",e),t&&l.css(this.dialog,"height",t)},t.prototype.setPosition=function(e,t){var o=this.window.innerWidth,i=this.window.innerHeight,n=o/2-this.dialog.offsetWidth/2,r=i/2-this.dialog.offsetHeight/2;void 0!==e&&void 0!==t&&(this.offsetX=e,this.offsetY=t,this.moved=Math.abs(e-n)>100||Math.abs(t-r)>100),this.dialog.style.left=(e||n)+"px",this.dialog.style.top=(t||r)+"px"},t.prototype.setElements=function(e,t){var o=this,i=[];l.asArray(t).forEach(function(t){var n=l.dom(t,o.document);i.push(n),n.parentNode!==e&&e.appendChild(n)}),[].slice.call(e.childNodes).forEach(function(t){-1===i.indexOf(t)&&e.removeChild(t)})},t.prototype.setTitle=function(e){this.setElements(this.dialogbox_header,e)},t.prototype.setContent=function(e){this.setElements(this.dialogbox_content,e)},t.prototype.setFooter=function(e){this.setElements(this.dialogbox_footer,e),this.dialog.classList.toggle("with_footer",!!e)},t.prototype.getMaxZIndexDialog=function(){var e,t,o=0,i=this;return l.$$(".jodit_dialog_box",this.destinition).forEach(function(n){e=n.__jodit_dialog,t=parseInt(l.css(n,"zIndex"),10),e.isOpened()&&!isNaN(t)&&t>o&&(i=e,o=t)}),i},t.prototype.setMaxZIndex=function(){var e=0,t=0;l.$$(".jodit_dialog_box",this.destinition).forEach(function(o){t=parseInt(l.css(o,"zIndex"),10),e=Math.max(isNaN(t)?0:t,e)}),this.dialogbox.style.zIndex=""+(e+1)},t.prototype.maximization=function(e){return"boolean"!=typeof e&&(e=!this.dialogbox.classList.contains("jodit_dialog_box-fullsize")),this.dialogbox.classList.toggle("jodit_dialog_box-fullsize",e),[this.destinition,this.destinition.parentNode].forEach(function(t){t&&t.classList&&t.classList.toggle("jodit_fullsize_box",e)}),this.iSetMaximization=e,e},t.prototype.open=function(e,t,o,i){this.jodit&&this.jodit.events&&!1===this.jodit.events.fire(this,"beforeOpen")||(this.destroyAfterClose=!0===o,this.options.fullsizeButton&&this.dialogbox_close.parentNode&&this.dialogbox_close.parentNode.appendChild(this.dialogbox_fullsize),void 0!==t&&this.setTitle(t),e&&this.setContent(e),this.dialogbox.classList.add("active"),i&&this.dialogbox.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(this,"afterOpen"))},t.prototype.isOpened=function(){return!this.__isDestructed&&this.dialogbox.classList.contains("active")},t.prototype.onMouseUp=function(){(this.draggable||this.resizeble)&&(this.draggable=!1,this.resizeble=!1,this.unlockSelect(),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"endResize endMove"))},t.prototype.onHeaderMouseDown=function(e){this.options.draggable&&(this.draggable=!0,this.startX=e.clientX,this.startY=e.clientY,this.startPoint.x=l.css(this.dialog,"left"),this.startPoint.y=l.css(this.dialog,"top"),this.setMaxZIndex(),e.preventDefault(),this.lockSelect(),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"startMove"))},t.prototype.onMouseMove=function(e){this.draggable&&this.options.draggable&&(this.setPosition(this.startPoint.x+e.clientX-this.startX,this.startPoint.y+e.clientY-this.startY),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"move",e.clientX-this.startX,e.clientY-this.startY),e.stopImmediatePropagation(),e.preventDefault()),this.resizeble&&this.options.resizable&&(this.setSize(this.startPoint.w+e.clientX-this.startX,this.startPoint.h+e.clientY-this.startY),this.jodit&&this.jodit.events&&this.jodit.events.fire(this,"resizeDialog",e.clientX-this.startX,e.clientY-this.startY),e.stopImmediatePropagation(),e.preventDefault())},t.prototype.onKeyDown=function(e){if(this.isOpened()&&e.which===c.KEY_ESC){var t=this.getMaxZIndexDialog();t?t.close():this.close(),e.stopImmediatePropagation()}},t.prototype.onResize=function(){!this.options.resizable||this.moved||!this.isOpened()||this.offsetX||this.offsetY||this.setPosition()},t.prototype.destruct=function(){this.dialogbox&&this.dialogbox.parentNode&&this.dialogbox.parentNode.removeChild(this.dialogbox),delete this.dialogbox,this.events.destruct(),this.__isDestructed=!0},t.prototype.onResizerMouseDown=function(e){this.resizeble=!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")},t}(s.Component);t.Dialog=p,t.Alert=function(e,t,o,i){void 0===i&&(i="jodit_alert"),"function"==typeof t&&(o=t,t=void 0);var n=new p,s=l.dom('
      ',n.document),a=l.dom(''+d.Toolbar.getIcon("cancel")+""+r.Jodit.prototype.i18n("Ok")+"",n.document);return s.appendChild(l.dom(e,n.document)),a.addEventListener("click",function(){o&&"function"==typeof o&&!1===o(n)||n.close()}),n.setFooter([a]),n.open(s,t||" ",!0,!0),a.focus(),n},r.Jodit.Alert=t.Alert,t.Promt=function(e,t,o,i){var n=new p,s=l.dom(''+d.Toolbar.getIcon("cancel")+""+r.Jodit.prototype.i18n("Cancel")+"",n.document),a=l.dom(''+d.Toolbar.getIcon("check")+""+r.Jodit.prototype.i18n("Ok")+"",n.document),c=l.dom('
      ',n.document),u=l.dom("",n.document),f=l.dom("",n.document);"function"==typeof t&&(o=t,t=void 0),i&&u.setAttribute("placeholder",i),f.appendChild(l.dom(e,n.document)),c.appendChild(f),c.appendChild(u),s.addEventListener("click",n.close,!1);var h=function(){o&&"function"==typeof o&&!1===o(u.value)||n.close()};return a.addEventListener("click",h),c.addEventListener("submit",function(){return h(),!1}),n.setFooter([a,s]),n.open(c,t||" ",!0,!0),u.focus(),n},r.Jodit.Promt=t.Promt,t.Confirm=function(e,t,o){var i=new p,n=l.dom('
      ',i.document),s=l.dom("",i.document);"function"==typeof t&&(o=t,t=void 0),s.appendChild(l.dom(e,i.document)),n.appendChild(s);var a=l.dom(''+d.Toolbar.getIcon("cancel")+""+r.Jodit.prototype.i18n("Cancel")+"",i.document);a.addEventListener("click",function(){o&&o(!1),i.close()});var c=function(){o&&o(!0),i.close()},u=l.dom(''+d.Toolbar.getIcon("check")+""+r.Jodit.prototype.i18n("Yes")+"",i.document);return u.addEventListener("click",c),n.addEventListener("submit",function(){return c(),!1}),i.setFooter([u,a]),i.open(n,t||" ",!0,!0),u.focus(),i},r.Jodit.Confirm=t.Confirm},function(e,t,o){"use strict";t.__esModule=!0,t.Component=o(4).Component,t.ContextMenu=o(16).ContextMenu,t.Cookie=o(10).Cookie;var i=o(7);t.Dialog=i.Dialog,t.Alert=i.Alert,t.Confirm=i.Confirm,t.Promt=i.Promt,t.Dom=o(3).Dom,t.EventsNative=o(12).EventsNative,t.FileBrowser=o(50).FileBrowser,t.Helpers=o(0),t.ImageEditor=o(51).ImageEditor,t.Observer=o(17).Observer,t.Select=o(13).Select,t.Snapshot=o(18).Snapshot,t.Table=o(15).Table,t.Toolbar=o(5).Toolbar,t.Stack=o(19).Stack,t.Uploader=o(11).Uploader},function(e,t,o){"use strict";t.__esModule=!0;var i=o(6),n=o(0),r=o(3);!function(e){e.ColorPickerWidget=function(e,t,o){var s=n.normalizeColor(o),a=n.dom('
      ',e.ownerDocument),l=function(e){var t=[];return n.isPlainObject(e)?Object.keys(e).forEach(function(o){t.push('
      '),t.push(l(e[o])),t.push("
      ")}):Array.isArray(e)&&e.forEach(function(e){t.push("'+(s===e?i.Jodit.modules.Toolbar.getIcon("eye"):"")+"")}),t.join("")};return a.appendChild(n.dom("
      "+l(e.options.colors)+"
      ",e.ownerDocument)),a.appendChild(n.dom(''+i.Jodit.modules.Toolbar.getIcon("eraser")+"",e.ownerDocument)),e.events.on(a,"mousedown touchstart",function(o){o.stopPropagation();var s=o.target;if("SVG"!==s.tagName.toUpperCase()&&"PATH"!==s.tagName.toUpperCase()||!s.parentNode||(s=r.Dom.closest(s.parentNode,"A",e.editor)),"A"===s.tagName.toUpperCase()){var l=a.querySelector("a.active");l&&(l.classList.remove("active"),l.innerHTML="");var d=s.getAttribute("data-color")||"";if(d){s.innerHTML=i.Jodit.modules.Toolbar.getIcon("eye"),s.classList.add("active");var c=n.hexToRgb(d);c&&(s.firstChild.style.fill="rgb("+(255-c.r)+","+(255-c.g)+","+(255-c.b)+")")}t&&"function"==typeof t&&t(d),o.preventDefault()}}),a},e.TabsWidget=function(e,t,o){var i=n.dom('
      ',e.ownerDocument),r=n.dom('
      ',e.ownerDocument),s=n.dom('
      ',e.ownerDocument),a={},l="",d=0;return i.appendChild(s),i.appendChild(r),n.each(t,function(t,i){var c=n.dom('
      ',e.ownerDocument),u=n.dom('',e.ownerDocument);l||(l=t),u.innerHTML=e.i18n(t),s.appendChild(u),c.appendChild("function"!=typeof i?n.dom(i,e.ownerDocument):n.dom('
      ',e.ownerDocument)),r.appendChild(c),e.events.on(u,"mousedown touchstart",function(a){return n.$$("a",s).forEach(function(e){e.classList.remove("active")}),n.$$(".jodit_tab",r).forEach(function(e){e.classList.remove("active")}),u.classList.add("active"),c.classList.add("active"),"function"==typeof i&&i.call(e),a.stopPropagation(),o&&(o.__activeTab=t),!1}),a[t]={button:u,tab:c},d+=1}),d?(n.$$("a",s).forEach(function(e){e.style.width=(100/d).toFixed(10)+"%"}),o&&o.__activeTab&&a[o.__activeTab]?(a[o.__activeTab].button.classList.add("active"),a[o.__activeTab].tab.classList.add("active")):(a[l].button.classList.add("active"),a[l].tab.classList.add("active")),i):i},e.ImageSelectorWidget=function(t,o,r,s){var a,l={};if(o.upload&&t.options.uploader&&t.options.uploader.url){var d=n.dom('
      '+t.i18n("Drop image")+"
      "+t.i18n("or click")+'
      ',t.ownerDocument);t.getInstance("Uploader").bind(d,function(e){"function"==typeof o.upload&&o.upload.call(t,{baseurl:e.baseurl,files:e.files})},function(e){t.events.fire("errorMessage",e.message)}),l[i.Jodit.modules.Toolbar.getIcon("upload")+t.i18n("Upload")]=d}if(o.filebrowser&&(t.options.filebrowser.ajax.url||t.options.filebrowser.items.url)&&(l[i.Jodit.modules.Toolbar.getIcon("folder")+t.i18n("Browse")]=function(){s&&s(),o.filebrowser&&t.getInstance("FileBrowser").open(o.filebrowser)}),o.url){var c=n.dom('
      ",t.ownerDocument),u=c.querySelector("button"),p=c.querySelector("input[name=url]");a=null,r&&r.nodeType!==Node.TEXT_NODE&&("IMG"===r.tagName||n.$$("img",r).length)&&(a="IMG"===r.tagName?r:n.$$("img",r)[0],n.val(c,"input[name=url]",a.getAttribute("src")),n.val(c,"input[name=text]",a.getAttribute("alt")),u.innerText=t.i18n("Update")),c.addEventListener("submit",function(e){return e.preventDefault(),e.stopPropagation(),n.val(c,"input[name=url]")?("function"==typeof o.url&&o.url.call(t,n.val(c,"input[name=url]"),n.val(c,"input[name=text]")),!1):(p.focus(),p.classList.add("jodit_error"),!1)},!1),l[i.Jodit.modules.Toolbar.getIcon("link")+" URL"]=c}return e.TabsWidget(t,l)}}(t.Widget||(t.Widget={}))},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4);t.Cookie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.set=function(e,t,o){var i,n;o?(n=new Date,n.setTime(n.getTime()+24*o*60*60*1e3),i="; expires="+n.toUTCString()):i="",document.cookie=e+"="+t+i+"; path=/"},t.get=function(e){var t,o,i=e+"=",n=document.cookie.split(";");for(t=0;n.length>t;t+=1){for(o=n[t];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(i))return o.substring(i.length,o.length)}return null},t.remove=function(e){t.set(e,"",-1)},t}(n.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(14),s=o(1),a=o(0),l=o(2),d=o(3);s.Config.prototype.enableDragAndDropFileToEditor=!0,s.Config.prototype.uploader={url:"",headers:null,data:null,format:"json",prepareData:function(e){return e},isSuccess:function(e){return e.success},getMessage:function(e){return void 0!==e.data.messages&&Array.isArray(e.data.messages)?e.data.messages.join(" "):""},process:function(e){return e.data},error:function(e){this.jodit.events.fire("errorMessage",e.message,"error",4e3)},defaultHandlerSuccess:function(e){var t=this;e.files&&e.files.length&&e.files.forEach(function(o){t.jodit.selection.insertImage(e.baseurl+o)})},defaultHandlerError:function(e){this.jodit.events.fire("errorMessage",e.message)}},t.Uploader=function(e){function t(t,o){var i=e.call(this,t)||this;return i.path="",i.source="default",i.options=a.extend(!0,{},s.Config.prototype.uploader,t.options.uploader,o),t.options.enableDragAndDropFileToEditor&&t.options.uploader&&t.options.uploader.url&&t.events.on("afterInit",function(){i.bind(t.editor)}),i}return i(t,e),t.prototype.buildData=function(e){if(void 0!==this.jodit.ownerWindow.FormData){if(e instanceof FormData)return e;if("string"==typeof e)return e;var t=new FormData;return Object.keys(e).forEach(function(o){t.append(o,e[o])}),t}return e},t.prototype.send=function(e,t){var o=this;this.__ajax=new r.Ajax(this.jodit,{xhr:function(){var e=new XMLHttpRequest;return void 0!==o.jodit.ownerWindow.FormData?e.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=e.loaded/e.total;t*=100,o.jodit.progress_bar.style.display="block",o.jodit.progress_bar.style.width=t+"%",100===t&&(o.jodit.progress_bar.style.display="none")}},!1):o.jodit.progress_bar.style.display="none",e},method:"POST",data:this.buildData(e),url:this.options.url,headers:this.options.headers,contentType:(void 0===this.jodit.ownerWindow.FormData||"string"==typeof e)&&"application/x-www-form-urlencoded; charset=UTF-8",dataType:this.options.format||"json"}),this.__ajax.send().then(t).catch(function(e){o.options.error.call(o,e)})},t.prototype.sendFiles=function(e,t,o,i){var n=this;if(e){var r,s,l,d,c=e.length,u=this;if(!c)return!1;s=new FormData,s.append("path",u.path),s.append("source",u.source);var p;for(r=0;c>r;r+=1)if((p=e[r])&&p.type){var f=p.type.match(/\/([a-z0-9]+)/i);l=f[1]?f[1].toLowerCase():"",s.append("files["+r+"]",e[r],e[r].name||(""+Math.random()).replace(".","")+"."+l)}if(u.options.prepareData(s),i&&i(s),u.options.data&&a.isPlainObject(u.options.data))for(d=Object.keys(u.options.data),r=0;d.length>r;r+=1)s.append(d[r],u.options.data[d[r]]);u.send(s,function(e){if(!n.options.isSuccess.call(u,e))return void(o||u.options.defaultHandlerError).call(u,Error(u.options.getMessage(e)));"function"==typeof(t||u.options.defaultHandlerSuccess)&&(t||u.options.defaultHandlerSuccess).call(u,u.options.process.call(u,e))})}},t.prototype.setPath=function(e){this.path=e},t.prototype.setSource=function(e){this.source=e},t.dataURItoBlob=function(e){var t,o=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(o.length),r=new Uint8Array(n);for(t=0;o.length>t;t+=1)r[t]=o.charCodeAt(t);return new Blob([r],{type:i})},t.prototype.bind=function(e,o,i){var n=this,r=this,s=function(e){var s,c,u,p,f=function(e){c&&(e.append("extension",u),e.append("mimetype",c.type))};if(e.clipboardData&&e.clipboardData.files&&e.clipboardData.files.length)return n.sendFiles(e.clipboardData.files,o,i),!1;if(a.browser("ff"))return void(e.clipboardData.types.length||e.clipboardData.types[0]===l.TEXT_PLAIN||(p=d.Dom.create("div","",n.jodit.editorDocument),n.jodit.selection.insertNode(p),p.focus(),setTimeout(function(){var e=p.firstChild;if(e&&e.hasAttribute("src")){var n=e.getAttribute("src")||"";p.parentNode&&p.parentNode.removeChild(p),r.sendFiles([t.dataURItoBlob(n)],o,i)}},200)));if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length)for(s=0;e.clipboardData.items.length>s;s+=1)if("file"===e.clipboardData.items[s].kind&&"image/png"===e.clipboardData.items[s].type){if(c=e.clipboardData.items[s].getAsFile()){var h=c.type.match(/\/([a-z0-9]+)/i);u=h[1]?h[1].toLowerCase():"",n.sendFiles([c],o,i,f)}e.preventDefault();break}};this.jodit.editor!==e?r.jodit.events.on(e,"paste",s):r.jodit.events.on("processPaste",s),r.jodit.events.on(e,"dragover",function(t){e.classList.add("draghover"),t.preventDefault()}).on(e,"dragleave dragend",function(t){e.classList.remove("draghover"),t.preventDefault()}).on(e,"drop",function(t){if(e.classList.remove("draghover"),t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length)t.preventDefault(),n.sendFiles(t.dataTransfer.files,o,i);else if(t.dataTransfer&&t.dataTransfer.getData(l.TEXT_PLAIN)&&"-"!==t.dataTransfer.getData(l.TEXT_PLAIN)&&e===r.jodit.editor){if(t.preventDefault(),t.stopPropagation(),!n.jodit.selection.insertCursorAtPoint(t.clientX,t.clientY))return!1;if(o||n.options.defaultHandlerSuccess){var s={baseurl:"",files:[]};s.files=[t.dataTransfer.getData(l.TEXT_PLAIN)],(o||n.options.defaultHandlerSuccess).call(n,s)}t.preventDefault()}});var c=e.querySelector("input[type=file]");c&&r.jodit.events.on(c,"change",function(){r.sendFiles(this.files,o,i)})},t.prototype.uploadRemoteImage=function(e,t,o){var i=this,n=this;n.send({action:"fileUploadRemote",url:e},function(e){if(n.options.isSuccess.call(n,e))"function"==typeof t?t.call(n,i.options.process(e)):i.options.defaultHandlerSuccess.call(n,i.options.process(e));else if("function"==typeof(o||n.options.defaultHandlerError))return void(o||i.options.defaultHandlerError).call(n,Error(n.options.getMessage(e)))})},t}(n.Component)},function(e,t,o){"use strict";t.__esModule=!0;var i=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 i=this.get(e,t);if(i)for(var n=0;i.length>n;n+=1)if(i[n].originalCallback===o)return n;return!1},e.prototype.namespaces=function(){return Object.keys(this.__store)},e.prototype.events=function(e){return this.__store[e]?Object.keys(this.__store[e]):[]},e.prototype.set=function(e,t,o,i){void 0===i&&(i=!1),void 0===this.__store[t]&&(this.__store[t]={}),void 0===this.__store[t][e]&&(this.__store[t][e]=[]),i?this.__store[t][e].unshift(o):this.__store[t][e].push(o)},e}();t.EventsNative=function(){function e(e){var t=this;this.__defaultNameSpace="JoditEventDefaultNamespace",this.__key="__JoditEventsNativeNamespaces",this.current="",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],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},enumerable:!0}))},this.__stopped=[],e&&(this.doc=e)}return e.prototype.eachEvent=function(e,t){var o=this;e.split(/[\s,]+/).forEach(function(e){var i=e.split(".");t.call(o,i[0],i[1]||o.__defaultNameSpace)})},e.prototype.getStore=function(e){if(void 0===e[this.__key]){var t=new i;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.on=function(e,t,o,i,n){var r=this;void 0===n&&(n=!1);var s="string"==typeof e?this:e,a="string"==typeof t?t:e,l=o;void 0===l&&"function"==typeof t&&(l=t);var d=this.getStore(s);if("string"!=typeof a||""===a)throw Error("Need events names");if("function"!=typeof l)throw Error("Need event handler");if(Array.isArray(s))return s.forEach(function(e){r.on(e,a,l,i)}),this;var c="function"==typeof s.addEventListener,u=this,p=function(){return l&&l.apply(this,arguments)};return c&&(p=function(e){if(u.prepareEvent(e),l&&!1===l.call(this,e))return e.preventDefault(),e.stopImmediatePropagation(),!1},i&&(p=function(e){u.prepareEvent(e);for(var t=e.target;t&&t!==this;){if(t.matches(i)){if(l&&!1===l.call(t,e))return e.preventDefault(),!1;return}t=t.parentNode}})),this.eachEvent(a,function(e,t){if(""===e)throw Error("Need event name");if(!1===d.indexOf(e,t,l)){var o={event:e,originalCallback:l,syntheticCallback:p};d.set(e,t,o,n),t!==r.__defaultNameSpace&&d.set(e,r.__defaultNameSpace,o,n),c&&s.addEventListener(e,p,!1)}}),this},e.prototype.off=function(e,t,o){var i=this,n="string"==typeof e?this:e,r="string"==typeof t?t:e,s=this.getStore(n),a=o;if("string"!=typeof r||!r)return s.namespaces().forEach(function(e){i.off(n,"."+e)}),this.clearStore(n),this;void 0===a&&"function"==typeof t&&(a=t);var l="function"==typeof n.removeEventListener,d=function(e){l&&n.removeEventListener(e.event,e.syntheticCallback,!1)},c=function(e,t){if(""!==e){var o=s.get(e,t);if(o&&o.length){var n=!1;if("function"!=typeof a)o.forEach(d),o.length=0,n=!0;else{var r=s.indexOf(e,t,a);!1!==r&&(d(o[r]),o.splice(r,1),n=!0)}n&&t!==i.__defaultNameSpace&&c(e,i.__defaultNameSpace)}}else s.events(t).forEach(function(e){""!==e&&c(e,t)})};return this.eachEvent(r,function(e,t){t===i.__defaultNameSpace?s.namespaces().forEach(function(t){c(e,t)}):c(e,t)}),this},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)},e.prototype.stopPropagation=function(e,t){var o=this,i="string"==typeof e?this:e,n="string"==typeof e?e:t;if("string"!=typeof n)throw Error("Need event names");var r=this.getStore(i);this.eachEvent(n,function(e,t){var i=r.get(e,t);i&&o.__stopped.push(i)})},e.prototype.removeStop=function(e){if(e){var t=this.__stopped.indexOf(e);-1!==t&&this.__stopped.splice(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=this,i=[],n=2;arguments.length>n;n++)i[n-2]=arguments[n];var r,s=void 0,a="string"==typeof e?this:e,l="string"==typeof e?e:t,d="string"==typeof e?[t].concat(i):i,c="function"==typeof a.dispatchEvent;if(!c&&"string"!=typeof l)throw Error("Need events names");var u=this.getStore(a);return"string"!=typeof l&&c?this.triggerNativeEvent(a,t):this.eachEvent(l,function(e,t){if(c)o.triggerNativeEvent(a,e);else{var i=u.get(e,t);if(i){o.current=e;try{i.every(function(e){return!o.isStopped(i)&&(r=e.syntheticCallback.apply(a,d),void 0!==r&&(s=r),!0)})}finally{o.removeStop(i)}}}}),s},e.prototype.destruct=function(){this.off(this)},e}()},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(2),r=o(4),s=o(0),a=o(3);t.Select=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isMarker=function(e){return a.Dom.isNode(e,t.jodit.editorWindow)&&"SPAN"===e.tagName&&e.hasAttribute("data-"+n.MARKER_CLASS)},t.marker=function(e,o){void 0===e&&(e=!1);var i=null;o&&(i=o.cloneRange(),i.collapse(e));var r=t.jodit.editorDocument.createElement("span");return r.id=n.MARKER_CLASS+"_"+ +new Date+"_"+(""+Math.random()).slice(2),r.style.lineHeight="0",r.style.display="none",r.setAttribute("data-"+n.MARKER_CLASS,e?"start":"end"),r.appendChild(t.jodit.editorDocument.createTextNode(n.INVISIBLE_SPACE)),i&&i.insertNode(r),r},t.focus=function(){var e=t.jodit;if(!t.isFocused()){if(e.options.iframe&&s.isIE())for(var o=0;1e5>o&&"complete"!==e.editorDocument.readyState;)o++;e.iframe&&e.iframe.focus(),e.editorWindow.focus(),e.editor.focus();var i=e.editorWindow.getSelection(),r=e.editorDocument.createRange();if(!i.rangeCount||!t.current()){var a=e.editor.firstChild;a||(a=e.editorDocument.createTextNode(n.INVISIBLE_SPACE),e.editor.appendChild(a)),r.selectNodeContents(a),r.collapse(!0),i.removeAllRanges(),i.addRange(r)}return!0}return!1},t.eachSelection=function(e){var o=t.jodit.editorWindow.getSelection();if(o.rangeCount){var i=o.getRangeAt(0),n=[],r=i.endContainer===t.jodit.editor?t.jodit.editor.childNodes[i.endOffset-1]:i.endContainer;a.Dom.find(i.startContainer===t.jodit.editor?t.jodit.editor.childNodes[i.startOffset]:i.startContainer,function(e){return!e||a.Dom.isEmptyTextNode(e)||t.isMarker(e)||n.push(e),e===r},t.jodit.editor,!0,"nextSibling",!1),n.forEach(function(t){e(t)})}},t.applyCSS=function(e,o,i){void 0===o&&(o="span");var r,l=function(e){return null!==e&&!a.Dom.isEmptyTextNode(e)&&!t.isMarker(e)},d=function(e){return"FONT"!==e.nodeName&&e.nodeType===Node.ELEMENT_NODE&&(s.isPlainObject(i)&&!1!==s.each(i,function(t,o){return-1!==o.indexOf((""+s.css(e,t)).toLowerCase())})||"function"==typeof i&&i(t.jodit,e))},c=function(e){return(RegExp("^"+e.nodeName+"$","i").test(o)||!(!i||!d(e)))&&l(e)},u=function(t){c(t)&&("SPAN"===t.nodeName&&e&&Object.keys(e).forEach(function(o){0===r||s.css(t,o)==s.normilizeCSSValue(o,e[o])?(s.css(t,o,""),void 0===r&&(r=0)):(s.css(t,o,e[o]),void 0===r&&(r=1))}),t.getAttribute("style")&&"SPAN"===t.nodeName||(a.Dom.unwrap(t),void 0===r&&(r=0)))};if(t.isCollapsed()){var p=!1;if(t.current()&&a.Dom.closest(t.current(),o,t.jodit.editor)){p=!0;var f=a.Dom.closest(t.current(),o,t.jodit.editor);f&&t.setCursorAfter(f)}if("SPAN"===o.toUpperCase()||!p){var h=a.Dom.create(o,n.INVISIBLE_SPACE,t.jodit.editorDocument);t.insertNode(h),"SPAN"===o.toUpperCase()&&e&&s.css(h,e),t.setCursorIn(h)}}else{var m=t.save();s.normalizeNode(t.jodit.editor.firstChild),t.jodit.editorDocument.execCommand("fontsize",!1,7),s.$$('font[size="7"]',t.jodit.editor).forEach(function(i){if(a.Dom.next(i,l,i.parentNode)||a.Dom.prev(i,l,i.parentNode)||!c(i.parentNode))if(i.firstChild&&!a.Dom.next(i.firstChild,l,i)&&!a.Dom.prev(i.firstChild,l,i)&&c(i.firstChild))u(i.firstChild);else if(a.Dom.closest(i,c,t.jodit.editor)){var n=t.jodit.editorDocument.createRange(),d=a.Dom.closest(i,c,t.jodit.editor);n.setStartBefore(d),n.setEndBefore(i);var p=n.extractContents();p.textContent&&s.trim(p.textContent).length||!p.firstChild||a.Dom.unwrap(p.firstChild),d.parentNode&&d.parentNode.insertBefore(p,d),n.setStartAfter(i),n.setEndAfter(d);var f=n.extractContents();f.textContent&&s.trim(f.textContent).length||!f.firstChild||a.Dom.unwrap(f.firstChild),a.Dom.after(d,f),u(d)}else{var h=[],m=void 0;i.firstChild&&a.Dom.find(i.firstChild,function(e){return e&&c(e)?(void 0===m&&(m=!0),h.push(e)):void 0===m&&(m=!1),!1},i,!0),h.forEach(a.Dom.unwrap),m||(void 0===r&&(r=1),1===r&&s.css(a.Dom.replace(i,o,!1,!1,t.jodit.editorDocument),e&&"SPAN"===o.toUpperCase()?e:{}))}else u(i.parentNode);i.parentNode&&a.Dom.unwrap(i)}),t.restore(m)}},t}return i(t,e),t.prototype.insertCursorAtPoint=function(e,t){var o,i=this.jodit.editorDocument;this.removeMarkers();try{var n=i.createRange();if(i.caretPositionFromPoint?(o=i.caretPositionFromPoint(e,t),n.setStart(o.offsetNode,o.offset)):this.jodit.editorDocument.caretRangeFromPoint&&(o=this.jodit.editorDocument.caretRangeFromPoint(e,t),n=this.jodit.editorDocument.createRange(),n.setStart(o.startContainer,o.startOffset)),n&&void 0!==this.jodit.editorWindow.getSelection){n.collapse(!0);var r=this.jodit.editorWindow.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==i.body.createTextRange){var s=i.body.createTextRange();s.moveToPoint(e,t),s.select()}return!0}catch(e){}return!1},t.prototype.removeMarkers=function(){s.$$("span[data-"+n.MARKER_CLASS+"]",this.jodit.editor).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})},t.prototype.restore=function(e){var t=this;if(void 0===e&&(e=[]),Array.isArray(e)){var o=this.jodit.editorWindow.getSelection();o.removeAllRanges(),e.forEach(function(e){var i=t.jodit.editorDocument.createRange(),n=t.jodit.editor.querySelector("#"+e.endId),r=t.jodit.editor.querySelector("#"+e.startId);if(r){if(e.collapsed||!n){var s=r.previousSibling;s&&s.nodeType===Node.TEXT_NODE?i.setStart(s,s.nodeValue?s.nodeValue.length:0):i.setStartBefore(r),r.parentNode&&r.parentNode.removeChild(r),i.collapse(!0)}else i.setStartAfter(r),r.parentNode&&r.parentNode.removeChild(r),i.setEndBefore(n),n.parentNode&&n.parentNode.removeChild(n);o.addRange(i)}})}},t.prototype.save=function(){var e=this.jodit.editorWindow.getSelection();if(!e.rangeCount)return[];var t,o,i,n=[],r=e.rangeCount,s=[];for(t=0;r>t;t+=1)s[t]=e.getRangeAt(t),s[t].collapsed?(o=this.marker(!0,s[t]),n[t]={startId:o.id,collapsed:!0,startMarker:o.outerHTML}):(o=this.marker(!0,s[t]),i=this.marker(!1,s[t]),n[t]={startId:o.id,endId:i.id,collapsed:!1,startMarker:o.outerHTML,endMarker:i.outerHTML});for(e.removeAllRanges(),t=r-1;t>=0;--t){var a=this.jodit.editorDocument.getElementById(n[t].startId);if(a)if(n[t].collapsed)s[t].setStartAfter(a),s[t].collapse(!0);else if(s[t].setStartBefore(a),n[t].endId){var l=this.jodit.editorDocument.getElementById(n[t].endId);l&&s[t].setEndAfter(l)}try{e.addRange(s[t].cloneRange())}catch(e){}}return n},t.prototype.isCollapsed=function(){var e,t=this.jodit.editorWindow.getSelection();for(e=0;t.rangeCount>e;e+=1)if(!t.getRangeAt(e).collapsed)return!1;return!0},t.prototype.isFocused=function(){return this.jodit.editorDocument.hasFocus&&this.jodit.editorDocument.hasFocus()&&this.jodit.editor===this.jodit.editorDocument.activeElement},t.prototype.current=function(){if(this.jodit.getRealMode()===n.MODE_WYSIWYG&&void 0!==this.jodit.editorWindow.getSelection){var e=this.jodit.editorWindow.getSelection();if(e.rangeCount>0){var t=e.getRangeAt(0),o=t.startContainer;if(t.startContainer.nodeType!==Node.TEXT_NODE&&t.startContainer===t.endContainer&&t.startOffset!==t.endOffset&&(o=t.startContainer.childNodes[t.startOffset]),a.Dom.isOrContains(this.jodit.editor,o))return o}}return!1},t.prototype.insertNode=function(e,t){if(void 0===t&&(t=!0),!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(this.focus(),!this.jodit.editorWindow.getSelection)throw Error("Jodit does'n support this browser");var o=this.jodit.editorWindow.getSelection();if(this.isCollapsed()||this.jodit.execCommand("Delete"),o.rangeCount){var i=o.getRangeAt(0);!function(e,t){for(var o=t;o;){if(o===e)return!0;o=o.parentNode}return!1}(this.jodit.editor,i.commonAncestorContainer)?this.jodit.editor.appendChild(e):(i.deleteContents(),i.insertNode(e))}else this.jodit.editor.appendChild(e);t&&this.setCursorAfter(e),this.jodit.setEditorValue()},t.prototype.insertHTML=function(e){if(""!==e){var t,o,i=this.jodit.editorDocument.createElement("div"),n=this.jodit.editorDocument.createDocumentFragment();for(this.isFocused()||this.jodit.editor.focus(),e instanceof this.jodit.editorWindow.Node?a.Dom.isNode(e,this.jodit.editorWindow)&&i.appendChild(e):i.innerHTML=""+e,t=i.lastChild;i.firstChild;)t=i.firstChild,n.appendChild(i.firstChild);for(this.insertNode(n,!1),t?this.setCursorAfter(t):this.setCursorIn(n),o=this.jodit.editor.lastChild;o&&o.nodeType===Node.TEXT_NODE&&o.previousSibling&&o.nodeValue&&/^\s*$/.test(o.nodeValue);)o=o.previousSibling;t&&(o&&t===o&&t.nodeType===Node.ELEMENT_NODE&&this.jodit.editor.appendChild(this.jodit.editorDocument.createElement("br")),this.setCursorAfter(t))}},t.prototype.insertImage=function(e,t){void 0===t&&(t={});var o,i="string"==typeof e?s.dom('',this.jodit.editorDocument):s.dom(e,this.jodit.editorDocument);this.isCollapsed()||this.jodit.execCommand("Delete"),"string"==typeof e&&i.setAttribute("src",e),o=""+this.jodit.options.imageDefaultWidth,o&&"auto"!==o&&0>(o+"").indexOf("px")&&0>(o+"").indexOf("%")&&(o+="px"),t.width=o,t&&"object"==typeof t&&s.each(t,function(e,t){i.style[t]=e});var n=function(){(i.offsetHeight>i.naturalHeight||i.offsetWidth>i.naturalWidth)&&(i.style.width="",i.style.height=""),i.removeEventListener("load",n)};i.addEventListener("load",n),i.complete&&n(),this.insertNode(i),this.jodit.events.fire("afterInsertImage",i)},t.prototype.setCursorAfter=function(e){var t=this;if(!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===t.jodit.editor||e&&e.parentNode===t.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var o=this.jodit.editorWindow.getSelection(),i=this.jodit.editorDocument.createRange(),r=this.jodit.editorDocument.createTextNode(n.INVISIBLE_SPACE);return e.nodeType!==Node.TEXT_NODE?(i.setStartAfter(e),i.insertNode(r),i.selectNode(r)):i.setStart(e,e.nodeValue?e.nodeValue.length:0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.jodit.events.fire("changeSelection"),r},t.prototype.cursorInTheEdge=function(e,t,o){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===o&&(o=!1);var i=this.jodit.editorWindow.getSelection(),n=function(e){return e&&!a.Dom.isEmptyTextNode(e)},r=t;if(!i.rangeCount)return!1;var s=i.getRangeAt(0),l=function(){return!1===o?e:!e}()?s.startContainer:s.endContainer;if(!1===t)r=a.Dom.up(l,a.Dom.isBlock,this.jodit.editor);else if("function"==typeof t)r=a.Dom.up(l,t,this.jodit.editor);else if(!a.Dom.isOrContains(t,s.startContainer))return null;return!(!r||(l===r?e?0!==s.startOffset:s.endOffset!==[].slice.call(r.childNodes).filter(n).length:e?l.nodeType===Node.TEXT_NODE&&0!==s.startOffset||a.Dom.prev(l,n,r):l.nodeType===Node.TEXT_NODE&&(!s.startContainer.nodeValue||s.endOffset!==s.startContainer.nodeValue.length)||a.Dom.next(l,n,r)))},t.prototype.setCursorBefore=function(e){var t=this;if(!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===t.jodit.editor||e&&e.parentNode===t.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var o=this.jodit.editorWindow.getSelection(),i=this.jodit.editorDocument.createRange(),r=this.jodit.editorDocument.createTextNode(n.INVISIBLE_SPACE);return e.nodeType!==Node.TEXT_NODE?(i.setStartBefore(e),i.insertNode(r),i.selectNode(r)):i.setStart(e,e.nodeValue?e.nodeValue.length:0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.jodit.events.fire("changeSelection"),r},t.prototype.setCursorIn=function(e,t){var o=this;if(void 0===t&&(t=!1),!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===o.jodit.editor||e&&e.parentNode===o.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var i=this.jodit.editorWindow.getSelection(),n=this.jodit.editorDocument.createRange(),r=e,s=e;do{if(r.nodeType===Node.TEXT_NODE)break;s=r,r=r[t?"firstChild":"lastChild"]}while(r);n.selectNodeContents(r||s),n.collapse(t),i.removeAllRanges(),i.addRange(n),this.jodit.events.fire("changeSelection")},t.prototype.selectRange=function(e){var t=this.jodit.editorWindow.getSelection();t.removeAllRanges(),t.addRange(e),this.jodit.events.fire("changeSelection")},t.prototype.select=function(e,t){var o=this;if(void 0===t&&(t=!1),!(e instanceof this.jodit.editorWindow.Node))throw Error("Parameter node most be instance of Node");if(!a.Dom.up(e,function(e){return e===o.jodit.editor||e&&e.parentNode===o.jodit.editor},this.jodit.editor))throw Error("Node element must be in editor");var i=this.jodit.editorWindow.getSelection(),n=this.jodit.editorDocument.createRange();n[t?"selectNodeContents":"selectNode"](e),i.removeAllRanges(),i.addRange(n)},t}(r.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(1),r=o(0),s=o(4);n.Config.prototype.defaultAjaxOptions={dataType:"json",method:"GET",url:"",data:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8",headers:{"X-REQUESTED-WITH":"XMLHttpRequest"},withCredentials:!0,xhr:function(){return new("undefined"==typeof XDomainRequest?XMLHttpRequest:XDomainRequest)}},t.Ajax=function(e){function t(t,o){var i=e.call(this,t)||this;return i.options=r.extend(!0,{},n.Config.prototype.defaultAjaxOptions,o),i.options.xhr&&(i.xhr=i.options.xhr()),i}return i(t,e),t.prototype.__buildParams=function(e,t){if("string"==typeof e||this.jodit.ownerWindow.FormData&&e instanceof this.jodit.ownerWindow.FormData)return e;var o,i,n,r=[];for(o in e)e.hasOwnProperty(o)&&(i=t?t+"["+o+"]":o,n=e[o],r.push("object"==typeof n?this.__buildParams(n,i):encodeURIComponent(i)+"="+encodeURIComponent(n)));return r.join("&")},t.prototype.abort=function(){return this.xhr.abort(),this},t.prototype.send=function(){var e=this;return new Promise(function(t,o){var i=function(t){switch(e.options.dataType){case"json":try{t=JSON.parse(t)}catch(t){return void o.call(e.xhr,t)}}return t};if(e.xhr.onabort=function(){o(Error(e.xhr.statusText))},e.xhr.onerror=function(){o(Error(e.xhr.statusText))},e.xhr.ontimeout=function(){o(Error(e.xhr.statusText))},e.xhr.onload=function(){e.response=e.xhr.responseText,e.status=e.xhr.status,t.call(e.xhr,i(e.response))},e.xhr.onreadystatechange=function(){if(e.xhr.readyState===XMLHttpRequest.DONE){var n=e.xhr.responseText;e.response=n,e.status=e.xhr.status,200===e.xhr.status?t.call(e.xhr,i(n)):o.call(e.xhr,Error(e.xhr.statusText||e.jodit.i18n("Connection error!")))}},e.xhr.withCredentials=e.options.withCredentials||!1,!e.options.url)throw Error("Need URL for AJAX request");e.xhr.open(e.options.method||"get",e.options.url,!0),e.options.contentType&&e.xhr.setRequestHeader&&e.xhr.setRequestHeader("Content-type",e.options.contentType),e.options.headers&&e.xhr.setRequestHeader&&r.each(e.options.headers,function(t,o){e.xhr.setRequestHeader(t,o)}),setTimeout(function(){e.xhr.send(e.options.data?e.__buildParams(e.options.data):void 0)},0)})},t}(s.Component)},function(e,t,o){"use strict";t.__esModule=!0;var i=o(0),n=o(2),r=o(3);t.Table=function(){function e(){}return e.addSelected=function(e){e.setAttribute(n.JODIT_SELECTED_CELL_MARKER,"1")},e.restoreSelection=function(e){e.removeAttribute(n.JODIT_SELECTED_CELL_MARKER)},e.getAllSelectedCells=function(e){return e?i.$$("td["+n.JODIT_SELECTED_CELL_MARKER+"],th["+n.JODIT_SELECTED_CELL_MARKER+"]",e):[]},e.getRowsCount=function(e){return e.rows.length},e.getColumnsCount=function(t){return e.formalMatrix(t).reduce(function(e,t){return Math.max(e,t.length)},0)},e.formalMatrix=function(e,t){for(var o=[[]],i=Array.prototype.slice.call(e.rows),n=0,r=void 0;i.length>n;n+=1){var s=Array.prototype.slice.call(i[n].cells);for(r=0;s.length>r;r+=1)if(!1===function(e,i){void 0===o[i]&&(o[i]=[]);for(var n,r,s=e.colSpan,a=e.rowSpan,l=0;o[i][l];)l+=1;for(r=0;a>r;r+=1)for(n=0;s>n;n+=1){if(void 0===o[i+r]&&(o[i+r]=[]),t&&!1===t(e,i+r,l+n,s,a))return!1;o[i+r][l+n]=e}}(s[r],n))return o}return o},e.formalCoordinate=function(t,o,i){void 0===i&&(i=!1);var n=0,r=0,s=1,a=1;return e.formalMatrix(t,function(e,t,l,d,c){if(o===e)return n=t,r=l,s=d||1,a=c||1,i&&(r+=(d||1)-1,n+=(c||1)-1),!1}),[n,r,s,a]},e.appendRow=function(t,o,n){void 0===o&&(o=!1),void 0===n&&(n=!0);var s,a=e.getColumnsCount(t),l=r.Dom.create("tr","",t.ownerDocument);for(s=0;a>s;s+=1)l.appendChild(r.Dom.create("td","",t.ownerDocument));n&&o&&o.nextSibling?o.parentNode&&o.parentNode.insertBefore(l,o.nextSibling):!n&&o?o.parentNode&&o.parentNode.insertBefore(l,o):(i.$$(":scope>tbody",t)[0]||t).appendChild(l)},e.removeRow=function(t,o){var n,s=e.formalMatrix(t),a=t.rows[o];i.each(s[o],function(e,i){if(n=!1,0>o-1||s[o-1][e]!==i)if(s[o+1]&&s[o+1][e]===i){if(i.parentNode===a&&i.parentNode.nextSibling){n=!0;for(var l=e+1;s[o+1][l]===i;)l+=1;var d=r.Dom.next(i.parentNode,function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&"TR"===e.nodeName},t);s[o+1][l]?d.insertBefore(i,s[o+1][l]):d.appendChild(i)}}else i.parentNode&&i.parentNode.removeChild(i);else n=!0;if(n&&(i.parentNode===a||i!==s[o][e-1])){var c=i.rowSpan;c-1>1?i.setAttribute("rowspan",""+(c-1)):i.removeAttribute("rowspan")}}),a&&a.parentNode&&a.parentNode.removeChild(a)},e.appendColumn=function(t,o,i){void 0===i&&(i=!0);var n,s=e.formalMatrix(t);for(void 0===o&&(o=e.getColumnsCount(t)-1),n=0;s.length>n;n+=1){var a=r.Dom.create("td","",t.ownerDocument),l=s[n][o],d=!1;i?(s[n]&&l&&o+1>=s[n].length||l!==s[n][o+1])&&(l.nextSibling?l.parentNode&&l.parentNode.insertBefore(a,l.nextSibling):l.parentNode&&l.parentNode.appendChild(a),d=!0):(0>o-1||s[n][o]!==s[n][o-1]&&s[n][o].parentNode)&&(l.parentNode&&l.parentNode.insertBefore(a,s[n][o]),d=!0),d||s[n][o].setAttribute("colspan",""+(parseInt(s[n][o].getAttribute("colspan")||"1",10)+1))}},e.removeColumn=function(t,o){var n,r=e.formalMatrix(t);i.each(r,function(e,t){var i=t[o];if(n=!1,0>o-1||r[e][o-1]!==i?t.length>o+1&&r[e][o+1]===i?n=!0:i.parentNode&&i.parentNode.removeChild(i):n=!0,n&&(0>e-1||i!==r[e-1][o])){var s=i.colSpan;s-1>1?i.setAttribute("colspan",""+(s-1)):i.removeAttribute("colspan")}})},e.getSelectedBound=function(t,o){var i,n,r,s=[[1/0,1/0],[0,0]],a=e.formalMatrix(t);for(i=0;a.length>i;i+=1)for(n=0;a[i].length>n;n+=1)-1!==o.indexOf(a[i][n])&&(s[0][0]=Math.min(i,s[0][0]),s[0][1]=Math.min(n,s[0][1]),s[1][0]=Math.max(i,s[1][0]),s[1][1]=Math.max(n,s[1][1]));for(i=s[0][0];s[1][0]>=i;i+=1)for(r=1,n=s[0][1];s[1][1]>=n;n+=1){for(;a[i][n-r]&&a[i][n]===a[i][n-r];)s[0][1]=Math.min(n-r,s[0][1]),s[1][1]=Math.max(n-r,s[1][1]),r+=1;for(r=1;a[i][n+r]&&a[i][n]===a[i][n+r];)s[0][1]=Math.min(n+r,s[0][1]),s[1][1]=Math.max(n+r,s[1][1]),r+=1;for(r=1;a[i-r]&&a[i][n]===a[i-r][n];)s[0][0]=Math.min(i-r,s[0][0]),s[1][0]=Math.max(i-r,s[1][0]),r+=1;for(r=1;a[i+r]&&a[i][n]===a[i+r][n];)s[0][0]=Math.min(i+r,s[0][0]),s[1][0]=Math.max(i+r,s[1][0]),r+=1}return s},e.normalizeTable=function(t){var o,i,n,r,s=[],a=e.formalMatrix(t);for(i=0;a[0].length>i;i+=1){for(n=1e6,r=!1,o=0;a.length>o;o+=1)if(void 0!==a[o][i]){if(2>a[o][i].colSpan){r=!0;break}n=Math.min(n,a[o][i].colSpan)}if(!r)for(o=0;a.length>o;o+=1)void 0!==a[o][i]&&e.__mark(a[o][i],"colspan",a[o][i].colSpan-n+1,s)}for(o=0;a.length>o;o+=1){for(n=1e6,r=!1,i=0;a[o].length>i;i+=1)if(void 0!==a[o][i]){if(2>a[o][i].rowSpan){r=!0;break}n=Math.min(n,a[o][i].rowSpan)}if(!r)for(i=0;a[o].length>i;i+=1)void 0!==a[o][i]&&e.__mark(a[o][i],"rowspan",a[o][i].rowSpan-n+1,s)}for(o=0;a.length>o;o+=1)for(i=0;a[o].length>i;i+=1)void 0!==a[o][i]&&(a[o][i].hasAttribute("rowspan")&&1===a[o][i].rowSpan&&a[o][i].removeAttribute("rowspan"),a[o][i].hasAttribute("colspan")&&1===a[o][i].colSpan&&a[o][i].removeAttribute("colspan"),a[o][i].hasAttribute("class")&&!a[o][i].getAttribute("class")&&a[o][i].removeAttribute("class"));e.__unmark(s)},e.mergeSelected=function(t){var o,r=e.getSelectedBound(t,e.getAllSelectedCells(t)),s=0,a=null,l=0,d=[],c=0,u=0,p=[];r&&(r[0][0]-r[1][0]||r[0][1]-r[1][1])&&(e.formalMatrix(t,function(t,n,f,h,m){if(!(r[0][0]>n||n>r[1][0]||r[0][1]>f||f>r[1][1])){if(o=t,o.__i_am_already_was)return;o.__i_am_already_was=!0,n===r[0][0]&&o.style.width&&(s+=o.offsetWidth),""!==i.trim(t.innerHTML.replace(//g,""))&&d.push(t.innerHTML),h>1&&(c+=h-1),m>1&&(u+=m-1),a?e.__mark(o,"remove",1,p):(a=t,l=f)}}),c=r[1][1]-r[0][1]+1,u=r[1][0]-r[0][0]+1,a&&(c>1&&e.__mark(a,"colspan",c,p),u>1&&e.__mark(a,"rowspan",u,p),s&&(e.__mark(a,"width",(s/t.offsetWidth*100).toFixed(n.ACCURACY)+"%",p),l&&e.setColumnWidthByDelta(t,l,0,!0,p)),a.innerHTML=d.join("
      "),delete a.__i_am_already_was,e.__unmark(p),e.normalizeTable(t),i.each([].slice.call(t.rows),function(e,t){t.cells.length||t.parentNode.removeChild(t)})))},e.splitHorizontal=function(t){var o,i,n,s,a,l=[];e.getAllSelectedCells(t).forEach(function(d){i=r.Dom.create("td","",t.ownerDocument),i.appendChild(r.Dom.create("br","",t.ownerDocument)),n=r.Dom.create("tr","",t.ownerDocument),o=e.formalCoordinate(t,d),2>d.rowSpan?(e.formalMatrix(t,function(t,i,n){o[0]===i&&o[1]!==n&&t!==d&&e.__mark(t,"rowspan",t.rowSpan+1,l)}),r.Dom.after(r.Dom.closest(d,"tr",t),n),n.appendChild(i)):(e.__mark(d,"rowspan",d.rowSpan-1,l),e.formalMatrix(t,function(e,i,n){i>o[0]&&o[0]+d.rowSpan>i&&o[1]>n&&e.parentNode.rowIndex===i&&(a=e),i>o[0]&&e===d&&(s=t.rows[i])}),a?r.Dom.after(a,i):s.insertBefore(i,s.firstChild)),d.colSpan>1&&e.__mark(i,"colspan",d.colSpan,l),e.__unmark(l),e.restoreSelection(d)}),this.normalizeTable(t)},e.splitVertical=function(t){var o,i,s,a=[];e.getAllSelectedCells(t).forEach(function(l){o=e.formalCoordinate(t,l),2>l.colSpan?e.formalMatrix(t,function(t,i,n){o[1]===n&&o[0]!==i&&t!==l&&e.__mark(t,"colspan",t.colSpan+1,a)}):e.__mark(l,"colspan",l.colSpan-1,a),i=r.Dom.create("td","",t.ownerDocument),i.appendChild(r.Dom.create("br","",t.ownerDocument)),l.rowSpan>1&&e.__mark(i,"rowspan",l.rowSpan,a);var d=l.offsetWidth;r.Dom.after(l,i),s=d/t.offsetWidth/2,e.__mark(l,"width",(100*s).toFixed(n.ACCURACY)+"%",a),e.__mark(i,"width",(100*s).toFixed(n.ACCURACY)+"%",a),e.__unmark(a),e.restoreSelection(l)}),e.normalizeTable(t)},e.__mark=function(e,t,o,i){i.push(e),e.__marked_value||(e.__marked_value={}),e.__marked_value[t]=void 0===o?1:o},e.__unmark=function(e){e.forEach(function(e){e.__marked_value&&(i.each(e.__marked_value,function(t,o){switch(t){case"remove":e.parentNode&&e.parentNode.removeChild(e);break;case"rowspan":o>1?e.setAttribute("rowspan",o):e.removeAttribute("rowspan");break;case"colspan":o>1?e.setAttribute("colspan",o):e.removeAttribute("colspan");break;case"width":e.style.width=o}delete e.__marked_value[t]}),delete e.__marked_value)})},e.setColumnWidthByDelta=function(t,o,i,r,s){var a,l,d,c=e.formalMatrix(t);for(a=0;c.length>a;a+=1)l=c[a][o].offsetWidth,d=(l+i)/t.offsetWidth*100,e.__mark(c[a][o],"width",d.toFixed(n.ACCURACY)+"%",s);r||e.__unmark(s)},e}()},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(0),s=o(5);t.ContextMenu=function(e){function t(t){var o=e.call(this,t)||this;return o.hide=function(){o.context.classList.remove("jodit_context_menu-show"),o.jodit.ownerWindow.removeEventListener("mouseup",o.hide)},o.context=r.dom('
      ',t.ownerDocument),o.jodit.ownerDocument.body.appendChild(o.context),o}return i(t,e),t.prototype.show=function(e,t,o){var i=this,n=this;Array.isArray(o)&&(this.context.innerHTML="",o.forEach(function(e){if(e){var t=r.dom(''+(e.icon?s.Toolbar.getIcon(e.icon):"")+"",i.jodit.ownerDocument),o=t.querySelector("span");t.addEventListener("click",function(t){return e.exec&&e.exec.call(n,t),n.hide(),!1}),o.innerText=n.jodit.i18n(e.title||""),n.context.appendChild(t)}}),r.css(n.context,{left:e,top:t}),this.jodit.ownerWindow.addEventListener("mouseup",n.hide),this.context.classList.add("jodit_context_menu-show"))},t}(n.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(1),r=o(4),s=o(18),a=o(2),l=o(19),d=o(0);n.Config.prototype.observer={timeout:100};var c=function(){function e(e,t,o){this.observer=o,this.oldValue=e,this.newValue=t}return e.prototype.execute=function(){},e.prototype.undo=function(){this.observer.snapshot.restore(this.oldValue)},e.prototype.redo=function(){this.observer.snapshot.restore(this.newValue)},e}();t.Command=c,t.Observer=function(e){function t(t){var o=e.call(this,t)||this;o.onChangeStack=function(){o.__newValue=o.snapshot.make(),s.Snapshot.equal(o.__newValue,o.__startValue)||(o.stack.execute(new c(o.__startValue,o.__newValue,o)),o.__startValue=o.__newValue)},o.stack=new l.Stack,o.stack.changed=function(){o.changed()},o.snapshot=new s.Snapshot(t),o.__startValue=o.snapshot.make(),o.stack.changed();var i=d.debounce(o.onChangeStack,o.jodit.options.observer.timeout);return t.events.on("updateToolbar",function(){o.stack.changed()}).on("change",function(){o.snapshot.isBlocked||i()}),o}return i(t,e),t.prototype.changed=function(){this.jodit.getMode()===a.MODE_WYSIWYG&&(this.jodit.events.fire("canRedo",this.stack.canRedo()),this.jodit.events.fire("canUndo",this.stack.canUndo()))},t.prototype.redo=function(){this.stack.redo()},t.prototype.undo=function(){this.stack.undo()},t}(r.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4);t.Snapshot=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isBlocked=!1,t}return i(t,e),t.__countElementsBefore=function(e){if(!e||!e.parentNode)return 0;var t,o=e.parentNode.childNodes,i=0,n=null;for(t=0;o.length>t;t+=1){if(!n||o[t].nodeType===Node.TEXT_NODE&&""===o[t].textContent||n.nodeType===Node.TEXT_NODE&&o[t].nodeType===Node.TEXT_NODE||(i+=1),o[t]===e)return i;n=o[t]}return 0},t.prototype.__decomposeHierarchyNodes=function(e){var o=[];if(!e||!e.parentNode)return[];for(;e&&e!==this.jodit.editor;)e&&o.push(t.__countElementsBefore(e)),e=e.parentNode;return o.reverse()},t.__strokeOffset=function(e,t){for(;e&&e.nodeType===Node.TEXT_NODE;)(e=e.previousSibling)&&e.nodeType===Node.TEXT_NODE&&null!==e.textContent&&(t+=e.textContent.length);return t},t.prototype.make=function(){var e={html:"",range:{startContainer:[],startOffset:0,endContainer:[],endOffset:0}};e.html=this.jodit.getEditorValue();var o=this.jodit.editorWindow.getSelection();if(o.rangeCount){var i=o.getRangeAt(0);e.range={startContainer:this.__decomposeHierarchyNodes(i.startContainer),startOffset:t.__strokeOffset(i.startContainer,i.startOffset),endContainer:this.__decomposeHierarchyNodes(i.endContainer),endOffset:t.__strokeOffset(i.endContainer,i.endOffset)}}return e},t.prototype.__restoreElementByLadder=function(e){var t,o=this.jodit.editor;for(t=0;o&&e.length>t;t+=1)o=o.childNodes[e[t]];return o},t.equal=function(e,t){return e.html===t.html&&JSON.stringify(e.range)===JSON.stringify(t.range)},t.prototype.restore=function(e){this.isBlocked=!0,this.jodit.setEditorValue(e.html);try{if(e.range){var t=this.jodit.editorWindow.getSelection(),o=this.jodit.editorDocument.createRange();o.setStart(this.__restoreElementByLadder(e.range.startContainer),e.range.startOffset),o.setEnd(this.__restoreElementByLadder(e.range.endContainer),e.range.endOffset),t.removeAllRanges(),t.addRange(o)}}catch(e){}this.isBlocked=!1},t}(n.Component)},function(e,t,o){"use strict";t.__esModule=!0,t.Stack=function(){function e(){this.commands=[],this.stackPosition=-1,this.savePosition=-1}return e.prototype.execute=function(e){this.__clearRedo(),e.execute(),this.commands.push(e),this.stackPosition+=1,this.changed()},e.prototype.undo=function(){this.commands[this.stackPosition]&&this.commands[this.stackPosition].undo(),this.stackPosition-=1,this.changed()},e.prototype.canUndo=function(){return this.stackPosition>=0},e.prototype.redo=function(){this.stackPosition+=1,this.commands[this.stackPosition]&&this.commands[this.stackPosition].redo(),this.changed()},e.prototype.canRedo=function(){return this.commands.length-1>this.stackPosition},e.prototype.save=function(){this.savePosition=this.stackPosition,this.changed()},e.prototype.__clearRedo=function(){this.commands.length=this.stackPosition+1},e.prototype.changed=function(){},e}()},function(e,t,o){"use strict";o(21),o(22);var i=o(6),n=o(5),r=o(2),s=o(28),a=o(8),l=o(64),d=o(69),c=o(1);Object.keys(r).forEach(function(e){i.Jodit[e]=r[e]});var u=function(e){return"__esModule"!==e};Object.keys(d).filter(u).forEach(function(e){n.Toolbar.icons[e.replace("_","-")]=d[e]}),Object.keys(a).filter(u).forEach(function(e){i.Jodit.modules[e]=a[e]}),Object.keys(s).filter(u).forEach(function(e){i.Jodit.plugins[e]=s[e]}),Object.keys(l).filter(u).forEach(function(e){i.Jodit.lang[e]=l[e]}),i.Jodit.defaultOptions=new c.Config,e.exports=i.Jodit},function(e,t){},function(e,t,o){"use strict";t.__esModule=!0,o(23),o(24),function(e){e.matches||(e.matches=void 0!==e.matchesSelector?e.matchesSelector:function(e){var t=this.ownerDocument.querySelectorAll(e),o=this;return Array.prototype.some.call(t,function(e){return e===o})})}(Element.prototype)},function(e,t){"document"in window.self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){"use strict";if("Element"in e){var t=e.Element.prototype,o=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},n=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},r=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},s=function(e,t){if(""===t)throw new r("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new r("INVALID_CHARACTER_ERR","String contains an invalid character");return n.call(e,t)},a=function(e){for(var t=i.call(e.getAttribute("class")||""),o=t?t.split(/\s+/):[],n=0,r=o.length;r>n;n++)this.push(o[n]);this._updateClassName=function(){e.setAttribute("class",""+this)}},l=a.prototype=[],d=function(){return new a(this)};if(r.prototype=Error.prototype,l.item=function(e){return this[e]||null},l.contains=function(e){return e+="",-1!==s(this,e)},l.add=function(){var e,t=arguments,o=0,i=t.length,n=!1;do{e=t[o]+"",-1===s(this,e)&&(this.push(e),n=!0)}while(++oo;o++)e=arguments[o],t.call(this,e)}};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}())},function(e,t,o){"use strict";e.exports=o(25).polyfill()},function(e,t,o){(function(t){!function(t,i){e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function i(e){return"function"==typeof e}function n(e){W=e}function r(e){F=e}function s(){return void 0!==H?function(){H(l)}:a()}function a(){var e=setTimeout;return function(){return e(l,1)}}function l(){for(var e=0;R>e;e+=2)(0,K[e])(K[e+1]),K[e]=void 0,K[e+1]=void 0;R=0}function d(e,t){var o=this,i=new this.constructor(u);void 0===i[J]&&k(i);var n=o._state;if(n){var r=arguments[n-1];F(function(){return T(n,i,r,o._result)})}else j(o,i,e,t);return i}function c(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var o=new t(u);return b(o,e),o}function u(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function f(){return new TypeError("A promises callback cannot return that same promise.")}function h(e){try{return e.then}catch(e){return te.error=e,te}}function m(e,t,o,i){try{e.call(t,o,i)}catch(e){return e}}function v(e,t,o){F(function(e){var i=!1,n=m(o,t,function(o){i||(i=!0,t!==o?b(e,o):w(e,o))},function(t){i||(i=!0,C(e,t))},"Settle: "+(e._label||" unknown promise"));!i&&n&&(i=!0,C(e,n))},e)}function g(e,t){t._state===Q?w(e,t._result):t._state===ee?C(e,t._result):j(t,void 0,function(t){return b(e,t)},function(t){return C(e,t)})}function _(e,t,o){t.constructor===e.constructor&&o===d&&t.constructor.resolve===c?g(e,t):o===te?(C(e,te.error),te.error=null):void 0===o?w(e,t):i(o)?v(e,t,o):w(e,t)}function b(t,o){t===o?C(t,p()):e(o)?_(t,o,h(o)):w(t,o)}function y(e){e._onerror&&e._onerror(e._result),x(e)}function w(e,t){e._state===Z&&(e._result=t,e._state=Q,0!==e._subscribers.length&&F(x,e))}function C(e,t){e._state===Z&&(e._state=ee,e._result=t,F(y,e))}function j(e,t,o,i){var n=e._subscribers,r=n.length;e._onerror=null,n[r]=t,n[r+Q]=o,n[r+ee]=i,0===r&&e._state&&F(x,e)}function x(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var i=void 0,n=void 0,r=e._result,s=0;t.length>s;s+=3)i=t[s],n=t[s+o],i?T(o,i,n,r):n(r);e._subscribers.length=0}}function q(){this.error=null}function E(e,t){try{return e(t)}catch(e){return oe.error=e,oe}}function T(e,t,o,n){var r=i(o),s=void 0,a=void 0,l=void 0,d=void 0;if(r){if(s=E(o,n),s===oe?(d=!0,a=s.error,s.error=null):l=!0,t===s)return void C(t,f())}else s=n,l=!0;t._state!==Z||(r&&l?b(t,s):d?C(t,a):e===Q?w(t,s):e===ee&&C(t,s))}function D(e,t){try{t(function(t){b(e,t)},function(t){C(e,t)})}catch(t){C(e,t)}}function S(){return ie++}function k(e){e[J]=ie++,e._state=void 0,e._result=void 0,e._subscribers=[]}function L(){return Error("Array Methods must be provided an Array")}function L(){return Error("Array Methods must be provided an Array")}function I(e){return new ne(this,e).promise}function M(e){var t=this;return new t(B(e)?function(o,i){for(var n=e.length,r=0;n>r;r++)t.resolve(e[r]).then(o,i)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function A(e){var t=this,o=new t(u);return C(o,e),o}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function z(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function O(){var e=void 0;if(void 0!==t)e=t;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw Error("polyfill failed because global object is unavailable in this environment")}var o=e.Promise;if(o){var i=null;try{i=Object.prototype.toString.call(o.resolve())}catch(e){}if("[object Promise]"===i&&!o.cast)return}e.Promise=re}var P=void 0;P=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var B=P,R=0,H=void 0,W=void 0,F=function(e,t){K[R]=e,K[R+1]=t,2===(R+=2)&&(W?W(l):G())},V="undefined"!=typeof window?window:void 0,Y=V||{},U=Y.MutationObserver||Y.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,K=Array(1e3),G=void 0;G=X?function(){return function(){return process.nextTick(l)}}():U?function(){var e=0,t=new U(l),o=document.createTextNode("");return t.observe(o,{characterData:!0}),function(){o.data=e=++e%2}}():$?function(){var e=new MessageChannel;return e.port1.onmessage=l,function(){return e.port2.postMessage(0)}}():void 0===V?function(){try{var e=o(27);return H=e.runOnLoop||e.runOnContext,s()}catch(e){return a()}}():a();var J=Math.random().toString(36).substring(16),Z=void 0,Q=1,ee=2,te=new q,oe=new q,ie=0,ne=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(u),this.promise[J]||k(this.promise),B(t)?(this.length=t.length,this._remaining=t.length,this._result=Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&w(this.promise,this._result))):C(this.promise,L())}return e.prototype._enumerate=function(e){for(var t=0;this._state===Z&&e.length>t;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var o=this._instanceConstructor,i=o.resolve;if(i===c){var n=h(e);if(n===d&&e._state!==Z)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(o===re){var r=new o(u);_(r,e,n),this._willSettleAt(r,t)}else this._willSettleAt(new o(function(t){return t(e)}),t)}else this._willSettleAt(i(e),t)},e.prototype._settledAt=function(e,t,o){var i=this.promise;i._state===Z&&(this._remaining--,e===ee?C(i,o):this._result[t]=o),0===this._remaining&&w(i,this._result)},e.prototype._willSettleAt=function(e,t){var o=this;j(e,void 0,function(e){return o._settledAt(Q,t,e)},function(e){return o._settledAt(ee,t,e)})},e}(),re=function(){function e(t){this[J]=S(),this._result=this._state=void 0,this._subscribers=[],u!==t&&("function"!=typeof t&&N(),this instanceof e?D(this,t):z())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this,o=t.constructor;return t.then(function(t){return o.resolve(e()).then(function(){return t})},function(t){return o.resolve(e()).then(function(){throw t})})},e}();return re.prototype.then=d,re.all=I,re.race=M,re.resolve=c,re.reject=A,re._setScheduler=n,re._setAsap=r,re._asap=F,re.polyfill=O,re.Promise=re,re}()}()}).call(t,o(26))},function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},function(e,t){},function(e,t,o){"use strict";t.__esModule=!0,t.addNewLine=o(29).addNewLine,t.autofocus=o(30).autofocus,t.backspace=o(31).backspace,t.bold=o(32).bold,t.cleanHTML=o(33).cleanHTML,t.color=o(34).color,t.copyformat=o(35).copyformat,t.enter=o(36).enter,t.errorMessages=o(37).errorMessages,t.font=o(38).font,t.formatBlock=o(39).formatBlock,t.fullsize=o(40).fullsize,t.iframe=o(41).iframe,t.indent=o(42).indent,t.imageInlineToolbar=o(43).imageInlineToolbar,t.imageProcessor=o(44).imageProcessor,t.imageProperties=o(45).imageProperties,t.inlinePopup=o(46).inlinePopup,t.justify=o(47).justify,t.link=o(48).link,t.mobile=o(49).mobile,t.orderedlist=o(52).orderedlist,t.paste=o(53).paste,t.placeholder=o(54).placeholder,t.redoundo=o(55).redoundo,t.resizer=o(56).resizer,t.size=o(57).size,t.source=o(58).source,t.symbols=o(59).symbols,t.hotkeys=o(60).hotkeys,t.table=o(61).TableProcessor,t.tableKeyboardNavigation=o(62).tableKeyboardNavigation,t.search=o(63).search},function(e,t,o){"use strict";function i(e){if(e.options.addNewLine){var t,o,i=r.dom('
      '+s.Toolbar.getIcon("enter")+"
      ",e.ownerDocument),n=i.querySelector("span"),d=RegExp("^("+e.options.addNewLineTagsTriggers.join("|")+")$","i"),c=!1,u=!1,p=function(){e.options.readonly||e.container.classList.contains("jodit_popup_active")||(clearTimeout(t),i.classList.toggle("jodit-add-new-line_after",!u),i.style.display="block",i.style.width=e.editor.clientWidth+"px",c=!1)},f=function(){clearTimeout(t),i.style.display="none",c=!0},h=function(e){return null!==e&&l.Dom.isBlock(e)&&!/^(img|table|iframe|hr)$/i.test(e.nodeName)},m=function(){c||(clearTimeout(t),t=window.setTimeout(f,500))};e.events.on("afterInit",function(){e.container.appendChild(i),e.events.on(i,"mousemove",function(e){e.stopPropagation()}).on(n,"mousedown touchstart",function(t){var i=e.editorDocument.createElement(e.options.enter);i.appendChild(e.editorDocument.createTextNode(a.INVISIBLE_SPACE)),u&&o?e.editor.insertBefore(i,o):e.editor.appendChild(i),e.selection.setCursorIn(i),e.setEditorValue(),f(),t.preventDefault()})}).on("change afterInit afterSetMode",r.debounce(function(){e.events.on(e.editor,"scroll",function(){f()}).on(e.container,"mouseleave",function(){m()}).on(e.editor,"mousemove",r.debounce(function(t){var n=e.editorDocument.elementFromPoint(t.pageX-e.editorWindow.pageXOffset,t.pageY-e.editorWindow.pageYOffset);if(n&&n!==i&&l.Dom.isOrContains(e.editor,n)){if(!((o=n)&&o.nodeName.match(d)&&l.Dom.isOrContains(e.editor,o)||(o=l.Dom.closest(o,d,e.editor))))return void m();var s=r.offset(o,e),a=!1;10>Math.abs(t.pageY-s.top)&&(a=s.top,u=!0),10>Math.abs(t.pageY-(s.top+s.height))&&(a=s.top+s.height,u=!1),!1!==a&&(u&&!l.Dom.prev(o,h,e.editor)||!u&&!l.Dom.next(o,h,e.editor))?(i.style.top=a+"px",p()):(o=!1,m())}},e.options.observer.timeout))},e.options.observer.timeout))}}t.__esModule=!0;var n=o(1),r=o(0),s=o(5),a=o(2),l=o(3);n.Config.prototype.addNewLine=!0,n.Config.prototype.addNewLineTagsTriggers=["table","iframe","img","hr","jodit"],t.addNewLine=i},function(e,t,o){"use strict";function i(e){var t;e.events.on("afterInit",function(){e.options.autofocus&&(e.options.observer.timeout?t=window.setTimeout(e.selection.focus,300):e.selection.focus())}).on("beforeDestruct",function(){clearTimeout(t)})}t.__esModule=!0,o(1).Config.prototype.autofocus=!1,t.autofocus=i},function(e,t,o){"use strict";function i(e){e.events.on("afterCommand",function(t){if("delete"===t){var o=e.selection.current();o&&o.firstChild&&"BR"===o.firstChild.nodeName&&o.removeChild(o.firstChild),r.trim(e.editor.innerText)||e.editor.querySelector("img")||(e.editor.innerHTML="",e.selection.setCursorIn(e.editor))}}),e.events.on("keydown",function(t){if(t.which===n.KEY_BACKSPACE||t.keyCode===n.KEY_DELETE){var o=t.which===n.KEY_BACKSPACE;if(!e.selection.isCollapsed())return e.execCommand("Delete"),!1;var i=e.editorWindow.getSelection(),r=!!i.rangeCount&&i.getRangeAt(0);if(r){var a=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer:r.startContainer.childNodes[r.startOffset];if(a&&a.nodeType===Node.TEXT_NODE&&a.nodeValue){for(var l=a.nodeValue,d=r.startOffset,c=o?-1:1;d>=0&&l.length>=d&&l[d+c]===n.INVISIBLE_SPACE;)d+=c;if(d!==r.startOffset){var u=r.startOffset;if(l=o?l.substr(0,d)+l.substr(u):l.substr(0,u)+l.substr(d),a.nodeValue=l,l)return void r.setStart(a,d)}}if(0===r.startOffset&&o&&a){var p=s.Dom.prev(a,s.Dom.isBlock,e.editor);p&&e.selection.setCursorIn(p,!1);var f=s.Dom.up(r.startContainer,s.Dom.isBlock,e.editor);if(f){var h=f.innerHTML.replace(n.INVISIBLE_SPACE_REG_EXP,"");if((!h.length||"
      "==h)&&!s.Dom.isCell(f,e.editorWindow)&&f.parentNode&&f!==e.editor)return f.parentNode.removeChild(f),!1}}}}})}t.__esModule=!0;var n=o(2),r=o(0),s=o(3);t.backspace=i},function(e,t,o){"use strict";function i(e){var t=function(t){var o=n({},r.Jodit.defaultOptions.controls[t].css),i={};Object.keys(o).forEach(function(e){i[e]=Array.isArray(o[e])?o[e][0]:o[e]});var s=r.Jodit.defaultOptions.controls[t];return e.selection.applyCSS(i,s.tags?s.tags[0]:void 0,s.css),e.setEditorValue(),!1};e.registerCommand("bold",{exec:t,hotkeys:"ctrl+b"}),e.registerCommand("italic",{exec:t,hotkeys:"ctrl+i"}),e.registerCommand("underline",{exec:t,hotkeys:"ctrl+u"}),e.registerCommand("strikethrough",{exec:t})}var n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(6),s=o(1);s.Config.prototype.controls.bold={tagRegExp:/^(strong|b)$/i,tags:["strong","b"],css:{"font-weight":["bold","700"]},tooltip:"Bold"},s.Config.prototype.controls.italic={tagRegExp:/^(em|i)$/i,tags:["em","i"],css:{"font-style":"italic"},tooltip:"Italic"},s.Config.prototype.controls.underline={tagRegExp:/^(u)$/i,tags:["u"],css:{"text-decoration":"underline"},tooltip:"Underline"},s.Config.prototype.controls.strikethrough={tagRegExp:/^(s)$/i,tags:["s"],css:{"text-decoration":"line-through"},tooltip:"Strike through"},t.bold=i},function(e,t,o){"use strict";function i(e){if(e.options.cleanHTML.cleanOnPaste&&e.events.on("processPaste",function(e,t){return s.cleanFromWord(t)}),e.options.cleanHTML.allowTags){var t=/([^\[]*)\[([^\]]+)]/,o=/[\s]*,[\s]*/,i=/^(.*)[\s]*=[\s]*(.*)$/,n={};"string"==typeof e.options.cleanHTML.allowTags?e.options.cleanHTML.allowTags.split(o).map(function(e){e=s.trim(e);var r=t.exec(e),a={},l=function(e){e=s.trim(e);var t=i.exec(e);t?a[t[1]]=t[2]:a[e]=!0};if(r){var d=r[2].split(o);r[1]&&(d.map(l),n[r[1].toUpperCase()]=a)}else n[e.toUpperCase()]=!0}):n=e.options.cleanHTML.allowTags,e.events.on("beforeSetElementValue",function(t){if(e.getRealMode()===r.MODE_WYSIWYG){var o=a.Dom.create("div","",e.editorDocument),i=null,s=[],l=void 0,d=0;for(o.innerHTML=t.value,o.firstChild&&(i=o.firstChild);i;){if(i&&i.nodeName)if(n[i.nodeName]){if(!0!==n[i.nodeName]&&i.attributes&&i.attributes.length){for(l=[],d=0;i.attributes.length>d;d+=1)(!n[i.nodeName][i.attributes[d].name]||!0!==n[i.nodeName][i.attributes[d].name]&&n[i.nodeName][i.attributes[d].name]!==i.attributes[d].value)&&l.push(i.attributes[d].name);for(d=0;l.length>=d;d+=1)i.removeAttribute(l[d])}}else s.push(i);i=a.Dom.next(i,function(e){return!!e},o,!0)}var c;for(d=0;s.length>d;d+=1)c=s[d].parentNode,s[d]&&c&&c.removeChild(s[d]);t.value=o.innerHTML}})}e.events.on("afterCommand",function(t){var o,i,n=e.selection;switch(t.toLowerCase()){case"inserthorizontalrule":(o=e.editor.querySelector("hr[id=null]"))&&(i=a.Dom.next(o,a.Dom.isBlock,e.editor,!1),i||(i=a.Dom.create(e.options.enter,"",e.editorDocument))&&a.Dom.after(o,i),n.setCursorIn(i));break;case"removeformat":i=n.current();var l=function(t){switch(t.nodeType){case Node.ELEMENT_NODE:a.Dom.each(t,l),"FONT"===t.nodeName?a.Dom.unwrap(t):([].slice.call(t.attributes).forEach(function(e){-1===["src","href","rel","content"].indexOf(e.name.toLowerCase())&&t.removeAttribute(e.name)}),s.normalizeNode(t));break;case Node.TEXT_NODE:e.options.cleanHTML.replaceNBSP&&t.nodeType===Node.TEXT_NODE&&null!==t.nodeValue&&t.nodeValue.match(r.SPACE_REG_EXP)&&(t.nodeValue=t.nodeValue.replace(r.SPACE_REG_EXP," "));break;default:t.parentNode&&t.parentNode.removeChild(t)}};if(n.isCollapsed())for(;i&&i.nodeType!==Node.ELEMENT_NODE&&i!==e.editor;)l(i),i&&(i=i.parentNode);else e.selection.eachSelection(function(e){l(e)})}})}t.__esModule=!0;var n=o(1),r=o(2),s=o(0),a=o(3);n.Config.prototype.cleanHTML={replaceNBSP:!0,cleanOnPaste:!0,allowTags:!1},n.Config.prototype.controls.eraser={command:"removeFormat",tooltip:"Clear Formatting"},t.cleanHTML=i},function(e,t,o){"use strict";function i(e){var t=function(t,o,i){var r=n.normalizeColor(i);switch(t){case"background":e.selection.applyCSS({backgroundColor:r||""});break;case"forecolor":e.selection.applyCSS({color:r||""})}return e.setEditorValue(),!1};e.registerCommand("forecolor",t),e.registerCommand("background",t)}t.__esModule=!0;var n=o(0),r=o(1),s=o(9),a=s.Widget.TabsWidget,l=s.Widget.ColorPickerWidget,d=o(3);r.Config.prototype.controls.brush={isActive:function(e,t,o){var i=e.selection.current(),r=o.btn.querySelector("svg");if(i){var s=d.Dom.closest(i,function(t){return d.Dom.isBlock(t)||d.Dom.isNode(t,e.editorWindow)&&t.nodeType===Node.ELEMENT_NODE},e.editor)||e.editor,a=""+n.css(s,"color"),l=""+n.css(s,"background-color");if(a!==""+n.css(e.editor,"color"))return r&&(r.style.fill=a),!0;if(l!==""+n.css(e.editor,"background-color"))return r&&(r.style.fill=l),!0}return r&&r.style.fill&&(r.style.fill=null),!1},popup:function(e,t,o,i){var r,s="",c="",u=null;t&&d.Dom.isNode(t,e.editorWindow)&&t.nodeType===Node.ELEMENT_NODE&&(s=""+n.css(t,"color"),c=""+n.css(t,"background-color"),u=t);var p=l(e,function(t){u?u.style.backgroundColor=t:e.execCommand("background",!1,t),i()},c),f=l(e,function(t){u?u.style.color=t:e.execCommand("forecolor",!1,t),i()},s);return r="background"===e.options.colorPickerDefaultTab?{Background:p,Text:f}:{Text:f,Background:p},a(e,r,u)},tooltip:"Fill color or set the text color"},t.color=i},function(e,t,o){"use strict";function i(e){e.buffer[a]={active:!1,format:{}},e.events.on("mouseup",function(){e.buffer[a].active&&(e.buffer[a].active=!1,e.selection.applyCSS(e.buffer[a].format))})}t.__esModule=!0;var n=o(1),r=o(3),s=o(0),a="copyformat",l=function(e,t){var o=r.Dom.up(t,function(e){return e&&e.nodeType!==Node.TEXT_NODE},e.editor)||e.editor;if(o)return{fontSize:s.css(o,"fontSize"),fontWeight:s.css(o,"fontWeight"),fontStyle:s.css(o,"fontStyle"),color:s.css(o,"color"),backgroundColor:s.css(o,"backgroundColor")}};n.Config.prototype.controls.copyformat={exec:function(e,t){t&&(e.buffer[a].active?e.buffer[a].active=!1:(e.buffer[a].format=l(e,t))&&(e.buffer[a].active=!0))},isActive:function(e){return void 0!==e.buffer[a]&&e.buffer[a].active},tooltip:"Paint format"},t.copyformat=i},function(e,t,o){"use strict";function i(e){e.events.on("keyup",function(){if(!e.options.readonly){var t=e.selection.current();if(!1!==t){var o=s.Dom.up(t,function(t){return t.tagName===e.options.enter.toUpperCase()},e.editor);o&&s.Dom.all(o,function(o){o.nodeType===Node.TEXT_NODE&&o.nodeValue&&r.INVISIBLE_SPACE_REG_EXP.test(o.nodeValue)&&0!==o.nodeValue.replace(r.INVISIBLE_SPACE_REG_EXP,"").length&&(o.nodeValue=o.nodeValue.replace(r.INVISIBLE_SPACE_REG_EXP,""),o===t&&e.selection.setCursorAfter(o))})}}}),e.events.on("keydown",function(o){if(o.which===r.KEY_ENTER||o.keyCode===r.KEY_ENTER){e.selection.isCollapsed()||e.execCommand("Delete"),e.selection.focus();var i=e.selection.current(),a=e.editorWindow.getSelection(),l=a.rangeCount?a.getRangeAt(0):e.editorDocument.createRange();i&&i!==e.editor||(i=s.Dom.create("text",r.INVISIBLE_SPACE,e.editorDocument),a.rangeCount?l.insertNode(i):e.editor.appendChild(i),l.selectNode(i),l.collapse(!1),a.removeAllRanges(),a.addRange(l));var d=void 0,c=!!i&&s.Dom.up(i,s.Dom.isBlock,e.editor);if(e.options.enter===r.BR||o.shiftKey||s.Dom.closest(i,"PRE|BLOCKQUOTE",e.editor)){var u=s.Dom.create("br",void 0,e.editorDocument);return e.selection.insertNode(u),u.scrollIntoView(),!1}if(c||!i||s.Dom.prev(i,function(t){return s.Dom.isBlock(t)||!!t&&s.Dom.isImage(t,e.ownerWindow)},e.editor)||(c=s.Dom.wrap(i,e.options.enter,e),l=a.rangeCount?a.getRangeAt(0):e.editorDocument.createRange()),c){if(!s.Dom.canSplitBlock(c,e.editorWindow)){var u=e.editorDocument.createElement("br");return e.selection.insertNode(u,!1),e.selection.setCursorAfter(u),!1}if("LI"===c.nodeName&&s.Dom.isEmpty(c)){var p=s.Dom.closest(c,"ol|ul",e.editor);if(s.Dom.prev(c,function(e){return e&&"LI"===e.nodeName},p))if(s.Dom.next(c,function(e){return e&&"LI"===e.nodeName},p)){var f=e.editorDocument.createRange();f.setStartBefore(p),f.setEndAfter(c);var h=f.extractContents();p.parentNode&&p.parentNode.insertBefore(h,p),d=e.selection.setCursorBefore(p)}else d=e.selection.setCursorAfter(p);else d=e.selection.setCursorBefore(p);return c.parentNode&&c.parentNode.removeChild(c),t.insertParagraph(e,d),!n.$$("li",p).length&&p.parentNode&&p.parentNode.removeChild(p),!1}if(e.selection.cursorInTheEdge(!0,c))d=e.selection.setCursorBefore(c),t.insertParagraph(e,d,"LI"===c.nodeName?"li":e.options.enter),e.selection.setCursorIn(c,!0);else if(e.selection.cursorInTheEdge(!1,c))d=e.selection.setCursorAfter(c),t.insertParagraph(e,d,"LI"===c.nodeName?"li":e.options.enter);else{var f=e.editorDocument.createRange();f.setStartBefore(c),f.setEnd(l.startContainer,l.startOffset);var h=f.extractContents();c.parentNode&&c.parentNode.insertBefore(h,c),e.selection.setCursorIn(c,!0)}}else t.insertParagraph(e);return!1}})}t.__esModule=!0;var n=o(0),r=o(2),s=o(3);t.insertParagraph=function(e,t,o){o||(o=e.options.enter);var i=e.editorDocument.createElement(o);return i.appendChild(e.editorDocument.createTextNode(r.INVISIBLE_SPACE)),e.selection.insertNode(i,!1),e.selection.setCursorIn(i),t&&t.parentNode&&t.parentNode.removeChild(t),i.scrollIntoView(),i},t.enter=i},function(e,t,o){"use strict";function i(e){if(e.options.showMessageErrors){var t,o=r.dom('
      ',e.ownerDocument),i=function(){t=5,[].slice.call(o.childNodes).forEach(function(i){r.css(o,"bottom",t+"px"),t+=i.offsetWidth+e.options.showMessageErrorOffsetPx})};e.workplace.appendChild(o),e.events.on("errorMessage",function(t,n,s){var a=r.dom('
      '+t+"
      ",e.ownerDocument);o.appendChild(a),i(),setTimeout(function(){a.classList.remove("active"),setTimeout(function(){o.removeChild(a),i()},300)},s||e.options.showMessageErrorTime)})}}t.__esModule=!0;var n=o(1),r=o(0);n.Config.prototype.showMessageErrors=!0,n.Config.prototype.showMessageErrorTime=3e3,n.Config.prototype.showMessageErrorOffsetPx=3,t.errorMessages=i},function(e,t,o){"use strict";function i(e){var t=function(t,o,i){switch(t){case"fontsize":e.selection.applyCSS({fontSize:n.normalizeSize(i)});break;case"fontname":e.selection.applyCSS({fontFamily:i})}return e.setEditorValue(),!1};e.registerCommand("fontsize",t),e.registerCommand("fontname",t)}t.__esModule=!0;var n=o(0),r=o(1),s=o(3);r.Config.prototype.controls.fontsize={command:"fontSize",list:["8","9","10","11","12","14","18","24","30","36","48","60","72","96"],template:function(e,t,o){return o},tooltip:"Font size",isActive:function(e){var t=e.selection.current();if(t){var o=s.Dom.closest(t,function(t){return s.Dom.isBlock(t)||s.Dom.isNode(t,e.editorWindow)&&t.nodeType===Node.ELEMENT_NODE},e.editor)||e.editor;return""+n.css(o,"font-size")!=""+n.css(e.editor,"font-size")}return!1}},r.Config.prototype.controls.font={command:"fontname",exec:function(e,t,o){e.execCommand(o.command,!1,o.args?o.args[0]:void 0)},list:{"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"},template:function(e,t,o){return''+o+""},tooltip:"Font family"},t.font=i},function(e,t,o){"use strict";function i(e){e.registerCommand("formatblock",function(t,o,i){e.selection.focus();var s=!1;if(e.selection.eachSelection(function(t){var o=e.selection.save(),r=!!t&&n.Dom.up(t,n.Dom.isBlock,e.editor);if(!r&&t&&(r=n.Dom.wrap(t,e.options.enter,e)),!r)return e.selection.restore(o),!1;r.tagName.match(/TD|TH|TBODY|TABLE|THEAD/i)?e.selection.isCollapsed()?n.Dom.wrap(t,i,e):e.selection.applyCSS({},i):n.Dom.replace(r,i,!0,!1,e.editorDocument),s=!0,e.selection.restore(o)}),!s){var a=n.Dom.create(i,r.INVISIBLE_SPACE,e.editorDocument);e.selection.insertNode(a,!1),e.selection.setCursorIn(a)}return e.setEditorValue(),!1})}t.__esModule=!0;var n=o(3),r=o(2);o(1).Config.prototype.controls.paragraph={command:"formatBlock",getLabel:function(e,t,o){var i=e.selection.current();if(i&&e.options.textIcons){var r=n.Dom.closest(i,n.Dom.isBlock,e.editor)||e.editor,s=r.nodeName.toLowerCase();t.data&&t.data.currentValue!==s&&t.list&&t.list[s]&&(o.container.innerHTML=""+t.list[s]+"",o.container.firstChild.classList.add("jodit_icon"),t.data.currentValue=s)}return!1},exec:function(e,t,o){e.execCommand(o.command,!1,o.args?o.args[0]:void 0)},data:{currentValue:"left"},list:{p:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",blockquote:"Quote",pre:"Code"},template:function(e,t,o){return"<"+t+' class="jodit_list_element">'+e.i18n(o)+""},tooltip:"Insert format block"},t.formatBlock=i},function(e,t,o){"use strict";function i(e){var t=!1,o=0,i=0,n=!1,a=function(){e.events&&(t?(o=r.css(e.container,"height"),i=r.css(e.container,"width"),r.css(e.container,{height:e.ownerWindow.innerHeight,width:e.ownerWindow.innerWidth}),n=!0):n&&r.css(e.container,{height:o||"auto",width:i||"auto"}))},l=function(o){if(void 0===o&&(o=!e.container.classList.contains("jodit_fullsize")),t=o,e.container.classList.toggle("jodit_fullsize",o),e.toolbar){r.css(e.toolbar.container,"width","auto");var i=r.dom(s.Toolbar.getIcon(o?"shrink":"fullsize"),e.ownerDocument),n=e.toolbar.container.querySelector(".jodit_toolbar_btn-fullsize a");n&&(i.classList.add("jodit_icon"),n.innerHTML="",n.appendChild(i))}if(e.options.globalFullsize){for(var l=e.container.parentNode;l&&!(l instanceof Document);)l.classList.toggle("jodit_fullsize_box",o),l=l.parentNode;a()}e.events.fire("afterResize")};e.options.fullsize&&e.events.on("afterInit",function(){l(!0)}),e.options.globalFullsize&&e.events.on(e.ownerWindow,"resize",a),e.events.on("toggleFullsize",l),e.events.on("beforeDestruct",function(){l(!1)})}t.__esModule=!0;var n=o(1),r=o(0),s=o(5),a=o(2);n.Config.prototype.fullsize=!1,n.Config.prototype.globalFullsize=!0,n.Config.prototype.controls.fullsize={exec:function(e){e.events.fire("toggleFullsize")},tooltip:"Open editor in fullsize",mode:a.MODE_SOURCE+a.MODE_WYSIWYG},t.fullsize=i},function(e,t,o){"use strict";function i(e){e.events.on("generateDocumentStructure.iframe",function(t){if(t.open(),t.write('\n \n \n '+(e.options.iframeBaseUrl?'':"")+'\n \n \n '),t.close(),e.options.iframeCSSLinks&&e.options.iframeCSSLinks.forEach(function(e){var o=r.dom('',t);t.head.appendChild(o)}),e.options.iframeStyle){var o=t.createElement("style");o.innerHTML=e.options.iframeStyle,t.head.appendChild(o)}}).on("createEditor",function(){if(e.options.iframe){e.iframe=e.ownerDocument.createElement("iframe"),e.iframe.style.display="block",e.iframe.src="about:blank",e.iframe.className="jodit_wysiwyg_iframe",e.iframe.frameBorder="0",e.iframe.setAttribute("allowtransparency","true"),e.iframe.setAttribute("tabindex","0"),e.iframe.setAttribute("frameborder","0"),e.workplace.appendChild(e.iframe);var t=e.iframe.contentWindow.document;if(e.events.fire("generateDocumentStructure.iframe",t),e.editorDocument=t,e.editorWindow=e.iframe.contentWindow,e.editor=t.body,"auto"===e.options.height){t.documentElement.style.overflowY="hidden";var o=function(){e.editor&&r.css(e.iframe,"height",e.editor.offsetHeight)};e.events.on("change afterInit afterSetMode resize",o).on([e.iframe,e.editorWindow,t.documentElement],"load",o).on(t,"readystatechange DOMContentLoaded",o)}return r.css(e.editor,"minHeight",e.options.minHeight),function(e){e.matches||(e.matches=Element.prototype.matches)}(e.editorWindow.Element.prototype),e.events.on(e.editorWindow,"mousedown click mouseup mousemove scroll",function(t){e.events&&e.events.fire&&e.events.fire(window,t)}),!1}})}t.__esModule=!0;var n=o(1),r=o(0);n.Config.prototype.iframe=!1,n.Config.prototype.iframeBaseUrl=!1,n.Config.prototype.iframeStyle='html{margin: 0px;}body{padding:10px;background:transparent;color:#000;position:relative;z-index: 2;user-select:auto;margin:0px;overflow:auto;}body:after{content:"";clear:both;display:block}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}td[data-jodit-selected-cell],th[data-jodit-selected-cell]{border: 1px double #1e88e5}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.Config.prototype.iframeCSSLinks=[],t.iframe=i},function(e,t,o){"use strict";function i(e){var t=function(t){return e.selection.eachSelection(function(o){var i=e.selection.save(),n=!!o&&r.Dom.up(o,r.Dom.isBlock,e.editor);if(!n&&o&&(n=r.Dom.wrap(o,e.options.enter,e)),!n)return e.selection.restore(i),!1;if(n&&n.style){var s=n.style.marginLeft?parseInt(n.style.marginLeft,10):0;s+=e.options.indentMargin*("outdent"===t?-1:1),n.style.marginLeft=s>0?s+"px":"",n.getAttribute("style")||n.removeAttribute("style")}e.selection.restore(i)}),e.setEditorValue(),!1};e.registerCommand("indent",{exec:t,hotkeys:"ctrl+]"}),e.registerCommand("outdent",{exec:t,hotkeys:"ctrl+["})}t.__esModule=!0;var n=o(1),r=o(3);n.Config.prototype.controls.indent={tooltip:"Increase Indent"},n.Config.prototype.controls.outdent={isDisable:function(e,t,o){var i=e.selection.current();if(i){var n=r.Dom.closest(i,r.Dom.isBlock,e.editor);if(n&&n.style&&n.style.marginLeft)return 0>=parseInt(n.style.marginLeft,10)}return!0},tooltip:"Decrease Indent"},n.Config.prototype.indentMargin=10,t.indent=i},function(e,t,o){"use strict";function i(e){e.events.on("click",function(e){})}t.__esModule=!0,t.imageInlineToolbar=i},function(e,t,o){"use strict";function i(e){var t,o=function(o){e.events.off(o,".imageProcessor").on(o,"dragstart.imageProcessor",function(e){t=o,e.preventDefault()}).on(o,"mousedown.imageProcessor",function(){t=o})};e.events.on("afterInit",function(){e.events.on(e.editor,"mousemove",n.throttle(function(o){t&&e.selection.insertCursorAtPoint(o.clientX,o.clientY)},e.options.observer.timeout)).on(window,"mouseup",function(){t=!1}).on(e.editor,"mouseup",function(o){var i,n=t;if(n&&o.target!==n){if(!1===e.selection.insertCursorAtPoint(o.clientX,o.clientY))return!1;i=!n.parentNode||"A"!==n.parentNode.tagName||n.parentNode.textContent&&n.parentNode.textContent.length?n:n.parentNode,i.parentNode&&i.parentNode.removeChild(i),i&&e.selection.insertImage(i),e.selection.select(i)}})}),e.events.on("change afterInit",n.debounce(function(){e.editor&&n.$$("img",e.editor).forEach(function(t){t[r]||(t[r]=!0,o(t),t.complete||t.addEventListener("load",function o(){e.events&&e.events.fire&&e.events.fire("resize"),t.removeEventListener("load",o)}))})},e.options.observer.timeout))}t.__esModule=!0;var n=o(0),r="__jodit_imageprocessor_binded";t.imageProcessor=i},function(e,t,o){"use strict";function i(e){var t=function(t){if(!e.options.readonly){var o,i=this,r=new a.Dialog(e),c=s.dom(''+l.Toolbar.getIcon("cancel")+""+e.i18n("Cancel")+"",e.ownerDocument),f=s.dom(''+l.Toolbar.getIcon("check")+""+e.i18n("Ok")+"",e.ownerDocument),h={remove:s.dom(''+l.Toolbar.getIcon("bin")+" "+e.i18n("Delete")+"",e.ownerDocument)},m=s.dom('
      ',e.ownerDocument),v=s.dom('
      ",e.ownerDocument),g=s.dom('
      '+(e.options.filebrowser.ajax.url||e.options.uploader.url?'
      '+(e.options.filebrowser.ajax.url||e.options.uploader.url?''+l.Toolbar.getIcon("image")+"":"")+(e.options.image.useImageEditor&&void 0!==n.Jodit.modules.ImageEditor&&e.options.filebrowser.ajax.url?''+l.Toolbar.getIcon("crop")+"":"")+"
      ":"")+'
      '+e.i18n("Open link in new tab")+"
      ",e.ownerDocument),_=i.naturalWidth/i.naturalHeight||1,b=m.querySelector("#imageWidth"),y=m.querySelector("#imageHeight"),w=function(){i.style.cssFloat&&-1!==["left","right"].indexOf(i.style.cssFloat.toLowerCase())?s.val(m,"#align",s.css(i,"float")):"block"===s.css(i,"display")&&"auto"===i.style.marginLeft&&"auto"===i.style.marginRight&&s.val(m,"#align","center")},C=function(){s.val(m,"#id",i.getAttribute("id")||"")},j=function(){s.val(m,"#style",i.getAttribute("style")||"")},x=function(){s.val(m,"#classes",(i.getAttribute("class")||"").replace(/jodit_focused_image[\s]*/,""))},q=function(){if(e.options.image.editMargins){var t=!1;s.$$(".margins",m).forEach(function(e){var o=i.style[e.id];o&&(/^[0-9]+(px)?$/.test(o)&&(o=parseInt(o,10)),e.value=""+o||"",t||"marginTop"===e.id||e.value===s.val(m,"#marginTop")||(t=!0))}),L=!t;var o=m.querySelector(".jodit_lock_margin");o&&(o.innerHTML=l.Toolbar.getIcon(L?"lock":"unlock")),s.$$(".margins:not(#marginTop)",m).forEach(function(e){return L?e.setAttribute("disabled","true"):e.removeAttribute("disabled")})}},E=function(){b.value=""+i.offsetWidth,y.value=""+i.offsetHeight},T=function(){i.hasAttribute("title")&&s.val(m,"#imageTitle",i.getAttribute("title")||""),i.hasAttribute("alt")&&s.val(m,"#imageAlt",i.getAttribute("alt")||"");var t=d.Dom.closest(i,"a",e.editor);t&&(s.val(m,"#imageLink",t.getAttribute("href")||""),m.querySelector("#imageLinkOpenInNewTab").checked="_blank"===t.getAttribute("target"))},D=function(){s.val(m,"#imageSrc",i.getAttribute("src")||"");var e=m.querySelector("#imageViewSrc");e&&e.setAttribute("src",i.getAttribute("src")||"")},S=function(){D(),T(),E(),q(),x(),C(),w(),j()},k=!0,L=!0,I={},M=m.querySelector("#tabsbox");I[e.i18n("Image")]=g,I[e.i18n("Advansed")]=v,M&&M.appendChild(u(e,I)),S(),e.events.on(r,"afterClose",function(){r.destruct(),i.parentNode&&e.options.image.selectImageAfterClose&&e.selection.select(i)}),h.remove.addEventListener("click",function(){i.parentNode&&i.parentNode.removeChild(i),r.close()}),e.options.image.useImageEditor&&s.$$(".jodit_use_image_editor",g).forEach(function(t){e.events.on(t,"mousedown touchstart",function(){var t=i.getAttribute("src")||"",o=e.ownerDocument.createElement("a"),n=function(){if(o.host!==location.host)return void a.Confirm(e.i18n("You can only edit your own images. Download this image on the host?"),function(t){t&&e.uploader&&e.uploader.uploadRemoteImage(""+o.href,function(t){a.Alert(e.i18n("The image has been successfully uploaded to the host!"),function(){"string"==typeof t.newfilename&&(i.setAttribute("src",t.baseurl+t.newfilename),D())})},function(t){a.Alert(e.i18n("There was an error loading %s",t.message))})})};o.href=t,e.getInstance("FileBrowser").getPathByUrl(""+o.href,function(n,r,s){e.getInstance("FileBrowser").openImageEditor(o.href,r,n,s,function(){var e=(new Date).getTime();i.setAttribute("src",t+(-1!==t.indexOf("?")?"":"?")+"&_tmp="+e),D()},function(e){a.Alert(e.message)})},function(e){a.Alert(e.message,n)})})}),s.$$(".jodit_rechange",g).forEach(function(t){t.addEventListener("mousedown",function(o){t.classList.toggle("active"),e.toolbar.openPopup(t,p(e,{upload:function(t){t.files&&t.files.length&&i.setAttribute("src",t.baseurl+t.files[0]),S(),e.toolbar.closeAll()},filebrowser:function(t){t&&t.files&&Array.isArray(t.files)&&t.files.length&&(i.setAttribute("src",t.files[0]),e.toolbar.closeAll(),S())}},i,e.toolbar.closeAll),!0),o.stopPropagation()})});var A=m.querySelector(".jodit_lock_helper.jodit_lock_size"),N=m.querySelector(".jodit_lock_helper.jodit_lock_margin");return A&&A.addEventListener("click",function(){k=!k,this.innerHTML=l.Toolbar.getIcon(k?"lock":"unlock"),e.events.fire(b,"change")}),N&&N.addEventListener("click",function(){L=!L,this.innerHTML=l.Toolbar.getIcon(L?"lock":"unlock"),L?s.$$(".margins",m).forEach(function(e){e.matches("#marginTop")||e.setAttribute("disabled","true")}):s.$$(".margins",m).forEach(function(e){e.matches("#marginTop")||e.removeAttribute("disabled")})}),e.events.on(s.$$("#imageWidth,#imageHeight",m),"change keydown mousedown paste",function(e){k&&(clearTimeout(o),o=window.setTimeout(function(){var t=parseInt(b.value,10),o=parseInt(y.value,10);"imageWidth"===e.target.getAttribute("id")?y.value=""+Math.round(t/_):b.value=""+Math.round(o*_)},100))}),r.setTitle([e.i18n("Image properties"),h.remove]),r.setContent(m),c.addEventListener("click",function(){r.close()}),f.addEventListener("click",function(){if(e.options.image.editStyle&&(s.val(m,"#style")?i.setAttribute("style",s.val(m,"#style")):i.removeAttribute("style")),!s.val(m,"#imageSrc"))return i.parentNode&&i.parentNode.removeChild(i),void r.close();i.setAttribute("src",s.val(m,"#imageSrc")),s.val(m,"#imageTitle")?i.setAttribute("title",s.val(m,"#imageTitle")):i.removeAttribute("title"),s.val(m,"#imageAlt")?i.setAttribute("alt",s.val(m,"#imageAlt")):i.removeAttribute("alt");var t=d.Dom.closest(i,"a",e.editor);s.val(m,"#imageLink")?(t||(t=d.Dom.wrap(i,"a",e)),t.setAttribute("href",s.val(m,"#imageLink")),m.querySelector("#imageLinkOpenInNewTab").checked?t.setAttribute("target","_blank"):t.removeAttribute("target")):t&&t.parentNode&&t.parentNode.replaceChild(i,t);var o=function(e){return e=s.trim(e),/^[0-9]+$/.test(e)?e+"px":e};s.css(i,{width:s.trim(b.value)?o(b.value):null,height:s.trim(y.value)?o(y.value):null}),e.options.image.editMargins&&(L?s.css(i,"margin",o(s.val(m,"#marginTop"))):s.$$(".margins",m).forEach(function(e){s.css(i,e.id,o(e.value))})),e.options.image.editClass&&(s.val(m,"#classes")?i.setAttribute("class",s.val(m,"#classes")):i.removeAttribute("class")),e.options.image.editId&&(s.val(m,"#id")?i.setAttribute("id",s.val(m,"#id")):i.removeAttribute("id"));var n=function(){"block"===s.css(i,"display")&&s.css(i,"display",""),"auto"===i.style.marginLeft&&"auto"===i.style.marginRight&&(i.style.marginLeft="",i.style.marginRight="")};e.options.image.editAlign&&(s.val(m,"#align")?-1!==["right","left"].indexOf(s.val(m,"#align").toLowerCase())?(s.css(i,"float",s.val(m,"#align")),n()):(s.css(i,"float",""),s.css(i,{display:"block","margin-left":"auto","margin-right":"auto"})):(s.css(i,"float")&&-1!==["right","left"].indexOf((""+s.css(i,"float")).toLowerCase())&&s.css(i,"float",""),n())),i.getAttribute("style")||i.removeAttribute("style"),e.setEditorValue(),r.close()}),r.setFooter([f,c]),r.setSize(500),r.open(),t&&t.preventDefault(),!1}};e.events.on("afterInit",function(){e.options.image.openOnDblClick?e.events.on(e.editor,"dblclick",t,"img"):e.events.on(e.editor,"dblclick",function(){e.selection.select(this)},"img")}).on("openImageProperties",function(e){t.call(e)})}t.__esModule=!0;var n=o(6),r=o(1),s=o(0),a=o(7),l=o(5),d=o(3),c=o(9),u=c.Widget.TabsWidget,p=c.Widget.ImageSelectorWidget;r.Config.prototype.image={openOnDblClick:!0,editSrc:!0,useImageEditor:!0,editTitle:!0,editAlt:!0,editLink:!0,editSize:!0,editMargins:!0,editClass:!0,editStyle:!0,editId:!0,editAlign:!0,showPreview:!0,selectImageAfterClose:!0},t.imageProperties=i},function(e,t,o){"use strict";function i(e){var t,o=new n.Toolbar(e),i=s.dom('
      ',e.ownerDocument),r=function(t){e.container&&e.container.classList&&e.container.classList.toggle("jodit_popup_active",t)},l=function(){i.classList&&i.classList.remove("active"),r(!1)},d=function(t,n,a){var l=t.tagName.toLowerCase();void 0!==e.options.popup[l]&&(i.innerHTML='',o.build(e.options.popup[l],i,t),i.classList.add("active"),s.css(i,{left:n+"px",top:a+"px"}),i.style.marginLeft=-Math.round(i.offsetWidth/2)+"px",r(!0),e.events.fire("afterOpenPopup",i,e.container))},c=function(o,i,n){e.options.readonly||(clearTimeout(t),e.options.observer.timeout?t=setTimeout(d.bind(e,o,i,n),e.options.observer.timeout):d(o,i,n))};e.events.on("hidePopup afterCommand keydown resize",l).on("showPopap",c).on("afterInit",function(){e.editorDocument.body.appendChild(i);var t=!1;e.events.on([e.ownerWindow,e.editor],"scroll",l).on(i,"mousedown",function(e){e.stopPropagation()}).on(e.editor,"mousedown",function(o){if("IMG"===o.target.tagName||a.Dom.closest(o.target,"table|a",e.editor)){var i="IMG"===o.target.tagName?o.target:a.Dom.closest(o.target,"table|a",e.editor),n=s.offset(i,e);c(i,Math.round(n.left+i.offsetWidth/2),Math.round(n.top+i.offsetHeight)),t=!0}else t=!1}).on(e.ownerWindow,"mousedown",function(){t||l(),t=!1})}).on("beforeDestruct",function(){i.parentNode&&i.parentNode.removeChild(i),clearTimeout(t)})}t.__esModule=!0;var n=o(5),r=o(1),s=o(0),a=o(3),l=o(15),d=o(9),c=d.Widget.ColorPickerWidget,u=d.Widget.TabsWidget;r.Config.prototype.popup={a:[{name:"eye",tooltip:"Open link",exec:function(e,t){var o=t.getAttribute("href");t&&o&&e.ownerWindow.open(o)}},{name:"link",tooltip:"Edit link",icon:"pencil"},"unlink","brush"],img:[{name:"bin",tooltip:"Delete",exec:function(e,t){t.parentNode&&t.parentNode.removeChild(t)}},{name:"pencil",exec:function(e,t){"img"===t.tagName.toLowerCase()&&e.events.fire("openImageProperties",t)},tooltip:"Edit"},{name:"valign",list:["Top","Middle","Bottom"],tooltip:"Vertical align",exec:function(e,t,o){if("img"===t.tagName.toLowerCase()){var i=o.args&&"string"==typeof o.args[1]?o.args[1].toLowerCase():"";s.css(t,"vertical-align",i)}}},{name:"left",list:["Left","Right","Center","Normal"],exec:function(e,t,o){if("img"===t.tagName.toLowerCase()){var i=function(){"block"===s.css(t,"display")&&s.css(t,"display",""),"auto"===t.style.marginLeft&&"auto"===t.style.marginRight&&(t.style.marginLeft="",t.style.marginRight="")},n=o.args&&"string"==typeof o.args[1]?o.args[1].toLowerCase():"";"normal"!==n?-1!==["right","left"].indexOf(n)?(s.css(t,"float",n),i()):(s.css(t,"float",""),s.css(t,{display:"block","margin-left":"auto","margin-right":"auto"})):(s.css(t,"float")&&-1!==["right","left"].indexOf(s.css(t,"float").toLowerCase())&&s.css(t,"float",""),i())}},tooltip:"Horizontal align"}],table:[{name:"brush",popup:function(e,t,o,i){var n,r,a,d,p,f,h=l.Table.getAllSelectedCells(t);return!!h.length&&(d=s.css(h[0],"color"),f=s.css(h[0],"background-color"),p=s.css(h[0],"border-color"),n=c(e,function(e){h.forEach(function(t){s.css(t,"background-color",e)}),i()},f),r=c(e,function(e){h.forEach(function(t){s.css(t,"color",e)}),i()},d),a=c(e,function(e){h.forEach(function(t){s.css(t,"border-color",e)}),i()},p),u(e,{Background:n,Text:r,Border:a}))},tooltip:"Background"},{name:"valign",list:["Top","Middle","Bottom"],exec:function(e,t,o){var i=o.args&&"string"==typeof o.args[1]?o.args[1].toLowerCase():"";l.Table.getAllSelectedCells(t).forEach(function(e){s.css(e,"vertical-align",i)})},tooltip:"Vertical align"},{name:"splitv",command:"tablesplitv",tooltip:"Split vertical"},{name:"splitg",command:"tablesplitg",tooltip:"Split horizontal"},"\n",{name:"merge",command:"tablemerge",tooltip:"Merge"},{name:"addcolumn",list:{tableaddcolumnbefore:"Insert column before",tableaddcolumnafter:"Insert column after"},exec:function(e,t,o){e.execCommand(o.args&&"string"==typeof o.args[0]?o.args[0].toLowerCase():"",!1,t)},tooltip:"Add column"},{name:"addrow",list:{tableaddrowbefore:"Insert row above",tableaddrowafter:"Insert row below"},exec:function(e,t,o){e.execCommand(o.args&&"string"==typeof o.args[0]?o.args[0].toLowerCase():"",!1,t)},tooltip:"Add row"},{name:"bin",list:{tablebin:"Delete table",tablebinrow:"Delete row",tablebincolumn:"Delete column",tableempty:"Empty cell"},exec:function(e,t,o){e.execCommand(o.args&&"string"==typeof o.args[0]?o.args[0].toLowerCase():"",!1,t)},tooltip:"Delete"}]},t.inlinePopup=i},function(e,t,o){"use strict";function i(e){var t=function(t){var o=function(o){if(o instanceof e.editorWindow.HTMLElement)switch(t.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"}};return e.selection.focus(),e.selection.eachSelection(function(t){if(!t&&e.editor.querySelector(".jodit_selected_cell"))return n.$$(".jodit_selected_cell",e.editor).forEach(o),!1;if(t instanceof e.editorWindow.Node){var i=!!t&&r.Dom.up(t,r.Dom.isBlock,e.editor);!i&&t&&(i=r.Dom.wrap(t,e.options.enter,e)),o(i)}}),!1};e.registerCommand("justifyfull",t),e.registerCommand("justifyright",t),e.registerCommand("justifyleft",t),e.registerCommand("justifycenter",t)}t.__esModule=!0;var n=o(0),r=o(3),s=o(1),a=o(5);s.Config.prototype.controls.align={name:"left",tooltip:"Align",getLabel:function(e,t,o){var i=e.selection.current();if(i){var s=r.Dom.closest(i,r.Dom.isBlock,e.editor)||e.editor,l=""+n.css(s,"text-align");t.data&&t.data.currentValue!==l&&t.list&&-1!==t.list.indexOf(l)&&(o.container.innerHTML=e.options.textIcons?""+l+"":a.Toolbar.getIcon(l,""),o.container.firstChild.classList.add("jodit_icon"),t.data.currentValue=l)}return!1},isActive:function(e,t){var o=e.selection.current();if(o&&t.defaultValue){var i=r.Dom.closest(o,r.Dom.isBlock,e.editor)||e.editor;return-1===t.defaultValue.indexOf(""+n.css(i,"text-align"))}return!1},defaultValue:["left","start","inherit"],data:{currentValue:"left"},list:["center","left","right","justify"]},s.Config.prototype.controls.center={command:"justifyCenter",tags:["center"],css:{"text-align":"center"},tooltip:"Align Center"},s.Config.prototype.controls.justify={command:"justifyFull",css:{"text-align":"justify"},tooltip:"Align Justify"},s.Config.prototype.controls.left={command:"justifyLeft",css:{"text-align":"left"},tooltip:"Align Left"},s.Config.prototype.controls.right={command:"justifyRight",css:{"text-align":"right"},tooltip:"Align Right"},t.justify=i},function(e,t,o){"use strict";function i(e){e.options.link.followOnDblClick&&e.events.on("afterInit",function(){e.events.on(e.editor,"dblclick",function(e){var t=this.getAttribute("href");t&&(location.href=t,e.preventDefault())},"a")}),e.options.link.processPastedLink&&e.events.on("processPaste",function(t,o){if(r.isURL(o)){var i=r.convertMediaURLToVideoEmbed(o);if(i!==o)return r.dom(i,e.editorDocument);var n=e.editorDocument.createElement("a");return n.setAttribute("href",o),n.innerText=o,e.options.link.openLinkDialogAfterPost&&setTimeout(function(){},100),n}}),e.options.link.removeLinkAfterFormat&&e.events.on("afterCommand",function(t){var o,i,n=e.selection;"removeFormat"===t&&(i=n.current(),i&&"A"!==i.nodeName&&(i=s.Dom.closest(i,"A",e.editor)),i&&"A"===i.nodeName&&(o=i.innerHTML===i.innerText?s.Dom.create("text",i.innerText,e.editorDocument):s.Dom.create("span",i.innerHTML,e.editorDocument),i.parentNode&&(i.parentNode.replaceChild(o,i),e.selection.setCursorIn(o,!0))))})}t.__esModule=!0;var n=o(1),r=o(0),s=o(3);n.Config.prototype.link={followOnDblClick:!0,processVideoLink:!0,processPastedLink:!0,openLinkDialogAfterPost:!0,removeLinkAfterFormat:!0},n.Config.prototype.controls.unlink={exec:function(e,t){var o=s.Dom.closest(t,"A",e.editor);o&&s.Dom.unwrap(o),e.events.fire("hidePopup")}},n.Config.prototype.controls.link={popup:function(e,t,o,i){var n=e.editorWindow.getSelection(),a=r.dom('
        
      ',e.ownerDocument);t=!(!t||!s.Dom.closest(t,"A",e.editor))&&s.Dom.closest(t,"A",e.editor);var l=a.querySelector(".jodit_link_insert_button"),d=a.querySelector(".jodit_unlink_button");t?(r.val(a,"input[name=url]",t.getAttribute("href")||""),r.val(a,"input[name=text]",t.innerText),a.querySelector("input[name=target]").checked="_blank"===t.getAttribute("target"),a.querySelector("input[name=nofollow]").checked="nofollow"===t.getAttribute("rel"),l&&(l.innerHTML=e.i18n("Update"))):(d&&(d.style.display="none"),r.val(a,"input[name=text]",""+n),l&&(l.innerHTML=e.i18n("Insert")));var c=e.selection.save();return d&&d.addEventListener("mousedown",function(o){t&&s.Dom.unwrap(t),e.selection.restore(c),i(),o.preventDefault()}),a.addEventListener("submit",function(o){o.preventDefault(),e.selection.restore(c);var n=t||s.Dom.create("a","",e.editorDocument);return r.val(a,"input[name=url]")?(n.setAttribute("href",r.val(a,"input[name=url]")),n.innerText=r.val(a,"input[name=text]"),a.querySelector("input[name=target]").checked?n.setAttribute("target","_blank"):n.removeAttribute("target"),a.querySelector("input[name=nofollow]").checked?n.setAttribute("rel","nofollow"):n.removeAttribute("rel"),t||e.selection.insertNode(n),i(),!1):(a.querySelector("input[name=url]").focus(),a.querySelector("input[name=url]").classList.add("jodit_error"),!1)}),a},tags:["a"],tooltip:"Insert link"},t.link=i},function(e,t,o){"use strict";function i(e){var t,o=0,i=e.options.buttons;e.events.on("touchend",function(i){i.changedTouches.length&&(t=(new Date).getTime())-o>e.options.mobileTapTimeout&&(o=t,e.selection.insertCursorAtPoint(i.changedTouches[0].clientX,i.changedTouches[0].clientY))}).on("getDiffButtons.mobile",function(){return e.options.buttons.filter(function(e){return 0>i.indexOf(e)})}).on("resize afterInit",function(){var t=e.container.offsetWidth;i=e.options.sizeLG>t?e.options.sizeMD>t?e.options.sizeSM>t?e.options.buttonsXS:e.options.buttonsSM:e.options.buttonsMD:e.options.buttons,e.toolbar.build(i.concat(e.options.extraButtons),e.container)})}t.__esModule=!0;var n=o(1),r=o(8),s=o(2);n.Config.prototype.mobileTapTimeout=300,n.Config.prototype.controls.dots={mode:s.MODE_SOURCE+s.MODE_WYSIWYG,popup:function(e,t,o,i){var n=o.data;return void 0===n&&(n={container:e.ownerDocument.createElement("div"),toolbar:new r.Toolbar(e),rebuild:function(){var t=e.events.fire("getDiffButtons.mobile");t&&n&&n.toolbar.build(t,n.container)}},n.container.style.width="100px",o.data=n),n.rebuild(),n.container}},t.mobile=i},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};t.__esModule=!0;var r=o(6),s=o(4),a=o(7),l=o(1),d=o(0),c=o(5),u=o(16),p=o(11),f=o(14),h=o(2),m=o(10);l.Config.prototype.filebrowser={filter:function(e,t){return t=t.toLowerCase(),"string"==typeof e?-1!==e.toLowerCase().indexOf(t):"string"==typeof e.name?-1!==e.name.toLowerCase().indexOf(t):"string"!=typeof e.file||-1!==e.file.toLowerCase().indexOf(t)},sortBy:"changed",sort:function(e,t,o){var i,n,r=function(e,t){return t>e?-1:e>t?1:0};if("string"==typeof e)return r(e.toLowerCase(),t.toLowerCase());if(void 0===e[o]||"name"===o)return"string"==typeof e.name?r(e.name.toLowerCase(),t.name.toLowerCase()):"string"==typeof e.file?r(e.file.toLowerCase(),t.file.toLowerCase()):0;switch(o){case"changed":return i=new Date(e.changed),n=new Date(t.changed),n.getTime()-i.getTime();case"size":return d.humanSizeToBytes(e.size)-d.humanSizeToBytes(t.size)}return 0},editImage:!0,preview:!0,showPreviewNavigation:!0,showSelectButtonInPreview:!0,contextMenu:!0,howLongShowMsg:3e3,createNewFolder:!0,deleteFolder:!0,moveFolder:!0,moveFile:!0,showFoldersPanel:!0,width:763,height:400,buttons:["upload","remove","update","select","edit","tiles","list","filter","sort"],view:"tiles",isSuccess:function(e){return e.success},getMessage:function(e){return void 0!==e.data.messages&&Array.isArray(e.data.messages)?e.data.messages.join(" "):""},showFileName:!0,showFileSize:!0,showFileChangeTime:!0,getThumbTemplate:function(e,t,o){var i,n="",r="",s=""+(new Date).getTime();return"string"==typeof e?(n=e,r=e):(void 0!==e.file&&(n=e.file,r=e.file),e.thumb&&(r=e.thumb)),i='
      \n '+(this.options.showFileName?''+n+"":"")+"\n "+(this.options.showFileSize&&e.size?''+e.size+"":"")+"\n "+(this.options.showFileChangeTime&&e.changed?''+e.changed+"":"")+"\n
      ",'\n '+n+'\n '+(this.options.showFileName||this.options.showFileSize&&e.size||this.options.showFileChangeTime&&e.changed?i:"")+"\n "},ajax:{url:"",async:!0,data:{},cache:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",method:"POST",processData:!0,dataType:"json",headers:{},prepareData:function(e){return e},process:function(e){return e}},create:{data:{action:"folderCreate"}},getLocalFileByUrl:{data:{action:"getLocalFileByUrl"}},resize:{data:{action:"imageResize"}},crop:{data:{action:"imageCrop"}},move:{data:{action:"fileMove"}},remove:{data:{action:"fileRemove"}},items:{data:{action:"files"}},folder:{data:{action:"folders"}},permissions:{data:{action:"permissions"}},uploader:null};var v="default",g="jodit_filebrowser_files_item";t.FileBrowser=function(e){function t(t){var o=e.call(this,t)||this;o.currentPath="",o.currentSource=v,o.currentBaseUrl="",o.__currentPerpissions=null,o.view="tiles",o.sortBy="changed",o.dragger=!1,o.filterWord="",o.getPathByUrl=function(e,t,i){var n=o;o.options.getLocalFileByUrl.data.url=e,o.send("getLocalFileByUrl",function(e){n.options.isSuccess(e)?t(e.data.path,e.data.name,e.data.source):i(Error(o.options.getMessage(e)))},function(e){i(e)})},o.loadItems=function(e,t){var i=o;i.options.items.data.path=e,i.options.items.data.source=t,i.options.items.url&&(i.files.classList.add("active"),i.files.appendChild(i.loader.cloneNode(!0)),i.__ajax2&&i.__ajax2.abort&&i.__ajax2.abort(),i.__ajax2=i.send("items",function(e){var t=i.options.items.process;if(t||(t=o.options.ajax.process),t){var n=t.call(i,e);i.generateItemsBox(n.data.sources),i.someSelectedWasChanged()}},function(e){a.Alert(e.message),i.errorHandler(e)}))},o.create=function(e,t,i){o.options.create.data.source=i,o.options.create.data.path=t,o.options.create.data.name=e,o.send("create",function(e){o.options.isSuccess(e)?(o.currentPath=t,o.currentSource=i,o.loadTree(t,i)):o.status(o.options.getMessage(e))},function(e){o.status(e.message)})},o.move=function(e,t,i){o.options.move.data.from=e,o.options.move.data.path=t,o.options.move.data.source=i,o.send("move",function(e){o.options.isSuccess(e)?o.loadTree(t,i):o.status(o.options.getMessage(e))},function(e){o.status(e.message)})},o.close=function(){o.dialog.close()},o.open=function(e){if(o.options.items.url){var t=0;o.jodit.events.off(o.files,"dblclick").on(o.files,"dblclick",o.onSelect(e),"a").on(o.files,"touchstart",function(){var i=(new Date).getTime();h.EMULATE_DBLCLICK_TIMEOUT>i-t&&o.onSelect(e)(),t=i},"a").off(o.buttons.select,"click").on(o.buttons.select,"click",o.onSelect(e)),o.loadTree(o.currentPath,o.currentSource);var i=[d.dom(''+o.jodit.i18n("File Browser")+"      ",o.jodit.ownerDocument)],n=void 0,s=void 0;for(n=0;o.options.buttons.length>n;n+=1){var a=o.options.buttons[n];"string"==typeof a&&void 0!==o.buttons[a]&&(o.options.editImage&&void 0!==r.Jodit.modules.ImageEditor||"edit"!==a)?i.push(o.buttons[a]):"function"==typeof a?i.push(a.call(o)):d.isPlainObject(a)&&a.exec&&a.name&&(s=d.dom('
      '+c.Toolbar.getIcon(a.icon||a.name||"")+"
      ",o.jodit.ownerDocument),i.push(s),s.addEventListener("click",a.exec))}o.dialog.open(o.browser,i)}},o.errorHandler=function(e){o.status(e instanceof Error?o.jodit.i18n(e.message):o.options.getMessage(e))},o.uploadHandler=function(){o.loadItems(o.currentPath,o.currentSource)},o.openImageEditor=function(e,t,i,n,r,s){o.jodit.getInstance("ImageEditor").open(e,function(e,a,l,d){void 0===o.options[a.action]&&(o.options[a.action]={}),void 0===o.options[a.action].data&&(o.options[a.action].data={action:a.action}),o.options[a.action].data.newname=e||t,o.options[a.action].data.box=a.box,o.options[a.action].data.path=i,o.options[a.action].data.name=t,o.options[a.action].data.source=n,o.send(a.action,function(e){o.options.isSuccess(e)?(o.loadTree(o.currentPath,o.currentSource),l(),r&&r()):(d(Error(o.options.getMessage(e))),s&&s(Error(o.options.getMessage(e))))},function(e){d(e),s&&s(e)})})},o.draggable=!1,o.start={top:0,left:0},o.client={x:0,y:0};var i=o,s=t.ownerDocument;i.options=d.extend(!0,{},l.Config.prototype.filebrowser,i.jodit.options.filebrowser),i.dialog=new a.Dialog(t,{fullsizeButton:!0}),i.loader=d.dom('
      ',s),i.browser=d.dom('
      '+(i.options.showFoldersPanel?'
      ':"")+'
      ',s),i.status_line=i.browser.querySelector(".jodit_filebrowser_status"),i.buttons={upload:d.dom('
      '+c.Toolbar.getIcon("plus")+'
      ',s),remove:d.dom('
      '+c.Toolbar.getIcon("bin")+"
      ",s),update:d.dom('
      '+c.Toolbar.getIcon("update")+"
      ",s),select:d.dom('
      '+c.Toolbar.getIcon("check")+"
      ",s),edit:d.dom('
      '+c.Toolbar.getIcon("pencil")+"
      ",s),tiles:d.dom('
      '+c.Toolbar.getIcon("th")+"
      ",s),list:d.dom('
      '+c.Toolbar.getIcon("th-list")+"
      ",s),filter:d.dom('',s),sort:d.dom('",s)},i.tree=i.browser.querySelector(".jodit_filebrowser_tree"),i.files=i.browser.querySelector(".jodit_filebrowser_files"),i.jodit.events.on([i.buttons.tiles,i.buttons.list],"click",function(e){var t=e.currentTarget;t.classList.contains("jodit_button_tiles")?(i.view="tiles",i.buttons.list.classList.add("disabled")):(i.view="list",i.buttons.tiles.classList.add("disabled")),t.classList.remove("disabled"),i.files.classList.remove("jodit_filebrowser_files_view-tiles"),i.files.classList.remove("jodit_filebrowser_files_view-list"),i.files.classList.add("jodit_filebrowser_files_view-"+i.view),m.Cookie.set("jodit_filebrowser_view",i.view,31)}).on(i.buttons.sort,"change",function(){i.sortBy=i.buttons.sort.value,m.Cookie.set("jodit_filebrowser_sortby",i.sortBy,31),i.loadItems(i.currentPath,i.currentSource)}).on(i.buttons.sort,"click mousedown",function(e){e.stopPropagation()}).on(i.buttons.filter,"click mousedown",function(e){e.stopPropagation()}).on(i.buttons.filter,"keydown",d.debounce(function(){i.filterWord=i.buttons.filter.value,i.loadItems(i.currentPath,i.currentSource)},300)).on(i.buttons.remove,"click",function(){o.__getActiveElements().length&&a.Confirm(t.i18n("Are you shure?"),"",function(e){e&&(o.__getActiveElements().forEach(function(e){i.remove(i.currentPath,e.getAttribute("data-name")||"",e.getAttribute("data-source")||"")}),i.someSelectedWasChanged(),i.loadTree(i.currentPath,i.currentSource))})}).on(i.buttons.edit,"click",function(){var e=o.__getActiveElements();1===e.length&&i.openImageEditor(e[0].getAttribute("href")||"",e[0].getAttribute("data-name")||"",e[0].getAttribute("data-path")||"",e[0].getAttribute("data-source")||"")}).on(i.buttons.update,"click",function(){i.loadTree(o.currentPath,o.currentSource)}).on(i.tree,"click",function(e){var o=this.parentNode,n=o.getAttribute("data-path")||"";return a.Confirm(t.i18n("Are you shure?"),"",function(e){e&&(i.remove(n,o.getAttribute("data-name")||"",o.getAttribute("data-source")||""),i.loadTree(i.currentPath,i.currentSource))}),e.stopImmediatePropagation(),!1},"a>i.remove").on(i.tree,"click",function(){var e=this;this.classList.contains("addfolder")?a.Promt(i.jodit.i18n("Enter Directory name"),i.jodit.i18n("Create directory"),function(t){i.create(t,e.getAttribute("data-path")||"",e.getAttribute("data-source")||"")},i.jodit.i18n("type name")):(i.currentPath=this.getAttribute("data-path")||"",i.currentSource=this.getAttribute("data-source")||"",i.loadTree(i.currentPath,i.currentSource))},"a").on(o.tree,"dragstart",function(){i.dragger=this},"a").on(o.tree,"drop",function(){if(i.options.moveFolder&&i.dragger){var e=i.dragger.getAttribute("data-path")||"";if(!i.options.moveFolder&&i.dragger.classList.contains("jodit_filebrowser_tree_item"))return!1;if(i.dragger.classList.contains(g)&&(e+=i.dragger.getAttribute("data-name"),!i.options.moveFile))return!1;i.move(e,this.getAttribute("data-path")||"",this.getAttribute("data-source")||"")}},"a");var f=new u.ContextMenu(o.jodit);return i.jodit.events.on(i.files,"mousedown",function(e){i.client.x=e.clientX,i.client.y=e.clientY,i.start=d.offset(this,i.jodit),i.draggable=this.cloneNode(!0),d.css(i.draggable,{"z-index":1e14,position:"fixed",display:"none",left:i.start.left,top:i.start.top,width:this.offsetWidth,height:this.offsetHeight}),s.body.appendChild(i.draggable)},"a>img").on(i.files,"dragstart",function(e){i.dragger=this,e.dataTransfer.setData(h.TEXT_PLAIN,this.getAttribute("href")||""),e.stopPropagation()},"a").on(i.files,"contextmenu",function(e){var t=this;if(i.options.contextMenu){var o=this;return f.show(e.pageX,e.pageY,[!(!i.options.editImage||!i.canI("ImageResize")&&!i.canI("ImageCrop"))&&{icon:"pencil",title:"Edit",exec:function(){i.openImageEditor(o.getAttribute("href")||"",o.getAttribute("data-name")||"",o.getAttribute("data-path")||"",o.getAttribute("data-source")||"")}},!!i.canI("FileRemove")&&{icon:"bin",title:"Delete",exec:function(){i.remove(i.currentPath,o.getAttribute("data-name")||"",o.getAttribute("data-source")||""),i.someSelectedWasChanged(),i.loadTree(i.currentPath,i.currentSource)}},!!i.options.preview&&{icon:"eye",title:"Preview",exec:function(){var e=o.getAttribute("href")||"",n=new a.Dialog(i.jodit),r=d.dom('
      ',s),l=i.buttons.select.cloneNode(!0),u=s.createElement("img"),p=function(){var a=function(){if(t.removeEventListener("load",a),r.innerHTML="",i.options.showPreviewNavigation){var l=d.dom(''+c.Toolbar.getIcon("angle-right")+"",s),f=d.dom(''+c.Toolbar.getIcon("angle-left")+"",s);o.previousSibling&&o.previousSibling.classList&&o.previousSibling.classList.contains(g)&&r.appendChild(f),o.nextSibling&&o.nextSibling.classList&&o.nextSibling.classList.contains(g)&&r.appendChild(l),i.jodit.events.on([l,f],"click",function(){o=this.classList.contains("jodit_filebrowser_preview_navigation-next")?o.nextSibling:o.previousSibling,r.innerHTML='',e=o.getAttribute("href")||"",u.setAttribute("src",e),p()})}r.appendChild(u),n.setPosition()};u.addEventListener("load",a),u.complete&&a.call(u)};p(),u.setAttribute("src",e),n.setContent(r),i.options.showSelectButtonInPreview&&(l.removeAttribute("disabled"),n.setTitle(l),l.addEventListener("click",function(){d.$$("a.active",i.files).forEach(function(e){return e.classList.add("active")}),o.classList.add("active"),i.jodit.events.fire(i.buttons.select,"click"),n.close()})),n.open()}},{icon:"upload",title:"Download",exec:function(){o.getAttribute("href")&&i.jodit.ownerWindow.open()}}]),e.stopPropagation(),e.preventDefault(),!1}},"a").on(i.files,"click",function(e){d.ctrlKey(e)||(o.__getActiveElements().forEach(function(e){e.classList.remove("active")}),i.someSelectedWasChanged())}).on(i.files,"click",function(e){return d.ctrlKey(e)||i.__getActiveElements().forEach(function(e){e.classList.remove("active")}),this.classList.toggle("active"),i.someSelectedWasChanged(),e.stopPropagation(),!1},"a").on(i.jodit.ownerDocument,"dragover",function(e){i.isOpened()&&i.draggable&&void 0!==e.clientX&&d.css(i.draggable,{left:e.clientX+20,top:e.clientY+20,display:"block"})}).on(i.jodit.ownerWindow,"keydown",function(e){i.isOpened()&&e.which===h.KEY_DELETE&&i.jodit.events.fire(i.buttons.remove,"click")}).on(i.jodit.ownerWindow,"mouseup dragend",function(){i.draggable&&(i.draggable.parentNode&&i.draggable.parentNode.removeChild(i.draggable),i.draggable=!1)}),o.dialog.setSize(o.options.width,o.options.height),o.options.getLocalFileByUrl=d.extend(!0,{},o.options.ajax,o.options.getLocalFileByUrl),o.options.crop=d.extend(!0,{},o.options.ajax,o.options.crop),o.options.resize=d.extend(!0,{},o.options.ajax,o.options.resize),o.options.create=d.extend(!0,{},o.options.ajax,o.options.create),o.options.move=d.extend(!0,{},o.options.ajax,o.options.move),o.options.remove=d.extend(!0,{},o.options.ajax,o.options.remove),o.options.folder=d.extend(!0,{},o.options.ajax,o.options.folder),o.options.items=d.extend(!0,{},o.options.ajax,o.options.items),o.options.permissions=d.extend(!0,{},o.options.ajax,o.options.permissions),o.view="list"===o.options.view?"list":"tiles",m.Cookie.get("jodit_filebrowser_view")&&(o.view="list"===m.Cookie.get("jodit_filebrowser_view")?"list":"tiles"),o.buttons[o.view].classList.remove("disabled"),o.files.classList.add("jodit_filebrowser_files_view-"+o.view),o.sortBy=-1!==["changed","name","size"].indexOf(o.options.sortBy)?o.options.sortBy:"changed",m.Cookie.get("jodit_filebrowser_sortby")&&(o.sortBy=-1!==["changed","name","size"].indexOf(m.Cookie.get("jodit_filebrowser_sortby")||"")?m.Cookie.get("jodit_filebrowser_sortby")||"":"changed"),o.buttons.sort.value=o.sortBy,o.currentBaseUrl=d.$$("base",o.jodit.editorDocument).length?d.$$("base",o.jodit.editorDocument)[0].getAttribute("href")||"":location.protocol+"//"+location.host,void 0!==r.Jodit.modules.Uploader&&(o.uploader=new p.Uploader(o.jodit,n({},o.jodit.options.uploader,o.options.uploader?o.options.uploader:{})),o.uploader.setPath(o.currentPath),o.uploader.setSource(o.currentSource),o.uploader.bind(o.browser,o.uploadHandler,o.errorHandler),o.uploader.bind(o.buttons.upload,o.uploadHandler,o.errorHandler)),o}return i(t,e),t.prototype.canI=function(e){return null!==this.__currentPerpissions&&(void 0===this.__currentPerpissions["allow"+e]||this.__currentPerpissions["allow"+e])},t.prototype.toggleButtonsByPermissions=function(){this.buttons.upload.classList.toggle("jodit_hidden",!this.canI("FileUpload")),this.buttons.remove.classList.toggle("jodit_hidden",!this.canI("FileRemove")),this.buttons.edit.classList.toggle("jodit_hidden",!this.canI("ImageResize")&&!this.canI("ImageCrop"))},t.prototype.isOpened=function(){return this.dialog.isOpened()&&"none"!==this.browser.style.display},t.prototype.status=function(e,t){var o=this;clearTimeout(this.statustimer),this.status_line.classList.remove("success"),this.status_line.classList.add("active"),this.status_line.innerHTML=e,t&&this.status_line.classList.add("success"),this.statustimer=window.setTimeout(function(){o.status_line.classList.remove("active")},this.options.howLongShowMsg)},t.prototype.generateFolderTree=function(e){var t=this,o=[];d.each(e,function(e,i){e&&e!==v&&o.push('
      '+e+"
      "),i.folders.forEach(function(n){var r=''+n+"";t.options.deleteFolder&&".."!==n&&"."!==n&&(r+='×'),r+="",o.push(r)}),t.options.createNewFolder&&t.canI("FolderCreate")&&o.push(''+c.Toolbar.getIcon("plus")+" "+t.jodit.i18n("Add folder")+"")}),this.tree.innerHTML=o.join("")},t.prototype.generateItemsBox=function(e){var t=this,o=[];d.each(e,function(e,i){e&&e!==v&&o.push('
      '+e+(i.path?" - "+i.path:"")+"
      "),i.files&&i.files.length?("function"==typeof t.options.sort&&i.files.sort(function(e,o){return t.options.sort(e,o,t.sortBy,t.jodit)}),i.files.forEach(function(n){(void 0===t.options.filter||t.options.filter(n,t.filterWord))&&o.push(t.options.getThumbTemplate.call(t,n,i,e))})):o.push("
      "+t.jodit.i18n("There are no files")+"
      ")}),this.files.innerHTML=o.join("")},t.prototype.__getActiveElements=function(){return d.$$(":scope>a.active",this.files)},t.prototype.someSelectedWasChanged=function(){var e=this.__getActiveElements();this.buttons.remove.classList.toggle("disabled",!e.length),this.buttons.select.classList.toggle("disabled",!e.length),this.buttons.edit.classList.toggle("disabled",1!==e.length)},t.prototype.send=function(e,t,o){var i,n=d.extend(!0,{},this.options.ajax,void 0!==this.options[e]?this.options[e]:this.options.ajax);return n.prepareData&&(n.data=n.prepareData.call(this,n.data)),i=new f.Ajax(this.jodit,n),i.send().then(t).catch(o),i},t.prototype.loadPermissions=function(e,t,o){var i=this,n=this;n.options.permissions.data.path=e,n.options.permissions.data.source=t,n.options.permissions.url?(n.__permissions&&n.__permissions.abort&&n.__permissions.abort(),n.__permissions=n.send("permissions",function(e){var t=n.options.permissions.process;if(t||(t=i.options.ajax.process),t){var r=t.call(n,e);r.data.permissions&&(i.__currentPerpissions=r.data.permissions,i.toggleButtonsByPermissions(),o())}},function(e){a.Alert(e.message),n.errorHandler(e),o()})):o()},t.prototype.loadTree=function(e,t){var o=this;this.loadPermissions(e,t,function(){var i=o;i.options.folder.data.path=e,i.options.folder.data.source=t,i.uploader&&(i.uploader.setPath(e),i.uploader.setSource(t)),i.options.showFoldersPanel&&(i.options.folder.url?(i.tree.classList.add("active"),i.tree.innerHTML="",i.tree.appendChild(i.loader.cloneNode(!0)),i.__ajax&&i.__ajax.abort&&i.__ajax.abort(),i.__ajax=o.send("folder",function(e){var t=i.options.folder.process;if(t||(t=o.options.ajax.process),t){var n=t.call(i,e);i.generateFolderTree(n.data.sources)}},function(){i.errorHandler(Error(i.jodit.i18n("Error on load folders")))})):i.tree.classList.remove("active")),o.loadItems(e,t)})},t.prototype.remove=function(e,t,o){var i=this;this.options.remove.data.path=e,this.options.remove.data.name=t,this.options.remove.data.source=o,this.send("remove",function(e){i.options.remove.process&&(e=i.options.remove.process.call(i,e)),i.options.isSuccess(e)?(i.someSelectedWasChanged(),i.status(i.options.getMessage(e),!0)):i.status(i.options.getMessage(e))},function(e){i.status(e.message)})},t.prototype.onSelect=function(e){var t=this;return function(){var o=t.__getActiveElements();if(o.length){var i=[];o.forEach(function(e){var t=e.getAttribute("data-url");t&&i.push(t)}),t.close(),"function"==typeof e&&e({baseurl:"",files:i})}return!1}},t}(s.Component)},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(4),r=o(1),s=o(0),a=o(5),l=o(7);r.Config.prototype.imageeditor={closeAfterSave:!1,width:"85%",height:"85%",crop:!0,resize:!0,resizeUseRatio:!0,resizeMinWidth:20,resizeMinHeight:20,cropUseRatio:!0,cropDefaultWidth:"70%",cropDefaultHeight:"70%"},t.ImageEditor=function(e){function t(t){var o=e.call(this,t)||this;return o.resizeUseRatio=!0,o.cropUseRatio=!0,o.clicked=!1,o.activeTab="resize",o.hide=function(){o.dialog.close()},o.calcValueByPercent=function(e,t){var o,i=""+t,n=parseFloat(""+e);return(o=/^[\-+]?[0-9]+(px)?$/.exec(i))?parseInt(i,10):(o=/^([\-+]?[0-9.]+)%$/.exec(i),o?Math.round(n*(parseFloat(o[1])/100)):n||0)},o.calcCropBox=function(){var e=.8*o.crop_box.parentNode.offsetWidth,t=.8*o.crop_box.parentNode.offsetHeight,i=e,n=t;e>o.naturalWidth&&t>o.naturalHeight?(i=o.naturalWidth,n=o.naturalHeight):o.ratio>e/t?(i=e,n=o.naturalHeight*(e/o.naturalWidth)):(i=o.naturalWidth*(t/o.naturalHeight),n=t),s.css(o.crop_box,{width:i,height:n})},o.showCrop=function(){o.cropImage&&(o.calcCropBox(),o.new_w=o.calcValueByPercent(o.cropImage.offsetWidth||o.image.offsetWidth,o.options.cropDefaultWidth),o.new_h=o.cropUseRatio?o.new_w/o.ratio:o.calcValueByPercent(o.cropImage.offsetHeight||o.image.offsetHeight,o.options.cropDefaultHeight),s.css(o.cropHandler,{backgroundImage:"url("+o.cropImage.getAttribute("src")+")",width:o.new_w,height:o.new_h,left:(o.cropImage.offsetWidth||o.image.offsetWidth)/2-o.new_w/2,top:(o.cropImage.offsetHeight||o.image.offsetHeight)/2-o.new_h/2}),o.jodit.events.fire(o.cropHandler,"updatesize"))},o.cropBox={x:0,y:0,w:0,h:0},o.updateCropBox=function(){if(o.cropImage){var e=o.cropImage.offsetWidth/o.naturalWidth,t=o.cropImage.offsetHeight/o.naturalHeight;o.cropBox.x=s.css(o.cropHandler,"left")/e,o.cropBox.y=s.css(o.cropHandler,"top")/t,o.cropBox.w=o.cropHandler.offsetWidth/e,o.cropBox.h=o.cropHandler.offsetHeight/t,o.sizes.innerText=o.cropBox.w.toFixed(0)+"x"+o.cropBox.h.toFixed(0)}},o.resizeBox={w:0,h:0},o.updateResizeBox=function(){o.resizeBox.w=o.image.offsetWidth||o.naturalWidth,o.resizeBox.h=o.image.offsetHeight||o.naturalHeight},o.open=function(e,t){var i=(new Date).getTime();o.image=o.jodit.ownerDocument.createElement("img"),s.$$("img,.jodit_icon-loader",o.resize_box).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),s.$$("img,.jodit_icon-loader",o.crop_box).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),s.css(o.cropHandler,"background","transparent"),o.onSave=t,o.resize_box.appendChild(s.dom('',o.jodit.ownerDocument)),o.crop_box.appendChild(s.dom('',o.jodit.ownerDocument)),/\?/.test(e)?e+="&_tst="+i:e+="?_tst="+i,o.image.setAttribute("src",e),o.dialog.open();var n=function(){o.image.removeEventListener("load",n),o.naturalWidth=o.image.naturalWidth,o.naturalHeight=o.image.naturalHeight,o.widthInput.value=""+o.naturalWidth,o.heightInput.value=""+o.naturalHeight,o.ratio=o.naturalWidth/o.naturalHeight,o.resize_box.appendChild(o.image),o.cropImage=o.image.cloneNode(),o.crop_box.appendChild(o.cropImage),s.$$(".jodit_icon-loader",o.editor).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),"crop"===o.activeTab&&o.showCrop(),o.jodit.events.fire(o.resizeHandler,"updatesize"),o.jodit.events.fire(o.cropHandler,"updatesize"),o.dialog.setPosition(),o.jodit.events.fire("afterImageEditor")};o.image.addEventListener("load",n),o.image.complete&&n()},o.setHandlers=function(){var e=o;e.jodit.events.on([e.editor.querySelector(".jodit_bottomright"),e.cropHandler],"mousedown",function(t){e.target=t.target||t.srcElement,t.preventDefault(),t.stopImmediatePropagation(),e.clicked=!0,e.start_x=t.clientX,e.start_y=t.clientY,"crop"===e.activeTab?(e.top_x=s.css(e.cropHandler,"left"),e.top_y=s.css(e.cropHandler,"top"),e.width=e.cropHandler.offsetWidth,e.height=e.cropHandler.offsetHeight):(e.width=e.image.offsetWidth,e.height=e.image.offsetHeight)}).off(o.jodit.ownerWindow,".jodit_image_editor"+e.jodit.id).on(o.jodit.ownerWindow,"mousemove.jodit_image_editor"+e.jodit.id,s.throttle(function(t){e.clicked&&(e.diff_x=t.clientX-e.start_x,e.diff_y=t.clientY-e.start_y,"resize"===e.activeTab&&e.resizeUseRatio||"crop"===e.activeTab&&e.cropUseRatio?e.diff_x?(e.new_w=e.width+e.diff_x,e.new_h=Math.round(e.new_w/e.ratio)):(e.new_h=e.height+e.diff_y,e.new_w=Math.round(e.new_h*e.ratio)):(e.new_w=e.width+e.diff_x,e.new_h=e.height+e.diff_y),"resize"===e.activeTab?(e.new_w>e.options.resizeMinWidth&&(s.css(e.image,"width",e.new_w+"px"),e.widthInput.value=""+e.new_w),e.new_h>e.options.resizeMinHeight&&(s.css(e.image,"height",e.new_h+"px"),e.heightInput.value=""+e.new_h),o.jodit.events.fire(e.resizeHandler,"updatesize")):(e.target!==e.cropHandler?(e.top_x+e.new_w>e.cropImage.offsetWidth&&(e.new_w=e.cropImage.offsetWidth-e.top_x),e.top_y+e.new_h>e.cropImage.offsetHeight&&(e.new_h=e.cropImage.offsetHeight-e.top_y),s.css(e.cropHandler,{width:e.new_w,height:e.new_h})):(e.top_x+e.diff_x+e.cropHandler.offsetWidth>e.cropImage.offsetWidth&&(e.diff_x=e.cropImage.offsetWidth-e.top_x-e.cropHandler.offsetWidth),s.css(e.cropHandler,"left",e.top_x+e.diff_x),e.top_y+e.diff_y+e.cropHandler.offsetHeight>e.cropImage.offsetHeight&&(e.diff_y=e.cropImage.offsetHeight-e.top_y-e.cropHandler.offsetHeight),s.css(e.cropHandler,"top",e.top_y+e.diff_y)),o.jodit.events.fire(e.cropHandler,"updatesize")),t.stopImmediatePropagation())},5)).on(o.jodit.ownerWindow,"resize.jodit_image_editor"+e.jodit.id,function(){o.jodit.events.fire(e.resizeHandler,"updatesize"),e.showCrop(),o.jodit.events.fire(e.cropHandler,"updatesize")}).on(o.jodit.ownerWindow,"mouseup.jodit_image_editor"+e.jodit.id+" keydown.jodit_image_editor"+e.jodit.id,function(t){e.clicked&&(e.clicked=!1,t.stopImmediatePropagation())}),s.$$(".jodit_btn_group",e.editor).forEach(function(t){var o=t.querySelector("input");e.jodit.events.on(t,"click change",function(){var i=this;s.$$("button",t).forEach(function(e){return e.classList.remove("active")}),i.classList.add("active"),o.checked=!!i.getAttribute("data-yes"),e.jodit.events.fire(o,"change")},"button")}),e.jodit.events.on(o.editor,"click",function(){s.$$(".jodit_image_editor_slider,.jodit_image_editor_area",e.editor).forEach(function(e){return e.classList.remove("active")});var t=this.parentNode;t.classList.add("active"),e.activeTab=t.getAttribute("data-area")||"";var o=e.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_"+e.activeTab);o&&o.classList.add("active"),"crop"===e.activeTab&&e.showCrop()},".jodit_image_editor_slider-title").on(e.widthInput,"change mousedown keydown",s.debounce(function(){var t,i=parseInt(e.widthInput.value,10);i>e.jodit.options.resizer.min_width&&(s.css(e.image,"width",i+"px"),e.resizeUseRatio&&(t=Math.round(i/e.ratio))>e.jodit.options.resizer.min_height&&(s.css(e.image,"height",t+"px"),e.heightInput.value=""+t)),o.jodit.events.fire(e.resizeHandler,"updatesize")},200)).on(e.heightInput,"change mousedown keydown",s.debounce(function(){var t,i=parseInt(e.heightInput.value,10);i>e.jodit.options.resizer.min_height&&(s.css(e.image,"height",i+"px"),e.resizeUseRatio&&(t=Math.round(i*e.ratio))>e.jodit.options.resizer.min_width&&(s.css(e.image,"width",t+"px"),e.widthInput.value=""+t)),o.jodit.events.fire(e.resizeHandler,"updatesize")},200));var t=e.editor.querySelector(".jodit_image_editor_keep_spect_ratio");t&&t.addEventListener("change",function(){e.resizeUseRatio=t.checked});var i=e.editor.querySelector(".jodit_image_editor_keep_spect_ratio_crop");i&&i.addEventListener("change",function(){e.cropUseRatio=i.checked}),e.jodit.events.on(e.resizeHandler,"updatesize",function(){s.css(e.resizeHandler,{top:0,left:0,width:(e.image.offsetWidth||e.naturalWidth)+"px",height:(e.image.offsetHeight||e.naturalHeight)+"px"}),o.updateResizeBox()}).on(e.cropHandler,"updatesize",function(){if(e.cropImage){var t=s.css(e.cropHandler,"left"),o=s.css(e.cropHandler,"top"),i=e.cropHandler.offsetWidth,n=e.cropHandler.offsetHeight;0>t&&(t=0),0>o&&(o=0),t+i>e.cropImage.offsetWidth&&(i=e.cropImage.offsetWidth-t,e.cropUseRatio&&(n=i/e.ratio)),o+n>e.cropImage.offsetHeight&&(n=e.cropImage.offsetHeight-o,e.cropUseRatio&&(i=n*e.ratio)),s.css(e.cropHandler,{width:i,height:n,left:t,top:o,backgroundPosition:-t-1+"px "+(-o-1)+"px",backgroundSize:e.cropImage.offsetWidth+"px "+e.cropImage.offsetHeight+"px"}),e.updateCropBox()}}),e.buttons.forEach(function(t){t.addEventListener("mousedown",function(e){e.stopImmediatePropagation()}),t.addEventListener("click",function(){var o={action:e.activeTab,box:"resize"===e.activeTab?e.resizeBox:e.cropBox};switch(t.getAttribute("data-action")){case"saveas":l.Promt(e.jodit.i18n("Enter new name"),e.jodit.i18n("Save in new file"),function(t){if(!s.trim(t))return l.Alert(e.jodit.i18n("The name should not be empty")),!1;e.onSave(t,o,e.hide,function(e){l.Alert(e)})});break;case"save":e.onSave(void 0,o,e.hide,function(e){l.Alert(e)});break;case"reset":"resize"===e.activeTab?(s.css(e.image,{width:null,height:null}),e.widthInput.value=""+e.naturalWidth,e.heightInput.value=""+e.naturalHeight,e.jodit.events.fire(e.resizeHandler,"updatesize")):e.showCrop()}})})},o.options=t.options.imageeditor,o.resizeUseRatio=o.options.resizeUseRatio,o.cropUseRatio=o.options.cropUseRatio,o.buttons=[s.dom('",t.ownerDocument),s.dom('",t.ownerDocument),s.dom('",t.ownerDocument)],o.activeTab=o.options.resize?"resize":"crop",o.editor=s.dom('
      '+(o.options.resize?'
      ':"")+(o.options.crop?'
      ':"")+'
      '+(o.options.resize?'
      '+a.Toolbar.getIcon("resize")+t.i18n("Resize")+'
      ":"")+(o.options.crop?'
      '+a.Toolbar.getIcon("crop")+t.i18n("Crop")+'
      ":"")+"
      ",t.ownerDocument),o.widthInput=o.editor.querySelector(".jodit_image_editor_width"),o.heightInput=o.editor.querySelector(".jodit_image_editor_height"),o.resize_box=o.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_resize .jodit_image_editor_box"),o.crop_box=o.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_crop .jodit_image_editor_box"),o.sizes=o.editor.querySelector(".jodit_image_editor_area.jodit_image_editor_area_crop .jodit_sizes"),o.resizeHandler=o.editor.querySelector(".jodit_image_editor_resizer"),o.cropHandler=o.editor.querySelector(".jodit_image_editor_croper"),o.dialog=new l.Dialog(t),o.dialog.setContent(o.editor),o.dialog.setSize(o.options.width,o.options.height),o.dialog.setTitle(o.buttons),o.setHandlers(),o}return i(t,e),t}(n.Component)},function(e,t,o){"use strict";function i(e){e.events.on("afterCommand",function(t){if(/insert(un)?orderedlist/i.test(t)){var o=n.Dom.up(e.selection.current(),function(e){return e&&/^UL|OL$/i.test(e.nodeName)},e.editor);if(o&&o.parentNode&&"P"===o.parentNode.nodeName){var i=e.selection.save();n.Dom.unwrap(o.parentNode),[].slice.call(o.childNodes).forEach(function(e){e.lastChild&&e.lastChild.nodeType===Node.ELEMENT_NODE&&"BR"===e.lastChild.nodeName&&e.removeChild(e.lastChild)}),e.selection.restore(i)}e.setEditorValue()}})}t.__esModule=!0;var n=o(3),r=o(1);r.Config.prototype.controls.ul={command:"insertUnorderedList",controlName:"ul",tags:["ul"],tooltip:"Insert Unordered List"},r.Config.prototype.controls.ol={command:"insertOrderedList",controlName:"ol",tags:["ol"],tooltip:"Insert Ordered List"},t.orderedlist=i},function(e,t,o){"use strict";function i(e){e.events.on("paste",function(t){if(!1===e.events.fire("beforePaste",t))return t.preventDefault(),!1;if(t&&t.clipboardData&&t.clipboardData.getData){var o=void 0,i=t.clipboardData.types,n="",r="";if(Array.isArray(i))for(o=0;i.length>o;o+=1)n+=i[o]+";";else n=i;/text\/html/.test(n)?r=t.clipboardData.getData("text/html"):/text\/rtf/.test(n)&&s.browser("safari")?r=t.clipboardData.getData("text/rtf"):/text\/plain/.test(n)&&!s.browser("mozilla")&&(r=s.htmlentities(t.clipboardData.getData(l.TEXT_PLAIN)).replace(/\n/g,"
      ")),(""!==r||r instanceof e.editorWindow.Node)&&(r=e.events.fire("processPaste",t,r),("string"==typeof r||r instanceof e.editorWindow.Node)&&e.selection.insertHTML(r),t.preventDefault(),t.stopPropagation())}return!1!==e.events.fire("afterPaste",t)&&void 0});var t=function(e){var t=document.createElement("div");return t.innerHTML=e,t.innerText},o=function(t,o,i,a,l){void 0===a&&(a="Clean"),void 0===l&&(l="Insert only Text");var d=r.Confirm('
      '+t+"
      ",o,i),c=s.dom(''+n.Jodit.prototype.i18n("Keep")+"",d.document),u=s.dom(''+n.Jodit.prototype.i18n(a)+"",d.document),p=s.dom(''+n.Jodit.prototype.i18n(l)+"",d.document),f=s.dom(''+n.Jodit.prototype.i18n("Cancel")+"",d.document);return e.events.on(c,"click",function(){d.close(),i&&i(!0)}),e.events.on(u,"click",function(){d.close(),i&&i(!1)}),e.events.on(p,"click",function(){d.close(),i&&i(0)}),e.events.on(f,"click",function(){d.close()}),d.setFooter([c,u,l?p:"",f]),d},i=function(i){if(s.isHTML(i))return o(e.i18n("Your code is similar to HTML. Keep as HTML?"),e.i18n("Paste as HTML"),function(o){!1===o&&(i=s.htmlspecialchars(i)),0===o&&(i=t(i)),e.selection.insertHTML(i),e.setEditorValue()},"Insert as Text"),!1};e.options.askBeforePasteHTML&&e.events.on("beforePaste",function(e){if(e&&e.clipboardData&&e.clipboardData.getData&&e.clipboardData.getData(l.TEXT_PLAIN)){var t=e.clipboardData.getData(l.TEXT_PLAIN);return i(t)}}),e.options.askBeforePasteFromWord&&e.events.on("beforePaste",function(n){if(n&&n.clipboardData&&n.clipboardData.getData&&n.clipboardData.getData(l.TEXT_HTML)){var r=function(n){if(s.isHTML(n))return s.isHTMLFromWord(n)?o(e.i18n("The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?"),e.i18n("Word Paste Detected"),function(o){!0===o&&(n=s.applyStyles(n),e.options.beautifyHTML&&e.ownerWindow.html_beautify&&(n=e.ownerWindow.html_beautify(n))),!1===o&&(n=s.cleanFromWord(n)),0===o&&(n=t(s.cleanFromWord(n))),e.selection.insertHTML(n),e.setEditorValue()}):i(n),!1};if(n.clipboardData.types&&-1!==n.clipboardData.types.indexOf("text/html")){var a=n.clipboardData.getData(l.TEXT_HTML);return r(a)}var d=s.dom('
      ',e.ownerDocument);e.container.appendChild(d),d.focus();var c=0,u=function(){if(c+=1,d.childNodes&&d.childNodes.length>0){var t=d.innerHTML;d.parentNode&&d.parentNode.removeChild(d),!1!==r(t)&&e.selection.insertHTML(t)}else 5>c?setTimeout(function(){u()},20):d.parentNode&&d.parentNode.removeChild(d)};u()}})}t.__esModule=!0;var n=o(6),r=o(7),s=o(0),a=o(1),l=o(2);a.Config.prototype.askBeforePasteHTML=!0,a.Config.prototype.askBeforePasteFromWord=!0,t.paste=i},function(e,t,o){"use strict";function i(e){if(e.options.showPlaceholder){this.destruct=function(){n.parentNode&&n.parentNode.removeChild(n)};var t=function(){if(n.parentNode&&!e.options.readonly){var t=0,o=0,i=e.editorWindow.getComputedStyle(e.editor);if(e.editor.firstChild&&e.editor.firstChild.nodeType===Node.ELEMENT_NODE){var r=e.editorWindow.getComputedStyle(e.editor.firstChild);t=parseInt(r.getPropertyValue("margin-top"),10),o=parseInt(r.getPropertyValue("margin-left"),10),n.style.fontSize=parseInt(r.getPropertyValue("font-size"),10)+"px",n.style.lineHeight=r.getPropertyValue("line-height")}else n.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",n.style.lineHeight=i.getPropertyValue("line-height");s.css(n,{display:"block",marginTop:Math.max(parseInt(i.getPropertyValue("margin-top"),10),t),marginLeft:Math.max(parseInt(i.getPropertyValue("margin-left"),10),o)})}},o=function(){n.parentNode&&(n.style.display="none")},i=s.debounce(function(){if(e.editor)return e.getRealMode()!==r.MODE_WYSIWYG?o():void(e.getEditorValue()?o():t())},e.options.observer.timeout/100),n=s.dom('",e.ownerDocument);"rtl"===e.options.direction&&(n.style.right="0px",n.style.direction="rtl"),e.options.useInputsPlaceholder&&e.element.hasAttribute("placeholder")&&(n.innerHTML=e.element.getAttribute("placeholder")||""),e.events.on("readonly",function(e){e?o():i()}).on("afterInit",function(){e.workplace.appendChild(n),i(),e.events.fire("placeholder",n.innerHTML),e.events.on("change keyup mouseup keydown mousedown afterSetMode",function(){null!==n.parentNode&&i()})})}}t.__esModule=!0;var n=o(1),r=o(2),s=o(0);n.Config.prototype.showPlaceholder=!0,n.Config.prototype.useInputsPlaceholder=!0,n.Config.prototype.placeholder="Type something",t.placeholder=i},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(17),r=o(2),s=o(1),a=o(4);s.Config.prototype.controls.redo={mode:r.MODE_SPLIT,tooltip:"Redo"},s.Config.prototype.controls.undo={mode:r.MODE_SPLIT,tooltip:"Undo"},t.redoundo=function(e){function t(t){var o=e.call(this,t)||this;o.observer=new n.Observer(o.jodit);var i=function(){t.events.fire("canRedo",o.observer.stack.canRedo()),t.events.fire("canUndo",o.observer.stack.canUndo())};t.events.on("afterSetMode",function(){t.getRealMode()===r.MODE_WYSIWYG&&i()});var s=function(e){return t.getRealMode()===r.MODE_WYSIWYG&&(o.observer.stack["can"+e.substr(0,1).toUpperCase()+e.substr(1)]()&&o.observer.stack[e](),i()),!1};return t.registerCommand("redo",{exec:s,hotkeys:"ctrl+y"}),t.registerCommand("undo",{exec:s,hotkeys:"ctrl+z"}),o}return i(t,e),t.prototype.destruct=function(){this.observer.destruct()},t}(a.Component)},function(e,t,o){"use strict";function i(e){var t,o,i,n,a,l,d,c,u,p,f,h=!1,m=!1,v=!1,g=s.dom('',e.ownerDocument),_=function(){m=!1,v=!1,o=null,g.style.display="none"},b=function(){if(v&&o&&g){var t=s.offset(o,e),i=parseInt(g.style.left||"0",10),n=parseInt(g.style.top||"0",10),r=g.offsetWidth,a=g.offsetHeight;n===t.top-1&&i===t.left-1&&r===o.offsetWidth&&a===o.offsetHeight||(g.style.top=t.top-1+"px",g.style.left=t.left-1+"px",g.style.width=o.offsetWidth+"px",g.style.height=o.offsetHeight+"px",e.events&&(e.events.fire(o,"changesize"),isNaN(i)||e.events.fire("resize")))}},y=function(){e.options.readonly||(v=!0,g.style.display="block",b())},w=function(t){var i;if("IFRAME"===t.tagName)if(t.parentNode&&t.parentNode.getAttribute("data-jodit_iframe_wrapper"))t=t.parentNode;else{i=s.dom('',e.editorDocument),i.style.display="inline-block"===t.style.display?"inline-block":"block",i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px",t.parentNode&&t.parentNode.insertBefore(i,t),i.appendChild(t);var n=t;e.events.on(i,"changesize",function(){n.setAttribute("width",i.offsetWidth+"px"),n.setAttribute("height",i.offsetHeight+"px")}),t=i}var r;e.events.on(t,"dragstart",_).on(t,"mousedown",function(e){s.isIE()&&e.preventDefault()}).on(t,"mousedown touchstart",function(){h||(h=!0,o=t,y(),"IMG"!==o.tagName||o.complete||o.addEventListener("load",function e(){b(),o&&o.removeEventListener("load",e)}),clearTimeout(r)),r=window.setTimeout(function(){h=!1},400)})};s.$$("i",g).forEach(function(r){e.events.on(r,"mousedown touchstart",function(s){if(!o||!o.parentNode)return _(),!1;t=r,s.preventDefault(),s.stopImmediatePropagation(),a=o.offsetWidth,l=o.offsetHeight,d=a/l,m=!0,i=s.clientX,n=s.clientY,e.lock("resizer")})}),e.events.on("readonly",function(e){e&&_()}).on("beforeDestruct",function(){g.parentNode&&g.parentNode.removeChild(g)}).on("afterInit",function(){e.editorDocument.body.appendChild(g),e.events.on(e.editor,"keydown",function(t){v&&t.keyCode===r.KEY_DELETE&&o&&"table"!==o.tagName.toLowerCase()&&("JODIT"!==o.tagName?e.selection.select(o):(o.parentNode&&o.parentNode.removeChild(o),_(),t.preventDefault()))}).on(e.ownerWindow,"mousemove touchmove",function(r){if(m){if(p=r.clientX-i,f=r.clientY-n,!o)return;"IMG"===o.tagName?p?(u=a+(t.className.match(/left/)?-1:1)*p,c=Math.round(u/d)):(c=l+(t.className.match(/top/)?-1:1)*f,u=Math.round(c*d)):(u=a+(t.className.match(/left/)?-1:1)*p,c=l+(t.className.match(/top/)?-1:1)*f),u>e.options.resizer.min_width&&(o.style.width=g.parentNode.offsetWidth>u?u+"px":"100%"),c>e.options.resizer.min_height&&(o.style.height=c+"px"),b(),r.stopImmediatePropagation()}}).on(e.ownerWindow,"resize",function(){v&&b()}).on(e.ownerWindow,"mouseup keydown touchend",function(t){v&&!h&&(m?(e.unlock(),m=!1,e.setEditorValue(),t.stopImmediatePropagation()):_())}).on([e.ownerWindow,e.editor],"scroll",function(){v&&!m&&_()})}).on("afterGetValueFromEditor",function(e){e.value=e.value.replace(/]+data-jodit_iframe_wrapper[^>]+>(.*?]+>[\s\n\r]*<\/iframe>.*?)<\/jodit>/gi,"$1")}).on("change afterInit afterSetMode",s.debounce(function(){v&&(o&&o.parentNode?b():_()),s.$$("img, table, iframe",e.editor).forEach(function(t){e.getMode()!==r.MODE_SOURCE&&!t.__jodit_resizer_binded&&("IFRAME"===t.tagName&&e.options.useIframeResizer||"IMG"===t.tagName&&e.options.useImageResizer||"TABLE"===t.tagName&&e.options.useTableResizer)&&(t.__jodit_resizer_binded=!0,w(t))})},e.options.observer.timeout))}t.__esModule=!0;var n=o(1),r=o(2),s=o(0);n.Config.prototype.useIframeResizer=!0,n.Config.prototype.useTableResizer=!0,n.Config.prototype.useImageResizer=!0,n.Config.prototype.resizer={min_width:10,min_height:10},t.resizer=i},function(e,t,o){"use strict";function i(e){if("auto"!==e.options.height&&(e.options.allowResizeX||e.options.allowResizeY)){var t=n.dom('
      ',e.ownerDocument),o={x:0,y:0,w:0,h:0},i=!1;e.events.on(t,"mousedown touchstart",function(t){i=!0,o.x=t.clientX,o.y=t.clientY,o.w=e.container.offsetWidth,o.h=e.container.offsetHeight,t.preventDefault()}).on(e.ownerWindow,"mousemove touchmove",n.throttle(function(t){i&&(n.css(e.container,{width:e.options.allowResizeX?o.w+t.clientX-o.x:o.w,height:e.options.allowResizeY?o.h+t.clientY-o.y:o.h}),e.events.fire("resize"))},e.options.observer.timeout)).on(e.ownerWindow,"mouseup touchsend",function(){i&&(i=!1)}).on("afterInit",function(){e.container.appendChild(t)})}e.events.on("afterInit",function(){n.css(e.editor,{minHeight:e.options.minHeight}),n.css(e.workplace,{width:e.options.width,height:e.options.height,minHeight:e.options.minHeight}),"auto"!==e.options.height&&(n.css(e.editor,{minHeight:"100%"}),n.css(e.workplace,{height:"",minHeight:""}),n.css(e.container,{height:e.options.height})),"auto"!==e.options.width&&(n.css(e.workplace,{width:""}),n.css(e.container,{width:e.options.width}))},void 0,void 0,!0)}t.__esModule=!0;var n=o(0),r=o(1);r.Config.prototype.allowResizeX=!1,r.Config.prototype.allowResizeY=!0,t.size=i},function(e,t,o){"use strict";var i=this&&this.__extends||function(){var e=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])};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}();t.__esModule=!0;var n=o(1),r=o(2),s=o(0),a=o(4);n.Config.prototype.beautifyHTML=!0,n.Config.prototype.useAceEditor=!0,n.Config.prototype.sourceEditorNativeOptions={showGutter:!1,theme:"ace/theme/idle_fingers",mode:"ace/mode/html",wrap:!0,highlightActiveLine:!0},n.Config.prototype.sourceEditorCDNUrlsJS=["//cdnjs.cloudflare.com/ajax/libs/ace/1.2.8/ace.js","//cdnjs.cloudflare.com/ajax/libs/ace/1.2.8/ext-emmet.js"],n.Config.prototype.beautifyHTMLCDNUrlsJS=["//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.14/beautify.min.js","//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.14/beautify-html.min.js"],n.Config.prototype.controls.source={mode:r.MODE_SPLIT,exec:function(e){e.toggleMode()},tooltip:"Change mode"},t.source=function(e){function t(t){var o=e.call(this,t)||this;return o.className="jodit_ace_editor",o.loadNext=function(e,t,i,n){if(void 0===i&&(i="aceReady"),void 0===n&&(n=o.className),i&&void 0===t[e]&&o.jodit&&o.jodit.events)return o.jodit.events&&o.jodit.events.fire(i),void(o.jodit.events&&o.jodit.events.fire(o.jodit.ownerWindow,i));void 0!==t[e]&&s.appendScript(t[e],function(){o.loadNext(e+1,t,i,n)},n,o.jodit.ownerDocument)},o.fromWYSIWYG=function(e){if(void 0===e&&(e=!1),!o.__lock||!0===e){o.__lock=!0;var t=o.jodit.getEditorValue();t!==o.getMirrorValue()&&o.setMirrorValue(t),o.__lock=!1}},o.__lock=!1,o.toWYSIWYG=function(){o.__lock||(o.__lock=!0,o.jodit.setEditorValue(o.getMirrorValue()),o.__lock=!1)},o.autosize=function(){o.mirror.style.height="auto",o.mirror.style.height=o.mirror.scrollHeight+"px"},o.getNormalPosition=function(e,t){for(var o=e;o>0;){if(o--,"<"===t[o]&&void 0!==t[o+1]&&t[o+1].match(/[\w\/]+/i))return o;if(">"===t[o])return e}return e},o.tempMarkerStart="{start-jodit-selection}",o.tempMarkerEnd="{end-jodit-selection}",o.__clear=function(e){return e.replace(r.INVISIBLE_SPACE_REG_EXP,"")},o.selInfo=[],o.getSelectionStart=function(){return o.mirror.selectionStart},o.getSelectionEnd=function(){return o.mirror.selectionEnd},o.setMirrorSelectionRange=function(e,t){o.mirror.setSelectionRange(e,t)},o.saveSelection=function(){if(o.jodit.getRealMode()===r.MODE_WYSIWYG)o.selInfo=o.jodit.selection.save()||[],o.jodit.setEditorValue(),o.fromWYSIWYG(!0);else{o.selInfo.length=0;var e=o.getMirrorValue();if(o.getSelectionStart()===o.getSelectionEnd()){var t=o.jodit.selection.marker(!0);o.selInfo[0]={startId:t.id,collapsed:!0,startMarker:t.outerHTML};var i=o.getNormalPosition(o.getSelectionStart(),o.getMirrorValue());o.setMirrorValue(e.substr(0,i)+o.__clear(o.selInfo[0].startMarker)+e.substr(i))}else{var n=o.jodit.selection.marker(!0),s=o.jodit.selection.marker(!1);o.selInfo[0]={startId:n.id,endId:s.id,collapsed:!1,startMarker:o.__clear(n.outerHTML),endMarker:o.__clear(s.outerHTML)};var i=o.getNormalPosition(o.getSelectionStart(),e),a=o.getNormalPosition(o.getSelectionEnd(),e);o.setMirrorValue(e.substr(0,i)+o.selInfo[0].startMarker+e.substr(i,a-i)+o.selInfo[0].endMarker+e.substr(a))}o.toWYSIWYG()}},o.restoreSelection=function(){if(o.selInfo.length){if(o.jodit.getRealMode()===r.MODE_WYSIWYG)return o.__lock=!0,o.jodit.selection.restore(o.selInfo),void(o.__lock=!1);var e=o.getMirrorValue();o.selInfo[0].startMarker&&(e=e.replace(/]+data-jodit_selection_marker="start"[^>]*>[<>]*?<\/span>/gim,o.tempMarkerStart)),o.selInfo[0].endMarker&&(e=e.replace(/]+data-jodit_selection_marker="end"[^>]*>[<>]*?<\/span>/gim,o.tempMarkerEnd)),o.jodit.ownerWindow.html_beautify&&o.jodit.options.beautifyHTML&&(e=o.jodit.ownerWindow.html_beautify(e));var t=e.indexOf(o.tempMarkerStart),i=t;e=e.replace(o.tempMarkerStart,""),o.selInfo[0].collapsed&&-1!==t||(i=e.indexOf(o.tempMarkerEnd),-1===t&&(t=i)),e=e.replace(o.tempMarkerEnd,""),o.setMirrorValue(e),o.setMirrorSelectionRange(t,i),o.toWYSIWYG(),o.setFocusToMirror()}},o.mirrorContainer=s.dom('
      ',o.jodit.ownerDocument),o.mirror=s.dom('