(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){c.overlayMode=function(d,e,f){return{startState:function(){return{base:c.startState(d),overlay:c.startState(e),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:c.copyState(d,b.base),overlay:c.copyState(e,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,
overlayCur:null}},token:function(b,a){if(b!=a.streamSeen||Math.min(a.basePos,a.overlayPos)<b.start)a.streamSeen=b,a.basePos=a.overlayPos=b.start;b.start==a.basePos&&(a.baseCur=d.token(b,a.base),a.basePos=b.pos);b.start==a.overlayPos&&(b.pos=b.start,a.overlayCur=e.token(b,a.overlay),a.overlayPos=b.pos);b.pos=Math.min(a.basePos,a.overlayPos);return null==a.overlayCur?a.baseCur:null!=a.baseCur&&a.overlay.combineTokens||f&&null==a.overlay.combineTokens?a.baseCur+" "+a.overlayCur:a.overlayCur},indent:d.indent&&
function(b,a){return d.indent(b.base,a)},electricChars:d.electricChars,innerMode:function(b){return{state:b.base,mode:d}},blankLine:function(b){d.blankLine&&d.blankLine(b.base);e.blankLine&&e.blankLine(b.overlay)}}}});