function l(t){o(t,"start");var e={},n=t.languageData||{},s=!1;for(var d in t)if(d!=n&&t.hasOwnProperty(d))for(var p=e[d]=[],r=t[d],a=0;a<r.length;a++){var i=r[a];p.push(new k(i,t)),(i.indent||i.dedent)&&(s=!0)}return{name:n.name,startState:function(){return{state:"start",pending:null,indent:s?[]:null}},copyState:function(u){var g={state:u.state,pending:u.pending,indent:u.indent&&u.indent.slice(0)};return u.stack&&(g.stack=u.stack.slice(0)),g},token:c(e),indent:x(e,n),mergeTokens:n.mergeTokens,languageData:n}}function o(t,e){if(!t.hasOwnProperty(e))throw Error("Undefined state "+e+" in simple mode")}function f(t,e){if(!t)return/(?:)/;var n="";return t instanceof RegExp?(t.ignoreCase&&(n="i"),t.unicode&&(n+="u"),t=t.source):t=String(t),RegExp((e===!1?"":"^")+"(?:"+t+")",n)}function h(t){if(!t)return null;if(t.apply)return t;if(typeof t=="string")return t.replace(/\./g," ");for(var e=[],n=0;n<t.length;n++)e.push(t[n]&&t[n].replace(/\./g," "));return e}function k(t,e){(t.next||t.push)&&o(e,t.next||t.push),this.regex=f(t.regex),this.token=h(t.token),this.data=t}function c(t){return function(e,n){if(n.pending){var s=n.pending.shift();return n.pending.length==0&&(n.pending=null),e.pos+=s.text.length,s.token}for(var d=t[n.state],p=0;p<d.length;p++){var r=d[p],a=(!r.data.sol||e.sol())&&e.match(r.regex);if(a){r.data.next?n.state=r.data.next:r.data.push?((n.stack||(n.stack=[])).push(n.state),n.state=r.data.push):r.data.pop&&n.stack&&n.stack.length&&(n.state=n.stack.pop()),r.data.indent&&n.indent.push(e.indentation()+e.indentUnit),r.data.dedent&&n.indent.pop();var i=r.token;if(i&&i.apply&&(i=i(a)),a.length>2&&r.token&&typeof r.token!="string"){n.pending=[];for(var u=2;u<a.length;u++)a[u]&&n.pending.push({text:a[u],token:r.token[u-1]});return e.backUp(a[0].length-(a[1]?a[1].length:0)),i[0]}else return i&&i.join?i[0]:i}}return e.next(),null}}function x(t,e){return function(n,s){if(n.indent==null||e.dontIndentStates&&e.dontIndentStates.indexOf(n.state)>-1)return null;var d=n.indent.length-1,p=t[n.state];t:for(;;){for(var r=0;r<p.length;r++){var a=p[r];if(a.data.dedent&&a.data.dedentIfLineStart!==!1){var i=a.regex.exec(s);if(i&&i[0]){d--,(a.next||a.push)&&(p=t[a.next||a.push]),s=s.slice(i[0].length);continue t}}}break}return d<0?0:n.indent[d]}}export{l as t};
