!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../yaml/yaml")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../yaml/yaml"],t):t(CodeMirror)}(function(t){var e=1;t.defineMode("yaml-frontmatter",function(n,a){var r=t.getMode(n,"yaml"),o=t.getMode(n,a&&a.base||"gfm");function i(t){return t.state==e?{mode:r,state:t.yaml}:{mode:o,state:t.inner}}return{startState:function(){return{state:0,yaml:null,inner:t.startState(o)}},copyState:function(e){return{state:e.state,yaml:e.yaml&&t.copyState(r,e.yaml),inner:t.copyState(o,e.inner)}},token:function(n,a){if(0==a.state)return n.match("---",!1)?(a.state=e,a.yaml=t.startState(r),r.token(n,a.yaml)):(a.state=2,o.token(n,a.inner));if(a.state==e){var i=n.sol()&&n.match(/(---|\.\.\.)/,!1),m=r.token(n,a.yaml);return i&&(a.state=2,a.yaml=null),m}return o.token(n,a.inner)},innerMode:i,indent:function(e,n,a){var r=i(e);return r.mode.indent?r.mode.indent(r.state,n,a):t.Pass},blankLine:function(t){var e=i(t);if(e.mode.blankLine)return e.mode.blankLine(e.state)}}})});