(function(){function n(n,t){for(var i=0;i<t.length;i+=1)if(t[i]===n)return!0;return!1}function f(n){return n.replace(/^\s+|\s+$/g,"")}function r(n,t){"use strict";var i=new e(n,t);return i.beautify()}function e(i,r){"use strict";function yt(n,t){var i=0;return n&&(i=n.indentation_level,!l.just_added_newline()&&n.line_indent_level>i&&(i=n.line_indent_level)),{mode:t,parent:n,last_text:n?n.last_text:"",last_word:n?n.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:i,line_indent_level:n?n.line_indent_level:i,start_line_index:l.get_line_number(),ternary_depth:0}}function pt(n){var i=n.newlines,r=c.keep_array_indentation&&d(u.mode),t;if(r)for(t=0;t<i;t+=1)a(t>0);else if(c.max_preserve_newlines&&i>c.max_preserve_newlines&&(i=c.max_preserve_newlines),c.preserve_newlines&&n.newlines>1)for(a(),t=1;t<i;t+=1)a(!0);e=n;at[e.type]()}function bt(n){n=n.replace(/\x0d/g,"");for(var i=[],t=n.indexOf("\n");t!==-1;)i.push(n.substring(0,t)),n=n.substring(t+1),t=n.indexOf("\n");return n.length&&i.push(n),i}function k(n){if(n=n===undefined?!1:n,!l.just_added_newline())if(c.preserve_newlines&&e.wanted_newline||n)a(!1,!0);else if(c.wrap_line_length){var t=l.current_line.get_character_count()+e.text.length+(l.space_before_token?1:0);t>=c.wrap_line_length&&a(!1,!0)}}function a(n,i){if(!i&&u.last_text!==";"&&u.last_text!==","&&u.last_text!=="="&&o!=="TK_OPERATOR")while(u.mode===t.Statement&&!u.if_block&&!u.do_block)b();l.add_new_line(n)&&(u.multiline_frame=!0)}function kt(){if(l.just_added_newline())if(c.keep_array_indentation&&d(u.mode)&&e.wanted_newline){l.current_line.push("");for(var n=0;n<e.whitespace_before.length;n+=1)l.current_line.push(e.whitespace_before[n]);l.space_before_token=!1}else l.add_indent_string(u.indentation_level)&&(u.line_indent_level=u.indentation_level)}function v(n){n=n||e.text;kt();l.add_token(n)}function rt(){u.indentation_level+=1}function dt(){u.indentation_level>0&&(!u.parent||u.indentation_level>u.parent.indentation_level)&&(u.indentation_level-=1)}function nt(n){u?(et.push(u),p=u):p=yt(null,n);u=yt(p,n)}function d(n){return n===t.ArrayLiteral}function ut(i){return n(i,[t.Expression,t.ForInitializer,t.Conditional])}function b(){et.length>0&&(p=u,u=et.pop(),p.mode===t.Statement&&l.remove_redundant_indentation(p))}function ot(){return u.parent.mode===t.ObjectLiteral&&u.mode===t.Statement&&(u.last_text===":"&&u.ternary_depth===0||o==="TK_RESERVED"&&n(u.last_text,["get","set"]))}function tt(){return o==="TK_RESERVED"&&n(u.last_text,["var","let","const"])&&e.type==="TK_WORD"||o==="TK_RESERVED"&&u.last_text==="do"||o==="TK_RESERVED"&&u.last_text==="return"&&!e.wanted_newline||o==="TK_RESERVED"&&u.last_text==="else"&&!(e.type==="TK_RESERVED"&&e.text==="if")||o==="TK_END_EXPR"&&(p.mode===t.ForInitializer||p.mode===t.Conditional)||o==="TK_WORD"&&u.mode===t.BlockStatement&&!u.in_case&&!(e.text==="--"||e.text==="++")&&e.type!=="TK_WORD"&&e.type!=="TK_RESERVED"||u.mode===t.ObjectLiteral&&(u.last_text===":"&&u.ternary_depth===0||o==="TK_RESERVED"&&n(u.last_text,["get","set"]))?(nt(t.Statement),rt(),o==="TK_RESERVED"&&n(u.last_text,["var","let","const"])&&e.type==="TK_WORD"&&(u.declaration_statement=!0),ot()||k(e.type==="TK_RESERVED"&&n(e.text,["do","for","if","while"])),!0):!1}function gt(n,t){for(var r,i=0;i<n.length;i++)if(r=f(n[i]),r.charAt(0)!==t)return!1;return!0}function ni(n,t){for(var i=0,u=n.length,r;i<u;i++)if(r=n[i],r&&r.indexOf(t)!==0)return!1;return!0}function st(t){return n(t,["case","return","do","if","throw","else"])}function ht(n){var t=lt+(n||0);return t<0||t>=ct.length?null:ct[t]}function ti(){tt();var i=t.Expression;if(e.text==="["){if(o==="TK_WORD"||u.last_text===")"){o==="TK_RESERVED"&&n(u.last_text,g.line_starters)&&(l.space_before_token=!0);nt(i);v();rt();c.space_in_paren&&(l.space_before_token=!0);return}i=t.ArrayLiteral;d(u.mode)&&(u.last_text==="["||u.last_text===","&&(w==="]"||w==="}"))&&(c.keep_array_indentation||a())}else o==="TK_RESERVED"&&u.last_text==="for"?i=t.ForInitializer:o==="TK_RESERVED"&&n(u.last_text,["if","while"])&&(i=t.Conditional);u.last_text===";"||o==="TK_START_BLOCK"?a():o==="TK_END_EXPR"||o==="TK_START_EXPR"||o==="TK_END_BLOCK"||u.last_text==="."?k(e.wanted_newline):o==="TK_RESERVED"&&e.text==="("||o==="TK_WORD"||o==="TK_OPERATOR"?o==="TK_RESERVED"&&(u.last_word==="function"||u.last_word==="typeof")||u.last_text==="*"&&w==="function"?c.space_after_anon_function&&(l.space_before_token=!0):o==="TK_RESERVED"&&(n(u.last_text,g.line_starters)||u.last_text==="catch")&&c.space_before_conditional&&(l.space_before_token=!0):l.space_before_token=!0;e.text==="("&&(o==="TK_EQUALS"||o==="TK_OPERATOR")&&(ot()||k());nt(i);v();c.space_in_paren&&(l.space_before_token=!0);rt()}function ii(){while(u.mode===t.Statement)b();u.multiline_frame&&k(e.text==="]"&&d(u.mode)&&!c.keep_array_indentation);c.space_in_paren&&(o!=="TK_START_EXPR"||c.space_in_empty_paren?l.space_before_token=!0:(l.trim(),l.space_before_token=!1));e.text==="]"&&c.keep_array_indentation?(v(),b()):(b(),v());l.remove_redundant_indentation(p);u.do_while&&p.mode===t.Conditional&&(p.mode=t.Expression,u.do_block=!1,u.do_while=!1)}function ri(){var i=ht(1),r=ht(2),f,e;r&&(r.text===":"&&n(i.type,["TK_STRING","TK_WORD","TK_RESERVED"])||n(i.text,["get","set"])&&n(r.type,["TK_WORD","TK_RESERVED"]))?n(w,["class","interface"])?nt(t.BlockStatement):nt(t.ObjectLiteral):nt(t.BlockStatement);f=!i.comments_before.length&&i.text==="}";e=f&&u.last_word==="function"&&o==="TK_END_EXPR";c.brace_style==="expand"?o!=="TK_OPERATOR"&&(e||o==="TK_EQUALS"||o==="TK_RESERVED"&&st(u.last_text)&&u.last_text!=="else")?l.space_before_token=!0:a(!1,!0):o!=="TK_OPERATOR"&&o!=="TK_START_EXPR"?o==="TK_START_BLOCK"?a():l.space_before_token=!0:d(p.mode)&&u.last_text===","&&(w==="}"?l.space_before_token=!0:a());v();rt()}function ui(){while(u.mode===t.Statement)b();var n=o==="TK_START_BLOCK";c.brace_style==="expand"?n||a():n||(d(u.mode)&&c.keep_array_indentation?(c.keep_array_indentation=!1,a(),c.keep_array_indentation=!0):a());b();v()}function wt(){var i,r;if(e.type==="TK_RESERVED"&&u.mode!==t.ObjectLiteral&&n(e.text,["set","get"])&&(e.type="TK_WORD"),e.type==="TK_RESERVED"&&u.mode===t.ObjectLiteral&&(i=ht(1),i.text==":"&&(e.type="TK_WORD")),tt()||!e.wanted_newline||ut(u.mode)||o==="TK_OPERATOR"&&u.last_text!=="--"&&u.last_text!=="++"||o==="TK_EQUALS"||!c.preserve_newlines&&o==="TK_RESERVED"&&n(u.last_text,["var","let","const","set","get"])||a(),u.do_block&&!u.do_while){if(e.type==="TK_RESERVED"&&e.text==="while"){l.space_before_token=!0;v();l.space_before_token=!0;u.do_while=!0;return}a();u.do_block=!1}if(u.if_block)if(u.else_block||e.type!=="TK_RESERVED"||e.text!=="else"){while(u.mode===t.Statement)b();u.if_block=!1;u.else_block=!1}else u.else_block=!0;if(e.type==="TK_RESERVED"&&(e.text==="case"||e.text==="default"&&u.in_case_statement)){a();(u.case_body||c.jslint_happy)&&(dt(),u.case_body=!1);v();u.in_case=!0;u.in_case_statement=!0;return}if(e.type==="TK_RESERVED"&&e.text==="function"&&((n(u.last_text,["}",";"])||l.just_added_newline()&&!n(u.last_text,["[","{",":","=",","]))&&(l.just_added_blankline()||e.comments_before.length||(a(),a(!0))),o==="TK_RESERVED"||o==="TK_WORD"?o==="TK_RESERVED"&&n(u.last_text,["get","set","new","return","export"])?l.space_before_token=!0:o==="TK_RESERVED"&&u.last_text==="default"&&w==="export"?l.space_before_token=!0:a():o==="TK_OPERATOR"||u.last_text==="="?l.space_before_token=!0:!u.multiline_frame&&(ut(u.mode)||d(u.mode))||a()),(o==="TK_COMMA"||o==="TK_START_EXPR"||o==="TK_EQUALS"||o==="TK_OPERATOR")&&(ot()||k()),e.type==="TK_RESERVED"&&n(e.text,["function","get","set"])){v();u.last_word=e.text;return}y="NONE";o==="TK_END_BLOCK"?e.type==="TK_RESERVED"&&n(e.text,["else","catch","finally"])?c.brace_style==="expand"||c.brace_style==="end-expand"?y="NEWLINE":(y="SPACE",l.space_before_token=!0):y="NEWLINE":o==="TK_SEMICOLON"&&u.mode===t.BlockStatement?y="NEWLINE":o==="TK_SEMICOLON"&&ut(u.mode)?y="SPACE":o==="TK_STRING"?y="NEWLINE":o==="TK_RESERVED"||o==="TK_WORD"||u.last_text==="*"&&w==="function"?y="SPACE":o==="TK_START_BLOCK"?y="NEWLINE":o==="TK_END_EXPR"&&(l.space_before_token=!0,y="NEWLINE");e.type==="TK_RESERVED"&&n(e.text,g.line_starters)&&u.last_text!==")"&&(y=u.last_text==="else"||u.last_text==="export"?"SPACE":"NEWLINE");e.type==="TK_RESERVED"&&n(e.text,["else","catch","finally"])?o!=="TK_END_BLOCK"||c.brace_style==="expand"||c.brace_style==="end-expand"?a():(l.trim(!0),r=l.current_line,r.last()!=="}"&&a(),l.space_before_token=!0):y==="NEWLINE"?o==="TK_RESERVED"&&st(u.last_text)?l.space_before_token=!0:o!=="TK_END_EXPR"?o==="TK_START_EXPR"&&e.type==="TK_RESERVED"&&n(e.text,["var","let","const"])||u.last_text===":"||(e.type==="TK_RESERVED"&&e.text==="if"&&u.last_text==="else"?l.space_before_token=!0:a()):e.type==="TK_RESERVED"&&n(e.text,g.line_starters)&&u.last_text!==")"&&a():u.multiline_frame&&d(u.mode)&&u.last_text===","&&w==="}"?a():y==="SPACE"&&(l.space_before_token=!0);v();u.last_word=e.text;e.type==="TK_RESERVED"&&e.text==="do"&&(u.do_block=!0);e.type==="TK_RESERVED"&&e.text==="if"&&(u.if_block=!0)}function fi(){for(tt()&&(l.space_before_token=!1);u.mode===t.Statement&&!u.if_block&&!u.do_block;)b();v()}function ei(){tt()?l.space_before_token=!0:o==="TK_RESERVED"||o==="TK_WORD"?l.space_before_token=!0:o==="TK_COMMA"||o==="TK_START_EXPR"||o==="TK_EQUALS"||o==="TK_OPERATOR"?ot()||k():a();v()}function oi(){tt();u.declaration_statement&&(u.declaration_assignment=!0);l.space_before_token=!0;v();l.space_before_token=!0}function si(){if(u.declaration_statement){ut(u.parent.mode)&&(u.declaration_assignment=!1);v();u.declaration_assignment?(u.declaration_assignment=!1,a(!1,!0)):l.space_before_token=!0;return}v();u.mode===t.ObjectLiteral||u.mode===t.Statement&&u.parent.mode===t.ObjectLiteral?(u.mode===t.Statement&&b(),a()):l.space_before_token=!0}function hi(){if(tt(),o==="TK_RESERVED"&&st(u.last_text)){l.space_before_token=!0;v();return}if(e.text==="*"&&o==="TK_DOT"){v();return}if(e.text===":"&&u.in_case){u.case_body=!0;rt();v();a();u.in_case=!1;return}if(e.text==="::"){v();return}e.wanted_newline&&(e.text==="--"||e.text==="++")&&a(!1,!0);o==="TK_OPERATOR"&&k();var i=!0,r=!0;n(e.text,["--","++","!","~"])||n(e.text,["-","+"])&&(n(o,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||n(u.last_text,g.line_starters)||u.last_text===",")?(i=!1,r=!1,u.last_text===";"&&ut(u.mode)&&(i=!0),o==="TK_RESERVED"||o==="TK_END_EXPR"?i=!0:o==="TK_OPERATOR"&&(i=n(e.text,["--","-"])&&n(u.last_text,["--","-"])||n(e.text,["++","+"])&&n(u.last_text,["++","+"])),(u.mode===t.BlockStatement||u.mode===t.Statement)&&(u.last_text==="{"||u.last_text===";")&&a()):e.text===":"?u.ternary_depth===0?i=!1:u.ternary_depth-=1:e.text==="?"?u.ternary_depth+=1:e.text==="*"&&o==="TK_RESERVED"&&u.last_text==="function"&&(i=!1,r=!1);l.space_before_token=l.space_before_token||i;v();l.space_before_token=r}function ci(){var n=bt(e.text),t,i=!1,r=!1,u=e.whitespace_before.join(""),o=u.length;for(a(!1,!0),n.length>1&&(gt(n.slice(1),"*")?i=!0:ni(n.slice(1),u)&&(r=!0)),v(n[0]),t=1;t<n.length;t++)a(!1,!0),i?v(" "+f(n[t])):r&&n[t].length>o?v(n[t].substring(o)):l.add_token(n[t]);a(!1,!0)}function li(){l.space_before_token=!0;v();l.space_before_token=!0}function ai(){e.wanted_newline?a(!1,!0):l.trim(!0);l.space_before_token=!0;v();a(!1,!0)}function vi(){tt();o==="TK_RESERVED"&&st(u.last_text)?l.space_before_token=!0:k(u.last_text===")"&&c.break_chained_methods);v()}function yi(){v();e.text[e.text.length-1]==="\n"&&a()}function pi(){while(u.mode===t.Statement)b()}var l,ct=[],lt,g,e,o,w,ft,u,p,et,y,at,c,vt="",it;for(at={TK_START_EXPR:ti,TK_END_EXPR:ii,TK_START_BLOCK:ri,TK_END_BLOCK:ui,TK_WORD:wt,TK_RESERVED:wt,TK_SEMICOLON:fi,TK_STRING:ei,TK_EQUALS:oi,TK_OPERATOR:hi,TK_COMMA:si,TK_BLOCK_COMMENT:ci,TK_INLINE_COMMENT:li,TK_COMMENT:ai,TK_DOT:vi,TK_UNKNOWN:yi,TK_EOF:pi},r=r?r:{},c={},r.braces_on_own_line!==undefined&&(c.brace_style=r.braces_on_own_line?"expand":"collapse"),c.brace_style=r.brace_style?r.brace_style:c.brace_style?c.brace_style:"collapse",c.brace_style==="expand-strict"&&(c.brace_style="expand"),c.indent_size=r.indent_size?parseInt(r.indent_size,10):4,c.indent_char=r.indent_char?r.indent_char:" ",c.preserve_newlines=r.preserve_newlines===undefined?!0:r.preserve_newlines,c.break_chained_methods=r.break_chained_methods===undefined?!1:r.break_chained_methods,c.max_preserve_newlines=r.max_preserve_newlines===undefined?0:parseInt(r.max_preserve_newlines,10),c.space_in_paren=r.space_in_paren===undefined?!1:r.space_in_paren,c.space_in_empty_paren=r.space_in_empty_paren===undefined?!1:r.space_in_empty_paren,c.jslint_happy=r.jslint_happy===undefined?!1:r.jslint_happy,c.space_after_anon_function=r.space_after_anon_function===undefined?!1:r.space_after_anon_function,c.keep_array_indentation=r.keep_array_indentation===undefined?!1:r.keep_array_indentation,c.space_before_conditional=r.space_before_conditional===undefined?!0:r.space_before_conditional,c.unescape_strings=r.unescape_strings===undefined?!1:r.unescape_strings,c.wrap_line_length=r.wrap_line_length===undefined?0:parseInt(r.wrap_line_length,10),c.e4x=r.e4x===undefined?!1:r.e4x,c.end_with_newline=r.end_with_newline===undefined?!1:r.end_with_newline,c.jslint_happy&&(c.space_after_anon_function=!0),r.indent_with_tabs&&(c.indent_char="\t",c.indent_size=1),ft="";c.indent_size>0;)ft+=c.indent_char,c.indent_size-=1;if(it=0,i&&i.length){while(i.charAt(it)===" "||i.charAt(it)==="\t")vt+=i.charAt(it),it+=1;i=i.substring(it)}o="TK_START_BLOCK";w="";l=new s(ft,vt);et=[];nt(t.BlockStatement);this.beautify=function(){var n,r,t;for(g=new h(i,c,ft),ct=g.tokenize(),lt=0;n=ht();){for(t=0;t<n.comments_before.length;t++)pt(n.comments_before[t]);pt(n);w=u.last_text;o=n.type;u.last_text=n.text;lt+=1}return r=l.get_code(),c.end_with_newline&&(r+="\n"),r}}function o(){var t=0,n=[];this.get_character_count=function(){return t};this.get_item_count=function(){return n.length};this.get_output=function(){return n.join("")};this.last=function(){return n.length?n[n.length-1]:null};this.push=function(i){n.push(i);t+=i.length};this.remove_indent=function(i,r){var u=0;n.length!==0&&(r&&n[0]===r&&(u=1),n[u]===i&&(t-=n[u].length,n.splice(u,1)))};this.trim=function(i,r){while(this.get_item_count()&&(this.last()===" "||this.last()===i||this.last()===r)){var u=n.pop();t-=u.length}}}function s(n,i){var r=[];this.baseIndentString=i;this.current_line=null;this.space_before_token=!1;this.get_line_number=function(){return r.length};this.add_new_line=function(n){return this.get_line_number()===1&&this.just_added_newline()?!1:n||!this.just_added_newline()?(this.current_line=new o,r.push(this.current_line),!0):!1};this.add_new_line(!0);this.get_code=function(){for(var t=r[0].get_output(),n=1;n<r.length;n++)t+="\n"+r[n].get_output();return t.replace(/[\r\n\t ]+$/,"")};this.add_indent_string=function(t){if(i&&this.current_line.push(i),r.length>1){for(var u=0;u<t;u+=1)this.current_line.push(n);return!0}return!1};this.add_token=function(n){this.add_space_before_token();this.current_line.push(n)};this.add_space_before_token=function(){if(this.space_before_token&&this.current_line.get_item_count()){var t=this.current_line.last();t!==" "&&t!==n&&t!==i&&this.current_line.push(" ")}this.space_before_token=!1};this.remove_redundant_indentation=function(u){if(!u.multiline_frame&&u.mode!==t.ForInitializer&&u.mode!==t.Conditional)for(var f=u.start_line_index,e=r.length;f<e;)r[f].remove_indent(n,i),f++};this.trim=function(t){for(t=t===undefined?!1:t,this.current_line.trim(n,i);t&&r.length>1&&this.current_line.get_item_count()===0;)r.pop(),this.current_line=r[r.length-1],this.current_line.trim(n,i)};this.just_added_newline=function(){return this.current_line.get_item_count()===0};this.just_added_blankline=function(){if(this.just_added_newline()){if(r.length===1)return!0;var n=r[r.length-2];return n.get_item_count()===0}return!1}}function h(t,r,e){function w(){var nt,d,w,rt,ct,et,pt,st,lt,ut;if(c=0,l=[],o>=s)return["","TK_EOF"];for(d=h.length?h[h.length-1]:new u("TK_START_BLOCK","{"),w=t.charAt(o),o+=1;n(w,b);){if(w==="\n"?(c+=1,l=[]):c&&(w===e?l.push(e):w!=="\r"&&l.push(" ")),o>=s)return["","TK_EOF"];w=t.charAt(o);o+=1}if(v.test(w)){var ft=!0,ht=!0,at=v;for(w==="0"&&o<s&&/[Xx]/.test(t.charAt(o))?(ft=!1,ht=!1,w+=t.charAt(o),o+=1,at=/[0123456789abcdefABCDEF]/):(w="",o-=1);o<s&&at.test(t.charAt(o));)w+=t.charAt(o),o+=1,ft&&o<s&&t.charAt(o)==="."&&(w+=t.charAt(o),o+=1,ft=!1),ht&&o<s&&/[Ee]/.test(t.charAt(o))&&(w+=t.charAt(o),o+=1,o<s&&/[+-]/.test(t.charAt(o))&&(w+=t.charAt(o),o+=1),ht=!1,ft=!1);return[w,"TK_WORD"]}if(i.isIdentifierStart(t.charCodeAt(o-1))){if(o<s)while(i.isIdentifierChar(t.charCodeAt(o)))if(w+=t.charAt(o),o+=1,o===s)break;return!(d.type==="TK_DOT"||d.type==="TK_RESERVED"&&n(d.text,["set","get"]))&&n(w,p)?w==="in"?[w,"TK_OPERATOR"]:[w,"TK_RESERVED"]:[w,"TK_WORD"]}if(w==="("||w==="[")return[w,"TK_START_EXPR"];if(w===")"||w==="]")return[w,"TK_END_EXPR"];if(w==="{")return[w,"TK_START_BLOCK"];if(w==="}")return[w,"TK_END_BLOCK"];if(w===";")return[w,"TK_SEMICOLON"];if(w==="/"){if(rt="",ct=!0,t.charAt(o)==="*"){if(o+=1,o<s)while(o<s&&!(t.charAt(o)==="*"&&t.charAt(o+1)&&t.charAt(o+1)==="/"))if(w=t.charAt(o),rt+=w,(w==="\n"||w==="\r")&&(ct=!1),o+=1,o>=s)break;return o+=2,ct&&c===0?["/*"+rt+"*/","TK_INLINE_COMMENT"]:["/*"+rt+"*/","TK_BLOCK_COMMENT"]}if(t.charAt(o)==="/"){for(rt=w;t.charAt(o)!=="\r"&&t.charAt(o)!=="\n";)if(rt+=t.charAt(o),o+=1,o>=s)break;return[rt,"TK_COMMENT"]}}if(w==="`"||w==="'"||w==='"'||(w==="/"||r.e4x&&w==="<"&&t.slice(o-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])\s*([-a-zA-Z:0-9_.]+=('[^']*'|"[^"]*"|{[^{}]*})\s*)*\/?\s*>/))&&(d.type==="TK_RESERVED"&&n(d.text,["return","case","throw","else","do","typeof","yield"])||d.type==="TK_END_EXPR"&&d.text===")"&&d.parent&&d.parent.type==="TK_RESERVED"&&n(d.parent.text,["if","while","for"])||n(d.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var tt=w,it=!1,vt=!1;if(nt=w,tt==="/")for(et=!1;o<s&&(it||et||t.charAt(o)!==tt)&&!i.newline.test(t.charAt(o));)nt+=t.charAt(o),it?it=!1:(it=t.charAt(o)==="\\",t.charAt(o)==="["?et=!0:t.charAt(o)==="]"&&(et=!1)),o+=1;else if(r.e4x&&tt==="<"){var yt=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])\s*([-a-zA-Z:0-9_.]+=('[^']*'|"[^"]*"|{[^{}]*})\s*)*(\/?)\s*>/g,ot=t.slice(o-1),g=yt.exec(ot);if(g&&g.index===0){for(pt=g[2],st=0;g;){var bt=!!g[1],wt=g[2],kt=!!g[g.length-1]||wt.slice(0,8)==="![CDATA[";if(wt!==pt||kt||(bt?--st:++st),st<=0)break;g=yt.exec(ot)}return lt=g?g.index+g[0].length:ot.length,o+=lt-1,[ot.slice(0,lt),"TK_STRING"]}}else while(o<s&&(it||t.charAt(o)!==tt&&(tt==="`"||!i.newline.test(t.charAt(o)))))nt+=t.charAt(o),it?((t.charAt(o)==="x"||t.charAt(o)==="u")&&(vt=!0),it=!1):it=t.charAt(o)==="\\",o+=1;if(vt&&r.unescape_strings&&(nt=k(nt)),o<s&&t.charAt(o)===tt&&(nt+=tt,o+=1,tt==="/"))while(o<s&&i.isIdentifierStart(t.charCodeAt(o)))nt+=t.charAt(o),o+=1;return[nt,"TK_STRING"]}if(w==="#"){if(h.length===0&&t.charAt(o)==="!"){for(nt=w;o<s&&w!=="\n";)w=t.charAt(o),nt+=w,o+=1;return[f(nt)+"\n","TK_UNKNOWN"]}if(ut="#",o<s&&v.test(t.charAt(o))){do w=t.charAt(o),ut+=w,o+=1;while(o<s&&w!=="#"&&w!=="=");return w==="#"||(t.charAt(o)==="["&&t.charAt(o+1)==="]"?(ut+="[]",o+=2):t.charAt(o)==="{"&&t.charAt(o+1)==="}"&&(ut+="{}",o+=2)),[ut,"TK_WORD"]}}if(w==="<"&&t.substring(o-1,o+3)==="<!--"){for(o+=3,w="<!--";t.charAt(o)!=="\n"&&o<s;)w+=t.charAt(o),o++;return a=!0,[w,"TK_COMMENT"]}if(w==="-"&&a&&t.substring(o-1,o+2)==="-->")return a=!1,o+=2,["-->","TK_COMMENT"];if(w===".")return[w,"TK_DOT"];if(n(w,y)){while(o<s&&n(w+t.charAt(o),y))if(w+=t.charAt(o),o+=1,o>=s)break;return w===","?[w,"TK_COMMA"]:w==="="?[w,"TK_EQUALS"]:[w,"TK_OPERATOR"]}return[w,"TK_UNKNOWN"]}function k(n){for(var e=!1,u="",r=0,f="",t=0,i;e||r<n.length;)if(i=n.charAt(r),r++,e){if(e=!1,i==="x")f=n.substr(r,2),r+=2;else if(i==="u")f=n.substr(r,4),r+=4;else{u+="\\"+i;continue}if(!f.match(/^[0123456789abcdefABCDEF]+$/))return n;if(t=parseInt(f,16),t>=0&&t<32){u+=i==="x"?"\\x"+f:"\\u"+f;continue}else if(t===34||t===39||t===92)u+="\\"+String.fromCharCode(t);else{if(i==="x"&&t>126&&t<=255)return n;u+=String.fromCharCode(t)}}else i==="\\"?e=!0:u+=i;return u}var b="\n\r\t ".split(""),v=/[0-9]/,y=("+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>"+" <%= <% %> <?= <? ?>").split(" "),p,c,l,a,h,o,s;this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,yield,import,export".split(",");p=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof"]);this.tokenize=function(){s=t.length;o=0;a=!1;h=[];for(var n,f,r,i=null,v=[],e=[];!(f&&f.type==="TK_EOF");){for(r=w(),n=new u(r[1],r[0],c,l);n.type==="TK_INLINE_COMMENT"||n.type==="TK_COMMENT"||n.type==="TK_BLOCK_COMMENT"||n.type==="TK_UNKNOWN";)e.push(n),r=w(),n=new u(r[1],r[0],c,l);e.length&&(n.comments_before=e,e=[]);n.type==="TK_START_BLOCK"||n.type==="TK_START_EXPR"?(n.parent=f,i=n,v.push(n)):(n.type==="TK_END_BLOCK"||n.type==="TK_END_EXPR")&&i&&(n.text==="]"&&i.text==="["||n.text===")"&&i.text==="("||n.text==="}"&&i.text==="}")&&(n.parent=i.parent,i=v.pop());h.push(n);f=n}return h}}var i={},t,u;(function(n){var t="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",i=new RegExp("["+t+"]"),r=new RegExp("["+t+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏０-９＿]"),u=n.newline=/[\n\r\u2028\u2029]/,f=n.isIdentifierStart=function(n){return n<65?n===36:n<91?!0:n<97?n===95:n<123?!0:n>=170&&i.test(String.fromCharCode(n))},e=n.isIdentifierChar=function(n){return n<48?n===36:n<58?!0:n<65?!1:n<91?!0:n<97?n===95:n<123?!0:n>=170&&r.test(String.fromCharCode(n))}})(i);t={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};u=function(n,t,i,r){this.type=n;this.text=t;this.comments_before=[];this.newlines=i||0;this.wanted_newline=i>0;this.whitespace_before=r||[];this.parent=null};typeof define=="function"&&define.amd?define([],function(){return{js_beautify:r}}):typeof exports!="undefined"?exports.js_beautify=r:typeof window!="undefined"?window.js_beautify=r:typeof global!="undefined"&&(global.js_beautify=r)})(),function(){function i(n){return n.replace(/^\s+/g,"")}function t(n){return n.replace(/\s+$/g,"")}function n(n,r,u,f){function ft(){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=k,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(n,t){for(var i=0;i<t.length;i++)if(n===t[i])return!0;return!1}},this.is_whitespace=function(n){for(var t=0;t<n.length;n++)if(!this.Utils.in_array(n.charAt(t),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var n="";if(n=this.input.charAt(this.pos),this.Utils.in_array(n,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(n,this.Utils.whitespace);)v&&n==="\n"&&this.newlines<=it&&(this.newlines+=1),this.pos++,n=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(n){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,n),this.print_indentation(n)):(this.line_char_count++,n.push(" "))},this.get_content=function(){for(var i="",n=[],t;this.input.charAt(this.pos)!=="<";){if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];if(this.traverse_whitespace()){this.space_or_wrap(n);continue}if(o)if(t=this.input.substr(this.pos,3),t==="{{#"||t==="{{/")break;else if(this.input.substr(this.pos,2)==="{{"&&this.get_tag(!0)==="{{else}}")break;i=this.input.charAt(this.pos);this.pos++;this.line_char_count++;n.push(i)}return n.length?n.join(""):""},this.get_contents_to=function(n){var i,t;if(this.pos===this.input.length)return["","TK_EOF"];var r="",u=new RegExp("<\/"+n+"\\s*>","igm");return u.lastIndex=this.pos,i=u.exec(this.input),t=i?i.index:this.input.length,this.pos<t&&(r=this.input.substring(this.pos,t),this.pos=t),r},this.record_tag=function(n){this.tags[n+"count"]?(this.tags[n+"count"]++,this.tags[n+this.tags[n+"count"]]=this.indent_level):(this.tags[n+"count"]=1,this.tags[n+this.tags[n+"count"]]=this.indent_level);this.tags[n+this.tags[n+"count"]+"parent"]=this.tags.parent;this.tags.parent=n+this.tags[n+"count"]},this.retrieve_tag=function(n){if(this.tags[n+"count"]){for(var t=this.tags.parent;t;){if(n+this.tags[n+"count"]===t)break;t=this.tags[t+"parent"]}t&&(this.indent_level=this.tags[n+this.tags[n+"count"]],this.tags.parent=this.tags[t+"parent"]);delete this.tags[n+this.tags[n+"count"]+"parent"];delete this.tags[n+this.tags[n+"count"]];this.tags[n+"count"]===1?delete this.tags[n+"count"]:this.tags[n+"count"]--}},this.indent_to_tag=function(n){if(this.tags[n+"count"]){for(var t=this.tags.parent;t;){if(n+this.tags[n+"count"]===t)break;t=this.tags[t+"parent"]}t&&(this.indent_level=this.tags[n+this.tags[n+"count"]])}},this.get_tag=function(n){var r="",t=[],h="",f=!1,s,p,e,c=this.pos,l=this.line_char_count,i,v,y,u;n=n!==undefined?n:!1;do{if(this.pos>=this.input.length)return n&&(this.pos=c,this.line_char_count=l),t.length?t.join(""):["","TK_EOF"];if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){f=!0;continue}if((r==="'"||r==='"')&&(r+=this.get_unformatted(r),f=!0),r==="="&&(f=!1),t.length&&t[t.length-1]!=="="&&r!==">"&&f&&(this.space_or_wrap(t),f=!1),o&&e==="<"&&r+this.input.charAt(this.pos)==="{{"&&(r+=this.get_unformatted("}}"),t.length&&t[t.length-1]!==" "&&t[t.length-1]!=="<"&&(r=" "+r),f=!0),r!=="<"||e||(s=this.pos-1,e="<"),o&&!e&&t.length>=2&&t[t.length-1]==="{"&&t[t.length-2]=="{"&&(s=r==="#"||r==="/"?this.pos-3:this.pos-2,e="{"),this.line_char_count++,t.push(r),t[1]&&t[1]==="!"){t=[this.get_comment(s)];break}if(o&&e==="{"&&t.length>2&&t[t.length-2]==="}"&&t[t.length-1]==="}")break}while(r!==">");return i=t.join(""),v=i.indexOf(" ")!==-1?i.indexOf(" "):i[0]==="{"?i.indexOf("}"):i.indexOf(">"),y=i[0]!=="<"&&o?i[2]==="#"?3:2:1,u=i.substring(y,v).toLowerCase(),i.charAt(i.length-2)==="/"||this.Utils.in_array(u,this.Utils.single_token)?n||(this.tag_type="SINGLE"):o&&i[0]==="{"&&u==="else"?n||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(u,a)?(h=this.get_unformatted("<\/"+u+">",i),t.push(h),p=this.pos-1,this.tag_type="SINGLE"):u==="script"&&(i.search("type")===-1||i.search("type")>-1&&i.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/)>-1)?n||(this.record_tag(u),this.tag_type="SCRIPT"):u==="style"&&(i.search("type")===-1||i.search("type")>-1&&i.search("text/css")>-1)?n||(this.record_tag(u),this.tag_type="STYLE"):u.charAt(0)==="!"?n||(this.tag_type="SINGLE",this.traverse_whitespace()):n||(u.charAt(0)==="/"?(this.retrieve_tag(u.substring(1)),this.tag_type="END"):(this.record_tag(u),u.toLowerCase()!=="html"&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(t),this.Utils.in_array(u,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&this.output[this.output.length-2]!=="\n"&&this.print_newline(!0,this.output))),n&&(this.pos=c,this.line_char_count=l),t.join("")},this.get_comment=function(n){var t="",i=">",r=!1;for(this.pos=n,input_char=this.input.charAt(this.pos),this.pos++;this.pos<=this.input.length;){if(t+=input_char,t[t.length-1]===i[i.length-1]&&t.indexOf(i)!==-1)break;!r&&t.length<10&&(t.indexOf("<![if")===0?(i="<![endif]>",r=!0):t.indexOf("<![cdata[")===0?(i="]\]>",r=!0):t.indexOf("<![")===0?(i="]>",r=!0):t.indexOf("<!--")===0&&(i="-->",r=!0));input_char=this.input.charAt(this.pos);this.pos++}return t},this.get_unformatted=function(n,t){if(t&&t.toLowerCase().indexOf(n)!==-1)return"";var r="",i="",u=0,f=!0;do{if(this.pos>=this.input.length)return i;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!f){this.line_char_count--;continue}if(r==="\n"||r==="\r"){i+="\n";this.line_char_count=0;continue}}i+=r;this.line_char_count++;f=!0;o&&r==="{"&&i.length&&i[i.length-2]==="{"&&(i+=this.get_unformatted("}}"),u=i.length)}while(i.toLowerCase().indexOf(n,u)===-1);return i},this.get_token=function(){var n,t,i;return this.last_token==="TK_TAG_SCRIPT"||this.last_token==="TK_TAG_STYLE"?(t=this.last_token.substr(7),n=this.get_contents_to(t),typeof n!="string")?n:[n,"TK_"+t]:this.current_mode==="CONTENT"?(n=this.get_content(),typeof n!="string"?n:[n,"TK_CONTENT"]):this.current_mode==="TAG"?(n=this.get_tag(),typeof n!="string"?n:(i="TK_TAG_"+this.tag_type,[n,i])):void 0},this.get_full_indent=function(n){return(n=this.indent_level+n||0,n<1)?"":Array(n+1).join(this.indent_string)},this.is_unformatted=function(n,t){if(!this.Utils.in_array(n,t))return!1;if(n.toLowerCase()!=="a"||!this.Utils.in_array("a",t))return!0;var r=this.get_tag(!0),i=(r||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!i||this.Utils.in_array(i,t)?!0:!1},this.printer=function(n,r,u,f,e){this.input=n||"";this.output=[];this.indent_character=r;this.indent_string="";this.indent_size=u;this.brace_style=e;this.indent_level=0;this.wrap_line_length=f;this.line_char_count=0;for(var o=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(n,i){(this.line_char_count=0,i&&i.length)&&(n||i[i.length-1]!=="\n")&&(i[i.length-1]!=="\n"&&(i[i.length-1]=t(i[i.length-1])),i.push("\n"))};this.print_indentation=function(n){for(var t=0;t<this.indent_level;t++)n.push(this.indent_string),this.line_char_count+=this.indent_string.length};this.print_token=function(n){(!this.is_whitespace(n)||this.output.length)&&((n||n!=="")&&this.output.length&&this.output[this.output.length-1]==="\n"&&(this.print_indentation(this.output),n=i(n)),this.print_token_raw(n))};this.print_token_raw=function(n){this.newlines>0&&(n=t(n));n&&n!==""&&(n.length>1&&n[n.length-1]==="\n"?(this.output.push(n.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(n));for(var i=0;i<this.newlines;i++)this.print_newline(i>0,this.output);this.newlines=0};this.indent=function(){this.indent_level++};this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var e,k,d,g,nt,tt,a,v,it,o,rt,y,ut,c,p,s,l,h,w,b;for(r=r||{},(r.wrap_line_length===undefined||parseInt(r.wrap_line_length,10)===0)&&r.max_char!==undefined&&parseInt(r.max_char,10)!==0&&(r.wrap_line_length=r.max_char),k=r.indent_inner_html===undefined?!1:r.indent_inner_html,d=r.indent_size===undefined?4:parseInt(r.indent_size,10),g=r.indent_char===undefined?" ":r.indent_char,tt=r.brace_style===undefined?"collapse":r.brace_style,nt=parseInt(r.wrap_line_length,10)===0?32786:parseInt(r.wrap_line_length||250,10),a=r.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],v=r.preserve_newlines===undefined?!0:r.preserve_newlines,it=v?isNaN(parseInt(r.max_preserve_newlines,10))?32786:parseInt(r.max_preserve_newlines,10):0,o=r.indent_handlebars===undefined?!1:r.indent_handlebars,rt=r.end_with_newline===undefined?!1:r.end_with_newline,e=new ft,e.printer(n,g,d,nt,tt);;){if(y=e.get_token(),e.token_text=y[0],e.token_type=y[1],e.token_type==="TK_EOF")break;switch(e.token_type){case"TK_TAG_START":e.print_newline(!1,e.output);e.print_token(e.token_text);e.indent_content&&(e.indent(),e.indent_content=!1);e.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":e.print_newline(!1,e.output);e.print_token(e.token_text);e.current_mode="CONTENT";break;case"TK_TAG_END":e.last_token==="TK_CONTENT"&&e.last_text===""&&(ut=e.token_text.match(/\w+/)[0],c=null,e.output.length&&(c=e.output[e.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),(c===null||c[1]!==ut)&&e.print_newline(!1,e.output));e.print_token(e.token_text);e.current_mode="CONTENT";break;case"TK_TAG_SINGLE":p=e.token_text.match(/^\s*<([a-z-]+)/i);p&&e.Utils.in_array(p[1],a)||e.print_newline(!1,e.output);e.print_token(e.token_text);e.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":e.print_token(e.token_text);e.indent_content&&(e.indent(),e.indent_content=!1);e.current_mode="CONTENT";break;case"TK_CONTENT":e.print_token(e.token_text);e.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(e.token_text!==""){if(e.print_newline(!1,e.output),s=e.token_text,h=1,e.token_type==="TK_SCRIPT"?l=typeof u=="function"&&u:e.token_type==="TK_STYLE"&&(l=typeof f=="function"&&f),r.indent_scripts==="keep"?h=0:r.indent_scripts==="separate"&&(h=-e.indent_level),w=e.get_full_indent(h),l)s=l(s.replace(/^\s*/,w),r);else{var et=s.match(/^\s*/)[0],ot=et.match(/[^\n\r]*$/)[0].split(e.indent_string).length-1,st=e.get_full_indent(h-ot);s=s.replace(/^\s*/,w).replace(/\r\n|\r|\n/g,"\n"+st).replace(/\s+$/,"")}s&&(e.print_token_raw(s),e.print_newline(!0,e.output))}e.current_mode="TAG";break;default:e.token_text!==""&&e.print_token(e.token_text)}e.last_token=e.token_type;e.last_text=e.token_text}return b=e.output.join("").replace(/[\r\n\t ]+$/,""),rt&&(b+="\n"),b}if(typeof define=="function"&&define.amd)define(["require","./beautify","./beautify-css"],function(t){var i=t("./beautify"),r=t("./beautify-css");return{html_beautify:function(t,u){return n(t,u,i.js_beautify,r.css_beautify)}}});else if(typeof exports!="undefined"){var r=require("./beautify.js"),u=require("./beautify-css.js");exports.html_beautify=function(t,i){return n(t,i,r.js_beautify,u.css_beautify)}}else typeof window!="undefined"?window.html_beautify=function(t,i){return n(t,i,window.js_beautify,window.css_beautify)}:typeof global!="undefined"&&(global.html_beautify=function(t,i){return n(t,i,global.js_beautify,global.css_beautify)})}()