(this.webpackChunktocco_legacy_bundle=this.webpackChunktocco_legacy_bundle||[]).push([[87268],{87268(e,t,a){e=a.nmd(e),ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],(function(e,t,a){"use strict";var r=e("../token_iterator").TokenIterator;function s(e,t){return e.type.lastIndexOf(t+".xml")>-1}t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.formatOptions={lineBreaksAfterCommasInCurlyBlock:!0},t.beautify=function(e){for(var a,o,n,c=new r(e,0,0),i=c.getCurrentToken(),l=e.getTabString(),u=t.singletonTags,m=t.blockTags,p=t.formatOptions||{},f=!1,h=!1,y=!1,g="",b="",d="",k=0,$=0,w=0,v=0,x=0,C=0,T=0,R=0,_=0,B=!1,O=!1,I=!1,q=!1,A={0:0},F=[],S=!1,K=function(){a&&a.value&&"string.regexp"!==a.type&&(a.value=a.value.replace(/^\s*/,""))},L=function(){for(var e=g.length-1;0!=e&&" "===g[e];)e-=1;g=g.slice(0,e+1)},V=function(){g=g.trimRight(),f=!1};null!==i;){if(R=c.getCurrentTokenRow(),c.$rowTokens,a=c.stepForward(),void 0!==i){if(b=i.value,x=0,I="style"===d||"ace/mode/css"===e.$modeId,s(i,"tag-open")?(O=!0,a&&(q=-1!==m.indexOf(a.value)),"</"===b&&(q&&!f&&_<1&&_++,I&&(_=1),x=1,q=!1)):s(i,"tag-close")?O=!1:s(i,"comment.start")?q=!0:s(i,"comment.end")&&(q=!1),O||_||"paren.rparen"!==i.type||"}"!==i.value.substr(0,1)||_++,R!==o&&(_=R,o&&(_-=o)),_){for(V();_>0;_--)g+="\n";f=!0,s(i,"comment")||i.type.match(/^(comment|string)$/)||(b=b.trimLeft())}if(b){if("keyword"===i.type&&b.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(F[k]=b,K(),y=!0,b.match(/^(else|elseif)$/)&&g.match(/\}[\s]*$/)&&(V(),h=!0)):"paren.lparen"===i.type?(K(),"{"===b.substr(-1)&&(y=!0,B=!1,O||(_=1)),"{"===b.substr(0,1)&&(h=!0,"["!==g.substr(-1)&&"["===g.trimRight().substr(-1)?(V(),h=!1):")"===g.trimRight().substr(-1)?V():L())):"paren.rparen"===i.type?(x=1,"}"===b.substr(0,1)&&("case"===F[k-1]&&x++,"{"===g.trimRight().substr(-1)?V():(h=!0,I&&(_+=2))),"]"===b.substr(0,1)&&"}"!==g.substr(-1)&&"}"===g.trimRight().substr(-1)&&(h=!1,v++,V()),")"===b.substr(0,1)&&"("!==g.substr(-1)&&"("===g.trimRight().substr(-1)&&(h=!1,v++,V()),L()):"keyword.operator"!==i.type&&"keyword"!==i.type||!b.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?"punctuation.operator"===i.type&&";"===b?(V(),K(),y=!0,I&&_++):"punctuation.operator"===i.type&&b.match(/^(:|,)$/)?(V(),K(),b.match(/^(,)$/)&&T>0&&0===C&&p.lineBreaksAfterCommasInCurlyBlock?_++:(y=!0,f=!1)):"support.php_tag"!==i.type||"?>"!==b||f?s(i,"attribute-name")&&g.substr(-1).match(/^\s$/)?h=!0:s(i,"attribute-equals")?(L(),K()):s(i,"tag-close")?(L(),"/>"===b&&(h=!0)):"keyword"===i.type&&b.match(/^(case|default)$/)&&S&&(x=1):(V(),h=!0):(V(),K(),h=!0,y=!0),f&&(!i.type.match(/^(comment)$/)||b.substr(0,1).match(/^[/#]$/))&&(!i.type.match(/^(string)$/)||b.substr(0,1).match(/^['"@]$/))){if(v=w,k>$)for(v++,n=k;n>$;n--)A[n]=v;else k<$&&(v=A[k]);for($=k,w=v,x&&(v-=x),B&&!C&&(v++,B=!1),n=0;n<v;n++)g+=l}if("keyword"===i.type&&b.match(/^(case|default)$/)?!1===S&&(F[k]=b,k++,S=!0):"keyword"===i.type&&b.match(/^(break)$/)&&F[k-1]&&F[k-1].match(/^(case|default)$/)&&(k--,S=!1),"paren.lparen"===i.type&&(C+=(b.match(/\(/g)||[]).length,T+=(b.match(/\{/g)||[]).length,k+=b.length),"keyword"===i.type&&b.match(/^(if|else|elseif|for|while)$/)?(B=!0,C=0):!C&&b.trim()&&"comment"!==i.type&&(B=!1),"paren.rparen"===i.type)for(C-=(b.match(/\)/g)||[]).length,T-=(b.match(/\}/g)||[]).length,n=0;n<b.length;n++)k--,"}"===b.substr(n,1)&&"case"===F[k]&&k--;"text"==i.type&&(b=b.replace(/\s+$/," ")),h&&!f&&(L(),"\n"!==g.substr(-1)&&(g+=" ")),g+=b,y&&(g+=" "),f=!1,h=!1,y=!1,(s(i,"tag-close")&&(q||-1!==m.indexOf(d))||s(i,"doctype")&&">"===b)&&(_=q&&a&&"</"===a.value?-1:1),a&&-1===u.indexOf(a.value)&&(s(i,"tag-open")&&"</"===b?k--:s(i,"tag-open")&&"<"===b?k++:s(i,"tag-close")&&"/>"===b&&k--),s(i,"tag-name")&&(d=b),o=R}}i=a}g=g.trim(),e.doc.setValue(g)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]})),ace.require(["ace/ext/beautify"],(function(t){e&&(e.exports=t)}))}}]);