Current File : /home/pacjaorg/public_html/kmm/media/vendor/codemirror/addon/mode/simple.min.js
(function(c){typeof exports=="object"&&typeof module=="object"?c(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){"use strict";c.defineSimpleMode=function(t,i){c.defineMode(t,function(n){return c.simpleMode(n,i)})},c.simpleMode=function(t,i){x(i,"start");var n={},e=i.meta||{},r=!1;for(var l in i)if(l!=e&&i.hasOwnProperty(l))for(var a=n[l]=[],p=i[l],d=0;d<p.length;d++){var o=p[d];a.push(new k(o,i)),(o.indent||o.dedent)&&(r=!0)}var g={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:r?[]:null}},copyState:function(f){var h={state:f.state,pending:f.pending,local:f.local,localState:null,indent:f.indent&&f.indent.slice(0)};f.localState&&(h.localState=c.copyState(f.local.mode,f.localState)),f.stack&&(h.stack=f.stack.slice(0));for(var S=f.persistentStates;S;S=S.next)h.persistentStates={mode:S.mode,spec:S.spec,state:S.state==f.localState?h.localState:c.copyState(S.mode,S.state),next:h.persistentStates};return h},token:w(n,t),innerMode:function(f){return f.local&&{mode:f.local.mode,state:f.localState}},indent:P(n,e)};if(e)for(var u in e)e.hasOwnProperty(u)&&(g[u]=e[u]);return g};function x(t,i){if(!t.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function s(t,i){if(!t)return/(?:)/;var n="";return t instanceof RegExp?(t.ignoreCase&&(n="i"),t.unicode&&(n+="u"),t=t.source):t=String(t),new RegExp((i===!1?"":"^")+"(?:"+t+")",n)}function y(t){if(!t)return null;if(t.apply)return t;if(typeof t=="string")return t.replace(/\./g," ");for(var i=[],n=0;n<t.length;n++)i.push(t[n]&&t[n].replace(/\./g," "));return i}function k(t,i){(t.next||t.push)&&x(i,t.next||t.push),this.regex=s(t.regex),this.token=y(t.token),this.data=t}function w(t,i){return function(n,e){if(e.pending){var r=e.pending.shift();return e.pending.length==0&&(e.pending=null),n.pos+=r.text.length,r.token}if(e.local)if(e.local.end&&n.match(e.local.end)){var l=e.local.endToken||null;return e.local=e.localState=null,l}else{var l=e.local.mode.token(n,e.localState),a;return e.local.endScan&&(a=e.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),l}for(var p=t[e.state],d=0;d<p.length;d++){var o=p[d],g=(!o.data.sol||n.sol())&&n.match(o.regex);if(g){o.data.next?e.state=o.data.next:o.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=o.data.push):o.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),o.data.mode&&m(i,e,o.data.mode,o.token),o.data.indent&&e.indent.push(n.indentation()+i.indentUnit),o.data.dedent&&e.indent.pop();var u=o.token;if(u&&u.apply&&(u=u(g)),g.length>2&&o.token&&typeof o.token!="string"){for(var f=2;f<g.length;f++)g[f]&&(e.pending||(e.pending=[])).push({text:g[f],token:o.token[f-1]});return n.backUp(g[0].length-(g[1]?g[1].length:0)),u[0]}else return u&&u.join?u[0]:u}}return n.next(),null}}function v(t,i){if(t===i)return!0;if(!t||typeof t!="object"||!i||typeof i!="object")return!1;var n=0;for(var e in t)if(t.hasOwnProperty(e)){if(!i.hasOwnProperty(e)||!v(t[e],i[e]))return!1;n++}for(var e in i)i.hasOwnProperty(e)&&n--;return n==0}function m(t,i,n,e){var r;if(n.persistent)for(var l=i.persistentStates;l&&!r;l=l.next)(n.spec?v(n.spec,l.spec):n.mode==l.mode)&&(r=l);var a=r?r.mode:n.mode||c.getMode(t,n.spec),p=r?r.state:c.startState(a);n.persistent&&!r&&(i.persistentStates={mode:a,spec:n.spec,state:p,next:i.persistentStates}),i.localState=p,i.local={mode:a,end:n.end&&s(n.end),endScan:n.end&&n.forceEnd!==!1&&s(n.end,!1),endToken:e&&e.join?e[e.length-1]:e}}function O(t,i){for(var n=0;n<i.length;n++)if(i[n]===t)return!0}function P(t,i){return function(n,e,r){if(n.local&&n.local.mode.indent)return n.local.mode.indent(n.localState,e,r);if(n.indent==null||n.local||i.dontIndentStates&&O(n.state,i.dontIndentStates)>-1)return c.Pass;var l=n.indent.length-1,a=t[n.state];n:for(;;){for(var p=0;p<a.length;p++){var d=a[p];if(d.data.dedent&&d.data.dedentIfLineStart!==!1){var o=d.regex.exec(e);if(o&&o[0]){l--,(d.next||d.push)&&(a=t[d.next||d.push]),e=e.slice(o[0].length);continue n}}}break}return l<0?0:n.indent[l]}}});
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!