(this.webpackChunktocco_admin=this.webpackChunktocco_admin||[]).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,i=new r(e,0,0),c=i.getCurrentToken(),m=e.getTabString(),u=t.singletonTags,l=t.blockTags,p=t.formatOptions||{},f=!1,h=!1,y=!1,d="",g="",b="",k=0,$=0,w=0,v=0,x=0,C=0,T=0,R=0,B=0,O=!1,I=!1,_=!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=d.length-1;0!=e&&" "===d[e];)e-=1;d=d.slice(0,e+1)},V=function(){d=d.trimRight(),f=!1};null!==c;){if(R=i.getCurrentTokenRow(),i.$rowTokens,a=i.stepForward(),void 0!==c){if(g=c.value,x=0,_="style"===b||"ace/mode/css"===e.$modeId,s(c,"tag-open")?(I=!0,a&&(q=-1!==l.indexOf(a.value)),"</"===g&&(q&&!f&&B<1&&B++,_&&(B=1),x=1,q=!1)):s(c,"tag-close")?I=!1:s(c,"comment.start")?q=!0:s(c,"comment.end")&&(q=!1),I||B||"paren.rparen"!==c.type||"}"!==c.value.substr(0,1)||B++,R!==o&&(B=R,o&&(B-=o)),B){for(V();B>0;B--)d+="\n";f=!0,s(c,"comment")||c.type.match(/^(comment|string)$/)||(g=g.trimLeft())}if(g){if("keyword"===c.type&&g.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(F[k]=g,K(),y=!0,g.match(/^(else|elseif)$/)&&d.match(/\}[\s]*$/)&&(V(),h=!0)):"paren.lparen"===c.type?(K(),"{"===g.substr(-1)&&(y=!0,O=!1,I||(B=1)),"{"===g.substr(0,1)&&(h=!0,"["!==d.substr(-1)&&"["===d.trimRight().substr(-1)?(V(),h=!1):")"===d.trimRight().substr(-1)?V():L())):"paren.rparen"===c.type?(x=1,"}"===g.substr(0,1)&&("case"===F[k-1]&&x++,"{"===d.trimRight().substr(-1)?V():(h=!0,_&&(B+=2))),"]"===g.substr(0,1)&&"}"!==d.substr(-1)&&"}"===d.trimRight().substr(-1)&&(h=!1,v++,V()),")"===g.substr(0,1)&&"("!==d.substr(-1)&&"("===d.trimRight().substr(-1)&&(h=!1,v++,V()),L()):"keyword.operator"!==c.type&&"keyword"!==c.type||!g.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?"punctuation.operator"===c.type&&";"===g?(V(),K(),y=!0,_&&B++):"punctuation.operator"===c.type&&g.match(/^(:|,)$/)?(V(),K(),g.match(/^(,)$/)&&T>0&&0===C&&p.lineBreaksAfterCommasInCurlyBlock?B++:(y=!0,f=!1)):"support.php_tag"!==c.type||"?>"!==g||f?s(c,"attribute-name")&&d.substr(-1).match(/^\s$/)?h=!0:s(c,"attribute-equals")?(L(),K()):s(c,"tag-close")?(L(),"/>"===g&&(h=!0)):"keyword"===c.type&&g.match(/^(case|default)$/)&&S&&(x=1):(V(),h=!0):(V(),K(),h=!0,y=!0),f&&(!c.type.match(/^(comment)$/)||g.substr(0,1).match(/^[/#]$/))&&(!c.type.match(/^(string)$/)||g.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),O&&!C&&(v++,O=!1),n=0;n<v;n++)d+=m}if("keyword"===c.type&&g.match(/^(case|default)$/)?!1===S&&(F[k]=g,k++,S=!0):"keyword"===c.type&&g.match(/^(break)$/)&&F[k-1]&&F[k-1].match(/^(case|default)$/)&&(k--,S=!1),"paren.lparen"===c.type&&(C+=(g.match(/\(/g)||[]).length,T+=(g.match(/\{/g)||[]).length,k+=g.length),"keyword"===c.type&&g.match(/^(if|else|elseif|for|while)$/)?(O=!0,C=0):!C&&g.trim()&&"comment"!==c.type&&(O=!1),"paren.rparen"===c.type)for(C-=(g.match(/\)/g)||[]).length,T-=(g.match(/\}/g)||[]).length,n=0;n<g.length;n++)k--,"}"===g.substr(n,1)&&"case"===F[k]&&k--;"text"==c.type&&(g=g.replace(/\s+$/," ")),h&&!f&&(L(),"\n"!==d.substr(-1)&&(d+=" ")),d+=g,y&&(d+=" "),f=!1,h=!1,y=!1,(s(c,"tag-close")&&(q||-1!==l.indexOf(b))||s(c,"doctype")&&">"===g)&&(B=q&&a&&"</"===a.value?-1:1),a&&-1===u.indexOf(a.value)&&(s(c,"tag-open")&&"</"===g?k--:s(c,"tag-open")&&"<"===g?k++:s(c,"tag-close")&&"/>"===g&&k--),s(c,"tag-name")&&(b=g),o=R}}c=a}d=d.trim(),e.doc.setValue(d)},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)}))}}]);