CodeMirror.defineMode("bbcodemixed",function(g){var f,l,n,p,q,r,h;function m(b){return b.replace(/([\[\]\.\-\+\<\>\?\:\(\)\{\}])/g,"\\$1")}var k,c=CodeMirror.getMode(g,"htmlmixed"),d=CodeMirror.getMode(g,"bbcode");h="literal";g.hasOwnProperty("bbCodeLiteral")&&(h=g.bbCodeLiteral);n=/.*\[/;p=/[^\<\>]*\[/;q=new RegExp(m("["+h+"]"));r=new RegExp(m("[/"+h+"]"));k={chain:function(b,a,e){a.tokenize=e;return e(b,a)},cleanChain:function(b,a,e){a.tokenize=null;a.localState=null;a.localMode=null;return"string"==
typeof e?e?e:null:e(b,a)},maybeBackup:function(b,a,e){a=m(a);var c=b.current(),d=c.search(a);-1<d?b.backUp(c.length-d):c.match(/<\/?$/)&&(b.backUp(c.length),b.match(a,!1)||b.match(c[0]));return e}};f=function(b,a){return!a.inLiteral&&b.match(p,!1)&&null===a.htmlMixedState.htmlState.tagName||!a.inLiteral&&b.match("[",!1)?(a.tokenize=l,a.localMode=d,a.localState=d.startState(c.indent(a.htmlMixedState,"")),k.maybeBackup(b,"[",d.token(b,a.localState))):c.token(b,a.htmlMixedState)};l=function(b,a){return b.match("]",
!1)?(b.eat("]"),a.tokenize=f,a.localMode=c,a.localState=a.htmlMixedState,"tag"):k.maybeBackup(b,"]",d.token(b,a.localState))};return{startState:function(){var b=c.startState();return{token:f,localMode:null,localState:null,htmlMixedState:b,tokenize:null,inLiteral:!1}},copyState:function(b){var a=null,e=b.tokenize||b.token;b.localState&&(a=CodeMirror.copyState(e!=f?d:c,b.localState));return{token:b.token,tokenize:b.tokenize,localMode:b.localMode,localState:a,htmlMixedState:CodeMirror.copyState(c,b.htmlMixedState),
inLiteral:b.inLiteral}},token:function(b,a){if(b.match("[",!1)){if(!a.inLiteral&&b.match(q,!0))return a.inLiteral=!0,"keyword";if(a.inLiteral&&b.match(r,!0))return a.inLiteral=!1,"keyword"}a.inLiteral&&a.localState!=a.htmlMixedState&&(a.tokenize=f,a.localMode=c,a.localState=a.htmlMixedState);return(a.tokenize||a.token)(b,a)},indent:function(b,a){return b.localMode==d||b.inLiteral&&!b.localMode||n.test(a)?CodeMirror.Pass:c.indent(b.htmlMixedState,a)},innerMode:function(b){return{state:b.localState||
b.htmlMixedState,mode:b.localMode||c}}}},"xml","javascript","css");CodeMirror.defineMIME("text/x-bbcode","bbcodemixed");