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