@firestitch/froala
Version:
The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.
1 lines • 626 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(dt){"use strict";function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if((dt=dt&&dt.hasOwnProperty("default")?dt.default:dt).PLUGINS.align=function(r){var o=r.$;return{apply:function(e){var t=r.selection.element();if(o(t).parents(".fr-img-caption").length)o(t).css("text-align",e);else{r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();for(var a=r.selection.blocks(),n=0;n<a.length;n++)o(a[n]).css("text-align",e).removeClass("fr-temp-div"),""===o(a[n]).attr("class")&&o(a[n]).removeAttr("class"),""===o(a[n]).attr("style")&&o(a[n]).removeAttr("style");r.selection.save(),r.html.unwrap(),r.selection.restore()}},refresh:function(e){var t=r.selection.blocks();t.length&&(t=r.helpers.getAlignment(o(t[0])),e.find("> *").first().replaceWith(r.icon.create("align-".concat(t))))},refreshOnShow:function(e,t){var a=r.selection.blocks();a.length&&(a=r.helpers.getAlignment(o(a[0])),t.find('a.fr-command[data-param1="'.concat(a,'"]')).addClass("fr-active").attr("aria-selected",!0))},refreshForToolbar:function(e){var t=r.selection.blocks();t.length&&(t=(t=r.helpers.getAlignment(o(t[0]))).charAt(0).toUpperCase()+t.slice(1),"align".concat(t)===e.attr("data-cmd"))&&e.addClass("fr-active")}}},dt.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),dt.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),dt.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),dt.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),dt.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),dt.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e,t='<ul class="fr-dropdown-list" role="presentation">',a=dt.COMMANDS.align.options;for(e in a)a.hasOwnProperty(e)&&(t+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align"data-param1="\n '.concat(e,'" title="').concat(this.language.translate(a[e]),'">').concat(this.icon.create("align-".concat(e)),'<span class="fr-sr-only">\n ').concat(this.language.translate(a[e]),"</span></a></li>"));return t+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,t){this.align.refreshOnShow(e,t)},plugin:"align"}),dt.RegisterCommand("alignLeft",{type:"button",icon:"align-left",title:"Align Left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),dt.RegisterCommand("alignRight",{type:"button",icon:"align-right",title:"Align Right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),dt.RegisterCommand("alignCenter",{type:"button",icon:"align-center",title:"Align Center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),dt.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",title:"Align Justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Object.assign(dt.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),dt.PLUGINS.charCounter=function(a){var t,n=a.$,r=function(){return(a.el.textContent||"").replace(/\u200B/g,"").length};function e(e){var t;return a.opts.charCounterMax<0||r()<a.opts.charCounterMax||(t=e.which,!(!a.keys.ctrlKey(e)&&a.keys.isCharacter(t)||t===dt.KEYCODE.IME))||(e.preventDefault(),e.stopPropagation(),a.events.trigger("charCounter.exceeded"),!1)}function o(e){return a.opts.charCounterMax<0||n("<div>").html(e).text().length+r()<=a.opts.charCounterMax?e:(a.events.trigger("charCounter.exceeded"),"")}function i(){var e;a.opts.charCounterCount&&(e=r()+(0<a.opts.charCounterMax?"/"+a.opts.charCounterMax:""),t.text("".concat(a.language.translate("Characters")," : ").concat(e)),a.opts.toolbarBottom&&t.css("margin-bottom",a.$tb.outerHeight(!0)),0<=(e=a.$wp.get(0).offsetWidth-a.$wp.get(0).clientWidth))&&("rtl"==a.opts.direction?t.css("margin-left",e):t.css("margin-right",e))}return{_init:function(){return!!a.$wp&&!!a.opts.charCounterCount&&((t=n(document.createElement("span")).attr("class","fr-counter")).css("bottom",a.$wp.css("border-bottom-width")),(a.$second_tb||a.$wp).append(t),a.events.on("keydown",e,!0),a.events.on("paste.afterCleanup",o),a.events.on("keyup contentChanged input",function(){a.events.trigger("charCounter.update")}),a.events.on("charCounter.update",i),a.events.trigger("charCounter.update"),void a.events.on("destroy",function(){n(a.o_win).off("resize.char".concat(a.id)),t.removeData().remove(),t=null}))},count:r}},dt.PLUGINS.codeBeautifier=function(){var e,t,a,n,W={};function A(n,e){var a,t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},r={"@media":!0,"@supports":!0,"@document":!0},o=(e=e||{},n=(n=n||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n"),e.indent_size||4),i=e.indent_char||" ",s=void 0===e.selector_separator_newline||e.selector_separator_newline,l=void 0!==e.end_with_newline&&e.end_with_newline,c=void 0===e.newline_between_rules||e.newline_between_rules,d=e.eol||"\n",f=("string"==typeof o&&(o=parseInt(o,10)),e.indent_with_tabs&&(i="\t",o=1),d=d.replace(/\\r/,"\r").replace(/\\n/,"\n"),/^\s+$/),p=-1,u=0;function g(){return(a=n.charAt(++p))||""}function h(e){var t=p;return e&&v(),e=n.charAt(p+1)||"",p=t-1,g(),e}function m(e){for(var t=p;g();)if("\\"===a)g();else{if(-1!==e.indexOf(a))break;if("\n"===a)break}return n.substring(t,p+1)}function v(){for(;f.test(h());)g(),0}function b(e){var t=p;for(e="/"===h(),g();g();){if(!e&&"*"===a&&"/"===h()){g();break}if(e&&"\n"===a)return n.substring(t,p)}return n.substring(t,p)+a}function _(e){return n.substring(p-e.length,p).toLowerCase()===e}var E=n.match(/^[\t ]*/)[0],w=new Array(o+1).join(i),y=0,A=0;for(var C={"{":function(e){C.singleSpace(),T.push(e),C.newLine()},"}":function(e){C.newLine(),T.push(e),C.newLine()},_lastCharWhitespace:function(){return f.test(T[T.length-1])},newLine:function(e){T.length&&(e||"\n"===T[T.length-1]||C.trim(),T.push("\n"),E)&&T.push(E)},singleSpace:function(){T.length&&!C._lastCharWhitespace()&&T.push(" ")},preserveSingleSpace:function(){O&&C.singleSpace()},trim:function(){for(;C._lastCharWhitespace();)T.pop()}},T=[],S=!1,R=!1,k=!1,L="";;){var x,I=function(){var e="";for(a&&f.test(a)&&(e=a);f.test(g());)e+=a;return e}(),O=""!==I,I=-1!==I.indexOf("\n"),M=L,L=a;if(!a)break;"/"===a&&"*"===h()?(x=0===y,(I||x)&&C.newLine(),T.push(b()),C.newLine(),x&&C.newLine(!0)):"/"===a&&"/"===h()?(I||"{"===M||C.trim(),C.singleSpace(),T.push(b()),C.newLine()):"@"===a?(C.preserveSingleSpace(),T.push(a),x=void 0,x=p,I=m(I=": , {}()[]/='\""),p=x-1,g(),(M=I).match(/[ :]$/)&&(g(),M=m(": ").replace(/\s$/,""),T.push(M),C.singleSpace()),(M=M.replace(/\s$/,""))in t&&(A+=1,M in r)&&(k=!0)):"#"===a&&"{"===h()?(C.preserveSingleSpace(),T.push(m("}"))):"{"===a?"}"===h(!0)?(v(),g(),C.singleSpace(),T.push("{}"),C.newLine(),c&&0===y&&C.newLine(!0)):(y++,E+=w,C["{"](a),S=k?(k=!1,A<y):A<=y):"}"===a?(y--,E=E.slice(0,-o),C["}"](a),R=S=!1,A&&A--,c&&0===y&&C.newLine(!0)):":"===a?(v(),!S&&!k||_("&")||function(){for(var e=0,t=p+1;t<n.length;t++){var a=n.charAt(t);if("{"===a)return 1;if("("===a)e+=1;else if(")"===a){if(0===e)return;--e}else if(" "===a||"}"===a)return}}()?":"===h()?(g(),T.push("::")):T.push(":"):(R=!0,T.push(":"),C.singleSpace())):'"'===a||"'"===a?(C.preserveSingleSpace(),T.push(m(a))):" "===a?(R=!1,T.push(a),C.newLine()):"("===a?_("url")?(T.push(a),v(),g()&&(")"!==a&&'"'!==a&&"'"!==a?T.push(m(")")):p--)):(u++,C.preserveSingleSpace(),T.push(a),v()):")"===a?(T.push(a),u--):","===a?(T.push(a),v(),s&&!R&&u<1?C.newLine():C.singleSpace()):("]"!==a&&("["!==a&&"="===a?(v(),a="="):C.preserveSingleSpace()),T.push(a))}e="";return E&&(e+=E),e+=T.join("").replace(/[\r\n\t ]+$/,""),l&&(e+="\n"),e="\n"!=d?e.replace(/[\n]/g,d):e}function K(e,t){for(var a=0;a<t.length;a+=1)if(t[a]===e)return!0;return!1}function G(e){return e.replace(/^\s+|\s+$/g,"")}function C(e,t){return new r(e,t).beautify()}e=W,t="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",a=new RegExp("[".concat(t,"]")),n=new RegExp("[".concat(t," ").concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_","]")),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|".concat(e.newline.source)),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&a.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e))))};var F={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(n,e){var i,r,o,s,l,c,t,d,a,f,p,u,g,h=[],m="";function v(e,t){var a=0;return e&&(a=e.indentation_level,!i.just_added_newline())&&e.line_indent_level>a&&(a=e.line_indent_level),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:a,line_indent_level:e?e.line_indent_level:a,start_line_index:i.get_line_number(),ternary_depth:0}}for(u={TK_START_EXPR:function(){x();var e=F.Expression;if("["===s.text){if("TK_WORD"===l||")"===d.last_text)return"TK_RESERVED"===l&&K(d.last_text,o.line_starters)&&(i.space_before_token=!0),T(e),A(),C(),void(g.space_in_paren&&(i.space_before_token=!0));e=F.ArrayLiteral,!S(d.mode)||"["!==d.last_text&&(","!==d.last_text||"]"!==c&&"}"!==c)||g.keep_array_indentation||w()}else"TK_RESERVED"===l&&"for"===d.last_text?e=F.ForInitializer:"TK_RESERVED"===l&&K(d.last_text,["if","while"])&&(e=F.Conditional);" "===d.last_text||"TK_START_BLOCK"===l?w():"TK_END_EXPR"===l||"TK_START_EXPR"===l||"TK_END_BLOCK"===l||"."===d.last_text?E(s.wanted_newline):"TK_RESERVED"===l&&"("===s.text||"TK_WORD"===l||"TK_OPERATOR"===l?"TK_RESERVED"===l&&("function"===d.last_word||"typeof"===d.last_word)||"*"===d.last_text&&"function"===c?g.space_after_anon_function&&(i.space_before_token=!0):"TK_RESERVED"!==l||!K(d.last_text,o.line_starters)&&"catch"!==d.last_text||g.space_before_conditional&&(i.space_before_token=!0):i.space_before_token=!0;"("===s.text&&"TK_RESERVED"===l&&"await"===d.last_word&&(i.space_before_token=!0);"("!==s.text||"TK_EQUALS"!==l&&"TK_OPERATOR"!==l||L()||E();T(e),A(),g.space_in_paren&&(i.space_before_token=!0);C()},TK_END_EXPR:function(){for(;d.mode===F.Statement;)k();d.multiline_frame&&E("]"===s.text&&S(d.mode)&&!g.keep_array_indentation);g.space_in_paren&&("TK_START_EXPR"!==l||g.space_in_empty_paren?i.space_before_token=!0:(i.trim(),i.space_before_token=!1));("]"===s.text&&g.keep_array_indentation?(A(),k):(k(),A))();i.remove_redundant_indentation(a),d.do_while&&a.mode===F.Conditional&&(a.mode=F.Expression,d.do_block=!1,d.do_while=!1)},TK_START_BLOCK:function(){var e=O(1),t=O(2);!t||!(":"===t.text&&K(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||K(e.text,["get","set"])&&K(t.type,["TK_WORD","TK_RESERVED"]))||K(c,["class","interface"])?T(F.BlockStatement):T(F.ObjectLiteral);t=!e.comments_before.length&&"}"===e.text&&"function"===d.last_word&&"TK_END_EXPR"===l;"expand"===g.brace_style||"none"===g.brace_style&&s.wanted_newline?"TK_OPERATOR"!==l&&(t||"TK_EQUALS"===l||"TK_RESERVED"===l&&I(d.last_text)&&"else"!==d.last_text)?i.space_before_token=!0:w(!1,!0):"TK_OPERATOR"!==l&&"TK_START_EXPR"!==l?"TK_START_BLOCK"===l?w():i.space_before_token=!0:S(a.mode)&&","===d.last_text&&("}"===c?i.space_before_token=!0:w());A(),C()},TK_END_BLOCK:function(){for(;d.mode===F.Statement;)k();var e="TK_START_BLOCK"===l;"expand"===g.brace_style?e||w():e||(S(d.mode)&&g.keep_array_indentation?(g.keep_array_indentation=!1,w(),g.keep_array_indentation=!0):w());k(),A()},TK_WORD:M,TK_RESERVED:M,TK_SEMICOLON:function(){x()&&(i.space_before_token=!1);for(;d.mode===F.Statement&&!d.if_block&&!d.do_block;)k();A()},TK_STRING:function(){x()||"TK_RESERVED"===l||"TK_WORD"===l?i.space_before_token=!0:"TK_COMMA"===l||"TK_START_EXPR"===l||"TK_EQUALS"===l||"TK_OPERATOR"===l?L()||E():w();A()},TK_EQUALS:function(){x();d.declaration_statement&&(d.declaration_assignment=!0);i.space_before_token=!0,A(),i.space_before_token=!0},TK_OPERATOR:function(){x();var e,t;"TK_RESERVED"===l&&I(d.last_text)?(i.space_before_token=!0,A()):"*"===s.text&&"TK_DOT"===l?A():":"===s.text&&d.in_case?(d.case_body=!0,C(),A(),w(),d.in_case=!1):"::"===s.text?A():("TK_OPERATOR"===l&&E(),t=e=!0,K(s.text,["--","++","!","~"])||K(s.text,["-","+"])&&(K(l,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||K(d.last_text,o.line_starters)||","===d.last_text)?(t=e=!1,!s.wanted_newline||"--"!==s.text&&"++"!==s.text||w(!1,!0)," "===d.last_text&&R(d.mode)&&(e=!0),"TK_RESERVED"===l?e=!0:"TK_END_EXPR"===l?e=!("]"===d.last_text&&("--"===s.text||"++"===s.text)):"TK_OPERATOR"===l&&(e=K(s.text,["--","-","++","+"])&&K(d.last_text,["--","-","++","+"]),K(s.text,["+","-"]))&&K(d.last_text,["--","++"])&&(t=!0),d.mode!==F.BlockStatement&&d.mode!==F.Statement||"{"!==d.last_text&&" "!==d.last_text||w()):":"===s.text?0===d.ternary_depth?e=!1:--d.ternary_depth:"?"===s.text?d.ternary_depth+=1:"*"===s.text&&"TK_RESERVED"===l&&"function"===d.last_text&&(t=e=!1),i.space_before_token=i.space_before_token||e,A(),i.space_before_token=t)},TK_COMMA:function(){d.declaration_statement?(R(d.parent.mode)&&(d.declaration_assignment=!1),A(),d.declaration_assignment?w(d.declaration_assignment=!1,!0):(i.space_before_token=!0,g.comma_first&&E())):(A(),d.mode===F.ObjectLiteral||d.mode===F.Statement&&d.parent.mode===F.ObjectLiteral?(d.mode===F.Statement&&k(),w()):(i.space_before_token=!0,g.comma_first&&E()))},TK_BLOCK_COMMENT:function(){if(i.raw)i.add_raw_token(s),!s.directives||"end"!==s.directives.preserve||g.test_output_raw||(i.raw=!1);else if(s.directives)w(!1,!0),A(),"start"===s.directives.preserve&&(i.raw=!0),w(!1,!0);else if(W.newline.test(s.text)||s.wanted_newline){var e,t=function(e){e=e.replace(/\x0d/g,"");var t,a=[];t=e.indexOf("\n");for(;-1!==t;)a.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&a.push(e);return a}(s.text),a=!1,n=!1,r=s.whitespace_before,o=r.length;for(w(!1,!0),1<t.length&&(!function(e,t){for(var a=0;a<e.length;a++)if(G(e[a]).charAt(0)!==t)return;return 1}(t.slice(1),"*")?function(e,t){for(var a,n=0,r=e.length;n<r;n++)if((a=e[n])&&0!==a.indexOf(t))return;return 1}(t.slice(1),r)&&(n=!0):a=!0),A(t[0]),e=1;e<t.length;e++)w(!1,!0),a?A(" ".concat(t[e].replace(/^\s+/g,""))):n&&t[e].length>o?A(t[e].substring(o)):i.add_token(t[e]);w(!1,!0)}else i.space_before_token=!0,A(),i.space_before_token=!0},TK_COMMENT:function(){s.wanted_newline?w(!1,!0):i.trim(!0);i.space_before_token=!0,A(),w(!1,!0)},TK_DOT:function(){x();"TK_RESERVED"===l&&I(d.last_text)?i.space_before_token=!0:E(")"===d.last_text&&g.break_chained_methods);A()},TK_UNKNOWN:function(){A(),"\n"===s.text[s.text.length-1]&&w()},TK_EOF:function(){for(;d.mode===F.Statement;)k()}},g={},void 0!==(e=e||{}).braces_on_own_line&&(g.brace_style=e.braces_on_own_line?"expand":"collapse"),g.brace_style=e.brace_style||g.brace_style||"collapse","expand-strict"===g.brace_style&&(g.brace_style="expand"),g.indent_size=e.indent_size?parseInt(e.indent_size,10):4,g.indent_char=e.indent_char||" ",g.eol=e.eol||"\n",g.preserve_newlines=void 0===e.preserve_newlines||e.preserve_newlines,g.break_chained_methods=void 0!==e.break_chained_methods&&e.break_chained_methods,g.max_preserve_newlines=void 0===e.max_preserve_newlines?0:parseInt(e.max_preserve_newlines,10),g.space_in_paren=void 0!==e.space_in_paren&&e.space_in_paren,g.space_in_empty_paren=void 0!==e.space_in_empty_paren&&e.space_in_empty_paren,g.jslint_happy=void 0!==e.jslint_happy&&e.jslint_happy,g.space_after_anon_function=void 0!==e.space_after_anon_function&&e.space_after_anon_function,g.keep_array_indentation=void 0!==e.keep_array_indentation&&e.keep_array_indentation,g.space_before_conditional=void 0===e.space_before_conditional||e.space_before_conditional,g.unescape_strings=void 0!==e.unescape_strings&&e.unescape_strings,g.wrap_line_length=void 0===e.wrap_line_length?0:parseInt(e.wrap_line_length,10),g.e4x=void 0!==e.e4x&&e.e4x,g.end_with_newline=void 0!==e.end_with_newline&&e.end_with_newline,g.comma_first=void 0!==e.comma_first&&e.comma_first,g.test_output_raw=void 0!==e.test_output_raw&&e.test_output_raw,g.jslint_happy&&(g.space_after_anon_function=!0),e.indent_with_tabs&&(g.indent_char="\t",g.indent_size=1),g.eol=g.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),t="";0<g.indent_size;)t+=g.indent_char,--g.indent_size;var b=0;if(n&&n.length){for(;" "===n.charAt(b)||"\t"===n.charAt(b);)m+=n.charAt(b),b+=1;n=n.substring(b)}function _(e){var t=e.newlines;if(g.keep_array_indentation&&S(d.mode))for(var a=0;a<t;a+=1)w(0<a);else if(g.max_preserve_newlines&&t>g.max_preserve_newlines&&(t=g.max_preserve_newlines),g.preserve_newlines&&1<e.newlines){w();for(var n=1;n<t;n+=1)w(!0)}u[(s=e).type]()}function E(e){e=void 0!==e&&e,i.just_added_newline()||(g.preserve_newlines&&s.wanted_newline||e||g.wrap_line_length&&i.current_line.get_character_count()+s.text.length+(i.space_before_token?1:0)>=g.wrap_line_length)&&w(!1,!0)}function w(e,t){if(!t&&" "!==d.last_text&&","!==d.last_text&&"="!==d.last_text&&"TK_OPERATOR"!==l)for(;d.mode===F.Statement&&!d.if_block&&!d.do_block;)k();i.add_new_line(e)&&(d.multiline_frame=!0)}function y(){i.just_added_newline()&&(g.keep_array_indentation&&S(d.mode)&&s.wanted_newline?(i.current_line.push(s.whitespace_before),i.space_before_token=!1):i.set_indent(d.indentation_level)&&(d.line_indent_level=d.indentation_level))}function A(e){i.raw?i.add_raw_token(s):(g.comma_first&&"TK_COMMA"===l&&i.just_added_newline()&&","===i.previous_line.last()&&(i.previous_line.pop(),y(),i.add_token(","),i.space_before_token=!0),e=e||s.text,y(),i.add_token(e))}function C(){d.indentation_level+=1}function T(e){a=d?(f.push(d),d):v(null,e),d=v(a,e)}function S(e){return e===F.ArrayLiteral}function R(e){return K(e,[F.Expression,F.ForInitializer,F.Conditional])}function k(){0<f.length&&(a=d,d=f.pop(),a.mode===F.Statement)&&i.remove_redundant_indentation(a)}function L(){return d.parent.mode===F.ObjectLiteral&&d.mode===F.Statement&&(":"===d.last_text&&0===d.ternary_depth||"TK_RESERVED"===l&&K(d.last_text,["get","set"]))}function x(){return("TK_RESERVED"===l&&K(d.last_text,["const","let","const"])&&"TK_WORD"===s.type||"TK_RESERVED"===l&&"do"===d.last_text||"TK_RESERVED"===l&&"return"===d.last_text&&!s.wanted_newline||"TK_RESERVED"===l&&"else"===d.last_text&&("TK_RESERVED"!==s.type||"if"!==s.text)||"TK_END_EXPR"===l&&(a.mode===F.ForInitializer||a.mode===F.Conditional)||"TK_WORD"===l&&d.mode===F.BlockStatement&&!d.in_case&&"--"!==s.text&&"++"!==s.text&&"function"!==c&&"TK_WORD"!==s.type&&"TK_RESERVED"!==s.type||d.mode===F.ObjectLiteral&&(":"===d.last_text&&0===d.ternary_depth||"TK_RESERVED"===l&&K(d.last_text,["get","set"])))&&(T(F.Statement),C(),"TK_RESERVED"===l&&K(d.last_text,["const","let","const"])&&"TK_WORD"===s.type&&(d.declaration_statement=!0),L()||E("TK_RESERVED"===s.type&&K(s.text,["do","for","if","while"])),1)}function I(e){return K(e,["case","return","do","if","throw","else"])}function O(e){e=r+(e||0);return e<0||e>=h.length?null:h[e]}function M(){if("TK_RESERVED"===s.type&&d.mode!==F.ObjectLiteral&&K(s.text,["set","get"])&&(s.type="TK_WORD"),"TK_RESERVED"===s.type&&d.mode===F.ObjectLiteral&&":"===O(1).text&&(s.type="TK_WORD"),x()||!s.wanted_newline||R(d.mode)||"TK_OPERATOR"===l&&"--"!==d.last_text&&"++"!==d.last_text||"TK_EQUALS"===l||!g.preserve_newlines&&"TK_RESERVED"===l&&K(d.last_text,["const","let","const","set","get"])||w(),d.do_block&&!d.do_while){if("TK_RESERVED"===s.type&&"while"===s.text)return i.space_before_token=!0,A(),i.space_before_token=!0,void(d.do_while=!0);w(),d.do_block=!1}if(d.if_block)if(d.else_block||"TK_RESERVED"!==s.type||"else"!==s.text){for(;d.mode===F.Statement;)k();d.if_block=!1,d.else_block=!1}else d.else_block=!0;"TK_RESERVED"===s.type&&("case"===s.text||"default"===s.text&&d.in_case_statement)?(w(),(d.case_body||g.jslint_happy)&&(0<d.indentation_level&&(!d.parent||d.indentation_level>d.parent.indentation_level)&&--d.indentation_level,d.case_body=!1),A(),d.in_case=!0,d.in_case_statement=!0):("TK_RESERVED"===s.type&&"function"===s.text&&(!(K(d.last_text,["}"," "])||i.just_added_newline()&&!K(d.last_text,["[","{",":","=",","]))||i.just_added_blankline()||s.comments_before.length||(w(),w(!0)),"TK_RESERVED"===l||"TK_WORD"===l?"TK_RESERVED"===l&&K(d.last_text,["get","set","new","return","export","async"])||"TK_RESERVED"===l&&"default"===d.last_text&&"export"===c?i.space_before_token=!0:w():"TK_OPERATOR"===l||"="===d.last_text?i.space_before_token=!0:!d.multiline_frame&&(R(d.mode)||S(d.mode))||w()),"TK_COMMA"!==l&&"TK_START_EXPR"!==l&&"TK_EQUALS"!==l&&"TK_OPERATOR"!==l||L()||E(),"TK_RESERVED"===s.type&&K(s.text,["function","get","set"])?(A(),d.last_word=s.text):(p="NONE","TK_END_BLOCK"===l?"TK_RESERVED"!==s.type||!K(s.text,["else","catch","finally"])||"expand"===g.brace_style||"end-expand"===g.brace_style||"none"===g.brace_style&&s.wanted_newline?p="NEWLINE":(p="SPACE",i.space_before_token=!0):"TK_SEMICOLON"===l&&d.mode===F.BlockStatement?p="NEWLINE":"TK_SEMICOLON"===l&&R(d.mode)?p="SPACE":"TK_STRING"===l?p="NEWLINE":"TK_RESERVED"===l||"TK_WORD"===l||"*"===d.last_text&&"function"===c?p="SPACE":"TK_START_BLOCK"===l?p="NEWLINE":"TK_END_EXPR"===l&&(i.space_before_token=!0,p="NEWLINE"),"TK_RESERVED"===s.type&&K(s.text,o.line_starters)&&")"!==d.last_text&&(p="else"===d.last_text||"export"===d.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===s.type&&K(s.text,["else","catch","finally"])?"TK_END_BLOCK"!==l||"expand"===g.brace_style||"end-expand"===g.brace_style||"none"===g.brace_style&&s.wanted_newline?w():(i.trim(!0),"}"!==i.current_line.last()&&w(),i.space_before_token=!0):"NEWLINE"===p?"TK_RESERVED"===l&&I(d.last_text)?i.space_before_token=!0:"TK_END_EXPR"!==l?"TK_START_EXPR"===l&&"TK_RESERVED"===s.type&&K(s.text,["const","let","const"])||":"===d.last_text||("TK_RESERVED"===s.type&&"if"===s.text&&"else"===d.last_text?i.space_before_token=!0:w()):"TK_RESERVED"===s.type&&K(s.text,o.line_starters)&&")"!==d.last_text&&w():d.multiline_frame&&S(d.mode)&&","===d.last_text&&"}"===c?w():"SPACE"===p&&(i.space_before_token=!0),A(),d.last_word=s.text,"TK_RESERVED"===s.type&&"do"===s.text&&(d.do_block=!0),"TK_RESERVED"===s.type&&"if"===s.text&&(d.if_block=!0)))}l="TK_START_BLOCK",c="",(i=new D(t,m)).raw=g.test_output_raw,f=[],T(F.BlockStatement),this.beautify=function(){var e,t;for(o=new B(n,g),h=o.tokenize(),r=0;e=O();){for(var a=0;a<e.comments_before.length;a++)_(e.comments_before[a]);_(e),c=d.last_text,l=e.type,d.last_text=e.text,r+=1}return t=i.get_code(),g.end_with_newline&&(t+="\n"),t="\n"!=g.eol?t.replace(/[\n]/g,g.eol):t}}function o(t){var a=0,n=-1,r=[],o=!0;this.set_indent=function(e){a=t.baseIndentLength+e*t.indent_length,n=e},this.get_character_count=function(){return a},this.is_empty=function(){return o},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),a+=e.length,o=!1},this.pop=function(){var e=null;return o||(e=r.pop(),a-=e.length,o=0===r.length),e},this.remove_indent=function(){0<n&&(--n,a-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),--a;o=0===r.length},this.toString=function(){var e="";return this._empty||(0<=n&&(e=t.indent_cache[n]),e+=r.join("")),e}}function D(t,a){a=a||"",this.indent_cache=[a],this.baseIndentLength=a.length,this.indent_length=t.length,this.raw=!1;var n=[];this.baseIndentString=a,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new o(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(e){return!(1===this.get_line_number()&&this.just_added_newline()||!e&&this.just_added_newline()||(this.raw||this.add_outputline(),0))},this.get_code=function(){return n.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<n.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==F.ForInitializer&&e.mode!==F.Conditional)for(var t=e.start_line_index,a=n.length;t<a;)n[t].remove_indent(),t++},this.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim(t,a);e&&1<n.length&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=1<n.length?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===n.length||n[n.length-2].is_empty())}}var Y=function(e,t,a,n,r,o){this.type=e,this.text=t,this.comments_before=[],this.newlines=a||0,this.wanted_newline=0<a,this.whitespace_before=n||"",this.parent=null,this.directives=null};function B(A,C,e){var T,S,R,k,L,x,I="\n\r\t ".split(""),O=/[0-9]/,M=/[01234567]/,F=/[0123456789abcdefABCDEF]/,D="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" "),B=(this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"])),N=/([\s\S]*?)((?:\*\/)|$)/g,P=/([^\n\r\u2028\u2029]*)/g,U=/\/\* beautify( \w+[:]\w+)+ \*\//g,H=/ (\w+)[:](\w+)/g,$=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,z=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function i(){var e=[];if(T=0,S="",x<=L)return["","TK_EOF"];var t=k.length?k[k.length-1]:new Y("TK_START_BLOCK","{"),a=A.charAt(L);for(L+=1;K(a,I);){if(W.newline.test(a)?"\n"===a&&"\r"===A.charAt(L-2)||(T+=1,e=[]):e.push(a),x<=L)return["","TK_EOF"];a=A.charAt(L),L+=1}if(e.length&&(S=e.join("")),O.test(a)){var n=!0,r=!0,o=O;for("0"===a&&L<x&&/[Xxo]/.test(A.charAt(L))?(r=n=!1,a+=A.charAt(L),L+=1,o=/[o]/.test(A.charAt(L))?M:F):(a="",--L);L<x&&o.test(A.charAt(L));)a+=A.charAt(L),L+=1,n&&L<x&&"."===A.charAt(L)&&(a+=A.charAt(L),L+=1,n=!1),r&&L<x&&/[Ee]/.test(A.charAt(L))&&(a+=A.charAt(L),(L+=1)<x&&/[+-]/.test(A.charAt(L))&&(a+=A.charAt(L),L+=1),n=r=!1);return[a,"TK_WORD"]}if(W.isIdentifierStart(A.charCodeAt(L-1))){if(L<x)for(;W.isIdentifierChar(A.charCodeAt(L))&&(a+=A.charAt(L),(L+=1)!==x););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&K(t.text,["set","get"])||!K(a,B)?[a,"TK_WORD"]:"in"===a?[a,"TK_OPERATOR"]:[a,"TK_RESERVED"]}if("("===a||"["===a)return[a,"TK_START_EXPR"];if(")"===a||"]"===a)return[a,"TK_END_EXPR"];if("{"===a)return[a,"TK_START_BLOCK"];if("}"===a)return[a,"TK_END_BLOCK"];if(" "===a)return[a,"TK_SEMICOLON"];if("/"===a){var i="";if("*"===A.charAt(L))return L+=1,N.lastIndex=L,y=N.exec(A),i="/*".concat(y[0]),L+=y[0].length,(E=function(e){if(!e.match(U))return null;for(var t={},a=(H.lastIndex=0,H.exec(e));a;)t[a[1]]=a[2],a=H.exec(e);return t}(i))&&"start"===E.ignore&&($.lastIndex=L,i+=(y=$.exec(A))[0],L+=y[0].length),[i=i.replace(W.lineBreak,"\n"),"TK_BLOCK_COMMENT",E];if("/"===A.charAt(L))return L+=1,P.lastIndex=L,y=P.exec(A),i="//".concat(y[0]),L+=y[0].length,[i,"TK_COMMENT"]}if("`"===a||"'"===a||'"'===a||("/"===a||C.e4x&&"<"===a&&A.slice(L-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&K(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&K(t.parent.text,["if","while","for"])||K(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var s=a,l=!1,c=!1,d=a;if("/"===s)for(var f=!1;L<x&&(l||f||A.charAt(L)!==s)&&!W.newline.test(A.charAt(L));)d+=A.charAt(L),l?l=!1:(l="\\"===A.charAt(L),"["===A.charAt(L)?f=!0:"]"===A.charAt(L)&&(f=!1)),L+=1;else if(C.e4x&&"<"===s){var p=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,u=A.slice(L-1),g=p.exec(u);if(g&&0===g.index){for(var h=g[2],m=0;g;){var v=!!g[1],b=g[2],_=!!g[g.length-1]||"![CDATA["===b.slice(0,8);if(b!==h||_||(v?--m:++m),m<=0)break;g=p.exec(u)}var E=g?g.index+g[0].length:u.length,u=u.slice(0,E);return L+=E-1,[u=u.replace(W.lineBreak,"\n"),"TK_STRING"]}}else for(;L<x&&(l||A.charAt(L)!==s&&("`"===s||!W.newline.test(A.charAt(L))));)(l||"`"===s)&&W.newline.test(A.charAt(L))?("\r"===A.charAt(L)&&"\n"===A.charAt(L+1)&&(L+=1),d+="\n"):d+=A.charAt(L),l=l?("x"!==A.charAt(L)&&"u"!==A.charAt(L)||(c=!0),!1):"\\"===A.charAt(L),L+=1;if(c&&C.unescape_strings&&(d=function(e){var t,a=!1,n="",r=0,o="",i=0;for(;a||r<e.length;)if(t=e.charAt(r),r++,a){if(a=!1,"x"===t)o=e.substr(r,2),r+=2;else{if("u"!==t){n+="\\".concat(t);continue}o=e.substr(r,4),r+=4}if(!o.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(i=parseInt(o,16))&&i<32)n+=("x"===t?"\\x":"\\u").concat(o);else if(34===i||39===i||92===i)n+="\\".concat(String.fromCharCode(i));else{if("x"===t&&126<i&&i<=255)return e;n+=String.fromCharCode(i)}}else"\\"===t?a=!0:n+=t;return n}(d)),L<x&&A.charAt(L)===s&&(d+=s,L+=1,"/"===s))for(;L<x&&W.isIdentifierStart(A.charCodeAt(L));)d+=A.charAt(L),L+=1;return[d,"TK_STRING"]}if("#"===a){if(0===k.length&&"!"===A.charAt(L)){for(d=a;L<x&&"\n"!==a;)d+=a=A.charAt(L),L+=1;return["".concat(G(d),"\n"),"TK_UNKNOWN"]}var w="#";if(L<x&&O.test(A.charAt(L))){for(;w+=a=A.charAt(L),(L+=1)<x&&"#"!==a&&"="!==a;);return"#"!==a&&("["===A.charAt(L)&&"]"===A.charAt(L+1)?(w+="[]",L+=2):"{"===A.charAt(L)&&"}"===A.charAt(L+1)&&(w+="{}",L+=2)),[w,"TK_WORD"]}}if("<"===a&&("?"===A.charAt(L)||"%"===A.charAt(L))){z.lastIndex=L-1;var y=z.exec(A);if(y)return a=y[0],L+=a.length-1,[a=a.replace(W.lineBreak,"\n"),"TK_STRING"]}if("<"===a&&"\x3c!--"===A.substring(L-1,L+3)){for(L+=3,a="\x3c!--";!W.newline.test(A.charAt(L))&&L<x;)a+=A.charAt(L),L++;return R=!0,[a,"TK_COMMENT"]}if("-"===a&&R&&"--\x3e"===A.substring(L-1,L+2))return R=!1,L+=2,["--\x3e","TK_COMMENT"];if("."===a)return[a,"TK_DOT"];if(K(a,D)){for(;L<x&&K(a+A.charAt(L),D)&&(a+=A.charAt(L),!(x<=(L+=1))););return","===a?[a,"TK_COMMA"]:"="===a?[a,"TK_EQUALS"]:[a,"TK_OPERATOR"]}return[a,"TK_UNKNOWN"]}this.tokenize=function(){x=A.length,L=0,R=!1,k=[];for(var e,t,a,n=null,r=[],o=[];!t||"TK_EOF"!==t.type;){for(a=i(),e=new Y(a[1],a[0],T,S);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=a[2]),o.push(e),a=i(),e=new Y(a[1],a[0],T,S);o.length&&(e.comments_before=o,o=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(n),n=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&n&&("]"===e.text&&"["===n.text||")"===e.text&&"("===n.text||"}"===e.text&&"{"===n.text)&&(e.parent=n.parent,n=r.pop()),k.push(e),t=e}return k}}return{run:function(e,t){function i(e){return e.replace(/\s+$/g,"")}var a,n,r,g,o,s,h,l,c,m,v,b,d,f;for(void 0!==(t=t||{}).wrap_line_length&&0!==parseInt(t.wrap_line_length,10)||void 0===t.max_char||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),n=void 0!==t.indent_inner_html&&t.indent_inner_html,r=void 0===t.indent_size?4:parseInt(t.indent_size,10),g=void 0===t.indent_char?" ":t.indent_char,s=void 0===t.brace_style?"collapse":t.brace_style,o=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),h=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],l=void 0===t.preserve_newlines||t.preserve_newlines,c=l?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,m=void 0!==t.indent_handlebars&&t.indent_handlebars,v=void 0===t.wrap_attributes?"auto":t.wrap_attributes,b=void 0!==t.wrap_attributes_indent_size&&parseInt(t.wrap_attributes_indent_size,10)||r,d=void 0!==t.end_with_newline&&t.end_with_newline,f=Array.isArray(t.extra_liners)?t.extra_liners.concat():("string"==typeof t.extra_liners?t.extra_liners:"head,body,/html").split(","),t.indent_with_tabs&&(g="\t",r=1),(a=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=n,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:f,in_array:function(e,t){for(var a=0;a<t.length;a++)if(e===t[a])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="",e=this.input.charAt(this.pos);if(this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)l&&"\n"===e&&this.newlines<=c&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return e.length?e.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(e);else{if(m){var t=this.input.substr(this.pos,3);if("{{#"===t||"{{/"===t)break;if("{{!"===t)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}t=this.input.charAt(this.pos),this.pos++,this.line_char_count++,e.push(t)}}return e.length?e.join(""):""},this.get_contents_to=function(e){var t;return this.pos===this.input.length?["","TK_EOF"]:(t="",(e=new RegExp("</".concat(e,"\\s*>"),"igm")).lastIndex=this.pos,e=(e=e.exec(this.input))?e.index:this.input.length,this.pos<e&&(t=this.input.substring(this.pos,e),this.pos=e),t)},this.record_tag=function(e){this.tags["".concat(e,"count")]?this.tags["".concat(e,"count")]++:this.tags["".concat(e,"count")]=1,this.tags[e+this.tags["".concat(e,"count")]]=this.indent_level,this.tags[e+this.tags["".concat(e,"count")]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags["".concat(e,"count")]},this.retrieve_tag=function(e){if(this.tags["".concat(e,"count")]){for(var t=this.tags.parent;t&&e+this.tags["".concat(e,"count")]!==t;)t=this.tags["".concat(t,"parent")];t&&(this.indent_level=this.tags[e+this.tags["".concat(e,"count")]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags["".concat(e,"count")]+"parent"],delete this.tags[e+this.tags["".concat(e,"count")]],1===this.tags["".concat(e,"count")]?delete this.tags["".concat(e,"count")]:this.tags["".concat(e,"count")]--}},this.indent_to_tag=function(e){if(this.tags["".concat(e,"count")]){for(var t=this.tags.parent;t&&e+this.tags["".concat(e,"count")]!==t;)t=this.tags["".concat(t,"parent")];t&&(this.indent_level=this.tags[e+this.tags["".concat(e,"count")]])}},this.get_tag=function(e){var t,a,n="",r=[],o=!1,i=!0,s=this.pos,l=this.line_char_count;e=void 0!==e&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=s,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace))o=!0;else{if("'"!==n&&'"'!==n||(n+=this.get_unformatted(n),o=!0),"="===n&&(o=!1),r.length&&"="!=r[r.length-1]&&">"!=n&&o){if(this.space_or_wrap(r),o=!1,!i&&"force"===v&&"/"!=n){this.print_newline(!0,r),this.print_indentation(r);for(var c=0;c<b;c++)r.push(g)}for(var d=0;d<r.length;d++)if(" "===r[d]){i=!1;break}}if(m&&"<"===a&&n+this.input.charAt(this.pos)==="{{"&&(n+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(n=" ".concat(n)),o=!0),"<"!==n||a||(t=this.pos-1,a="<"),m&&!a&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===n||"/"===n||"!"===n?this.pos-3:this.pos-2,a="{"),this.line_char_count++,r.push(n),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(m&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(m&&"{"===a&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=n);var f=r.join(""),p=-1!=f.indexOf(" ")?f.indexOf(" "):"{"===f[0]?f.indexOf("}"):f.indexOf(">"),u="<"!==f[0]&&m?"#"===f[2]?3:2:1,u=f.substring(u,p).toLowerCase();return"/"===f.charAt(f.length-2)||this.Utils.in_array(u,this.Utils.single_token)?e||(this.tag_type="SINGLE"):m&&"{"===f[0]&&"else"===u?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(u,h)?(p=this.get_unformatted("</".concat(u,">"),f),r.push(p),this.pos,this.tag_type="SINGLE"):"script"===u&&(-1===f.search("type")||-1<f.search("type")&&-1<f.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(u),this.tag_type="SCRIPT"):"style"===u&&(-1===f.search("type")||-1<f.search("type")&&-1<f.search("text/css"))?e||(this.record_tag(u),this.tag_type="STYLE"):"!"===u.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===u.charAt(0)?(this.retrieve_tag(u.substring(1)),this.tag_type="END"):(this.record_tag(u),"html"!=u.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(u,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length)&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output)),e&&(this.pos=s,this.line_char_count=l),r.join("")},this.get_comment=function(e){var t="",a=">",n=!1,r=(this.pos=e,this.input.charAt(this.pos));for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!==a[a.length-1]||-1==t.indexOf(a));)!n&&t.length<10&&(0===t.indexOf("<![if")?(a="<![endif]>",n=!0):0===t.indexOf("<![cdata[")?(a="]]>",n=!0):0===t.indexOf("<![")?(a="]>",n=!0):0===t.indexOf("\x3c!--")?(a="--\x3e",n=!0):0===t.indexOf("{{!")?(a="}}",n=!0):0===t.indexOf("<?")?(a="?>",n=!0):0===t.indexOf("<%")&&(a="%>",n=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var a,n="",r=0,o=!0;do{if(this.pos>=this.input.length)return n;if(a=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(a,this.Utils.whitespace)){if(!o){this.line_char_count--;continue}if("\n"===a||"\r"===a){n+="\n",this.line_char_count=0;continue}}n+=a,this.line_char_count++,o=!0,m&&"{"===a&&n.length&&"{"===n[n.length-2]&&(r=(n+=this.get_unformatted("}}")).length)}while(-1===n.toLowerCase().indexOf(e,r));return n},this.get_token=function(){var e,t;return"TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token?(e=this.last_token.substr(7),"string"!=typeof(t=this.get_contents_to(e))?t:[t,"TK_".concat(e)]):"CONTENT"===this.current_mode?"string"!=typeof(t=this.get_content())?t:[t,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(t=this.get_tag())?t:[t,"TK_TAG_".concat(this.tag_type)]:void 0},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){return!(!this.Utils.in_array(e,t)||"a"==e.toLowerCase()&&this.Utils.in_array("a",t)&&(e=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/))&&!this.Utils.in_array(e,t))},this.printer=function(e,t,a,n,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=a,this.brace_style=r,this.indent_level=0,this.wrap_line_length=n;for(var o=this.line_char_count=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(!e&&"\n"==t[t.length-1]||("\n"!=t[t.length-1]&&(t[t.length-1]=i(t[t.length-1])),t.push("\n")))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=e.replace(/^\s+/g,"")),this.print_token_raw(e))},this.print_token_raw=function(e){(e=0<this.newlines?i(e):e)&&""!==e&&(1<e.length&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,g,r,o,s);;){var p,u,_,E,w=a.get_token();if(a.token_text=w[0],a.token_type=w[1],"TK_EOF"===a.token_type)break;switch(a.token_type){case"TK_TAG_START":a.print_newline(!1,a.output),a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_END":"TK_CONTENT"===a.last_token&&""===a.last_text&&(y=a.token_text.match(/\w+/)[0],(E=null)!==(E=a.output.length?a.output[a.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/):E)&&(E[1]==y||a.Utils.in_array(E[1],h))||a.print_newline(!1,a.output)),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var y=a.token_text.match(/^\s*<([a-z-]+)/i);y&&a.Utils.in_array(y[1],h)||a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":a.print_token(a.token_text),a.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":""!==a.token_text&&(a.print_newline(!1,a.output),E=a.token_text,u=void 0,_=1,"TK_SCRIPT"===a.token_type?u=C:"TK_STYLE"===a.token_type&&(u=A),"keep"===t.indent_scripts?_=0:"separate"===t.indent_scripts&&(_=-a.indent_level),p=a.get_full_indent(_),E=u?u(E.replace(/^\s*/,p),t):(u=E.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(a.indent_string).length-1,_=a.get_full_indent(_-u),E.replace(/^\s*/,p).replace(/\r\n|\r|\n/g,"\n"+_).replace(/\s+$/,"")))&&(a.print_token_raw(E),a.print_newline(!0,a.output)),a.current_mode="TAG";break;default:""!==a.token_text&&a.print_token(a.token_text)}a.last_token=a.token_type,a.last_text=a.token_text}return e=a.output.join("").replace(/[\r\n\t ]+$/,""),d&&(e+="\n"),e}}},Object.assign(dt.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),dt.PLUGINS.codeView=function(l){var c,d,f=l.$,p=function(){return l.$box.hasClass("fr-code-view")};function u(){return d?d.getValue():c.val()}function g(){p()&&(d&&d.setSize(null,l.opts.height||"auto"),l.opts.heightMin||l.opts.height?(l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",l.opts.heightMin||l.opts.height),c.css("height",l.opts.height)):l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var h,m=!1;function v(){p()&&l.events.trigger("blur")}function b(){p()&&m&&l.events.trigger("focus")}function a(e){function t(){return!p()}c||(c=f('<textarea class="fr-code" tabIndex="-1">'),l.$wp.append(c),c.attr("dir",l.opts.direction),l.$box.hasClass("fr-basic")||(h=f('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'.concat(l.helpers.isMobile()?"":" fr-desktop",'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>')),l.$box.append(h),l.events.bindClick(l.$box,"a.html-switch",function(){l.events.trigger("commands.before",["html"]),_(!1),l.events.trigger("commands.after",["html"])})),l.events.on("buttons.refresh",t),l.events.on("copy",t,!0),l.events.on("cut",t,!0),l.events.on("paste",t,!0),l.events.on("destroy",E,!0),l.events.on("html.set",function(){p()&&_(!0)}),l.events.on("codeView.update",g),l.events.on("codeView.toggle",function(){l.$box.hasClass("fr-code-view")&&_()}),l.events.on("form.submit",function(){p()&&(l.html.set(u()),l.events.trigger("contentChanged",[],!0))},!0),!d&&l.opts.codeMirror?((d=l.opts.codeMirror.fromTextArea(c.get(0),l.opts.codeMirrorOptions)).on("blur",v),d.on("focus",b)):(l.events.$on(c,"keydown keyup change input",function(){l.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height="".concat(this.scrollHeight,"px"))}),l.events.$on(c,"blur",v),l.events.$on(c,"focus",b))),l.undo.saveStep(),l.html.cleanEmptyTags(),l.html.cleanWhiteTags(!0),l.core.hasFocus()&&!l.core.isEmpty()&&(l.selection.save(),l.$el.find('.fr-marker[data-type="true"]').first().replaceWith('<span class="fr-tmp fr-sm">F</span>'),l.$el.find('.fr-marker[data-type="false"]').last().replaceWith('<span class="fr-tmp fr-em">F</span>'));var a,n,r,o,i=l.html.get(!1,!0),s=(l.$el.find("span.fr-tmp").remove(),l.$box.toggleClass("fr-code-view",!0),!1);l.core.hasFocus()&&(s=!0,l.events.disableBlur(),l.$el.blur()),i=(i=i.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),l.codeBeautifier&&!i.includes("fr-embedly")&&(i=l.codeBeautifier.run(i,l.opts.codeBeautifierOptions)),d?(n=i.indexOf("FROALA-SM"),(r=i.indexOf("FROALA-EM"))<n?n=r:r-=9,o=(i=i.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,n).length-i.substring(0,n).replace(/\n/g,"").length,a=i.substring(0,r).length-i.substring(0,r).replace(/\n/g,"").length,n=i.substring(0,n).length-i.substring(0,i.substring(0,n).lastIndexOf("\n")+1).length,r=i.substring(0,r).length-i.substring(0,i.substring(0,r).lastIndexOf("\n")+1).length,d.setSize(null,l.opts.height||"auto"),l.opts.heightMin&&l.$box.find(".CodeMirror-scroll").css("min-height",l.opts.heightMin),d.setValue(i),m=!s,d.focus(),m=!0,d.setSelection({line:o,ch:n},{line:a,ch:r}),d.refresh(),d.clearHistory()):(n=i.indexOf("FROALA-SM"),r=i.indexOf("FROALA-EM")-9,l.opts.heightMin&&c.css("min-height",l.opts.heightMin),l.opts.height&&c.css("height",l.opts.height),l.opts.heightMax&&c.css("max-height",l.opts.height||l.opts.heightMax),c.val(i.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change"),o=f(l.o_doc).scrollTop(),m=!s,c.focus(),m=!0,c.get(0).setSelectionRange(n,r),f(l.o_doc).scrollTop(o)),l.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(f(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!l.helpers.isMobile()&&l.opts.toolbarInline&&l.toolbar.hide()}function _(e){void 0===e&&(e=!p());var t=l.$tb.find('.fr-command[data-cmd="html"]');e?(l.popups.hideAll(),a(t)):(l.$box.toggleClass("fr-code-view",!1),e=t,t=u(),l.html.set(t),l.$el.blur(),l.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-