Liferay.Loader.define("liferay!template-web$codemirror@5.65.2/mode/smarty/smarty",["module","exports","require","../../lib/codemirror"],(function(t,e,r){var n,i=void 0;window;n=function(t){"use strict";t.defineMode("smarty",(function(e,r){var n,i=r.rightDelimiter||"}",o=r.leftDelimiter||"{",a=r.version||2,u=t.getMode(e,r.baseMode||"null"),l=["debug","extends","function","include","literal"],f={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/};function cont(t,e){return n=e,t}function doesNotCount(t,e){return null==e&&(e=t.pos),3===a&&"{"==o&&(e==t.string.length||/\s/.test(t.string.charAt(e)))}function tokenTop(t,e){for(var r=t.string,a=t.pos;;){var l=r.indexOf(o,a);if(a=l+o.length,-1==l||!doesNotCount(t,l+o.length))break}if(l==t.pos)return t.match(o),t.eat("*")?function chain(t,e,r){return e.tokenize=r,r(t,e)}(t,e,function tokenBlock(t,e){return function(r,n){for(;!r.eol();){if(r.match(e)){n.tokenize=tokenTop;break}r.next()}return t}}("comment","*"+i)):(e.depth++,e.tokenize=tokenSmarty,n="startTag","tag");l>-1&&(t.string=r.slice(0,l));var f=u.token(t,e.base);return l>-1&&(t.string=r),f}function tokenSmarty(t,e){if(t.match(i,!0))return 3===a?(e.depth--,e.depth<=0&&(e.tokenize=tokenTop)):e.tokenize=tokenTop,cont("tag",null);if(t.match(o,!0))return e.depth++,cont("tag","startTag");var r=t.next();if("$"==r)return t.eatWhile(f.validIdentifier),cont("variable-2","variable");if("|"==r)return cont("operator","pipe");if("."==r)return cont("operator","property");if(f.stringChar.test(r))return e.tokenize=function tokenAttribute(t){return function(e,r){for(var n=null,i=null;!e.eol();){if(i=e.peek(),e.next()==t&&"\\"!==n){r.tokenize=tokenSmarty;break}n=i}return"string"}}(r),cont("string","string");if(f.operatorChars.test(r))return t.eatWhile(f.operatorChars),cont("operator","operator");if("["==r||"]"==r)return cont("bracket","bracket");if("("==r||")"==r)return cont("bracket","operator");if(/\d/.test(r))return t.eatWhile(/\d/),cont("number","number");if("variable"==e.last){if("@"==r)return t.eatWhile(f.validIdentifier),cont("property","property");if("|"==r)return t.eatWhile(f.validIdentifier),cont("qualifier","modifier")}else{if("pipe"==e.last)return t.eatWhile(f.validIdentifier),cont("qualifier","modifier");if("whitespace"==e.last)return t.eatWhile(f.validIdentifier),cont("attribute","modifier")}if("property"==e.last)return t.eatWhile(f.validIdentifier),cont("property",null);if(/\s/.test(r))return n="whitespace",null;var u="";"/"!=r&&(u+=r);for(var c=null;c=t.eat(f.validIdentifier);)u+=c;for(var s=0,d=l.length;s<d;s++)if(l[s]==u)return cont("keyword","keyword");return/\s/.test(r)?null:cont("tag","tag")}return{startState:function(){return{base:t.startState(u),tokenize:tokenTop,last:null,depth:0}},copyState:function(e){return{base:t.copyState(u,e.base),tokenize:e.tokenize,last:e.last,depth:e.depth}},innerMode:function(t){if(t.tokenize==tokenTop)return{mode:u,state:t.base}},token:function(t,e){var r=e.tokenize(t,e);return e.last=n,r},indent:function(e,r,n){return e.tokenize==tokenTop&&u.indent?u.indent(e.base,r,n):t.Pass},blockCommentStart:o+"*",blockCommentEnd:"*"+i}})),t.defineMIME("text/x-smarty","smarty")},"object"==typeof e&&"object"==typeof t?n(r("../../lib/codemirror")):"function"==typeof i&&i.amd?i(["../../lib/codemirror"],n):n(CodeMirror)}));
//# sourceMappingURL=smarty.js.map